Explication Ce sujet est une compilation des differents scripts de menu fait par Yanfly...
Vous trouverez les menus suivant : Items, Skills, Equip, Status, and Save
Screen Items
Spoiler:
Skills
Spoiler:
Equip
Spoiler:
Status
Spoiler:
Save
Spoiler:
Script Les scripts sont dans les posts ci-dessous, a cause de la limite de post du fofo'...
Note au Admins et Modos : A cause de la limite de post du fofo' j'ai du diviser les scripts en plusieurs posts...
Installation Mettez les tous au-dessus de Main, et en-dessous de Materials
Voici l'ordre dans lequel vous DEVEZ les mettre :
- Equip Engine - Item Menu - Save Engine - Skill Menu - Status Menu
Lien Item Menu : http://yanflychannel.wordpress.com/rmvxa/menu-scripts/ace-item-menu/ Skill Menu : http://yanflychannel.wordpress.com/rmvxa/menu-scripts/ace-skill-menu/ Equip Engine : http://yanflychannel.wordpress.com/rmvxa/gameplay-scripts/ace-equip-engine/ Status Menu : http://yanflychannel.wordpress.com/rmvxa/menu-scripts/ace-status-menu/ Save Engine : http://yanflychannel.wordpress.com/rmvxa/menu-scripts/ace-save-engine/
Credits - Yanfly
Dernière édition par cagt3000 le Mer 11 Avr 2012 - 15:59, édité 3 fois
#============================================================================== # # ▼ Yanfly Engine Ace - Ace Item Menu v1.02 # -- Last Updated: 2012.01.05 # -- Level: Normal, Hard # -- Requires: n/a # #==============================================================================
$imported = {} if $imported.nil? $imported["YEA-ItemMenu"] = true
#============================================================================== # ▼ Updates # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # 2012.01.05 - Compatibility Update with Equip Dynamic Stats. # 2012.01.03 - Started Script and Finished. # - Compatibility Update with Ace Menu Engine. # #============================================================================== # ▼ Introduction # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # The Ace Item Menu offers more item categorization control and a better layout # that simulatenously provides information regarding the items to the player, # while keeping a good amount of the item list visible on screen at once. The # script can also be customized to rearrange commands and categories. # #============================================================================== # ▼ Instructions # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # To install this script, open up your script editor and copy/paste this script # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save. # # ----------------------------------------------------------------------------- # Item Notetags - These notetags go in the item notebox in the database. # ----------------------------------------------------------------------------- # <category: string> # Places this object into the item category for "string". Whenever the selected # category is highlighted in the Ace Item Menu command window, this object will # be included and shown in the item window. # # <image: string> # Uses a picture from Graphics\Pictures\ of your RPG Maker VX Ace Project's # directory with the filename of "string" (without the extension) as the image # picture shown in the Ace Item Menu. # # ----------------------------------------------------------------------------- # Weapon Notetags - These notetags go in the weapon notebox in the database. # ----------------------------------------------------------------------------- # <category: string> # Places this object into the item category for "string". Whenever the selected # category is highlighted in the Ace Item Menu command window, this object will # be included and shown in the item window. # # <image: string> # Uses a picture from Graphics\Pictures\ of your RPG Maker VX Ace Project's # directory with the filename of "string" (without the extension) as the image # picture shown in the Ace Item Menu. # # ----------------------------------------------------------------------------- # Armour Notetags - These notetags go in the armour notebox in the database. # ----------------------------------------------------------------------------- # <category: string> # Places this object into the item category for "string". Whenever the selected # category is highlighted in the Ace Item Menu command window, this object will # be included and shown in the item window. # # <image: string> # Uses a picture from Graphics\Pictures\ of your RPG Maker VX Ace Project's # directory with the filename of "string" (without the extension) as the image # picture shown in the Ace Item Menu. # #============================================================================== # ▼ 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. # #==============================================================================
module YEA module ITEM
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # - Item Command Settings - #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # This array adjusts what options appear in the initial item command window # before the items are split into separate categories. Add commands, remove # commands, or rearrange them. Here's a list of which does what: # # ------------------------------------------------------------------------- # :command Description # ------------------------------------------------------------------------- # :item Opens up the various item categories. Default. # :weapon Opens up the various weapon categories. Default. # :armor Opens up the various armour categories. Default. # :key_item Shows a list of the various key items. Default. # # :gogototori Requires Kread-EX's Go Go Totori Synthesis. # #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- COMMANDS =[ :item, # Opens up the various item categories. Default. :weapon, # Opens up the various weapon categories. Default. :armor, # Opens up the various armour categories. Default. :key_item, # Shows a list of the various key items. Default. :gogototori, # Requires Kread-EX's Go Go Totori Synthesis. # :custom1, # Custom command 1. # :custom2, # Custom command 2. ] # Do not remove this.
#-------------------------------------------------------------------------- # - Item Custom Commands - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # For those who use scripts to that may produce unique effects for the item # scene, use this hash to manage the custom commands for the Item 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_ITEM_COMMANDS ={ # :command => ["Display Name", EnableSwitch, ShowSwitch, Handler Method], :gogototori => ["Synthesis", 0, 0, :command_totori], :custom1 => [ "Custom Name", 0, 0, :command_name1], :custom2 => [ "Custom Text", 13, 0, :command_name2], } # Do not remove this.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # - Item Type Settings - #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # These arrays adjusts and shows the various item types shown for Items, # Weapons, and Armours. Note that when using :category symbols, the # specific category shown will be equal to the text used for the Display # and the included item must contain a category equal to the Display name. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # This array contains the order for the Item categories. ITEM_TYPES =[ # [ :symbol, "Display"], [ :field, "Field"], # Shows Menu-usable items. [ :battle, "Battle"], # Shows Battle-usable items. [:category, "Special"], # Categorized by <category: string> [:category,"Ingredient"], # Categorized by <category: string> [:key_item, "Key Item"], # Shows all key items. [ :all, "All"], # Shows all usable items. ] # Do not remove this.
# This array contains the order for the Weapon categories. WEAPON_TYPES =[ # [ :symbol, "Display"], [ :types, "WPNTYPES"], # Lists all of the individual weapon types. [:category, "Training"], # Categorized by <category: string> [:category, "Legendary"], # Categorized by <category: string> [ :all, "All"], # Shows all weapons. ] # Do not remove this.
# This array contains the order for the Armour categories. ARMOUR_TYPES =[ # [ :symbol, "Display"], [ :slots, "ARMSLOTS"], # Lists all of the individual armour slots. [ :types, "ARMTYPES"], # Lists all of the individual armours types. [:category, "Training"], # Categorized by <category: string> [:category, "Legendary"], # Categorized by <category: string> [ :all, "All"], # Shows all armours. ] # Do not remove this.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # - Item Status Settings - #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # The item status window displays information about the item in detail. # Adjust the settings below to change the way the status window appears. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- STATUS_FONT_SIZE = 20 # Font size used for status window. MAX_ICONS_DRAWN = 10 # Maximum number of icons drawn for states.
# The following adjusts the vocabulary used for the status window. Each # of the vocabulary settings are self explanatory. VOCAB_STATUS ={ :empty => "---", # Text used when nothing is shown. :hp_recover => "HP Heal", # Text used for HP Recovery. :mp_recover => "MP Heal", # Text used for MP Recovery. :tp_recover => "TP Heal", # Text used for TP Recovery. :tp_gain => "TP Gain", # Text used for TP Gain. :applies => "Applies", # Text used for applied states and buffs. :removes => "Removes", # Text used for removed states and buffs. } # Do not remove this.
end # ITEM end # 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. #==============================================================================
#-------------------------------------------------------------------------- # alias method: load_database #-------------------------------------------------------------------------- class <<self; alias load_database_aim load_database; end def self.load_database load_database_aim load_notetags_aim end
#-------------------------------------------------------------------------- # new method: load_notetags_aim #-------------------------------------------------------------------------- def self.load_notetags_aim groups = [$data_items, $data_weapons, $data_armors] for group in groups for obj in group next if obj.nil? obj.load_notetags_aim end end end
#-------------------------------------------------------------------------- # public instance variables #-------------------------------------------------------------------------- attr_accessor :category attr_accessor :image
#-------------------------------------------------------------------------- # common cache: load_notetags_aim #-------------------------------------------------------------------------- def load_notetags_aim @category = [] #--- self.note.split(/[\r\n]+/).each { |line| case line #--- when YEA::REGEXP::BASEITEM::CATEGORY @category.push($1.upcase.to_s) when YEA::REGEXP::BASEITEM::IMAGE @image = $1.to_s end } # self.note.split #--- end
#-------------------------------------------------------------------------- # public instance variables #-------------------------------------------------------------------------- attr_reader :item_window
#-------------------------------------------------------------------------- # initialize #-------------------------------------------------------------------------- def initialize(x, y) super(x, y) end
#-------------------------------------------------------------------------- # window_width #-------------------------------------------------------------------------- def window_width; return 160; end
#-------------------------------------------------------------------------- # visible_line_number #-------------------------------------------------------------------------- def visible_line_number; return 4; end
#-------------------------------------------------------------------------- # process_ok #-------------------------------------------------------------------------- def process_ok $game_temp.scene_item_index = index $game_temp.scene_item_oy = self.oy super end
#-------------------------------------------------------------------------- # make_command_list #-------------------------------------------------------------------------- def make_command_list for command in YEA::ITEM::COMMANDS case command #--- Default Commands --- when :item add_command(Vocab::item, :item) when :weapon add_command(Vocab::weapon, :weapon) when :armor add_command(Vocab::armor, :armor) when :key_item add_command(Vocab::key_item, :key_item) #--- Imported --- when :gogototori next unless $imported["KRX-AlchemicSynthesis"] process_custom_command(command) #--- Custom Commands --- else process_custom_command(command) end end end
#-------------------------------------------------------------------------- # window_width #-------------------------------------------------------------------------- def window_width; return 160; end
#-------------------------------------------------------------------------- # visible_line_number #-------------------------------------------------------------------------- def visible_line_number; return 4; end
#-------------------------------------------------------------------------- # reveal #-------------------------------------------------------------------------- def reveal(type) @type = type refresh activate select(0) end
#-------------------------------------------------------------------------- # make_command_list #-------------------------------------------------------------------------- def make_command_list return if @type.nil? #--- case @type when :item commands = YEA::ITEM::ITEM_TYPES when :weapon commands = YEA::ITEM::WEAPON_TYPES else commands = YEA::ITEM::ARMOUR_TYPES end #--- for command in commands case command[0] #--- when :types case @type when :weapon for i in 1...$data_system.weapon_types.size name = $data_system.weapon_types[i] add_command(name, :w_type, true, i) end else for i in 1...$data_system.armor_types.size name = $data_system.armor_types[i] add_command(name, :a_type, true, i) end end #--- when :slots if $imported["YEA-AceEquipEngine"] maximum = 1 for key in YEA::EQUIP::TYPES maximum = [maximum, key[0]].max end else maximum = 4 end for i in 1..maximum name = Vocab::etype(i) add_command(name, :e_type, true, i) if name != "" end #--- else add_command(command[1], command[0], true, @type) end end end
#-------------------------------------------------------------------------- # update #-------------------------------------------------------------------------- def update super return unless self.active @item_window.category = current_symbol if @item_window end
#-------------------------------------------------------------------------- # alias method: initialize #-------------------------------------------------------------------------- alias window_itemlist_initialize_aim initialize def initialize(dx, dy, dw, dh) window_itemlist_initialize_aim(dx, dy, dw, dh) @ext = :none @name = "" end
#-------------------------------------------------------------------------- # alias method: category= #-------------------------------------------------------------------------- alias window_itemlist_category_aim category= def category=(category) if @types_window.nil? window_itemlist_category_aim(category) else return unless update_types?(category) @category = category if @types_window.active @name = @types_window.current_data[:name] @ext = @types_window.current_ext end refresh self.oy = 0 end end
#-------------------------------------------------------------------------- # new method: update_types? #-------------------------------------------------------------------------- def update_types?(category) return true if @category != category return false unless @types_window.active if category == :category return @name != @types_window.current_data[:name] end return @ext != @types_window.current_ext end
#-------------------------------------------------------------------------- # new method: types_window= #-------------------------------------------------------------------------- def types_window=(window) @types_window = window end
#-------------------------------------------------------------------------- # alias method: include? #-------------------------------------------------------------------------- alias window_itemlist_include_aim include? def include?(item) if @types_window.nil? return window_itemlist_include_aim(item) else return ace_item_menu_include?(item) end end
#-------------------------------------------------------------------------- # new method: ace_item_menu_include? #-------------------------------------------------------------------------- def ace_item_menu_include?(item) case @category #--- when :field return false unless item.is_a?(RPG::Item) return item.menu_ok? when :battle return false unless item.is_a?(RPG::Item) return item.battle_ok? #--- when :w_type return false unless item.is_a?(RPG::Weapon) return item.wtype_id == @types_window.current_ext when :a_type return false unless item.is_a?(RPG::Armor) return item.atype_id == @types_window.current_ext when :e_type return false unless item.is_a?(RPG::Armor) return item.etype_id == @types_window.current_ext #--- when :all case @types_window.current_ext when :item return item.is_a?(RPG::Item) when :weapon return item.is_a?(RPG::Weapon) else return item.is_a?(RPG::Armor) end #--- when :category case @types_window.current_ext when :item return false unless item.is_a?(RPG::Item) when :weapon return false unless item.is_a?(RPG::Weapon) else return false unless item.is_a?(RPG::Armor) end return item.category.include?(@types_window.current_data[:name].upcase) #--- else return window_itemlist_include_aim(item) end end
#-------------------------------------------------------------------------- # update #-------------------------------------------------------------------------- def update super update_item(@item_window.item) end
#-------------------------------------------------------------------------- # update_item #-------------------------------------------------------------------------- def update_item(item) return if @item == item @item = item refresh end
#-------------------------------------------------------------------------- # refresh #-------------------------------------------------------------------------- def refresh contents.clear reset_font_settings return draw_empty if @item.nil? contents.font.size = YEA::ITEM::STATUS_FONT_SIZE draw_item_image draw_item_stats draw_item_effects end
#-------------------------------------------------------------------------- # draw_empty #-------------------------------------------------------------------------- def draw_empty colour = Color.new(0, 0, 0, translucent_alpha/2) rect = Rect.new(1, 1, 94, 94) contents.fill_rect(rect, colour) dx = 96; dy = 0 dw = (contents.width - 96) / 2 for i in 0...8 draw_background_box(dx, dy, dw) dx = dx >= 96 + dw ? 96 : 96 + dw dy += line_height if dx == 96 end end
#-------------------------------------------------------------------------- # draw_set_param #-------------------------------------------------------------------------- def draw_set_param(param_id, dx, dy, dw) value = @item.params[param_id] if $imported["YEA-EquipDynamicStats"] && @item.var_params[param_id] > 0 value += $game_variables[@item.var_params[param_id]] rescue 0 end change_color(param_change_color(value), value != 0) text = value.group text = "+" + text if value > 0 draw_text(dx+4, dy, dw-8, line_height, text, 2) return text end
#-------------------------------------------------------------------------- # draw_percent_param #-------------------------------------------------------------------------- def draw_percent_param(param_id, dx, dy, dw) value = @item.per_params[param_id] change_color(param_change_color(value)) text = (@item.per_params[param_id] * 100).to_i.group + "%" text = "+" + text if @item.per_params[param_id] > 0 draw_text(dx+4, dy, dw-8, line_height, text, 2) return text end
#-------------------------------------------------------------------------- # draw_item_effects #-------------------------------------------------------------------------- def draw_item_effects return unless @item.is_a?(RPG::Item) dx = 96; dy = 0 dw = (contents.width - 96) / 2 draw_hp_recover(dx, dy + line_height * 0, dw) draw_mp_recover(dx, dy + line_height * 1, dw) draw_tp_recover(dx + dw, dy + line_height * 0, dw) draw_tp_gain(dx + dw, dy + line_height * 1, dw) dw = contents.width - 96 draw_applies(dx, dy + line_height * 2, dw) draw_removes(dx, dy + line_height * 3, dw) end
#-------------------------------------------------------------------------- # draw_hp_recover #-------------------------------------------------------------------------- def draw_hp_recover(dx, dy, dw) draw_background_box(dx, dy, dw) change_color(system_color) draw_text(dx+4, dy, dw-8, line_height, Vocab::item_status(:hp_recover)) per = 0 set = 0 for effect in @item.effects next unless effect.code == 11 per += (effect.value1 * 100).to_i set += effect.value2.to_i end if per != 0 && set != 0 change_color(param_change_color(set)) text = set > 0 ? sprintf("+%s", set.group) : set.group draw_text(dx+4, dy, dw-8, line_height, text, 2) dw -= text_size(text).width change_color(param_change_color(per)) text = per > 0 ? sprintf("+%s%%", per.group) : sprintf("%s%%", per.group) draw_text(dx+4, dy, dw-8, line_height, text, 2) return elsif per != 0 change_color(param_change_color(per)) text = per > 0 ? sprintf("+%s%%", per.group) : sprintf("%s%%", per.group) elsif set != 0 change_color(param_change_color(set)) text = set > 0 ? sprintf("+%s", set.group) : set.group else change_color(normal_color, false) text = Vocab::item_status(:empty) end draw_text(dx+4, dy, dw-8, line_height, text, 2) end
#-------------------------------------------------------------------------- # draw_mp_recover #-------------------------------------------------------------------------- def draw_mp_recover(dx, dy, dw) draw_background_box(dx, dy, dw) change_color(system_color) draw_text(dx+4, dy, dw-8, line_height, Vocab::item_status(:mp_recover)) per = 0 set = 0 for effect in @item.effects next unless effect.code == 12 per += (effect.value1 * 100).to_i set += effect.value2.to_i end if per != 0 && set != 0 change_color(param_change_color(set)) text = set > 0 ? sprintf("+%s", set.group) : set.group draw_text(dx+4, dy, dw-8, line_height, text, 2) dw -= text_size(text).width change_color(param_change_color(per)) text = per > 0 ? sprintf("+%s%%", per.group) : sprintf("%s%%", per.group) draw_text(dx+4, dy, dw-8, line_height, text, 2) return elsif per != 0 change_color(param_change_color(per)) text = per > 0 ? sprintf("+%s%%", per.group) : sprintf("%s%%", per.group) elsif set != 0 change_color(param_change_color(set)) text = set > 0 ? sprintf("+%s", set.group) : set.group else change_color(normal_color, false) text = Vocab::item_status(:empty) end draw_text(dx+4, dy, dw-8, line_height, text, 2) end
#-------------------------------------------------------------------------- # draw_tp_recover #-------------------------------------------------------------------------- def draw_tp_recover(dx, dy, dw) draw_background_box(dx, dy, dw) change_color(system_color) draw_text(dx+4, dy, dw-8, line_height, Vocab::item_status(:tp_recover)) set = 0 for effect in @item.effects next unless effect.code == 13 set += effect.value1.to_i end if set != 0 change_color(param_change_color(set)) text = set > 0 ? sprintf("+%s", set.group) : set.group else change_color(normal_color, false) text = Vocab::item_status(:empty) end draw_text(dx+4, dy, dw-8, line_height, text, 2) end
#-------------------------------------------------------------------------- # draw_tp_gain #-------------------------------------------------------------------------- def draw_tp_gain(dx, dy, dw) draw_background_box(dx, dy, dw) change_color(system_color) draw_text(dx+4, dy, dw-8, line_height, Vocab::item_status(:tp_gain)) set = @item.tp_gain if set != 0 change_color(param_change_color(set)) text = set > 0 ? sprintf("+%s", set.group) : set.group else change_color(normal_color, false) text = Vocab::item_status(:empty) end draw_text(dx+4, dy, dw-8, line_height, text, 2) end
#-------------------------------------------------------------------------- # draw_applies #-------------------------------------------------------------------------- def draw_applies(dx, dy, dw) draw_background_box(dx, dy, dw) change_color(system_color) draw_text(dx+4, dy, dw-8, line_height, Vocab::item_status(:applies)) icons = [] for effect in @item.effects case effect.code when 21 next unless effect.value1 > 0 next if $data_states[effect.value1].nil? icons.push($data_states[effect.data_id].icon_index) when 31 icons.push($game_actors[1].buff_icon_index(1, effect.data_id)) when 32 icons.push($game_actors[1].buff_icon_index(-1, effect.data_id)) end icons.delete(0) break if icons.size >= YEA::ITEM::MAX_ICONS_DRAWN end draw_icons(dx, dy, dw, icons) end
#-------------------------------------------------------------------------- # draw_removes #-------------------------------------------------------------------------- def draw_removes(dx, dy, dw) draw_background_box(dx, dy, dw) change_color(system_color) draw_text(dx+4, dy, dw-8, line_height, Vocab::item_status(:removes)) icons = [] for effect in @item.effects case effect.code when 22 next unless effect.value1 > 0 next if $data_states[effect.value1].nil? icons.push($data_states[effect.data_id].icon_index) when 33 icons.push($game_actors[1].buff_icon_index(1, effect.data_id)) when 34 icons.push($game_actors[1].buff_icon_index(-1, effect.data_id)) end icons.delete(0) break if icons.size >= YEA::ITEM::MAX_ICONS_DRAWN end draw_icons(dx, dy, dw, icons) end
#-------------------------------------------------------------------------- # draw_icons #-------------------------------------------------------------------------- def draw_icons(dx, dy, dw, icons) dx += dw - 4 dx -= icons.size * 24 for icon_id in icons draw_icon(icon_id, dx, dy) dx += 24 end if icons.size == 0 change_color(normal_color, false) text = Vocab::item_status(:empty) draw_text(4, dy, contents.width-8, line_height, text, 2) end end
#-------------------------------------------------------------------------- # new method: process_custom_item_commands #-------------------------------------------------------------------------- def process_custom_item_commands for command in YEA::ITEM::COMMANDS next unless YEA::ITEM::CUSTOM_ITEM_COMMANDS.include?(command) called_method = YEA::ITEM::CUSTOM_ITEM_COMMANDS[command][3] @category_window.set_handler(command, method(called_method)) end end
#-------------------------------------------------------------------------- # new method: relocate_windows #-------------------------------------------------------------------------- def relocate_windows return unless $imported["YEA-AceMenuEngine"] case Menu.help_window_location when 0 # Top @help_window.y = 0 @category_window.y = @help_window.height @item_window.y = @category_window.y + @category_window.height when 1 # Middle @category_window.y = 0 @help_window.y = @category_window.height @item_window.y = @help_window.y + @help_window.height else # Bottom @category_window.y = 0 @item_window.y = @category_window.height @help_window.y = @item_window.y + @item_window.height end @types_window.y = @category_window.y @status_window.y = @category_window.y end
#-------------------------------------------------------------------------- # new method: open_categories #-------------------------------------------------------------------------- def open_types @category_window.x = Graphics.width @types_window.x = 0 @types_window.reveal(@category_window.current_symbol) end
#-------------------------------------------------------------------------- # new method: on_types_ok #-------------------------------------------------------------------------- def on_types_ok @item_window.activate @item_window.select_last end
#-------------------------------------------------------------------------- # new method: on_types_cancel #-------------------------------------------------------------------------- def on_types_cancel @category_window.x = 0 @category_window.activate @types_window.unselect @types_window.x = Graphics.width end
#-------------------------------------------------------------------------- # alias method: on_item_cancel #-------------------------------------------------------------------------- alias scene_item_on_item_cancel_aim on_item_cancel def on_item_cancel if @types_window.x <= 0 @item_window.unselect @types_window.activate else scene_item_on_item_cancel_aim end end
#-------------------------------------------------------------------------- # new method: command_totori #-------------------------------------------------------------------------- def command_totori SceneManager.call(Scene_Alchemy) end
#-------------------------------------------------------------------------- # new method: command_name1 #-------------------------------------------------------------------------- def command_name1 # Do nothing. end
#-------------------------------------------------------------------------- # new method: command_name2 #-------------------------------------------------------------------------- def command_name2 # Do nothing. end
end # Scene_Item
#============================================================================== # # ▼ End of File # #==============================================================================
Skills
Code:
#============================================================================== # # ▼ Yanfly Engine Ace - Ace Skill Menu v1.01 # -- Last Updated: 2012.01.08 # -- Level: Normal, Hard # -- Requires: n/a # #==============================================================================
$imported = {} if $imported.nil? $imported["YEA-SkillMenu"] = true
#============================================================================== # ▼ Updates # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # 2012.01.08 - Compatibility Update: Learn Skill Engine # 2012.01.02 - Started Script and Finished. # #============================================================================== # ▼ Introduction # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # This is a menu reordering script for the Skill Menu for RPG Maker VX Ace. The # script lets you add, remove, and rearrange skill menu additions added by # other scripts. This script will update periodically to provide better updated # compatibility with those other scripts. # #============================================================================== # ▼ Instructions # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # To install this script, open up your script editor and copy/paste this script # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save. # # Adjust the module's settings to adjust the skill command window. # #============================================================================== # ▼ 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. # #==============================================================================
module YEA module SKILL_MENU
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # - Command Window Settings - #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # Adjust the command window that appears in the skill command window. Add, # remove, or rearrange the commands as you see fit. If you would like to # add in custom commands, please refer to the custom hash. Here's a list of # what does what: # # ------------------------------------------------------------------------- # :command Description # ------------------------------------------------------------------------- # :stype_list Displays all of the actor's usable skill types. # # :tp_mode Requires YEA - TP Manager # :learn_skill Requires YEA - Learn Skill Engine # # :grathnode Requires Kread-EX - Grathnode Install # :sslots Requires YSA - Slots Battle # # And that's all of the currently available commands. This list will be # updated as more scripts become available. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- COMMANDS =[ :stype_list, # Displays all of the actor's usable skill types. :learn_skill, # Requires YEA - Learn Skill Engine :tp_mode, # Requires YEA - TP Manager :grathnode, # Requires Kread-EX - Grathnode Install :sslots, # Requires YSA - Slots Battle. # :custom1, # Custom Skill Command 1 # :custom2, # Custom Skill Command 2 ] # Do not remove this.
#-------------------------------------------------------------------------- # - Skill Custom Commands - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # For those who use scripts to that may produce unique effects for # equipping, use this hash to manage the custom commands for the Skill # 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_SKILL_COMMANDS ={ # :command => ["Display Name", EnableSwitch, ShowSwitch, Handler Method], :grathnode => ["Grathnodes", 0, 0, :command_grath], :sslots => [ "Pick Slots", 0, 0, :command_sslot], :custom1 => [ "Custom Name", 0, 0, :command_name1], :custom2 => [ "Custom Text", 13, 0, :command_name2], } # Do not remove this.
end # SKILL_MENU end # 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. #==============================================================================
#-------------------------------------------------------------------------- # alias method: make_command_list #-------------------------------------------------------------------------- alias window_skillcommand_make_command_list_asm make_command_list def make_command_list unless SceneManager.scene_is?(Scene_Skill) window_skillcommand_make_command_list_asm return end return unless @actor for command in YEA::SKILL_MENU::COMMANDS case command #--- Imported YEA --- when :stype_list add_skill_types #--- Imported YEA --- when :tp_mode next unless $imported["YEA-TPManager"] add_tp_modes when :learn_skill next unless $imported["YEA-LearnSkillEngine"] add_learn_skill_command #--- Imported Other --- when :grathnode next unless $imported["KRX-GrathnodeInstall"] process_custom_command(command) when :sslots next unless $imported["YSA-SlotBattle"] process_custom_command(command) #--- Custom Commands --- else process_custom_command(command) end end end
#-------------------------------------------------------------------------- # new method: add_skill_types #-------------------------------------------------------------------------- def add_skill_types @actor.added_skill_types.each do |stype_id| name = $data_system.skill_types[stype_id] add_command(name, :skill, true, stype_id) end end
#-------------------------------------------------------------------------- # new method: process_custom_command #-------------------------------------------------------------------------- def process_custom_command(command) return unless YEA::SKILL_MENU::CUSTOM_SKILL_COMMANDS.include?(command) show = YEA::SKILL_MENU::CUSTOM_SKILL_COMMANDS[command][2] continue = show <= 0 ? true : $game_switches[show] return unless continue text = YEA::SKILL_MENU::CUSTOM_SKILL_COMMANDS[command][0] switch = YEA::SKILL_MENU::CUSTOM_SKILL_COMMANDS[command][1] enabled = switch <= 0 ? true : $game_switches[switch] add_command(text, command, enabled, @actor.added_skill_types[0]) end
#-------------------------------------------------------------------------- # new method: process_ok #-------------------------------------------------------------------------- def process_ok if SceneManager.scene_is?(Scene_Skill) $game_temp.scene_skill_index = index $game_temp.scene_skill_oy = self.oy end super end
#-------------------------------------------------------------------------- # alias method: create_command_window #-------------------------------------------------------------------------- alias scene_skill_create_command_window_asm create_command_window def create_command_window scene_skill_create_command_window_asm if !$game_temp.scene_skill_index.nil? && SceneManager.scene_is?(Scene_Skill) @command_window.select($game_temp.scene_skill_index) @command_window.oy = $game_temp.scene_skill_oy end $game_temp.scene_skill_index = nil $game_temp.scene_skill_oy = nil process_custom_skill_commands end
#-------------------------------------------------------------------------- # new method: process_custom_skill_commands #-------------------------------------------------------------------------- def process_custom_skill_commands for command in YEA::SKILL_MENU::COMMANDS next unless YEA::SKILL_MENU::CUSTOM_SKILL_COMMANDS.include?(command) called_method = YEA::SKILL_MENU::CUSTOM_SKILL_COMMANDS[command][3] @command_window.set_handler(command, method(called_method)) end end
#-------------------------------------------------------------------------- # new method: command_grath #-------------------------------------------------------------------------- def command_grath SceneManager.call(Scene_Grathnode) end
#-------------------------------------------------------------------------- # new method: command_sslot #-------------------------------------------------------------------------- def command_sslot SceneManager.call(Scene_PickSlots) end
#-------------------------------------------------------------------------- # new method: command_name1 #-------------------------------------------------------------------------- def command_name1 # Do nothing. end
#-------------------------------------------------------------------------- # new method: command_name2 #-------------------------------------------------------------------------- def command_name2 # Do nothing. end
end # Scene_Skill
#============================================================================== # # ▼ End of File # #==============================================================================
Dernière édition par cagt3000 le Mer 11 Avr 2012 - 15:28, édité 1 fois
$imported = {} if $imported.nil? $imported["YEA-AceEquipEngine"] = true
#============================================================================== # ▼ Updates # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # 2012.02.02 - Bug Fixed: Crash when changing classes to different equip slots. # 2012.01.22 - Bug Fixed: <equip slot> notetags updated to factor in spaces. # 2012.01.05 - Compatibility Update: Equip Dynamic Stats # 2011.12.30 - Bug Fixed: Stats didn't update. # 2011.12.23 - Script efficiency optimized. # 2011.12.18 - Script efficiency optimized. # 2011.12.13 - Started Script and Finished. # #============================================================================== # ▼ Introduction # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # The default equipment system in RPG Maker VX is the standard equipment system # seen in all of the previous iterations, which consists of weapon, shield, # headgear, bodygear, and accessory. To break free of that norm, this script # allows users access to giving actors and/or classes dynamic equipment setups # (including having multiples of the same categories). In addition to having # different equip slot setups, newer equipment types can be made to allow for # more diversity in armour types. # #============================================================================== # ▼ Instructions # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # To install this script, open up your script editor and copy/paste this script # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save. # # ----------------------------------------------------------------------------- # Actor Notetags - These notetags go in the actors notebox in the database. # ----------------------------------------------------------------------------- # <equip slots> # string # string # </equip slots> # This sets the actor's default slots to whatever is listed in between the two # notetags. An actor's custom equip slots will take priority over a class's # custom equip slots, which will take priority over the default equip slots. # Replace "string" with the proper equipment type name or when in doubt, use # "equip type: x" with x as the equipment type. # # <starting gear: x> # <starting gear: x, x> # Adds armour x to the actor's list of starting gear. This is used primarily # for the newer pieces of gear that can't be added through the starting set of # equipment through the RPG Maker VX Ace editor by default. Insert multiple of # these notetags to add more pieces of starting gear if so desired. # # <fixed equip: x> # <fixed equip: x, x> # This will fix the equip type x. Fixed equip slots mean that the equipment # already on it are unable to be exchanged in or out by the player. This tag # has been made so that equip types can be fixed for equip type 5 and above. # Use multiple of these notetags to add more fixed equipment restrictions. # # <sealed equip: x> # <sealed equip: x, x> # This will seal the equip type x. Sealed equip slots mean that no equipment # can be equipped onto that equip type slot. This tag has been made so that # equip types can be sealed for equip type 5 and above. Use multiple of these # notetags to add more sealed equipment restrictions. # # ----------------------------------------------------------------------------- # Class Notetags - These notetags go in the class notebox in the database. # ----------------------------------------------------------------------------- # <equip slots> # string # string # </equip slots> # This sets the class's default slots to whatever is listed in between the two # notetags. An actor's custom equip slots will take priority over a class's # custom equip slots, which will take priority over the default equip slots. # Replace "string" with the proper equipment type name or when in doubt, use # "equip type: x" with x as the equipment type. # # <fixed equip: x> # <fixed equip: x, x> # This will fix the equip type x. Fixed equip slots mean that the equipment # already on it are unable to be exchanged in or out by the player. This tag # has been made so that equip types can be fixed for equip type 5 and above. # Use multiple of these notetags to add more fixed equipment restrictions. # # <sealed equip: x> # <sealed equip: x, x> # This will seal the equip type x. Sealed equip slots mean that no equipment # can be equipped onto that equip type slot. This tag has been made so that # equip types can be sealed for equip type 5 and above. Use multiple of these # notetags to add more sealed equipment restrictions. # # ----------------------------------------------------------------------------- # Weapon Notetags - These notetags go in the weapons notebox in the database. # ----------------------------------------------------------------------------- # <fixed equip: x> # <fixed equip: x, x> # This will fix the equip type x. Fixed equip slots mean that the equipment # already on it are unable to be exchanged in or out by the player. This tag # has been made so that equip types can be fixed for equip type 5 and above. # Use multiple of these notetags to add more fixed equipment restrictions. # # <sealed equip: x> # <sealed equip: x, x> # This will seal the equip type x. Sealed equip slots mean that no equipment # can be equipped onto that equip type slot. This tag has been made so that # equip types can be sealed for equip type 5 and above. Use multiple of these # notetags to add more sealed equipment restrictions. # # ----------------------------------------------------------------------------- # Armour Notetags - These notetags go in the armour notebox in the database. # ----------------------------------------------------------------------------- # <equip type: x> # <equip type: string> # For the newer equip types, replace x or string with the equip type ID or the # name of the equip type respectively. This will set that armour to that # particular equip type. # # <fixed equip: x> # <fixed equip: x, x> # This will fix the equip type x. Fixed equip slots mean that the equipment # already on it are unable to be exchanged in or out by the player. This tag # has been made so that equip types can be fixed for equip type 5 and above. # Use multiple of these notetags to add more fixed equipment restrictions. # # <sealed equip: x> # <sealed equip: x, x> # This will seal the equip type x. Sealed equip slots mean that no equipment # can be equipped onto that equip type slot. This tag has been made so that # equip types can be sealed for equip type 5 and above. Use multiple of these # notetags to add more sealed equipment restrictions. # # ----------------------------------------------------------------------------- # State Notetags - These notetags go in the states notebox in the database. # ----------------------------------------------------------------------------- # <fixed equip: x> # <fixed equip: x, x> # This will fix the equip type x. Fixed equip slots mean that the equipment # already on it are unable to be exchanged in or out by the player. This tag # has been made so that equip types can be fixed for equip type 5 and above. # Use multiple of these notetags to add more fixed equipment restrictions. # # <sealed equip: x> # <sealed equip: x, x> # This will seal the equip type x. Sealed equip slots mean that no equipment # can be equipped onto that equip type slot. This tag has been made so that # equip types can be sealed for equip type 5 and above. Use multiple of these # notetags to add more sealed equipment restrictions. # #============================================================================== # ▼ 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. # #==============================================================================
module YEA module EQUIP
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # - General Equip Settings - #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # This adjusts the default equip configuration. While actors can have their # own unique equipment configurations, it's recommended to not change too # much as things get really hairy when it comes to proper eventing. # # ID Equip Type # --- ------------ # 0 Weapon # 1 Shield # 2 Headgear # 3 Bodygear # 4 Accessory # # Whatever you set the below slots to, the dual wield setup will be exactly # identical except that the second slot will be changed to a weapon (0). #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # Adjust this array to set the default slots used for all of your actors # and classes if they do not have a custom equipment slot setup. DEFAULT_BASE_SLOTS = [ 0, 1, 2, 3, 5, 6, 4, 4]
# This hash adjusts the new equip types (past 4+). Adjust them to match # their names properly. You can choose to allow certain types of equipment # be removable or not, or whether or not optimize will affect them. TYPES ={ # TypeID => ["Type Name", Removable?, Optimize?], 0 => [ "Weapon", false, true], 1 => [ "Shield", true, true], 2 => [ "Headgear", true, true], 3 => [ "Bodygear", true, true], 4 => ["Accessory", true, false], 5 => [ "Cloak", true, true], 6 => [ "Necklace", true, true], } # Do not remove this.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # - Equip Command List - #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # Here, you can adjust the order at which the commands appear (or even # remove commands as you see fit). Here's a list of which does what: # # ------------------------------------------------------------------------- # :command Description # ------------------------------------------------------------------------- # :equip Activates the manual equip window. Default. # :optimize Optimizes equipment for the actor. Default. # :clear Clears all equipment from the actor. Default # # 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 Equip # Command window in the Equip Scene. COMMAND_LIST =[ :equip, :optimize, :clear, # :custom1, # :custom2, ] # Do not remove this.
#-------------------------------------------------------------------------- # - Equip Custom Commands - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # For those who use scripts to that may produce unique effects for # equipping, use this hash to manage the custom commands for the Equip # 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_EQUIP_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.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # - Misc Window Settings - #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # This section adjusts the minor visuals that you see inside of the newly # organized Equip Scene. Adjust the settings as you see fit. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # This sets the font size used for the status window in the lower right # corner of the screen (which shows stats and comparisons). STATUS_FONT_SIZE = 20
# This sets the remove equip command in the item window. REMOVE_EQUIP_ICON = 185 REMOVE_EQUIP_TEXT = "<Remove Equip>"
# This sets the no-equipment text in the slot window. NOTHING_ICON = 185 NOTHING_TEXT = "<Empty>"
end # EQUIP end # 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. #==============================================================================
#-------------------------------------------------------------------------- # alias method: load_database #-------------------------------------------------------------------------- class <<self; alias load_database_aee load_database; end def self.load_database load_database_aee load_notetags_aee end
#-------------------------------------------------------------------------- # new method: load_notetags_aee #-------------------------------------------------------------------------- def self.load_notetags_aee groups = [$data_actors, $data_classes, $data_weapons, $data_armors, $data_states] for group in groups for obj in group next if obj.nil? obj.load_notetags_aee end end end
#-------------------------------------------------------------------------- # common cache: load_notetags_aee #-------------------------------------------------------------------------- def load_notetags_aee @base_equip_slots = [] @equip_slots_on = false @fixed_equip_type = [] @sealed_equip_type = [] @extra_starting_equips = [] #--- self.note.split(/[\r\n]+/).each { |line| case line #--- when YEA::REGEXP::BASEITEM::EQUIP_SLOTS_ON next unless self.is_a?(RPG::Actor) ||self.is_a?(RPG::Class) @equip_slots_on = true when YEA::REGEXP::BASEITEM::EQUIP_SLOTS_OFF next unless self.is_a?(RPG::Actor) ||self.is_a?(RPG::Class) @equip_slots_on = false #--- when YEA::REGEXP::BASEITEM::STARTING_GEAR next unless self.is_a?(RPG::Actor) $1.scan(/\d+/).each { |num| @extra_starting_equips.push(num.to_i) if num.to_i > 0 } when YEA::REGEXP::BASEITEM::FIXED_EQUIP $1.scan(/\d+/).each { |num| @fixed_equip_type.push(num.to_i) if num.to_i > 0 } when YEA::REGEXP::BASEITEM::SEALED_EQUIP $1.scan(/\d+/).each { |num| @sealed_equip_type.push(num.to_i) if num.to_i > 0 } #--- when YEA::REGEXP::BASEITEM::EQUIP_TYPE_INT next unless self.is_a?(RPG::Armor) @etype_id = [1, $1.to_i].max when YEA::REGEXP::BASEITEM::EQUIP_TYPE_STR next unless self.is_a?(RPG::Armor) for key in YEA::EQUIP::TYPES id = key[0] next if YEA::EQUIP::TYPES[id][0].upcase != $1.to_s.upcase @etype_id = [1, id].max break end #--- else if @equip_slots_on case line.upcase when /EQUIP TYPE[ ](\d+)/i, /EQUIP TYPE:[ ](\d+)/i id = $1.to_i @base_equip_slots.push(id) if [0,1,2,3,4].include?(id) @base_equip_slots.push(id) if YEA::EQUIP::TYPES.include?(id) when /WEAPON/i @base_equip_slots.push(0) when /SHIELD/i @base_equip_slots.push(1) when /HEAD/i @base_equip_slots.push(2) when /BODY/i, /ARMOR/i, /ARMOUR/i @base_equip_slots.push(3) when /ETC/i, /OTHER/i, /ACCESSOR/i @base_equip_slots.push(4) else text = line.upcase.delete(" ") for key in YEA::EQUIP::TYPES id = key[0] next if YEA::EQUIP::TYPES[id][0].upcase.delete(" ")!= text @base_equip_slots.push(id) break end end end end } # self.note.split #--- return unless self.is_a?(RPG::Class) if @base_equip_slots.empty? @base_equip_slots = YEA::EQUIP::DEFAULT_BASE_SLOTS.clone end end
#-------------------------------------------------------------------------- # alias method: equip_type_fixed? #-------------------------------------------------------------------------- alias game_battlerbase_equip_type_fixed_aee equip_type_fixed? def equip_type_fixed?(etype_id) return true if fixed_etypes.include?(etype_id) if actor? return game_battlerbase_equip_type_fixed_aee(etype_id) end
#-------------------------------------------------------------------------- # alias method: equip_type_sealed? #-------------------------------------------------------------------------- alias game_battlerbase_equip_type_sealed_aee equip_type_sealed? def equip_type_sealed?(etype_id) return true if sealed_etypes.include?(etype_id) if actor? return game_battlerbase_equip_type_sealed_aee(etype_id) end
#-------------------------------------------------------------------------- # alias method: init_equips #-------------------------------------------------------------------------- alias game_actor_init_equips_aee init_equips def init_equips(equips) game_actor_init_equips_aee(equips) equip_extra_starting_equips end
#-------------------------------------------------------------------------- # new method: equip_extra_starting_equips #-------------------------------------------------------------------------- def equip_extra_starting_equips for equip_id in actor.extra_starting_equips armour = $data_armors[equip_id] next if armour.nil? etype_id = armour.etype_id next unless equip_slots.include?(etype_id) slot_id = empty_slot(etype_id) @equips[slot_id].set_equip(etype_id == 0, armour.id) end refresh end
#-------------------------------------------------------------------------- # overwrite method: equip_slots #-------------------------------------------------------------------------- def equip_slots return equip_slots_dual if dual_wield? return equip_slots_normal end
#-------------------------------------------------------------------------- # new method: equip_slots_normal #-------------------------------------------------------------------------- def equip_slots_normal return self.actor.base_equip_slots if self.actor.base_equip_slots != [] return self.class.base_equip_slots end
#-------------------------------------------------------------------------- # new method: equip_slots_dual #-------------------------------------------------------------------------- def equip_slots_dual array = equip_slots_normal.clone array[1] = 0 if array.size >= 2 return array end
#-------------------------------------------------------------------------- # new method: fixed_etypes #-------------------------------------------------------------------------- def fixed_etypes array = [] array |= self.actor.fixed_equip_type array |= self.class.fixed_equip_type for equip in equips next if equip.nil? array |= equip.fixed_equip_type end for state in states next if state.nil? array |= state.fixed_equip_type end return array end
#-------------------------------------------------------------------------- # new method: sealed_etypes #-------------------------------------------------------------------------- def sealed_etypes array = [] array |= self.actor.sealed_equip_type array |= self.class.sealed_equip_type for equip in equips next if equip.nil? array |= equip.sealed_equip_type end for state in states next if state.nil? array |= state.sealed_equip_type end return array end
#-------------------------------------------------------------------------- # alias method: change_equip #-------------------------------------------------------------------------- alias game_actor_change_equip_aee change_equip def change_equip(slot_id, item) if item.nil? && !@optimize_clear etype_id = equip_slots[slot_id] return unless YEA::EQUIP::TYPES[etype_id][1] elsif item.nil? && @optimize_clear etype_id = equip_slots[slot_id] return unless YEA::EQUIP::TYPES[etype_id][2] end @equips[slot_id] = Game_BaseItem.new if @equips[slot_id].nil? game_actor_change_equip_aee(slot_id, item) end
#-------------------------------------------------------------------------- # overwrite method: optimize_equipments #-------------------------------------------------------------------------- def optimize_equipments $game_temp.eds_actor = self @optimize_clear = true clear_equipments @optimize_clear = false equip_slots.size.times do |i| next if !equip_change_ok?(i) next unless can_optimize?(i) items = $game_party.equip_items.select do |item| item.etype_id == equip_slots[i] && equippable?(item) && item.performance >= 0 end change_equip(i, items.max_by {|item| item.performance }) end $game_temp.eds_actor = nil end
#-------------------------------------------------------------------------- # new method: can_optimize? #-------------------------------------------------------------------------- def can_optimize?(slot_id) etype_id = equip_slots[slot_id] return YEA::EQUIP::TYPES[etype_id][2] end
#-------------------------------------------------------------------------- # alias method: force_change_equip #-------------------------------------------------------------------------- alias game_actor_force_change_equip_aee force_change_equip def force_change_equip(slot_id, item) @equips[slot_id] = Game_BaseItem.new if @equips[slot_id].nil? game_actor_force_change_equip_aee(slot_id, item) end
#-------------------------------------------------------------------------- # alias method: weapons #-------------------------------------------------------------------------- alias game_actor_weapons_aee weapons def weapons anti_crash_equips return game_actor_weapons_aee end
#-------------------------------------------------------------------------- # alias method: armors #-------------------------------------------------------------------------- alias game_actor_armors_aee armors def armors anti_crash_equips return game_actor_armors_aee end
#-------------------------------------------------------------------------- # alias method: equips #-------------------------------------------------------------------------- alias game_actor_equips_aee equips def equips anti_crash_equips return game_actor_equips_aee end
#-------------------------------------------------------------------------- # new method: equips #-------------------------------------------------------------------------- def anti_crash_equips for i in 0...@equips.size next unless @equips[i].nil? @equips[i] = Game_BaseItem.new end end
#-------------------------------------------------------------------------- # overwrite method: make_command_list #-------------------------------------------------------------------------- def make_command_list for command in YEA::EQUIP::COMMAND_LIST case command when :equip add_command(Vocab::equip2, :equip) when :optimize add_command(Vocab::optimize, :optimize) when :clear add_command(Vocab::clear, :clear) else process_custom_command(command) end end end
#-------------------------------------------------------------------------- # process_ok #-------------------------------------------------------------------------- def process_ok $game_temp.scene_equip_index = index $game_temp.scene_equip_oy = self.oy super end
#-------------------------------------------------------------------------- # new method: process_custom_command #-------------------------------------------------------------------------- def process_custom_command(command) return unless YEA::EQUIP::CUSTOM_EQUIP_COMMANDS.include?(command) show = YEA::EQUIP::CUSTOM_EQUIP_COMMANDS[command][2] continue = show <= 0 ? true : $game_switches[show] return unless continue text = YEA::EQUIP::CUSTOM_EQUIP_COMMANDS[command][0] switch = YEA::EQUIP::CUSTOM_EQUIP_COMMANDS[command][1] enabled = switch <= 0 ? true : $game_switches[switch] add_command(text, command, enabled) end
#-------------------------------------------------------------------------- # overwrite method: draw_item #-------------------------------------------------------------------------- def draw_item(index) item = @data[index] rect = item_rect(index) rect.width -= 4 if item.nil? draw_remove_equip(rect) return end dw = contents.width - rect.x - 24 draw_item_name(item, rect.x, rect.y, enable?(item), dw) draw_item_number(rect, item) end
#-------------------------------------------------------------------------- # new method: draw_remove_equip #-------------------------------------------------------------------------- def draw_remove_equip(rect) draw_icon(Icon.remove_equip, rect.x, rect.y) text = YEA::EQUIP::REMOVE_EQUIP_TEXT rect.x += 24 rect.width -= 24 draw_text(rect, text) end
#-------------------------------------------------------------------------- # overwrite method: include? #-------------------------------------------------------------------------- def include?(item) if item.nil? && !@actor.nil? etype_id = @actor.equip_slots[@slot_id] return YEA::EQUIP::TYPES[etype_id][1] end return true if item.nil? return false unless item.is_a?(RPG::EquipItem) return false if @slot_id < 0 return false if item.etype_id != @actor.equip_slots[@slot_id] return @actor.equippable?(item) end
#-------------------------------------------------------------------------- # overwrite method: enable? #-------------------------------------------------------------------------- def enable?(item) if item.nil? && !@actor.nil? etype_id = @actor.equip_slots[@slot_id] return YEA::EQUIP::TYPES[etype_id][1] end return @actor.equippable?(item) end
#-------------------------------------------------------------------------- # new method: show #-------------------------------------------------------------------------- def show @last_item = 0 update_help super end
#-------------------------------------------------------------------------- # overwrite method: update_help #-------------------------------------------------------------------------- def update_help super return if @actor.nil? return if @status_window.nil? return if @last_item == item @last_item = item temp_actor = Marshal.load(Marshal.dump(@actor)) temp_actor.force_change_equip(@slot_id, item) @status_window.set_temp_actor(temp_actor) end
#-------------------------------------------------------------------------- # actor= #-------------------------------------------------------------------------- def actor=(actor) return if @actor == actor @actor = actor refresh end
#-------------------------------------------------------------------------- # new method: process_custom_equip_commands #-------------------------------------------------------------------------- def process_custom_equip_commands for command in YEA::EQUIP::COMMAND_LIST next unless YEA::EQUIP::CUSTOM_EQUIP_COMMANDS.include?(command) called_method = YEA::EQUIP::CUSTOM_EQUIP_COMMANDS[command][3] @command_window.set_handler(command, method(called_method)) end end
#-------------------------------------------------------------------------- # alias method: command_optimize #-------------------------------------------------------------------------- alias scene_equip_command_optimize_aee command_optimize def command_optimize scene_equip_command_optimize_aee @actor_window.refresh end
#-------------------------------------------------------------------------- # alias method: command_clear #-------------------------------------------------------------------------- alias scene_equip_command_clear_aee command_clear def command_clear scene_equip_command_clear_aee @actor_window.refresh end
#-------------------------------------------------------------------------- # alias method: on_slot_ok #-------------------------------------------------------------------------- alias scene_equip_on_slot_ok_aee on_slot_ok def on_slot_ok scene_equip_on_slot_ok_aee @slot_window.hide @item_window.refresh @item_window.show end
#-------------------------------------------------------------------------- # alias method: on_item_ok #-------------------------------------------------------------------------- alias scene_equip_on_item_ok_aee on_item_ok def on_item_ok scene_equip_on_item_ok_aee @actor_window.refresh @slot_window.show @item_window.hide end
#-------------------------------------------------------------------------- # alias method: on_item_cancel #-------------------------------------------------------------------------- alias scene_equip_on_item_cancel_aee on_item_cancel def on_item_cancel scene_equip_on_item_cancel_aee @slot_window.show @item_window.hide end
#-------------------------------------------------------------------------- # alias method: on_actor_change #-------------------------------------------------------------------------- alias scene_equip_on_actor_change_aee on_actor_change def on_actor_change scene_equip_on_actor_change_aee @actor_window.actor = @actor end
#-------------------------------------------------------------------------- # new method: command_name1 #-------------------------------------------------------------------------- def command_name1 # Do nothing. end
#-------------------------------------------------------------------------- # new method: command_name2 #-------------------------------------------------------------------------- def command_name2 # Do nothing. end
end # Scene_Equip
#============================================================================== # # ▼ End of File # #==============================================================================
#============================================================================== # # ▼ Yanfly Engine Ace - Ace Status Menu v1.01 # -- Last Updated: 2011.12.26 # -- Level: Normal # -- Requires: n/a # #==============================================================================
$imported = {} if $imported.nil? $imported["YEA-StatusMenu"] = true
#============================================================================== # ▼ Updates # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # 2011.12.26 - Compatibility Update: Rename Actor # 2011.12.23 - Started Script and Finished. # #============================================================================== # ▼ Introduction # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # This script changes the status screen completely to something the player can # interact with more and be able to view actor data with more clarity. The # player is able to view the general information for an actor (parameters and # experience), a parameters bar graph, the various hidden extra parameters # (named properties in the script), and a customizable biography for the actor. # Also with this script, biographies can be changed at any time using a script # call to add more of a personal touch to characters. # #============================================================================== # ▼ Instructions # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # To install this script, open up your script editor and copy/paste this script # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save. # # ----------------------------------------------------------------------------- # Script Calls - These commands are used with script calls. # ----------------------------------------------------------------------------- # $game_actors[x].description = string # Changes the biography description for actor x to that of the string. Use \n # to designate linebreaks in the string. If you wish to use text codes, write # them in the strings as \\n[2] or \\c[3] to make them work properly. # #============================================================================== # ▼ 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. # #==============================================================================
module YEA module STATUS
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # - Command Window Settings - #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # This section adjusts the commands that appear in the command window used # for the status screen. Rearrange the commands, add new ones, remove them # as you see fit. # # ------------------------------------------------------------------------- # :command Description # ------------------------------------------------------------------------- # :general Adds general page. # :parameters Adds parameters page. # :properties Adds properties page. # :biography Adds biography page. # # :rename Requires YEA - Rename Actor # :retitle Requires YEA - Retitle Actor # #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- COMMANDS =[ # The order at which the menu items are shown. # [ :command, "Display"], [ :general, "General"], [ :parameters, "Parameters"], [ :properties, "Properties"], # [ :custom1, "Skills"], # [ :custom2, "Equipment"], # [ :custom3, "Class"], [ :biography, "Biography"], [ :rename, "Rename"], # Requires YEA - Rename Actor [ :retitle, "Retitle"], # Requires YEA - Rename Actor ] # Do not remove this.
#-------------------------------------------------------------------------- # - Status Custom Commands - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # For those who use scripts to that may produce unique effects for the # status menu, use this hash to manage the custom commands for the Status # 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_STATUS_COMMANDS ={ # :command => [EnableSwitch, ShowSwitch, Handler Method, Window Draw], :custom1 => [ 0, 0, :command_name1, :draw_custom1], :custom2 => [ 0, 0, :command_name2, :draw_custom2], :custom3 => [ 0, 0, :command_name3, :draw_custom3], } # Do not remove this.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # - General Window Settings - #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # These settings adjust the way the general window visually appears. # Not many changes need to be done here other than vocab changes. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- PARAMETERS_VOCAB = "Parameters" # Title used for Parameters. EXPERIENCE_VOCAB = "Experience" # Title used for Experience. NEXT_TOTAL_VOCAB = "Next %s Total EXP" # Label used for total experience.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # - Parameters Window Settings - #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # These settings adjust the way the parameters window visually appears. # Each of the stats have a non-window colour. Adjust them as you see fit. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- PARAM_COLOUR ={ # ParamID => [:stat, Colour1, Colour2 ], 2 => [ :atk, Color.new(225, 100, 100), Color.new(240, 150, 150)], 3 => [ :def, Color.new(250, 150, 30), Color.new(250, 180, 100)], 4 => [ :mat, Color.new( 70, 140, 200), Color.new(135, 180, 230)], 5 => [ :mdf, Color.new(135, 130, 190), Color.new(170, 160, 220)], 6 => [ :agi, Color.new( 60, 180, 80), Color.new(120, 200, 120)], 7 => [ :luk, Color.new(255, 240, 100), Color.new(255, 250, 200)], } # Do not remove this.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # - Properties Window Settings - #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # These settings adjust the way the properties window visually appears. # The properties have abbreviations, but leaving them as such makes things # confusing (as it's sometimes hard to figure out what the abbreviations # mean). Change the way the appear, whether or not they appear, and what # order they will appear in. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- PROPERTIES_FONT_SIZE = 16 # Font size used for properties.
# These are the properties that appear in column 1. PROPERTIES_COLUMN1 =[ [:hit, "Hit Rate"], [:eva, "Evasion"], [:cri, "Critical Hit"], [:cev, "Critical Evade"], [:mev, "Magic Evasion"], [:mrf, "Magic Reflect"], [:cnt, "Counter Rate"], [:tgr, "Target Rate"], ] # Do not remove this.
# These are the properties that appear in column 2. PROPERTIES_COLUMN2 =[ [:hrg, "HP Regen"], [:mrg, "MP Regen"], [:trg, "TP Regen"], [:rec, "Recovery"], [:grd, "Guard Rate"], [:pha, "Item Boost"], [:exr, "EXP Rate"], [:tcr, "TP Charge"], ] # Do not remove this.
# These are the properties that appear in column 3. PROPERTIES_COLUMN3 =[ [:hcr, "HP Cost Rate"], # Requires YEA - Skill Cost Manager [:mcr, "MP Cost Rate"], [:tcr, "TP Cost Rate"], # Requires YEA - Skill Cost Manager [:cdr, "Cooldown Rate"], # Requires YEA - Skill Restrictions [:wur, "Warmup Rate"], # Requires YEA - Skill Restrictions [:pdr, "Physical Damage"], [:mort de rire, "Magical Damage"], [:fdr, "Floor Damage"], ] # Do not remove this.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # - Biography Window Settings - #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # These settings adjust the way the biography appears including the title # used at the top, the font size, and whatnot. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- BIOGRAPHY_NICKNAME_TEXT = "%s the %s" # How the nickname will appear. BIOGRAPHY_NICKNAME_SIZE = 32 # Size of the font used.
end # STATUS end # 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. #==============================================================================
#-------------------------------------------------------------------------- # new method: description= #-------------------------------------------------------------------------- def description=(text) @description = text end
#-------------------------------------------------------------------------- # window_width #-------------------------------------------------------------------------- def window_width; return 160; end
#-------------------------------------------------------------------------- # actor= #-------------------------------------------------------------------------- def actor=(actor) return if @actor == actor @actor = actor refresh end
#-------------------------------------------------------------------------- # visible_line_number #-------------------------------------------------------------------------- def visible_line_number; return 4; end
#-------------------------------------------------------------------------- # ok_enabled? #-------------------------------------------------------------------------- def ok_enabled? return handle?(current_symbol) end
#-------------------------------------------------------------------------- # make_command_list #-------------------------------------------------------------------------- def make_command_list return unless @actor for command in YEA::STATUS::COMMANDS case command[0] #--- Default --- when :general, :parameters, :properties, :biography add_command(command[1], command[0]) #--- Yanfly Engine Ace --- when :rename next unless $imported["YEA-RenameActor"] add_command(command[1], command[0], @actor.rename_allow?) when :retitle next unless $imported["YEA-RenameActor"] add_command(command[1], command[0], @actor.retitle_allow?) #--- Custom Commands --- else process_custom_command(command) end end if !$game_temp.scene_status_index.nil? select($game_temp.scene_status_index) self.oy = $game_temp.scene_status_oy end $game_temp.scene_status_index = nil $game_temp.scene_status_oy = nil end
#-------------------------------------------------------------------------- # process_ok #-------------------------------------------------------------------------- def process_ok $game_temp.scene_status_index = index $game_temp.scene_status_oy = self.oy super end
#-------------------------------------------------------------------------- # update #-------------------------------------------------------------------------- def update super update_item_window end
#-------------------------------------------------------------------------- # update_item_window #-------------------------------------------------------------------------- def update_item_window return if @item_window.nil? return if @current_index == current_symbol @current_index = current_symbol @item_window.refresh end
#-------------------------------------------------------------------------- # actor= #-------------------------------------------------------------------------- def actor=(actor) return if @actor == actor @actor = actor refresh end
#-------------------------------------------------------------------------- # actor= #-------------------------------------------------------------------------- def actor=(actor) return if @actor == actor @actor = actor refresh end
#-------------------------------------------------------------------------- # draw_window_contents #-------------------------------------------------------------------------- def draw_window_contents case @command_window.current_symbol when :general draw_actor_general when :parameters draw_parameter_graph when :properties draw_properties_list when :biography, :rename, :retitle draw_actor_biography else draw_custom end end
#-------------------------------------------------------------------------- # draw_actor_general #-------------------------------------------------------------------------- def draw_actor_general change_color(system_color) text = YEA::STATUS::PARAMETERS_VOCAB draw_text(0, 0, contents.width/2, line_height, text, 1) text = YEA::STATUS::EXPERIENCE_VOCAB draw_text(contents.width/2, 0, contents.width/2, line_height, text, 1) draw_general_parameters draw_general_experience end
#-------------------------------------------------------------------------- # draw_properties_column1 #-------------------------------------------------------------------------- def draw_properties_column1 dx = 24 dw = (contents.width - 24) / 3 - 24 dy = 0 for property in YEA::STATUS::PROPERTIES_COLUMN1 dy = draw_property(property, dx, dy, dw) end end
#-------------------------------------------------------------------------- # draw_properties_column2 #-------------------------------------------------------------------------- def draw_properties_column2 dx = 24 + (contents.width - 24) / 3 dw = (contents.width - 24) / 3 - 24 dy = 0 for property in YEA::STATUS::PROPERTIES_COLUMN2 dy = draw_property(property, dx, dy, dw) end end
#-------------------------------------------------------------------------- # draw_properties_column3 #-------------------------------------------------------------------------- def draw_properties_column3 dx = 24 + (contents.width - 24) / 3 * 2 dw = (contents.width - 24) / 3 - 24 dy = 0 for property in YEA::STATUS::PROPERTIES_COLUMN3 dy = draw_property(property, dx, dy, dw) end end
#-------------------------------------------------------------------------- # draw_property #-------------------------------------------------------------------------- def draw_property(property, dx, dy, dw) fmt = "%1.2f%%" case property[0] #--- when :hit value = sprintf(fmt, @actor.hit * 100) when :eva value = sprintf(fmt, @actor.eva * 100) when :cri value = sprintf(fmt, @actor.cri * 100) when :cev value = sprintf(fmt, @actor.cev * 100) when :mev value = sprintf(fmt, @actor.mev * 100) when :mrf value = sprintf(fmt, @actor.mrf * 100) when :cnt value = sprintf(fmt, @actor.cnt * 100) when :hrg value = sprintf(fmt, @actor.hrg * 100) when :mrg value = sprintf(fmt, @actor.mrg * 100) when :trg value = sprintf(fmt, @actor.trg * 100) when :tgr value = sprintf(fmt, @actor.tgr * 100) when :grd value = sprintf(fmt, @actor.grd * 100) when :rec value = sprintf(fmt, @actor.rec * 100) when :pha value = sprintf(fmt, @actor.pha * 100) when :mcr value = sprintf(fmt, @actor.mcr * 100) when :tcr value = sprintf(fmt, @actor.tcr * 100) when :pdr value = sprintf(fmt, @actor.pdr * 100) when :mort de rire value = sprintf(fmt, @actor.mort de rire * 100) when :fdr value = sprintf(fmt, @actor.fdr * 100) when :exr value = sprintf(fmt, @actor.exr * 100) when :hcr return dy unless $imported["YEA-SkillCostManager"] value = sprintf(fmt, @actor.hcr * 100) when :tcr return dy unless $imported["YEA-SkillCostManager"] value = sprintf(fmt, @actor.tcr * 100) when :gcr return dy unless $imported["YEA-SkillCostManager"] value = sprintf(fmt, @actor.gcr * 100) when :cdr return dy unless $imported["YEA-SkillRestrictions"] value = sprintf(fmt, @actor.cdr * 100) when :wur return dy unless $imported["YEA-SkillRestrictions"] value = sprintf(fmt, @actor.wur * 100) #--- else; return dy end colour = Color.new(0, 0, 0, translucent_alpha/2) rect = Rect.new(dx+1, dy+1, dw-2, line_height-2) contents.fill_rect(rect, colour) change_color(system_color) draw_text(dx+4, dy, dw-8, line_height, property[1], 0) change_color(normal_color) draw_text(dx+4, dy, dw-8, line_height, value, 2) return dy + line_height end
#-------------------------------------------------------------------------- # draw_custom1 #-------------------------------------------------------------------------- def draw_custom1 dx = 0; dy = 0 for skill in @actor.skills next if skill.nil? next unless @actor.added_skill_types.include?(skill.stype_id) draw_item_name(skill, dx, dy) dx = dx == contents.width / 2 + 16 ? 0 : contents.width / 2 + 16 dy += line_height if dx == 0 return if dy + line_height > contents.height end end
#-------------------------------------------------------------------------- # draw_custom2 #-------------------------------------------------------------------------- def draw_custom2 dx = 4; dy = 0; slot_id = 0 for equip in @actor.equips change_color(system_color) text = Vocab.etype(@actor.equip_slots[slot_id]) draw_text(dx, dy, contents.width - dx, line_height, text) reset_font_settings draw_item_name(equip, dx+92, dy) unless equip.nil? slot_id += 1 dy += line_height break if dy + line_height > contents.height end dw = Graphics.width * 2 / 5 - 24 dx = contents.width - dw; dy = 0 param_id = 0 8.times do colour = Color.new(0, 0, 0, translucent_alpha/2) rect = Rect.new(dx+1, dy+1, dw - 2, line_height - 2) contents.fill_rect(rect, colour) size = $imported["YEA-AceEquipEngine"] ? YEA::EQUIP::STATUS_FONT_SIZE : 20 contents.font.size = size change_color(system_color) draw_text(dx+4, dy, dw, line_height, Vocab::param(param_id)) change_color(normal_color) dwa = (Graphics.width * 2 / 5 - 2) / 2 draw_text(dx, dy, dwa, line_height, @actor.param(param_id).group, 2) reset_font_settings change_color(system_color) draw_text(dx + dwa, dy, 22, line_height, "→", 1) param_id += 1 dy += line_height break if dy + line_height > contents.height end end
#-------------------------------------------------------------------------- # draw_custom3 #-------------------------------------------------------------------------- def draw_custom3 return unless $imported["YEA-ClassSystem"] data = [] for class_id in YEA::CLASS_SYSTEM::CLASS_ORDER next if $data_classes[class_id].nil? item = $data_classes[class_id] next unless @actor.unlocked_classes.include?(item.id) or YEA::CLASS_SYSTEM::DEFAULT_UNLOCKS.include?(item.id) data.push(item) end dx = 0; dy = 0; class_index = 0 for class_id in data item = data[class_index] reset_font_settings if item == @actor.class change_color(text_color(YEA::CLASS_SYSTEM::CURRENT_CLASS_COLOUR)) elsif item == @actor.subclass change_color(text_color(YEA::CLASS_SYSTEM::SUBCLASS_COLOUR)) else change_color(normal_color) end icon = item.icon_index draw_icon(icon, dx, dy) text = item.name draw_text(24, dy, contents.width-24, line_height, text) next if YEA::CLASS_SYSTEM::MAINTAIN_LEVELS level = @actor.class_level(item.id) contents.font.size = YEA::CLASS_SYSTEM::LEVEL_FONT_SIZE text = sprintf(YEA::CLASS_SYSTEM::CLASS_LEVEL, level.group) dwa = contents.width - (Graphics.width * 2 / 5 - 24) - 28 draw_text(dx, dy, dwa, line_height, text, 2) class_index += 1 dy += line_height break if dy + line_height > contents.height end dw = Graphics.width * 2 / 5 - 24 dx = contents.width - dw; dy = 0 param_id = 0 8.times do colour = Color.new(0, 0, 0, translucent_alpha/2) rect = Rect.new(dx+1, dy+1, dw - 2, line_height - 2) contents.fill_rect(rect, colour) contents.font.size = YEA::CLASS_SYSTEM::PARAM_FONT_SIZE change_color(system_color) draw_text(dx+4, dy, dw, line_height, Vocab::param(param_id)) change_color(normal_color) dwa = (Graphics.width * 2 / 5 - 2) / 2 draw_text(dx, dy, dwa, line_height, @actor.param(param_id).group, 2) reset_font_settings change_color(system_color) draw_text(dx + dwa, dy, 22, line_height, "→", 1) param_id += 1 dy += line_height break if dy + line_height > contents.height end end
#-------------------------------------------------------------------------- # process_custom_status_commands #-------------------------------------------------------------------------- def process_custom_status_commands for command in YEA::STATUS::COMMANDS next unless YEA::STATUS::CUSTOM_STATUS_COMMANDS.include?(command[0]) called_method = YEA::STATUS::CUSTOM_STATUS_COMMANDS[command[0]][2] @command_window.set_handler(command[0], method(called_method)) end end
#-------------------------------------------------------------------------- # new method: command_name1 #-------------------------------------------------------------------------- def command_name1 SceneManager.call(Scene_Skill) end
#-------------------------------------------------------------------------- # new method: command_name2 #-------------------------------------------------------------------------- def command_name2 SceneManager.call(Scene_Equip) end
#-------------------------------------------------------------------------- # new method: command_name3 #-------------------------------------------------------------------------- def command_name3 unless $imported["YEA-ClassSystem"] @command_window.activate return end SceneManager.call(Scene_Class) end
end # Scene_Status
#============================================================================== # # ▼ End of File # #==============================================================================
#============================================================================== # # ▼ Yanfly Engine Ace - Ace Save Engine v1.02 # -- Last Updated: 2012.01.23 # -- Level: Normal # -- Requires: n/a # #==============================================================================
$imported = {} if $imported.nil? $imported["YEA-SaveEngine"] = true
#============================================================================== # ▼ Updates # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # 2012.01.23 - Anti-crash method added for removed maps. # 2011.12.26 - Compatibility Update: New Game+ # 2011.12.26 - Started Script and Finished. # #============================================================================== # ▼ Introduction # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # This script provides a new save interface for the player. Along with a new # interface, the player can also load and delete saves straight from the menu # itself. This will in turn make the save command from the Main Menu always # available, but the save option within the new save menu will be enabled # depending on whether or not it is allowed or disallowed. From the interface, # the player is given more information regarding the save file including the # the location the player saved at, the amount of gold available, and any # variables that you want to show the player as well. # #============================================================================== # ▼ Instructions # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # To install this script, open up your script editor and copy/paste this script # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save. # # For first time installers, be warned that loading this script the first time # may not display all information in the status window for save files made # before the installation of this script. To remedy this, just load up the save # and save the file again. # #============================================================================== # ▼ 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. # #==============================================================================
module YEA module SAVE
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # - Slot Window Settings - #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # This section adjusts how the slot window appears on the left side of the # screen. This also adjusts the maximum number of saves a player can make, # the way the slot names appear, and the icons used. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- MAX_FILES = 24 # Maximum saves a player can make. Default: 16 SLOT_NAME = "File %s" # How the file slots will be named.
# These are the icons SAVE_ICON = 368 # Icon used to indicate a save is present. EMPTY_ICON = 375 # Icon used to indicate an empty file.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # - Action Window Settings - #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # This section adjusts how the action window appears, the sound effect # played when deleting files, and what appears in the help window above. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- ACTION_LOAD = "Load" # Text used for loading games. ACTION_SAVE = "Save" # Text used for saving games. ACTION_DELETE = "Delete" # Text used for deleting games. DELETE_SOUND = RPG::SE.new("Collapse3", 100, 100) # Sound for deleting.
# These text settings adjust what displays in the help window. SELECT_HELP = "Please select a file slot." LOAD_HELP = "Loads the data from the saved game." SAVE_HELP = "Saves the current progress in your game." DELETE_HELP = "Deletes all data from this save file."
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # - Status Window Settings - #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # This section adjusts how the status window appears in the middle of the # screen (that displays the game's data) such as the total playtime, total # times saved, total gold, the party's current location, and the variables # to be displayed. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- EMPTY_TEXT = "No Save Data" # Text used when no save data is present. PLAYTIME = "Playtime" # Text used for total playtime. TOTAL_SAVE = "Total Saves: " # Text used to indicate total saves. TOTAL_GOLD = "Total Gold: " # Text used to indicate total gold. LOCATION = "Location: " # Text used to indicate current location.
# These variables will be shown in each of the two columns for those who # would want to display more information than just what's shown. Input the # variables into the arrays below to designate what data will be shown. COLUMN1_VARIABLES = [1, 2, 3] COLUMN2_VARIABLES = [4, 5, 6]
end # SAVE end # 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. #==============================================================================
#-------------------------------------------------------------------------- # draw_save_location #-------------------------------------------------------------------------- def draw_save_location(dx, dy, dw) return if @header[:map].nil? reset_font_settings change_color(system_color) draw_text(dx, dy, dw, line_height, YEA::SAVE::LOCATION) change_color(normal_color) cx = text_size(YEA::SAVE::LOCATION).width return if $data_mapinfos[@header[:map]].nil? text = @header[:map].display_name text = $data_mapinfos[@header[:map].map_id].name if text == "" draw_text(dx+cx, dy, dw-cx, line_height, text) end
#-------------------------------------------------------------------------- # draw_save_characters #-------------------------------------------------------------------------- def draw_save_characters(dx, dy) return if @header[:party].nil? reset_font_settings make_font_smaller dw = (contents.width - dx) / @header[:party].max_battle_members dx += dw/2 for member in @header[:party].battle_members next if member.nil? member = @header[:actors][member.id] change_color(normal_color) draw_actor_graphic(member, dx, dy) text = member.name draw_text(dx-dw/2, dy, dw, line_height, text, 1) text = member.level.group draw_text(dx-dw/2, dy-line_height, dw-4, line_height, text, 2) cx = text_size(text).width change_color(system_color) text = Vocab::level_a draw_text(dx-dw/2, dy-line_height, dw-cx-4, line_height, text, 2) dx += dw end end
#-------------------------------------------------------------------------- # draw_save_column1 #-------------------------------------------------------------------------- def draw_save_column1(dx, dy, dw) data = YEA::SAVE::COLUMN1_VARIABLES draw_column_data(data, dx, dy, dw) end
#-------------------------------------------------------------------------- # draw_save_column2 #-------------------------------------------------------------------------- def draw_save_column2(dx, dy, dw) data = YEA::SAVE::COLUMN2_VARIABLES draw_column_data(data, dx, dy, dw) end
#-------------------------------------------------------------------------- # draw_column_data #-------------------------------------------------------------------------- def draw_column_data(data, dx, dy, dw) return if @header[:variables].nil? reset_font_settings for variable_id in data next if $data_system.variables[variable_id].nil? change_color(system_color) name = $data_system.variables[variable_id] draw_text(dx, dy, dw, line_height, name, 0) value = @header[:variables][variable_id].group change_color(normal_color) draw_text(dx, dy, dw, line_height, value, 2) dy += line_height end end
#-------------------------------------------------------------------------- # add_load_command #-------------------------------------------------------------------------- def add_load_command add_command(YEA::SAVE::ACTION_LOAD, :load, load_enabled?) end
#-------------------------------------------------------------------------- # load_enabled? #-------------------------------------------------------------------------- def load_enabled? return false if @header.nil? return true end
#-------------------------------------------------------------------------- # add_save_command #-------------------------------------------------------------------------- def add_save_command add_command(YEA::SAVE::ACTION_SAVE, :save, save_enabled?) end
#-------------------------------------------------------------------------- # save_enabled? #-------------------------------------------------------------------------- def save_enabled? return false if @header.nil? && SceneManager.scene_is?(Scene_Load) return false if SceneManager.scene_is?(Scene_Load) return false if $game_system.save_disabled return true end
#-------------------------------------------------------------------------- # add_delete_command #-------------------------------------------------------------------------- def add_delete_command add_command(YEA::SAVE::ACTION_DELETE, :delete, delete_enabled?) end
#-------------------------------------------------------------------------- # delete_enabled? #-------------------------------------------------------------------------- def delete_enabled? return false if @header.nil? return true end
#-------------------------------------------------------------------------- # update_help #-------------------------------------------------------------------------- def update_help case current_symbol when :load; @help_window.set_text(YEA::SAVE::LOAD_HELP) when :save; @help_window.set_text(YEA::SAVE::SAVE_HELP) when :delete; @help_window.set_text(YEA::SAVE::DELETE_HELP) end end
#-------------------------------------------------------------------------- # overwrite method: start #-------------------------------------------------------------------------- def start super create_all_windows end
#-------------------------------------------------------------------------- # overwrite method: terminate #-------------------------------------------------------------------------- def terminate super end
#-------------------------------------------------------------------------- # overwrite method: update #-------------------------------------------------------------------------- def update super end
#-------------------------------------------------------------------------- # new method: create_all_windows #-------------------------------------------------------------------------- def create_all_windows create_help_window create_file_window create_action_window create_status_window end
#-------------------------------------------------------------------------- # new method: on_file_ok #-------------------------------------------------------------------------- def on_file_ok @action_window.activate index = SceneManager.scene_is?(Scene_Load) ? 0 : 1 @action_window.select(index) end
#-------------------------------------------------------------------------- # new method: on_action_cancel #-------------------------------------------------------------------------- def on_action_cancel @action_window.unselect @file_window.activate @help_window.set_text(YEA::SAVE::SELECT_HELP) end
#-------------------------------------------------------------------------- # new method: on_action_load #-------------------------------------------------------------------------- def on_action_load if DataManager.load_game(@file_window.index) on_load_success else Sound.play_buzzer end end
#-------------------------------------------------------------------------- # new method: on_action_save #-------------------------------------------------------------------------- def on_action_save @action_window.activate if DataManager.save_game(@file_window.index) on_save_success refresh_windows else Sound.play_buzzer end end
#-------------------------------------------------------------------------- # overwrite method: on_save_success #-------------------------------------------------------------------------- def on_save_success; Sound.play_save; end
#-------------------------------------------------------------------------- # new method: on_action_delete #-------------------------------------------------------------------------- def on_action_delete @action_window.activate DataManager.delete_save_file(@file_window.index) on_delete_success refresh_windows end
#-------------------------------------------------------------------------- # new method: on_delete_success #-------------------------------------------------------------------------- def on_delete_success YEA::SAVE::DELETE_SOUND.play end
#-------------------------------------------------------------------------- # new method: refresh_windows #-------------------------------------------------------------------------- def refresh_windows @file_window.refresh @action_window.refresh @status_window.refresh end
#-------------------------------------------------------------------------- # overwrite method: on_savefile_ok #-------------------------------------------------------------------------- def on_savefile_ok; super; end
#-------------------------------------------------------------------------- # overwrite method: on_load_success #-------------------------------------------------------------------------- def on_load_success; super; end
end # Scene_Load
#============================================================================== # # ▼ End of File # #==============================================================================