Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #======================#
- # Z-Systems by: Zetu #
- #===========================#======================#===========================#
- # * * * Executable Actions Extension v1.04 * * * #
- #=#==========================================================================#=#
- # - - - Version History - - - #
- # Version History #
- # 1.01 ALPHA #
- # 1.02 #
- # • Added Further Customization (Vocab for defaults and Advanced #
- # Conditions for further support of other scripts.) #
- # 1.03 #
- # • Corrected Capatability issues. #
- # 1.04 #
- # • Complete Overhaul #
- #--------------------------------------------------------------------------#
- # WARNING: Use of this program may require some scripting knowledge. If #
- # you do not know what your doing, please ask on a forum. #
- #--------------------------------------------------------------------------#
- # How to configure. #
- # • First, all commands must be added to the COMMANDS array. In this #
- # array, you have [Symbol, Label, and Code]. #
- # - Symbol => Any representation of the command. This will not #
- # appear within the game, only for representation within the code. #
- # - Label => What you wish for the action to be labeled as. #
- # - Code => Code that is run at the time of selecting a command. #
- # More than one line can be done without "\n" by placing each line #
- # in a separate element within the array. #
- # • After that, if there is an alternate term for your action, place #
- # it within the REPLACE hash. It is symbol => [To, If] #
- # - Symbol => Must be the same one defined in COMMANDS. #
- # - To => The new term, if applicable. #
- # - If => The condition to use the new term. #
- # • Then, for CONDITIONS, only place a new line if it will not always #
- # appear as a command. Symbol => Condition. #
- # - Symbol => Must be the same one defined in COMMANDS (again). #
- # - Condition => Condition for appearing in commands. #
- #==========================================================================#
- module Z_Systems
- module ExComEx
- #FOR ALL LITERAL STRINGS, USE ('""')
- COMMANDS = [#In the order to appear in command window.
- #[Symbol, Label, Code(new element per line)]
- [:event, '"Event"', 'force_skill(96)'],
- [:dual, '"Double Attack"', 'force_skill(1)'],
- [:tri, '"Triple Attack"', 'force_skill(3)'],
- [:attack, 'Vocab::attack', '@active_battler.action.set_attack', 'start_target_enemy_selection'],
- [:skill, 'Vocab::skill', 'start_skill_selection'],
- [:scan, '"Scan"', 'force_skill(97)'],
- [:guard, 'Vocab::guard', '@active_battler.action.set_guard', 'next_actor'],
- [:item, 'Vocab::item', 'start_item_selection']
- ] #DO NOT REMOVE
- REPLACE = { #[To What?, if What?]
- :skill => ['actor.class.skill_name', 'actor.class.skill_name_valid'],
- :event => ['"This Event"', 'true']
- } #DO NOT REMOVE
- CONDITIONS = {#If condition is false, it will not show up.
- #if you cannot use Dual or Triple Attacks
- :attack => 'not cond(:dual) and not cond(:tri)',
- #if $event is set to true and actor id is 1.
- :event => '$event == true and actor.id == 1',
- #if actor id is 1, 3, or 7 and does not use Triple Attack
- :dual => 'not cond(:tri)',#'[1,3,7].include?(actor.id) and not cond(:tri)',
- #if actor id is 3 and at least level 34
- :tri => 'actor.id == 3 and actor.level >= 34'
- } #DO NOT REMOVE
- end
- end
- #========#======================#====#================================#========#
- #--------# #----# DO NOT EDIT PAST THIS POINT!!! #--------#
- #--------# End of Customization #----# Editing will cause death by #--------#
- #--------# #----# brain asplosions. #--------#
- #========#======================#====#================================#========#
- class Window_ActorCommand < Window_Command
- include Z_Systems::ExComEx
- def initialize
- super(128, [], 1, 4)
- self.active = false
- end
- def setup(actor)
- @command_sym = []
- @commands = []
- for array in COMMANDS
- bool = CONDITIONS[array[0]].nil? ? true : eval(CONDITIONS[array[0]])
- if bool
- @command_sym.push(array[0])
- if REPLACE[array[0]].nil?
- push_csym(array[1])
- else
- if eval(REPLACE[array[0]][1])
- push_replaced_csym(array[0])
- else
- push_csym(array[1])
- end
- end
- end
- end
- @item_max = @commands.size
- create_contents
- refresh
- self.index = 0
- end
- def cond(symbol)
- actor = $scene.a_battler
- return eval(CONDITIONS[symbol])
- end
- def wcom
- return @command_sym
- end
- def push_csym(string)
- string = eval(string)
- @commands.push(string)
- end
- def push_replaced_cym(symbol)
- push_csym(REPLACE[symbol][1])
- end
- end
- class Scene_Battle < Scene_Base
- include Z_Systems::ExComEx
- def update_actor_command_selection
- if Input.trigger?(Input::B)
- Sound.play_cancel
- prior_actor
- elsif Input.trigger?(Input::C)
- Sound.play_decision
- for array in COMMANDS
- if array[0] == @actor_command_window.wcom[@actor_command_window.index]
- index = 2
- while !array[index].nil?
- eval(array[index])
- index += 1
- end
- break
- end
- end
- end
- end
- def a_battler
- return @active_battler
- end
- def force_skill(skill_id)
- @skill = $data_skills[skill_id]
- @active_battler.action.set_skill(@skill.id)
- @active_battler.action.forcing = true
- if @skill.need_selection?
- if @skill.for_opponent?
- start_target_enemy_selection
- else
- start_target_actor_selection
- end
- else
- end_skill_selection
- next_actor
- end
- end
- end
- class Game_Actor < Game_Battler
- def skills_include?(skill_id)
- return @skills.include?(skill_id)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement