TheoAllen

JTS - Almashield State

Dec 10th, 2013
343
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.99 KB | None | 0 0
  1. #==============================================================================
  2. # ** JtS - Almashield State
  3. #------------------------------------------------------------------------------
  4. #  Untuk fungsi Almashield. Untuk resist all states
  5. #==============================================================================
  6. =begin
  7.  
  8.   Gunakan tag <almashield> pada state untuk bikin state resist segalanya
  9.  
  10. =end
  11. module JTS
  12.  
  13.   AS_NonResist = [18,19]
  14.   # Catat yang non resist disini
  15.  
  16. end
  17. # ----------------------------------------------------------------------------
  18. # End of config
  19. # ----------------------------------------------------------------------------
  20. class RPG::State
  21.  
  22.   def almashield?
  23.     note[/<almashield>/i]
  24.   end
  25.  
  26. end
  27.  
  28. class Game_Battler
  29.  
  30.   alias jts_ashield_add_st add_state
  31.   def add_state(state_id)
  32.     return if states.any? do |state|
  33.       state.almashield?
  34.     end && !JTS::AS_NonResist.include?(state_id)
  35.     jts_ashield_add_st(state_id)
  36.   end
  37.  
  38. end
Advertisement
Add Comment
Please, Sign In to add comment