Guest User

Limit Break 7

a guest
Mar 8th, 2014
92
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #===============================================================================
  2. #Script: Limit Break 7
  3. #Author: Selchar
  4. #-------------------------------------------------------------------------------
  5. =begin
  6. This is a rather basic implementation of the Limit Break system from FF7.  To
  7. use it, start with the settings below.  You create a skill category much like
  8. the default Skill/Magic, and place it's number in TYPE_ID.  Then you create
  9. skills in said category and have your actors learn them.  They don't need to
  10. have the "Limit" category under features as the command will appear on it's own
  11. when the conditions have been met(Full TP gauge).
  12.  
  13. Also of note, any skills placed in your "Limit" category will automatically have
  14. it's TP cost equal your current TP, or max TP since you need it at max to
  15. access the command.
  16.  
  17. Finally, the Limit command will only appear to actors/classes who have the
  18. notetag <use_limit_break_7>, or are equipped with an item/state that has it.
  19. =end
  20. #===============================================================================
  21. module Selchar
  22.   module Limit_Break_7
  23.     #Allows you to change Max TP.
  24.     Max_TP = 100
  25.    
  26.     #Use this to designate a skill category to be used for Limit Breaks.
  27.     Type_ID = 3
  28.    
  29.     #Choose whether your "Limit" command will either replace, or appear above
  30.     #the Attack command.
  31.     Replace_Attack = false
  32.   end
  33. end
  34.  
  35. #===============================================================================
  36. #Don't edit below this line unless you know what you are doing.
  37. #===============================================================================
  38. $imported = {} if $imported.nil?
  39. $imported[:Limit_Break_7] = true
  40.  
  41. unless $imported[:Selchar_ASCE]
  42.   msgbox("'Selchar's Add Skill Command Exceptions has
  43. not been detected, Exiting")
  44.   Exit
  45. end
  46.  
  47. module Selchar::ASCE
  48.   Battle_ID << Selchar::Limit_Break_7::Type_ID
  49. end
  50.  
  51. class Window_ActorCommand < Window_Command
  52.   #--------------------------------------------------------------------------
  53.   # * Alias: Add Attack Command to List
  54.   #--------------------------------------------------------------------------
  55.   alias :sel_limit_break_7_add_attack_command :add_attack_command
  56.   def add_attack_command
  57.     if @actor.tp == @actor.max_tp
  58.       limit_check = false
  59.       @actor.feature_objects.each do |obj|
  60.         limit_check = true if obj.use_limit_break_7
  61.       end
  62.       if limit_check
  63.         add_limit_7_command
  64.         return if Selchar::Limit_Break_7::Replace_Attack
  65.       end
  66.     end
  67.     sel_limit_break_7_add_attack_command
  68.   end
  69.  
  70.   #--------------------------------------------------------------------------
  71.   # * New Method: Add Limit Command to List
  72.   #--------------------------------------------------------------------------
  73.   def add_limit_7_command
  74.     name = $data_system.skill_types[Selchar::Limit_Break_7::Type_ID]
  75.     add_command(name, :skill, true, Selchar::Limit_Break_7::Type_ID)
  76.   end
  77. end
  78.  
  79. class Game_BattlerBase
  80.   def tp_rate
  81.     @tp.to_f / max_tp
  82.   end
  83.  
  84.   def max_tp
  85.     return Selchar::Limit_Break_7::Max_TP
  86.   end
  87.  
  88.   alias :sel_limit_break_7_tp_cost :skill_tp_cost
  89.   def skill_tp_cost(skill)
  90.     if skill.stype_id == Selchar::Limit_Break_7::Type_ID
  91.       return @tp.to_i
  92.     else
  93.       sel_limit_break_7_tp_cost(skill)
  94.     end
  95.   end
  96. end
  97.  
  98. class RPG::BaseItem
  99.   def use_limit_break_7
  100.     @note =~ /<use_limit_break_7>/i ? @use_limit_break_7 = true : @use_limit_break_7 = false if @limit_break_7.nil?
  101.     @use_limit_break_7
  102.   end
  103. end
RAW Paste Data