Bigace360

Enemy Auto States

Feb 17th, 2012
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.20 KB | None | 0 0
  1. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  2. # ■ Enemy Auto States
  3. # ■ Author: Bigace360
  4. # ■ Type: Battle Add-on
  5. # ■ Date: Feb. 18, 2012
  6. # ■ Version: 1.0
  7. #
  8. # This script allows you to create effects that stay always active for enemies
  9. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  10.  
  11. module ACE
  12.   # Do not remove this line
  13.   Auto_Status_Enemy = {}
  14.   # Do not remove this line
  15.  
  16.   # Auto_Status_Enemy[Enemy_ID] = [States,...]
  17.   #   A = Enemy ID
  18.   #   States = States ID
  19.  
  20.   Auto_Status_Enemy[1] = [7]
  21.  
  22. end
  23.  
  24.  
  25. #==============================================================================
  26. # ** Game_Enemy
  27. #==============================================================================
  28. class Game_Enemy < Game_Battler
  29.   include ACE
  30.   alias initialize_enemystatus initialize
  31.   def initialize(troop_id, member_index)
  32.     initialize_enemystatus(troop_id, member_index)
  33.     update_auto_state
  34.   end
  35.   def update_auto_state
  36.     st = Auto_Status_Enemy
  37.     multi_auto_state_id = (st != nil and st[@enemy_id] != nil) ? st[@enemy_id] : []
  38.     for state in multi_auto_state_id
  39.       add_state(state, true)
  40.     end
  41.   end
  42. end
Advertisement
Add Comment
Please, Sign In to add comment