molegato

Basimple BS5 add-on template

Nov 16th, 2013
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.35 KB | None | 0 0
  1. #==============================================================================
  2. # ACTION CHAIN ADD-ONS
  3. #------------------------------------------------------------------------------
  4. # Warning, only for advanced users!
  5. #
  6. # You can now create add-ons for the chain interpreter.
  7. # The format is:
  8. #   if action[0]=="name of the command"
  9. #     code to be done.
  10. #     action[1], action[2], etc contain the parameters
  11. #     to add a condition, do
  12. #       @action_conditions.push(@chain_index)
  13. #     in case the condition failed.
  14. #   end
  15. #==============================================================================
  16. class Scene_Battle < Scene_Base
  17.   alias custom_extension_interpret_action interpret_action
  18.   def interpret_action(action, item)
  19.     return false if !custom_extension_interpret_action(action, item)
  20.    
  21.     #example interpretation add-ons
  22.    
  23.     #this example interpretation prints 'hello, name' with name being the
  24.     #first parameter
  25.     if action[0]=="say_hello"
  26.       p "hello, "+action[1]
  27.     end
  28.    
  29.     #This example interpretation acts as condition. if switch3 isn't true
  30.     #it skips its block
  31.     if action[0]=="if_switch3"
  32.       if !$game_switches[3]
  33.         @action_conditions.push(@chain_index)
  34.       end
  35.     end
  36.    
  37.     #Add here your interpretations
  38.    
  39.     #Don't delete this!
  40.     return true
  41.   end
  42. end
Advertisement
Add Comment
Please, Sign In to add comment