Advertisement
FlipelyFlip

Additional Battle Action

Jul 30th, 2014
358
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.37 KB | None | 0 0
  1. #==============================================================================
  2. # ○Additional Action Ver1.00
  3. # for RGSS2
  4. # Originalscripter / Space not far
  5. # http://muspell.raindrop.jp/
  6. # Allows a enemy to act more than once.
  7. # Translation by Zak
  8. #==============================================================================
  9.  
  10. # Insert in the enemy tag following line:
  11. # <additionalaction:X>
  12. # X stands for the number of times the enemy should act.
  13. # <additionalactionstate:X>
  14. # X stands for the state that should add 1 action
  15.  
  16. class Game_Actor < Game_Battler
  17.   def extraaction_number
  18.     return 0
  19.   end
  20. end
  21. class Game_Enemy < Game_Battler
  22.   def extraaction_number
  23.     resulta = 0
  24.     resultb = 0
  25.     s = enemy.note[/<additionalaction:([0-9]+?)>/]
  26.     resulta = ($1 != nil ? $1.to_i : 0)
  27.     resulta = 0 if $game_troop.turn_count == 0
  28.     t = enemy.note[/<additionalactionstate:([0-9]+?)>/]
  29.     if $1 != nil
  30.       $game_troop.members[enemy.id].states.include?($1.to_i)
  31.       resultb = 1
  32.       resultb = 0 if $game_troop.turn_count == 0
  33.     end
  34.     return resulta + resultb
  35.   end
  36. end
  37.  
  38. class Scene_Battle < Scene_Base
  39.   alias snf_execute_action execute_action
  40.   def execute_action
  41.     snf_execute_action
  42.     @active_battler.extraaction_number.times do
  43.       @message_window.clear
  44.       @active_battler.make_action
  45.       snf_execute_action
  46.     end
  47.   end
  48. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement