Hello. I'm using Yanfly's Battle Command List script and would like to have Modern Algebra's State Viewer accessable from the party commands -- so that players can reference state effects during battle.
Is this possible?
So far I've only been able to add the party command option "State List" (it's custom2 under party commands) but I don't know how to make it open the state viewer.
Here is what the Battle Command List script looks like in my game so far:
And here is what the State View script looks like in my game:
Thanks for looking.
Is this possible?
So far I've only been able to add the party command option "State List" (it's custom2 under party commands) but I don't know how to make it open the state viewer.
Here is what the Battle Command List script looks like in my game so far:
#==============================================================================# # ¥ Yanfly Engine Ace - Battle Command List v1.09b# -- Last Updated: 2012.12.18# -- Level: Normal# -- Requires: n/a# #==============================================================================$imported = {} if $imported.nil?$imported["YEA-BattleCommandList"] = true#==============================================================================# ¥ Updates# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# 2012.12.18 - Completely fixed the command hide switch bug.# 2012.12.17 - Fixed Bug with command hide until switch.# 2012.01.10 - Compatibility Update: Battle System FTB# 2011.12.30 - Bug Fixed: Disappearing windows when no confirm window is used.# 2011.12.26 - Bug Fixed: Actor Command Window disappears without Battle Engine# Ace installed.# 2011.12.19 - Compatibility Update: Class System# - New Actor Command: Subclass List# 2011.12.17 - Bug Fixed: Item command from Actor Command Window fixed.# 2011.12.15 - Bug Fixed: Prevented multiple actions per battler.# 2011.12.13 - Compatibility Update: Command Equip# Compatibility Update: Add-On: Command Party# 2011.12.12 - Compatibility Update: Command Autobattle# 2011.12.10 - Started Script and Finished.# - Compatibility Update: Combat Log Display# #==============================================================================# ¥ Introduction# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# This script allows you to change the order to commands that appear in battle# for the Party Command Window and Actor Command Window. In addition to the# ability to change the order commands appear, you may also add commands to the# Actor Command Window that can trigger the usage of skills and/or items. The# Confirm Command Window is also a new addition that appears at the end of the# action select phase (after the last actor has made a choice) before entering# the battle phase.# #==============================================================================# ¥ Instructions# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# To install this script, open up your script editor and copy/paste this script# to an open slot below ¥ Materials/‘fÞ but above ¥ Main. Remember to save.# # -----------------------------------------------------------------------------# Actor Notetags - These notetags go in the actors notebox in the database.# -----------------------------------------------------------------------------# <command list># string# string# </command list># These lines go inside of an actor's notebox to adjust the battle commands# that appear in the actor's Actor Command Window. Refer to the module as to# what to use for the strings. If a custom command list is used for an actor,# it will take priority over its class's custom command list, which takes place# over the default command list.# # -----------------------------------------------------------------------------# Class Notetags - These notetags go in the class notebox in the database.# -----------------------------------------------------------------------------# <command list># string# string# </command list># These lines go inside of a class's notebox to adjust the battle commands# that appear in the actor's Actor Command Window. Refer to the module as to# what to use for the strings. A custom command list for a class does not take# priority over an actor's custom command list, but it does take priority over# the default command list.# # -----------------------------------------------------------------------------# Skill Notetags - These notetags go in the skill notebox in the database.# -----------------------------------------------------------------------------# <command name: string># If this skill is being used as a command, it will use "string" to replace the# skill's name in the command list window.# # <command hide until learn># This hides the command until the actor has learned the respective skill for# the command to appear in the actor's command list.# # <command hide until usable># This hides the command until the actor is capable of using the command by# meeting TP costs or MP costs.# # <command hide until switch: x># This switch x is OFF, then the command remains hidden. If the switch is ON,# then the command becomes enabled and appears in the command list.# # -----------------------------------------------------------------------------# Item Notetags - These notetags go in the item notebox in the database.# -----------------------------------------------------------------------------# <command name: string># If this item is being used as a command, it will use "string" to replace the# item's name in the command list window.# # <command hide until usable># This hides the command until the actor is capable of using the command as# long as that item is usable normally.# # <command hide until switch: x># This switch x is OFF, then the command remains hidden. If the switch is ON,# then the command becomes enabled and appears in the command list.# #==============================================================================# ¥ Compatibility# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# This script is made strictly for RPG Maker VX Ace. It is highly unlikely that# it will run with RPG Maker VX without adjusting.# # For maximum compatibility with Yanfly Engine Ace - Ace Battle Engine, place# this script under Ace Battle Engine.# #==============================================================================module YEA module BATTLE_COMMANDS #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # - Party Command Window Settings - #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # This section adjusts the commands for the Party Command Window. Rearrange # commands as you see fit or add in new ones. Here's a list of which # command does what: # # ------------------------------------------------------------------------- # :command Description # ------------------------------------------------------------------------- # :fight Enters the command selection phase for actors. Default. # :escape Party attempts to escape from battle. Default. # # :combatlog Requires YEA - Combat Log Display. # :autobattle Requires YEA - Command Autobattle. # 😛arty Requires YEA - Party System Add-On: Command Party. # # And that's all of the currently available commands. This list will be # updated as more scripts become available. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # This array arranges the order of which the commands appear in the Party # Command window. PARTY_COMMANDS =[ :fight, #:autobattle, #😛arty, :combatlog, :custom2, :escape, ] # Do not remove this. #-------------------------------------------------------------------------- # - Party Command Custom Commands - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # For those who use scripts to that may produce unique effects in battle, # use this hash to manage the custom commands for the Party Command Window. # You can disable certain commands or prevent them from appearing by using # switches. If you don't wish to bind them to a switch, set the proper # switch to 0 for it to have no impact. #-------------------------------------------------------------------------- CUSTOM_PARTY_COMMANDS ={ # :command => ["Display Name", EnableSwitch, ShowSwitch, Handler Method], :custom1 => [ "Custom Name", 0, 0, :command_name1], :custom2 => [ "StateList", 0, 0, :command_name2], } # Do not remove this. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # - Actor Command Window Settings - #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # This section only adjusts the default commands for actors. If you wish # for an actor to have a unique command list, use the notetags listed in # the instructions to apply them. The custom command lists for actors will # override this command list. # # Here's a list of which command does what: # # ------------------------------------------------------------------------- # :command Description # ------------------------------------------------------------------------- # "ATTACK" Normal attack for actor. Default. # "SKILL LIST" All of the skill types the actor can use. Default. # "DEFEND" Set defend action for actor. Default. # "ITEMS" Opens up the item menu for the actor. Default. # # "SKILL TYPE X" Specifically puts in skill type X if actor has it. # "SKILL X" Uses Skill X in that slot. # "ITEM X" Uses Item X in that slot. # # "AUTOBATTLE" Requires YEA - Command Autobattle. # "EQUIP" Requires YEA - Command Equip # "SUBCLASS LIST" Requires YEA - Class System. Adds subclass skill types. # # And that's all of the currently available commands. This list will be # updated as more scripts become available. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # This array arranges the order of which the commands appear in the Actor # Command window if the actor does not have a custom command list. DEFAULT_ACTOR_COMMANDS =[ # "AUTOBATTLE", "ATTACK", "SKILL LIST", "SUBCLASS LIST", "DEFEND", "ITEMS", "EQUIP", ] # Do not remove this. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # - Confirm Command Window Settings - #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # The confirm window is something new that's been added. It shows after the # last actor has made a decision as to what actions the player wishes to # take for the turn Here's a list of which command does what: # # ------------------------------------------------------------------------- # :command Description # ------------------------------------------------------------------------- # :execute Start the battle turn. Comes with this script. # # :combatlog Requires YEA - Combat Log Display. # # And that's all of the currently available commands. This list will be # updated as more scripts become available. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- USE_CONFIRM_WINDOW = false # Set to false if you don't wish to use it. # This array arranges the order of which the commands appear in the Party # Command window. CONFIRM_COMMANDS =[ :execute, :combatlog, # :custom1, # :custom2, ] # Do not remove this. # This sets what text appears for the execute command. EXECUTE_VOCAB = "Execute" #-------------------------------------------------------------------------- # - Confirm Command Custom Commands - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # For those who use scripts to that may produce unique effects in battle, # use this hash to manage the custom commands for the Confirm Command # Window. You can disable certain commands or prevent them from appearing # by using switches. If you don't wish to bind them to a switch, set the # proper switch to 0 for it to have no impact. #-------------------------------------------------------------------------- CUSTOM_CONFIRM_COMMANDS ={ # :command => ["Display Name", EnableSwitch, ShowSwitch, Handler Method], :custom1 => [ "Custom Name", 0, 0, :command_name1], :custom2 => [ "Custom Text", 13, 0, :command_name2], } # Do not remove this. end # BATTLE_COMMANDSend # YEA#==============================================================================# ¥ Editting anything past this point may potentially result in causing# computer damage, incontinence, explosion of user's head, coma, death, and/or# halitosis so edit at your own risk.#==============================================================================module YEA module REGEXP module BASEITEM COMMAND_LIST_ON = /<(?:COMMAND_LIST|command list)>/i COMMAND_LIST_OFF = /<\/(?:COMMAND_LIST|command list)>/i end # BASEITEM module USABLEITEM COMMAND_NAME = /<(?:COMMAND NAME|command name):[ ](.*)>/i COMMAND_HIDE_LEARN = /<(?:COMMAND_HIDE_UNTIL_LEARN|command hide until learn)>/i COMMAND_HIDE_USABLE = /<(?:COMMAND_HIDE_UNTIL_USABLE|command hide until usable)>/i COMMAND_HIDE_SWITCH = /<(?:COMMAND_HIDE_UNTIL_SWITCH|command hide until switch):[ ](\d+)>/i end # USABLEITEM end # REGEXPend # YEA#==============================================================================# ¡ DataManager#==============================================================================module DataManager #-------------------------------------------------------------------------- # alias method: load_database #-------------------------------------------------------------------------- class <<self; alias load_database_bcl load_database; end def self.load_database load_database_bcl load_notetags_bcl end #-------------------------------------------------------------------------- # new method: load_notetags_bcl #-------------------------------------------------------------------------- def self.load_notetags_bcl groups = [$data_actors, $data_classes, $data_skills, $data_items] for group in groups for obj in group next if obj.nil? obj.load_notetags_bcl end end end end # DataManager#==============================================================================# ¡ RPG::BaseItem#==============================================================================class RPG::BaseItem #-------------------------------------------------------------------------- # public instance variables #-------------------------------------------------------------------------- attr_accessor :battle_commands #-------------------------------------------------------------------------- # common cache: load_notetags_bcl #-------------------------------------------------------------------------- def load_notetags_bcl @battle_commands = [] @command_list = false #--- self.note.split(/[\r\n]+/).each { |line| case line #--- when YEA::REGEXP::BASEITEM::COMMAND_LIST_ON @command_list = true when YEA::REGEXP::BASEITEM::COMMAND_LIST_OFF @command_list = false else next unless @command_list @battle_commands.push(line.to_s.upcase) #--- end } # self.note.split #--- if @battle_commands == [] and self.is_a?(RPG::Class) @battle_commands = YEA::BATTLE_COMMANDS:😀EFAULT_ACTOR_COMMANDS end end end # RPG::BaseItem#==============================================================================# ¡ RPG::UsableItem#==============================================================================class RPG::UsableItem < RPG::BaseItem #-------------------------------------------------------------------------- # public instance variables #-------------------------------------------------------------------------- attr_accessor :command_name attr_accessor :command_hide_until_learn attr_accessor :command_hide_until_usable attr_accessor :command_hide_until_switch #-------------------------------------------------------------------------- # common cache: load_notetags_bcl #-------------------------------------------------------------------------- def load_notetags_bcl @command_name = @name.clone @command_hide_until_switch = 0 #--- self.note.split(/[\r\n]+/).each { |line| case line #--- when YEA::REGEXP::USABLEITEM::COMMAND_NAME @command_name = $1.to_s when YEA::REGEXP::USABLEITEM::COMMAND_HIDE_LEARN @command_hide_until_learn = true when YEA::REGEXP::USABLEITEM::COMMAND_HIDE_USABLE @command_hide_until_usable = true when YEA::REGEXP::USABLEITEM::COMMAND_HIDE_SWITCH @command_hide_until_switch = $1.to_i #--- end } # self.note.split #--- end end # RPG::UsableItem#==============================================================================# ¡ Game_Actor#==============================================================================class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # new method: battle_commands #-------------------------------------------------------------------------- def battle_commands return self.actor.battle_commands unless actor.battle_commands == [] return self.class.battle_commands end #-------------------------------------------------------------------------- # new method: next_command_valid? #-------------------------------------------------------------------------- def next_command_valid? if $imported["YEA-BattleSystem-FTB"] && BattleManager.btype?🙂ftb) return false end return false if @action_input_index >= @actions.size - 1 return true end end # Game_Actor#==============================================================================# ¡ Window_PartyCommand#==============================================================================class Window_PartyCommand < Window_Command #-------------------------------------------------------------------------- # overwrite method: make_command_list #-------------------------------------------------------------------------- def make_command_list for command in YEA::BATTLE_COMMANDS:😛ARTY_COMMANDS case command when :fight add_command(Vocab::fight, :fight) when :escape add_command(Vocab::escape, :escape, BattleManager.can_escape?) when :combatlog next unless $imported["YEA-CombatLogDisplay"] add_command(YEA::COMBAT_LOG::COMMAND_NAME, :combatlog) when :autobattle next unless $imported["YEA-CommandAutobattle"] add_autobattle_command when 😛arty next unless $imported["YEA-PartySystem"] next unless $imported["YEA-CommandParty"] add_party_command else process_custom_command(command) end end end #-------------------------------------------------------------------------- # new method: process_custom_command #-------------------------------------------------------------------------- def process_custom_command(command) return unless YEA::BATTLE_COMMANDS::CUSTOM_PARTY_COMMANDS.include?(command) show = YEA::BATTLE_COMMANDS::CUSTOM_PARTY_COMMANDS[command][2] continue = show <= 0 ? true : $game_switches[show] return unless continue text = YEA::BATTLE_COMMANDS::CUSTOM_PARTY_COMMANDS[command][0] switch = YEA::BATTLE_COMMANDS::CUSTOM_PARTY_COMMANDS[command][1] enabled = switch <= 0 ? true : $game_switches[switch] add_command(text, command, enabled) end end # Window_PartyCommand#==============================================================================# ¡ Window_ConfirmCommand#==============================================================================class Window_ConfirmCommand < Window_Command #-------------------------------------------------------------------------- # initialize #-------------------------------------------------------------------------- def initialize super(0, 0) deactivate hide end #-------------------------------------------------------------------------- # window_width #-------------------------------------------------------------------------- def window_width; return 128; end #-------------------------------------------------------------------------- # visible_line_number #-------------------------------------------------------------------------- def visible_line_number; return 4; end #-------------------------------------------------------------------------- # overwrite method: make_command_list #-------------------------------------------------------------------------- def make_command_list for command in YEA::BATTLE_COMMANDS::CONFIRM_COMMANDS case command when :execute text = YEA::BATTLE_COMMANDS::EXECUTE_VOCAB add_command(text, :execute) when :combatlog next unless $imported["YEA-CombatLogDisplay"] add_command(YEA::COMBAT_LOG::COMMAND_NAME, :combatlog) else process_custom_command(command) end end end #-------------------------------------------------------------------------- # new method: process_custom_command #-------------------------------------------------------------------------- def process_custom_command(command) return unless YEA::BATTLE_COMMANDS::CUSTOM_CONFIRM_COMMANDS.include?(command) show = YEA::BATTLE_COMMANDS::CUSTOM_CONFIRM_COMMANDS[command][2] continue = show <= 0 ? true : $game_switches[show] return unless continue text = YEA::BATTLE_COMMANDS::CUSTOM_CONFIRM_COMMANDS[command][0] switch = YEA::BATTLE_COMMANDS::CUSTOM_CONFIRM_COMMANDS[command][1] enabled = switch <= 0 ? true : $game_switches[switch] add_command(text, command, enabled) end #-------------------------------------------------------------------------- # setup #-------------------------------------------------------------------------- def setup clear_command_list make_command_list refresh select(0) activate self.openness = 255 show end #-------------------------------------------------------------------------- # process_handling #-------------------------------------------------------------------------- if $imported["YEA-BattleEngine"] def process_handling return unless open? && active return process_dir4 if Input.repeat?🙂LEFT) return super end #-------------------------------------------------------------------------- # process_dir4 #-------------------------------------------------------------------------- def process_dir4 Sound.play_cursor Input.update deactivate call_handler🙂dir4) end end # $imported["YEA-BattleEngine"] end # Window_ConfirmCommand#==============================================================================# ¡ Window_ActorCommand#==============================================================================class Window_ActorCommand < Window_Command #-------------------------------------------------------------------------- # alias method: setup #-------------------------------------------------------------------------- alias window_actorcommand_setup_bcl setup def setup(actor) window_actorcommand_setup_bcl(actor) show end #-------------------------------------------------------------------------- # overwrite method: make_command_list #-------------------------------------------------------------------------- def make_command_list return if @actor.nil? @stype_list = [] for command in @actor.battle_commands case command.upcase #--- when /ATTACK/i add_attack_command when /SKILL LIST/i add_skill_commands when /DEFEND/i add_guard_command when /ITEMS/i add_item_command #--- when /SKILL TYPE[ ](\d+)/i add_skill_type_command($1.to_i) when /SKILL[ ](\d+)/i add_skill_id_command($1.to_i) when /ITEM[ ](\d+)/i add_item_id_command($1.to_i) #--- when /AUTOBATTLE/i next unless $imported["YEA-CommandAutobattle"] add_autobattle_command when /EQUIP/i next unless $imported["YEA-CommandEquip"] add_equip_command when /SUBCLASS LIST/i add_subclass_skill_types #--- else; next end end end #-------------------------------------------------------------------------- # overwrite method: add_skill_commands #-------------------------------------------------------------------------- def add_skill_commands @actor.added_skill_types.each do |stype_id| next if @stype_list.include?(stype_id) next if include_subclass_type?(stype_id) add_skill_type_command(stype_id) end end #-------------------------------------------------------------------------- # new method: include_subclass_type? #-------------------------------------------------------------------------- def include_subclass_type?(stype_id) return false unless $imported["YEA-ClassSystem"] return @actor.subclass_skill_types.include?(stype_id) end #-------------------------------------------------------------------------- # new method: add_subclass_skill_types #-------------------------------------------------------------------------- def add_subclass_skill_types return unless $imported["YEA-ClassSystem"] return if @actor.subclass.nil? @actor.subclass_skill_types.sort.each do |stype_id| next if @stype_list.include?(stype_id) add_skill_type_command(stype_id) end end #-------------------------------------------------------------------------- # new method: add_skill_type_command #-------------------------------------------------------------------------- def add_skill_type_command(stype_id) return unless @actor.added_skill_types.include?(stype_id) return if @stype_list.include?(stype_id) @stype_list.push(stype_id) name = $data_system.skill_types[stype_id] add_command(name, :skill, true, stype_id) end #-------------------------------------------------------------------------- # new method: add_skill_id_command #-------------------------------------------------------------------------- def add_skill_id_command(skill_id) return if $data_skills[skill_id].nil? return unless add_use_skill?(skill_id) name = $data_skills[skill_id].command_name add_command(name, :use_skill, use_skill_valid?(skill_id), skill_id) end #-------------------------------------------------------------------------- # new method: add_use_skill? #-------------------------------------------------------------------------- def add_use_skill?(skill_id) skill = $data_skills[skill_id] return false if hide_until_learn?(skill) return false if hide_until_usable?(skill) return false if hide_until_switch?(skill) return true end #-------------------------------------------------------------------------- # new method: hide_until_learn? #-------------------------------------------------------------------------- def hide_until_learn?(skill) return false unless skill.command_hide_until_learn return false if @actor.skill_learn?(skill) return false if @actor.added_skills.include?(skill.id) return true end #-------------------------------------------------------------------------- # new method: hide_until_usable? #-------------------------------------------------------------------------- def hide_until_usable?(skill) return false unless skill.command_hide_until_usable return false if @actor.usable?(skill) return true end #-------------------------------------------------------------------------- # new method: hide_until_switch? #-------------------------------------------------------------------------- def hide_until_switch?(skill) return false unless skill.command_hide_until_switch > 0 return false if $game_switches[skill.command_hide_until_switch] return true end #-------------------------------------------------------------------------- # new method: use_skill_valid? #-------------------------------------------------------------------------- def use_skill_valid?(skill_id) skill = $data_skills[skill_id] return false unless @actor.skill_conditions_met?(skill) return true end #-------------------------------------------------------------------------- # new method: add_item_id_command #-------------------------------------------------------------------------- def add_item_id_command(item_id) return if $data_items[item_id].nil? return unless add_use_item?(item_id) name = $data_items[item_id].command_name add_command(name, :use_item, use_item_valid?(item_id), item_id) end #-------------------------------------------------------------------------- # new method: add_use_item? #-------------------------------------------------------------------------- def add_use_item?(item_id) item = $data_items[item_id] return false if hide_until_usable?(item) return false if hide_until_switch?(item) return true end #-------------------------------------------------------------------------- # new method: use_item_valid? #-------------------------------------------------------------------------- def use_item_valid?(item_id) item = $data_items[item_id] return false unless @actor.item_conditions_met?(item) return true end end # Window_ActorCommand#==============================================================================# ¡ Scene_Battle#==============================================================================class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # alias method: create_all_windows #-------------------------------------------------------------------------- alias scene_battle_create_all_windows_bcl create_all_windows def create_all_windows scene_battle_create_all_windows_bcl create_confirm_command_window end #-------------------------------------------------------------------------- # alias method: create_party_command_window #-------------------------------------------------------------------------- alias create_party_command_window_bcl create_party_command_window def create_party_command_window create_party_command_window_bcl process_custom_party_commands end #-------------------------------------------------------------------------- # new method: process_custom_party_commands #-------------------------------------------------------------------------- def process_custom_party_commands for command in YEA::BATTLE_COMMANDS:😛ARTY_COMMANDS next unless YEA::BATTLE_COMMANDS::CUSTOM_PARTY_COMMANDS.include?(command) called_method = YEA::BATTLE_COMMANDS::CUSTOM_PARTY_COMMANDS[command][3] @party_command_window.set_handler(command, method(called_method)) end end #-------------------------------------------------------------------------- # alias method: create_actor_command_window #-------------------------------------------------------------------------- alias create_actor_command_window_bcl create_actor_command_window def create_actor_command_window create_actor_command_window_bcl @actor_command_window.set_handler🙂use_skill, method🙂command_use_skill)) @actor_command_window.set_handler🙂use_item, method🙂command_use_item)) end #-------------------------------------------------------------------------- # alias method: start_actor_command_selection #-------------------------------------------------------------------------- alias start_actor_command_selection_bcl start_actor_command_selection def start_actor_command_selection @confirm_command_window.hide unless @confirm_command_window.nil? start_actor_command_selection_bcl @actor_command_window.show end #-------------------------------------------------------------------------- # new method: command_use_skill #-------------------------------------------------------------------------- def command_use_skill @skill = $data_skills[@actor_command_window.current_ext] BattleManager.actor.input.set_skill(@skill.id) BattleManager.actor.last_skill.object = @skill status_redraw_target(BattleManager.actor) if $imported["YEA-BattleEngine"] $game_temp.battle_aid = @skill if @skill.for_opponent? select_enemy_selection elsif @skill.for_friend? select_actor_selection else next_command $game_temp.battle_aid = nil end else if [email protected]_selection? next_command elsif @skill.for_opponent? select_enemy_selection else select_actor_selection end end end #-------------------------------------------------------------------------- # new method: command_use_item #-------------------------------------------------------------------------- def command_use_item @item = $data_items[@actor_command_window.current_ext] BattleManager.actor.input.set_item(@item.id) status_redraw_target(BattleManager.actor) if $imported["YEA-BattleEngine"] $game_temp.battle_aid = @item if @item.for_opponent? select_enemy_selection elsif @item.for_friend? select_actor_selection else next_command $game_temp.battle_aid = nil end else if [email protected]_selection? next_command elsif @item.for_opponent? select_enemy_selection else select_actor_selection end end end #-------------------------------------------------------------------------- # alias method: on_actor_ok #-------------------------------------------------------------------------- alias scene_battle_on_actor_ok_bcl on_actor_ok def on_actor_ok scene_battle_on_actor_ok_bcl return if !@confirm_command_window.nil? && @confirm_command_window.visible @actor_command_window.show end #-------------------------------------------------------------------------- # alias method: on_actor_cancel #-------------------------------------------------------------------------- alias scene_battle_on_actor_cancel_bcl on_actor_cancel def on_actor_cancel scene_battle_on_actor_cancel_bcl case @actor_command_window.current_symbol when :use_skill, :use_item @help_window.hide @status_window.show @actor_command_window.activate status_redraw_target(BattleManager.actor) end end #-------------------------------------------------------------------------- # alias method: on_enemy_ok #-------------------------------------------------------------------------- alias scene_battle_on_enemy_ok_bcl on_enemy_ok def on_enemy_ok scene_battle_on_enemy_ok_bcl return if !@confirm_command_window.nil? && @confirm_command_window.visible @actor_command_window.show end #-------------------------------------------------------------------------- # alias method: on_enemy_cancel #-------------------------------------------------------------------------- alias scene_battle_on_enemy_cancel_bcl on_enemy_cancel def on_enemy_cancel scene_battle_on_enemy_cancel_bcl case @actor_command_window.current_symbol when :use_skill, :use_item @help_window.hide @status_window.show @actor_command_window.activate status_redraw_target(BattleManager.actor) end end #-------------------------------------------------------------------------- # new method: status_redraw_target #-------------------------------------------------------------------------- def status_redraw_target(target) return unless target.actor? @status_window.draw_item($game_party.battle_members.index(target)) end #-------------------------------------------------------------------------- # new method: create_confirm_command_window #-------------------------------------------------------------------------- def create_confirm_command_window return unless YEA::BATTLE_COMMANDS::USE_CONFIRM_WINDOW @confirm_command_window = Window_ConfirmCommand.new @confirm_command_window.viewport = @info_viewport @confirm_command_window.set_handler🙂execute, method🙂command_execute)) @confirm_command_window.set_handler🙂cancel, method🙂on_confirm_cancel)) @confirm_command_window.set_handler🙂dir4, method🙂on_confirm_cancel)) @confirm_command_window.unselect @confirm_command_window.x = Graphics.width process_custom_confirm_commands process_confirm_compatibility_commands end #-------------------------------------------------------------------------- # new method: process_custom_confirm_commands #-------------------------------------------------------------------------- def process_custom_confirm_commands for command in YEA::BATTLE_COMMANDS::CONFIRM_COMMANDS next unless YEA::BATTLE_COMMANDS::CUSTOM_CONFIRM_COMMANDS.include?(command) called_method = YEA::BATTLE_COMMANDS::CUSTOM_CONFIRM_COMMANDS[command][3] @party_command_window.set_handler(command, method(called_method)) end end #-------------------------------------------------------------------------- # new method: process_confirm_compatibility_commands #-------------------------------------------------------------------------- def process_confirm_compatibility_commands #--- if $imported["YEA-CombatLogDisplay"] @confirm_command_window.set_handler🙂combatlog, method🙂open_combatlog)) end #--- end #-------------------------------------------------------------------------- # new method: start_confirm_command_selection #-------------------------------------------------------------------------- def start_confirm_command_selection if $imported["YEA-BattleEngine"] @status_window.show redraw_current_status @status_aid_window.hide end @status_window.unselect @actor_command_window.hide @confirm_command_window.setup end #-------------------------------------------------------------------------- # new method: on_confirm_cancel #-------------------------------------------------------------------------- def on_confirm_cancel @confirm_command_window.hide unless @confirm_command_window.nil? @actor_command_window.show @actor_command_window.setup(BattleManager.actor) @status_window.select(BattleManager.actor.index) prior_command unless BattleManager.actor.inputable? end #-------------------------------------------------------------------------- # alias method: next_command #-------------------------------------------------------------------------- alias scene_battle_next_command_bcl next_command def next_command if prompt_next_actor? scene_battle_next_command_bcl elsif YEA::BATTLE_COMMANDS::USE_CONFIRM_WINDOW start_confirm_command_selection else turn_start end end #-------------------------------------------------------------------------- # new method: prompt_next_actor? #-------------------------------------------------------------------------- def prompt_next_actor? index = @status_window.index last_index = $game_party.battle_members.size - 1 for member in $game_party.battle_members.reverse break if member.inputable? last_index -= 1 end if index >= last_index actor = $game_party.battle_members[index] return true if prompt_ftb_action?(actor) return true if actor.next_command_valid? return false if YEA::BATTLE_COMMANDS::USE_CONFIRM_WINDOW end return true end #-------------------------------------------------------------------------- # new method: prompt_ftb_action? #-------------------------------------------------------------------------- def prompt_ftb_action?(actor) return false unless $imported["YEA-BattleEngine"] return false unless $imported["YEA-BattleSystem-FTB"] return false unless BattleManager.btype?🙂ftb) return actor.current_action.valid? end #-------------------------------------------------------------------------- # new method: command_execute #-------------------------------------------------------------------------- def command_execute @confirm_command_window.close turn_start end #-------------------------------------------------------------------------- # new method: command_name1 #-------------------------------------------------------------------------- def command_name1 # Do nothing. end #-------------------------------------------------------------------------- # new method: command_name2 #-------------------------------------------------------------------------- def command_name2 # Do nothing. end end # Scene_Battle#==============================================================================# # ¥ End of File# #==============================================================================
#==============================================================================# State Viewer# Version: 1.0b# Author: modern algebra (rmrk.net)# Date: February 4, 2012#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# Description:## This script allows you to give states descriptions and calls up a scene# which has as its sole purpose to describe what each state (and buff, if# desired) does. This sscene can be made accessible from the Menu, the Status# Scene, or simply by call script in an event.#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# Instructions:## Paste this script into its own slot above Main and below Materials. If you# are using a menu script and you want this script to add itself to the menu# automatically, then this script should be below the custom menu.## The scene can be called in an event using the following script call:# call_stateview## To set the descriptions for each state, simply use the following code in# its notebox:# \DESC{x}# where x is the description you want. You can use the code \LB to go# to another line. Also, you can use any message codes, so if you want# to, for instance, change the colour, you could do it with \c[n] - many# default commands work and, if you use a custom message system, then# some of those codes might work as well.## EXAMPLE:# \DESC{This state drains HP every turn}## You can exclude some states from showing up in the list with the code:# \DESC_HIDE## You have the option to make it accessible from the menu, status or both at# lines 86-93. You can then go on to set whether a label will be shown in the# scene and its size, font, color etc... at lines 99-109.## You can set the script to also show descriptions for the buffs at line 123# and you can setup what is shown for each level of a buff at lines 124-175.## There is an option at line 112 to show all states at all times, but you# can also turn that feature off and require that the states (and buffs) be# inflicted before they are shown. There is an option at line 118 to have# states and buffs be revealed automatically the first time it is inflicted# on a party member or else you can reveal them manually using the following# codes in an evented script call:## reveal_state_description(state_id)# state_id : the ID of the state, as listed in the database.## reveal_buff_description(buff_id)# reveal_buff_description(buff_id, level)# buff_id : ID of the buff, where 0 = MaxHP; 1 = MaxMP; 2 = Attack;# 3 = Defence; 4 = Magic; 5 = Magic Defence; 6 = Agility;# 7 = Luck# level : level of the buff, where -1 = Debuff 1; -2 = Debuff 2;# 1 = Buff 1; 2 = Buff 2. If you exclude level, then all# levels of the buff will be revealed.## EXAMPLES:## reveal_state_description(2)# State 2 (Poison) will now be described in the State View scene.## reveal_buff_description(5, 2)# Level 2 of the Magic Defence Buff will now be described in State View## reveal_buff_description(2)# All levels of the Attack Buff will be described in State View## I reiterate: the above commands are only relevant if you set the option at# line 112, MASV_SHOW_ALL_STATES, to false. If you do not and that is true,# then all states (and buffs, if included) will be shown right off the bat.#==============================================================================$imported = {} unless $imported$imported[:MA_StateView] = true#\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\# CONFIGURATION#||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||# Whether the scene should be accessible via the Status SceneMASV_STATUS_ACCESS = false # If accessible by status screen, what button needs to be pressed? MASV_STATUS_KEY = :A# Whether the scene should be accessible via a command in the menuMASV_MENU_ACCESS = true # If accessible via the menu, what index is it in the command list MASV_MENU_INDEX = 4# The Label used to describe the scene in menu and on the screenMASV_SCENE_LABEL = "State List"# The amount of horizontal space, in pixels, to draw the name of the state.MASV_NAME_FIELD_WIDTH = 124MASV_LABEL_WINDOW = { # <- Do not touch # Whether to show the label at the top of the screen when viewing states show: true, # The name of the font for the label if shown. Can be a string ("Arial") or # an array of strings. Font.default_name is the basic font fontname: Font.default_name, # The size of the font if label is shown fontsize: 32, # The colour of the label if it is shown colour: 16, # The alignment of the label if shown. 0 => Left; 1 => Centre; 2 => Right align: 1} # <- Do not touch# Whether to show all non-hidden states immediatelyMASV_SHOW_ALL_STATES = true # If SHOW_ALL_STATES is false, then turning MASV_AUTOREVEAL_STATES to true # will set it so that the descriptions of states (and buffs) will be shown # once the party first encounters them. If you set this option to false, # then you will need to manually reveal states and buffs via call script in # order for them to show up. See lines 45-62. MASV_AUTOREVEAL_STATES = true#||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||# BUFFS# When this is true, buffs will also be shown in the sceneMASV_INCLUDE_BUFFS = true# If you are showing buffs, then you will need to set the name and description# of each level of the buff in the array below.# They are set in the following way: firstly, there is a hash for each buff,# and in that hash you can set a different name and description for every# buff level in the following format:## level => ["name", "description"],## As with states, you can use \\LB to make a new line and message codes in# the description, but note that you need two backslashes (\\) instead of 1.# So, it would be \\c[1] to change the colour, not \c[1]MASV_BUFFS = [ # <- Do not touch { # Max HP Maximum HP -1 => ["MaxHP -1", "MaxHP decreased by 25%"], # Debuff Level 1 -2 => ["MaxHP -2", "MaxHP decreased by 50%"], # Debuff Level 2 1 => ["MaxHP +1", "MaxHP increased by 25%"], # Buff Level 1 2 => ["MaxHP +2", "MaxHP increased by 50%"], # Buff Level 2 },{ # Max MP Maximum MP -1 => ["MaxMP -1", "MaxMP decreased by 25%"], # Debuff Level 1 -2 => ["MaxMP -2", "MaxMP decreased by 50%"], # Debuff Level 2 1 => ["MaxMP +1", "MaxMP increased by 25%"], # Buff Level 1 2 => ["MaxMP +2", "MaxMP increased by 50%"], # Buff Level 2 },{ # Attack Attack -1 => ["Attack -1", "Attack decreased by 25%"], # Debuff Level 1 -2 => ["Attack -2", "Attack decreased by 50%"], # Debuff Level 2 1 => ["Attack +1", "Attack increased by 25%"], # Buff Level 1 2 => ["Attack +2", "Attack increased by 50%"], # Buff Level 2 },{ # Defence Defence -1 => ["Defence -1", "Defence decreased by 25%"], # Debuff Level 1 -2 => ["Defence -2", "Defence decreased by 50%"], # Debuff Level 2 1 => ["Defence +1", "Defence increased by 25%"], # Buff Level 1 2 => ["Defence +2", "Defence increased by 50%"], # Buff Level 2 },{ # Magic Magic -1 => ["Magic -1", "Magic decreased by 25%"], # Debuff Level 1 -2 => ["Magic -2", "Magic decreased by 50%"], # Debuff Level 2 1 => ["Magic +1", "Magic increased by 25%"], # Buff Level 1 2 => ["Magic +2", "Magic increased by 50%"], # Buff Level 2 },{ # Magic Defence Magic Defence -1 => ["MDefence -1", "MDefence decreased by 25%"], # Debuff Level 1 -2 => ["MDefence -2", "MDefence decreased by 50%"], # Debuff Level 2 1 => ["MDefence +1", "MDefence increased by 25%"], # Buff Level 1 2 => ["MDefence +2", "MDefence increased by 50%"], # Buff Level 2 },{ # Agility Agility -1 => ["Agility -1", "Agility decreased by 25%"], # Debuff Level 1 -2 => ["Agility -2", "Agility decreased by 50%"], # Debuff Level 2 1 => ["Agility +1", "Agility increased by 25%"], # Buff Level 1 2 => ["Agility +2", "Agility increased by 50%"], # Buff Level 2 },{ # Luck Luck -1 => ["Luck -1", "Luck decreased by 25%"], # Debuff Level 1 -2 => ["Luck -2", "Luck decreased by 50%"], # Debuff Level 2 1 => ["Luck +1", "Luck increased by 25%"], # Buff Level 1 2 => ["Luck +2", "Luck increased by 50%"], # Buff Level 2 },] # <- Do not touch#``````````````````````````````````````````````````````````````````````````````# END CONFIGURATION#//////////////////////////////////////////////////////////////////////////////MASV_BUFFS.each {|hash| hash.values.each {|ary| ary[1].gsub!(/\\LB/i, "\n") } }#==============================================================================# ** RPG::State#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# Summary of Changes:# overwritten super method - description# new method - desc_hide?#==============================================================================class RPG::State #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Description #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def description if !@masv_description @masv_description = self.note[/\\DESC\{(.+?)\}/im].nil? ? "" : $1 @masv_description.gsub!(/\n/, "") @masv_description.gsub!(/\\LB/i, "\n") end @masv_description end #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Excluded? #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def desc_hide? @desc_hide = !self.note[/\\DESC_HIDE/i].nil? if !@desc_hide @desc_hide endend#==============================================================================# *** DataManager#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# Summary of Changes:# aliased method - extract_save_contents#==============================================================================module DataManager class << self #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Extract Save Contents #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ alias masv_extrctsvcon_5gh6 extract_save_contents def extract_save_contents(contents, *args, &block) masv_extrctsvcon_5gh6(contents, *args, &block) # Initialize new data if old save file $game_system.masv_initialize_statebuff_counters if !$game_system.masv_states_afflicted end endend#==============================================================================# ** Game_System#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# Summary of Changes:# new public instance variables - masv_states_afflicted; masv_buffs_added# aliased method - initialize# new methods - reveal_state_description; reveal_buff_description#==============================================================================class Game_System #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Public Instance Variables #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ attr_reader :masv_states_afflicted attr_reader :masv_buffs_added #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Object Initialization #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ alias molbr_stvw_inze_4rp8 initialize def initialize(*args, &block) masv_initialize_statebuff_counters molbr_stvw_inze_4rp8(*args, &block) # Run Original Method end #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Initialize MASV Data #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def masv_initialize_statebuff_counters @masv_states_afflicted = [] @masv_buffs_added = Array.new(MASV_BUFFS.size, []) end #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Reveal State Description #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def reveal_state_description(state_id) $game_system.masv_states_afflicted.push(state_id) unless $game_system.masv_states_afflicted.include?(state_id) end #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Reveal Buff Description #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def reveal_buff_description(param_id, lvl = nil) return if param_id == 0 || lvl == 0 $game_system.masv_buffs_added[param_id] = [] unless $game_system.masv_buffs_added[param_id] if lvl.nil? # Reveal all levels of a parameter if lvl not specified $game_system.masv_buffs_added[param_id] |= MASV_BUFFS[param_id].keys else $game_system.masv_buffs_added[param_id].push(lvl) unless $game_system.masv_buffs_added[param_id].include?(lvl) end endend#==============================================================================# ** Game_Battler#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# Summary of Changes:# aliased method - add_state; add_buff; add_debuff#==============================================================================class Game_Battler #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Add State #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ alias morala_stvw_adstat_5fc1 add_state def add_state(state_id, *args, &block) # Add the state to the added states counter $game_system.reveal_state_description(state_id) if MASV_AUTOREVEAL_STATES && actor? && state_addable?(state_id) morala_stvw_adstat_5fc1(state_id, *args, &block) # Run Original Method end #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Add Buff #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ alias masv_adbuff_5tz9 add_buff def add_buff(param_id, *args, &block) masv_adbuff_5tz9(param_id, *args, &block) # Run Original Method # Add the buff level to the added buffs counter $game_system.reveal_buff_description(param_id, @buffs[param_id]) if MASV_AUTOREVEAL_STATES && actor? end #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Add Debuff #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ alias masv_debuff_3hj7 add_debuff def add_debuff(param_id, *args, &block) masv_debuff_3hj7(param_id, *args, &block) # Run Original Method # Add the buff level to the added buffs counter $game_system.reveal_buff_description(param_id, @buffs[param_id]) if MASV_AUTOREVEAL_STATES && actor? endend#==============================================================================# ** Game_Interpreter#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# Summary of Changes:# new methods - call_stateview; reveal_state_description;# reveal_buff_description#==============================================================================class Game_Interpreter #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Call State View Scene #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def call_stateview SceneManager.call(Scene_StateView) end #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Reveal State Description #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [:reveal_state_description, :reveal_buff_description].each { |sys_meth| define_method(sys_meth) do |*args| $game_system.send(sys_meth, *args) end }end#==============================================================================# ** Window_StateView#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# This window displays all states and descriptions of their effects#==============================================================================class Window_StateView < Window_Selectable #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Object Initialization #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def initialize(*args) @item_max = 1 super(*args) refresh activate end #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Item Max #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def item_max @item_max end #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Include State? #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def state_include?(state) return false unless state # False if nil return false if state.desc_hide? return true if MASV_SHOW_ALL_STATES return $game_system.masv_states_afflicted.include?(state.id) end #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Include Buff? #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def buff_include?(param_id, lvl) return false unless MASV_BUFFS[param_id] && MASV_BUFFS[param_id][lvl].is_a?(Array) return false unless MASV_BUFFS[param_id][lvl][0].is_a?(String) && MASV_BUFFS[param_id][lvl][1].is_a?(String) return true end #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Make State List #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def make_state_list @data = $data_states.compact.select { |state| state_include?(state) } @item_max = @data.inject(0) { |r, state| r += state.description.scan(/\n/).size + 1 } if MASV_INCLUDE_BUFFS for i in 0...MASV_BUFFS.size ary = MASV_SHOW_ALL_STATES ? MASV_BUFFS.keys : $game_system.masv_buffs_added ary.each { |lvl| if buff_include?(i, lvl) @data.push([i, lvl]) @item_max += MASV_BUFFS[lvl][1].scan(/\n/).size + 1 end } end end @item_max = 1 if @item_max < 1 end #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Refresh #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def refresh make_state_list create_contents # Draw all states y = 0 @dummy_battler = Game_BattlerBase.new for i in [email hidden] y = draw_item(y, i) end @dummy_battler = nil end #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Draw Item # state : RPG::State object that is being drawn #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def draw_item(y, index) reset_font_settings contents.font.name = Font.default_name icon_index, icon_hue, name, description = get_data(index) # Draw Icon $imported[:MAIcon_Hue] ? draw_icon_with_hue(icon_index, icon_hue, x, y) : draw_icon(icon_index, 0, y) # Draw Name change_color(system_color) draw_text(28, y, MASV_NAME_FIELD_WIDTH, 24, name) # Draw Description change_color(normal_color) draw_text_ex(34 + MASV_NAME_FIELD_WIDTH, y, description) return y + (description.scan(/\n/).size + 1)*line_height end #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Get the data to draw #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def get_data(index) item = @data[index] icon_index, icon_hue, name, description = 0, 0, "", "" if item.is_a?(RPG::State) icon_index, name, description = item.icon_index, item.name, item.description icon_hue = $imported[:MAIcon_Hue] ? item.icon_hue : 0 elsif item.is_a?(Array) icon_index = @dummy_battler.buff_icon_index(item[1], item[0]) if @dummy_battler name = MASV_BUFFS[item[0]][item[1]][0] rescue "" description = MASV_BUFFS[item[0]][item[1]][1] rescue "" end icon_index = 0 if icon_index.nil? return icon_index, icon_hue, name, description end #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Cursor Down #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def cursor_down(*args) tr = self.top_row self.top_row += 1 unless self.bottom_row >= item_max - 1 Sound.play_cursor if tr != self.top_row end #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Cursor Down #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def cursor_up(*args) tr = self.top_row self.top_row -= 1 Sound.play_cursor if tr != self.top_row endend#==============================================================================# ** Window_StateLabel#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# This window shows the label if desired#==============================================================================class Window_StateLabel < Window_Base #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Object Initialization #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def initialize(*args) super(*args) refresh end #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Refresh #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def refresh contents.clear settings = MASV_LABEL_WINDOW contents.font.name = settings[:fontname] contents.font.size = settings[:fontsize] change_color(text_color(settings[:colour])) contents.fill_rect(0, settings[:fontsize] - 1, contents_width, 2, contents.font.color) draw_text(0, 0, contents_width, settings[:fontsize], MASV_SCENE_LABEL, settings[:align]) endend#==============================================================================# ** Scene_StateView#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# This scene processes the state viewing scene#==============================================================================class Scene_StateView < Scene_MenuBase #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Start Processing #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def start super if MASV_LABEL_WINDOW[:show] @label_window = Window_StateLabel.new(0, 0, Graphics.width, Graphics.height) swy = ((Graphics.height - MASV_LABEL_WINDOW[:fontsize] - @label_window.padding) / 24)*24 swy += @label_window.padding @states_window = Window_StateView.new(0, Graphics.height - swy, Graphics.width, swy) @states_window.opacity = 0 else @states_window = Window_StateView.new(0, 0, Graphics.width, Graphics.height) end @states_window.set_handler🙂ok, method🙂return_scene)) @states_window.set_handler🙂cancel, method🙂return_scene)) endend# Status Integration#==============================================================================# ** Scene Status (Access from Status)#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# Summary of Changes:# aliased method - update# new method - update_stateview_call#==============================================================================class Scene_Status #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Frame Update #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ alias malsv_updte_2hg1 update def update(*args, &block) malsv_updte_2hg1(*args, &block) # Run Original Method update_stateview_call if MASV_STATUS_ACCESS end #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Update SceneView Call #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def update_stateview_call SceneManager.call(Scene_StateView) if Input.trigger?(MASV_STATUS_KEY) endend# Menu Integrationif MASV_MENU_ACCESSunless $imported[:MA_InsertCommand]# Initialize the Insertion HashMA_COMMAND_INSERTS = {}MA_InsertableMenuCommand = Struct.new🙂name, :index, :enable, :scene, 😮ther)#==============================================================================# ** Game_System#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# Summary of Changes:# new public instance variable - maic_menu_commands# aliased method - initialize#==============================================================================class Game_System #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Inserted Menu Commands #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def maic_inserted_menu_commands # Lazy Instantiation so that old save files are not corrupted if !@maic_inserted_menu_commands @maic_inserted_menu_commands = MA_COMMAND_INSERTS.keys # Sort by index @maic_inserted_menu_commands.sort! { |a, b| MA_COMMAND_INSERTS[a].index <=> MA_COMMAND_INSERTS.index } end @maic_inserted_menu_commands endend#==============================================================================# ** Window_MenuCommand#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# Summary of Changes:# aliased method - make_command_list; maic_insert_command#==============================================================================class Window_MenuCommand #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Make Command List #`````````````````````````````````````````````````````````````````````````` # I alias this method instead of add_original_commands because I need to # have all commands created before I can insert at the correct index #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ alias maic_mkcmmndl_6yd2 make_command_list def make_command_list(*args, &block) maic_mkcmmndl_6yd2(*args, &block) # Run Original Method # Insert new commands $game_system.maic_inserted_menu_commands.each { |sym| maic_insert_command(sym) } end #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Insert Command #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def maic_insert_command(symbol) command = MA_COMMAND_INSERTS[symbol] # Get the command name name = command.name.is_a?(Symbol) ? eval(command.name.to_s) : command.name # Check whether enabled enabled = case command.enable when Integer then command.enable == 0 ? true : $game_switches[command.enable] when String then eval(command.enable) when Symbol then self.send(command.enable) else enabled = true end # Add the command to the list add_command(name, symbol, enabled) added = @list.pop @list.insert([command.index, @list.size].min, added) # Insert at specific index endend#==============================================================================# ** Scene_Menu#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++# Summary of Changes:# aliased method - create_command_window; on_personal_ok# new methods - maic_set_insert_handler; maic_command_insert#==============================================================================class Scene_Menu #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Create Command Window #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ alias maic_createcndwin_3ey7 create_command_window def create_command_window(*args, &block) maic_createcndwin_3ey7(*args, &block) # Run Original Method # Add handlers for all custom commands $game_system.maic_inserted_menu_commands.each { |symbol| maic_set_insert_handler(symbol) } end #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Set Inserted Handler #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def maic_set_insert_handler(symbol) other = MA_COMMAND_INSERTS[symbol].other handler = case other when Symbol then method(other) when String then lambda { eval(other) } when TrueClass then method🙂command_personal) else handler = method🙂maic_command_insert) end @command_window.set_handler(symbol, handler) end #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Custom Command #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def maic_command_insert SceneManager.call(Kernel.const_get(MA_COMMAND_INSERTS[@command_window.current_symbol].scene)) end #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Personal OK #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ alias maic_onpok_3ek9 on_personal_ok def on_personal_ok(*args, &block) if $game_system.maic_inserted_menu_commands.include?(@command_window.current_symbol) maic_command_insert else maic_onpok_3ek9(*args, &block) # Run Original Method end endend$imported[:MA_InsertCommand] = trueendMA_COMMAND_INSERTS[:stateview] = MA_InsertableMenuCommand.new(MASV_SCENE_LABEL,MASV_MENU_INDEX, true, :Scene_StateView, false)end
Thanks for looking.