Advertisement
Guest User

ความเร็วของสกิล

a guest
Jan 3rd, 2015
424
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 2.86 KB | None | 0 0
  1. #==============================================================================
  2. # **  ความเร็วของสกิล
  3. #------------------------------------------------------------------------------
  4. # * โดย: jojo741963
  5. # * เวอร์ชั่น: 1.0
  6. #    3-1-2015
  7. #------------------------------------------------------------------------------
  8. #  รายละเอียดของสคริปต์นี้  :
  9. #   -  กำหนดความเร็วของสกิลแต่ล่ะไอดีได้
  10. #------------------------------------------------------------------------------
  11. #  วิธีการใช้งานสคริปต์นี้ :
  12. #     วางสคริปต์นี้เหนือสคริปต์ Main และอยู่ใต้สคริปต์ Game_Battler 1
  13. #     แล้วเซ็ตค่าได้ด่านล่างเลยครับ
  14. #==============================================================================
  15.  
  16. module SKILL_SPEED
  17.  
  18.   Skill_speed = {
  19.   #------------------------------------------------------------------------------
  20.   #  ส่วนการตั้งค่า
  21.   #------------------------------------------------------------------------------
  22.   # ตั้งค่าโดยใช้รูปบบดังนี้
  23.   #     ไอดีของสกิล => ความเร็วของสกิล , ..........
  24.   # ตัวอย่าง : กำหนดให้เมื่อใช้สกิล Fire (ไอดี 7) ก็จะเริ่มทำงานก่อน ก็ให้ใส่ความเร็วไว้เยอะๆ เช่น 1000
  25.   #     7=>1000
  26.   #------------------------------------------------------------------------------
  27.   7=>1000, 57 =>1000
  28.  
  29.   #------------------------------------------------------------------------------
  30.   #  จบส่วนการตั้งค่า
  31.   #------------------------------------------------------------------------------
  32.   }
  33.  
  34. end
  35.  
  36. class Game_Battler
  37.   def make_action_speed
  38.        
  39.     if @current_action.kind == 1 #ตรวจสอบว่าเป็นการใช้สกิลหรือไม่
  40.      
  41.       if SKILL_SPEED::Skill_speed[@current_action.skill_id] != nil #ตรวจสอบว่าได้กำหนดไอดีไว้หรือไม่
  42.         @current_action.speed = SKILL_SPEED::Skill_speed[@current_action.skill_id]
  43.       else
  44.         @current_action.speed = agi + rand(10 + agi / 4) #<< นี่คือคำสั่งสุ่มความเร็วแบบปกติ
  45.       end
  46.      
  47.     else
  48.       @current_action.speed = agi + rand(10 + agi / 4) #<< นี่คือคำสั่งสุ่มความเร็วแบบปกติ
  49.     end
  50.    
  51.   end
  52. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement