Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #======================#
- # Z-Systems by: Zetu #
- #===========================#======================#===========================#
- # * * * Z04 Executable Actions Extention v1.03 * * * #
- #=#==========================================================================#=#
- # Add regular expression NOCONDITIONAL into any skill to make it appear #
- # in the Window_ActorCommand, instead of Window_SkillList. All commands #
- # will be placed where :exact is inside the CMDS array, unless you place #
- # :skillid, <skill.id> where you wish for it to be instead. #
- #==========================================================================#
- module Z04
- CMDS = [
- :attack,
- :exact,
- :skill,
- :guard,
- :skillid, 5,
- :item
- ]
- NOCONDITION = /<exact>/i
- CONDITIONAL = /<exact[:]*\s*(\d+)>/i
- #========#======================#====#================================#========#
- #--------# #----# DO NOT EDIT PAST THIS POINT!!! #--------#
- #--------# End of Customization #----# Editing will cause death by #--------#
- #--------# #----# brain asplosions. #--------#
- #========#======================#====#================================#========#
- end
- class Window_ActorCommand < Window_Command
- attr_reader :skillsincmd
- def make_command_list
- return unless @actor
- index=0
- while index<Z04::CMDS.size
- case Z04::CMDS[index]
- when :attack; add_attack_command
- when :skill; add_skill_commands
- when :guard; add_guard_command
- when :item; add_item_command
- when :skillid; add_skill_command_by_id(Z04::CMDS[index+1]); index +=1
- when :exact; add_noninclusive_skill_commands
- end
- index+=1
- end
- end
- def add_noninclusive_skill_commands
- for skill in @actor.skills
- add_skill_exact(skill) unless Z04::CMDS.include?(skill.id)
- end
- end
- def add_skill_command_by_id(id)
- add_skill_exact($data_skills[id])
- end
- def add_skill_exact(skill)
- return unless skill.command_condition_met?
- add_command(skill.name, :exactskill, @actor.skill_conditions_met?(skill),
- skill.id)
- end
- end
- class Scene_Battle < Scene_Base
- def skill_exact
- @skill = $data_skills[@actor_command_window.current_ext]
- BattleManager.actor.input.set_skill(@skill.id)
- BattleManager.actor.last_skill.object = @skill
- if !@skill.need_selection?
- next_command
- elsif @skill.for_opponent?
- select_enemy_selection
- else
- select_actor_selection
- end
- end
- alias z04cacw create_actor_command_window unless $@
- def create_actor_command_window
- z04cacw
- @actor_command_window.set_handler(:exactskill, method(:skill_exact))
- end
- end
- class Window_BattleSkill < Window_SkillList
- def include?(item)
- (item && item.stype_id == @stype_id) and not item.command?
- end
- end
- class RPG::Skill < RPG::UsableItem
- def command?
- self.note.scan(Z04::NOCONDITION){return true}
- self.note.scan(Z04::CONDITIONAL){return true}
- return false
- end
- def command_condition_met?
- self.note.scan(Z04::CONDITIONAL){return false unless $game_switches[$1.to_i]}
- return command?
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement