# ▼ Yanfly Engine Ace - Adjust Limits v1.00 # -- Last Updated: 2011.12.03 # -- Level: Normal # -- Requires: n/a # #============================================================================== $imported = {} if $imported.nil? $imported["YEA-AdjustLimits"] = true #============================================================================== # ▼ Updates # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # 2011.12.03 - Finished Script. # 2011.12.02 - Started Script. # #============================================================================== # ▼ Introduction # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # There exists some limitations in RPG Maker VX Ace that not everybody's fond # of. With this script, you can easily adjust the limits of each limitation. # Here's the list of various limits that can be changed: # # - Gold Max - Have more than 99,999,999 gold. # - Item Max - Have more than 99 items. Customizable per item, too. # - Level Max - Exceed 99 levels. Parameters are automatically calculated based # on the level 99 and level 98 stats in the class parameters. # - Stat Max - Stats can exceed 999. Does not adjust for current formulas. # #============================================================================== # ▼ 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. # # ----------------------------------------------------------------------------- # 角色备注栏 - These notetags go in the actors notebox in the database. # ----------------------------------------------------------------------------- # <initial level: x> 设置角色的初始等级,可超过99. # <max level: x> 设置角色的最高等级,可超过99. # ----------------------------------------------------------------------------- # 职业备注栏 - These notetags go in the class notebox in the database. # ----------------------------------------------------------------------------- # <learn at level: x> 在职业的技能备注栏里设置,等级可超过99. # ----------------------------------------------------------------------------- # 物品备注栏 - These notetags go in the items notebox in the database. # ----------------------------------------------------------------------------- # <max limit: x> 设置该物品的可持有上限,比如50. # <price: x> 设置物品的价格,可打破数据库限制的999999。 # ----------------------------------------------------------------------------- # 武器备注栏 - These notetags go in the weapons notebox in the database. # ----------------------------------------------------------------------------- # <max limit: x> 设置该物品的可持有上限,比如50. # <price: x> 设置物品的价格,可打破数据库限制的999999。 # <stat: +x> 设置武器的能力值变化量,例:<ATK: +500> # <stat: -x> # ----------------------------------------------------------------------------- # 防具备注栏 - These notetags go in the armours notebox in the database. # ----------------------------------------------------------------------------- # <max limit: x> 同上 # # <price: x> # <stat: +x> # <stat: -x> # # ----------------------------------------------------------------------------- # 敌人备注栏 - These notetags go in the enemy notebox in the database. # ----------------------------------------------------------------------------- # <stat: x> 设置敌人属性值,可破限。例:<EXP: 6666666> # MAXHP, MAXMP, ATK, DEF, MAT, MDF, AGI, LUK, EXP, GOLD # ----------------------------------------------------------------------------- # 脚本呼出语句 - These commands are used with script calls. # ----------------------------------------------------------------------------- # gain_gold(x) 设置增减金币,可破限。 # lose_gold(x) # # gain_item(x, y) 设置增减X物品Y数目,可破限。 # lose_item(x, y) # gain_weapon(x, y) # lose_weapon(x, y) # gain_armour(x, y) # lose_armour(x, y) #============================================================================== # ▼ 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 LIMIT #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # - Gold Settings - #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # Adjust gold settings here. You can change the maximum amount of gold to # whatever you want. In addition to that, you can also adjust whether or # not you wish for your gold display to show an icon instead, (and change # the font size if needed). If there's too much gold that's to be displayed # then you can change the text shown in place of that. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- GOLD_MAX = 999999999999999 # Maximum gold. GOLD_ICON = 95 # Icon used for gold. Use 0 for text currency. GOLD_FONT = 20 # Font size used to display gold. TOO_MUCH_GOLD = "A lotta gold!" # Text used when gold cannot fit. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # - Item Settings - #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # Adjust item settings here. You can change the maximum number of items # held from 99 to whatever you want. In addition to that, change the prefix # used for items when shown in the item display menu (and the font size if # needed). Items can have individual maximums through usage of the # <max limit: x> notetag. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- ITEM_MAX = 999 # The default maximum number of items held each. ITEM_FONT = 20 # Font size used to display item quantity. SHOP_FONT = 20 # Font size used for shop item costs. ITEM_PREFIX = "×%s" # Prefix used for item quantity in item lists. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # - Parameter Settings - #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # Adjust the limits for each of the various stats (for MaxHP, MaxMP, ATK, # DEF, MAT, and more). Adjust them as you see fit. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- LEVEL_MAX = 90000 # Sets max level to x for those with 99 level limit. MAXHP_MAX = 90000000 # Sets MaxHP to something higher than 9999. MAXMP_MAX = 9999999 # Sets MaxMP to something higher than 9999. PARAM_MAX = 9999999 # Sets stat max for something higher than 999. EQUIP_FONT = 20 # Changes the default equip window font size. end # LIMIT 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. #============================================================================== module YEA module REGEXP module ACTOR MAX_LEVEL = /<(?:MAX_LEVEL|max level):[ ](\d+)>/i INI_LEVEL = /<(?:INITIAL_LEVEL|initial level):[ ](\d+)>/i end # ACTOR module CLASS LEARN_AT_LV = /<(?:LEARN_AT_LEVEL|learn at level):[ ](\d+)>/i end # CLASS module BASEITEM PRICE = /<(?:GOLD|price|COST):[ ](\d+)>/i MAX_LIMIT = /<(?:MAX_LIMIT|max limit):[ ](\d+)>/i STAT_SET = /<(.*):[ ]*([\+\-]\d+)>/i end # BASEITEM module ENEMY STAT_SET = /<(.*):[ ]*(\d+)>/i end # ENEMY end # REGEXP end # YEA #============================================================================== # ■ Icon #============================================================================== module Icon #-------------------------------------------------------------------------- # self.gold #-------------------------------------------------------------------------- def self.gold; return YEA::LIMIT::GOLD_ICON; end end # Icon #============================================================================== # ■ Numeric #============================================================================== class Numeric #-------------------------------------------------------------------------- # new method: group_digits #-------------------------------------------------------------------------- unless $imported["YEA-CoreEngine"] def group; return self.to_s; end end # $imported["YEA-CoreEngine"] end # Numeric #============================================================================== # ■ DataManager #============================================================================== module DataManager #-------------------------------------------------------------------------- # alias method: load_database #-------------------------------------------------------------------------- class <<self; alias load_database_al load_database; end def self.load_database load_database_al load_notetags_al end #-------------------------------------------------------------------------- # new method: load_notetags_al #-------------------------------------------------------------------------- def self.load_notetags_al groups = [$data_actors, $data_items, $data_weapons, $data_armors, $data_enemies, $data_classes] for group in groups for obj in group next if obj.nil? obj.load_notetags_al end end end end # DataManager #============================================================================== # ■ RPG::Actor #============================================================================== class RPG::Actor < RPG::BaseItem #-------------------------------------------------------------------------- # common cache: load_notetags_al #-------------------------------------------------------------------------- def load_notetags_al @max_level = YEA::LIMIT::LEVEL_MAX if @max_level == 99 #--- self.note.split(/[\r\n]+/).each { |line| case line #--- when YEA::REGEXP::ACTOR::MAX_LEVEL @max_level = [[$1.to_i, 1].max, YEA::LIMIT::LEVEL_MAX].min @ini_level = [@ini_level, @max_level].min when YEA::REGEXP::ACTOR::INI_LEVEL @ini_level = [[$1.to_i, 1].max, @max_level].min #--- end } # self.note.split #--- end end # RPG::Actor #============================================================================== # ■ RPG::Class #============================================================================== class RPG::Class < RPG::BaseItem #-------------------------------------------------------------------------- # new method: above_lv99_params #-------------------------------------------------------------------------- def above_lv99_params(param_id, level) return @params[param_id, level] if level <= 99 n = @params[param_id, 99] multiplier = [level - 99, 1].max change = (@params[param_id, 99] - @params[param_id, 98]) + 1 n += change * multiplier return n end #-------------------------------------------------------------------------- # new method: load_notetags_al #-------------------------------------------------------------------------- def load_notetags_al for item in @learnings; item.load_notetags_al; end end end # RPG::Class #============================================================================== # ■ RPG::Class::Learning #============================================================================== class RPG::Class::Learning #-------------------------------------------------------------------------- # common cache: load_notetags_al #-------------------------------------------------------------------------- def load_notetags_al #--- self.note.split(/[\r\n]+/).each { |line| case line #--- when YEA::REGEXP::CLASS::LEARN_AT_LV @level = [[$1.to_i, 1].max, YEA::LIMIT::LEVEL_MAX].min #--- end } # self.note.split #--- end end # RPG::Class::Learning #============================================================================== # ■ RPG::BaseItem #============================================================================== class RPG::BaseItem #-------------------------------------------------------------------------- # public instance variables #-------------------------------------------------------------------------- attr_accessor :max_limit #-------------------------------------------------------------------------- # common cache: load_notetags_al #-------------------------------------------------------------------------- def load_notetags_al @max_limit = YEA::LIMIT::ITEM_MAX #--- self.note.split(/[\r\n]+/).each { |line| case line #--- when YEA::REGEXP::BASEITEM::PRICE @price = [$1.to_i, YEA::LIMIT::GOLD_MAX].min when YEA::REGEXP::BASEITEM::MAX_LIMIT @max_limit = [$1.to_i, 1].max when YEA::REGEXP::BASEITEM::STAT_SET case $1.upcase when "HP", "MAXHP", "MHP" @params[0] = $2.to_i when "MP", "MAXMP", "MMP", "SP", "MAXSP", "MSP" @params[1] = $2.to_i when "ATK" @params[2] = $2.to_i when "DEF" @params[3] = $2.to_i when "MAT", "INT", "SPI" @params[4] = $2.to_i when "MDF", "RES" @params[5] = $2.to_i when "AGI", "SPD" @params[6] = $2.to_i when "LUK", "LUCK" @params[7] = $2.to_i end #--- end } # self.note.split #--- end #-------------------------------------------------------------------------- # new method: max_limit #-------------------------------------------------------------------------- def max_limit; return @max_limit; end end # RPG::BaseItem #============================================================================== # ■ RPG::Enemy #============================================================================== class RPG::Enemy < RPG::BaseItem #-------------------------------------------------------------------------- # common cache: load_notetags_al #-------------------------------------------------------------------------- def load_notetags_al #--- self.note.split(/[\r\n]+/).each { |line| case line #--- when YEA::REGEXP::ENEMY::STAT_SET case $1.upcase when "HP", "MAXHP", "MHP" @params[0] = $2.to_i when "MP", "MAXMP", "MMP", "SP", "MAXSP", "MSP" @params[1] = $2.to_i when "ATK" @params[2] = $2.to_i when "DEF" @params[3] = $2.to_i when "MAT", "INT", "SPI" @params[4] = $2.to_i when "MDF", "RES" @params[5] = $2.to_i when "AGI", "SPD" @params[6] = $2.to_i when "LUK", "LUCK" @params[7] = $2.to_i when "EXP", "XP" @exp = $2.to_i when "GOLD", "GP" @gold = $2.to_i end #--- end } # self.note.split #--- end end # RPG::Enemy #============================================================================== # ■ Game_BattlerBase #============================================================================== class Game_BattlerBase #-------------------------------------------------------------------------- # overwrite method: param_max #-------------------------------------------------------------------------- def param_max(param_id) return YEA::LIMIT::MAXHP_MAX if param_id == 0 return YEA::LIMIT::MAXMP_MAX if param_id == 1 return YEA::LIMIT::PARAM_MAX end end # Game_BattlerBase #============================================================================== # ■ Game_Actor #============================================================================== class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # overwrite method: param_max #-------------------------------------------------------------------------- def param_max(param_id) return super end #-------------------------------------------------------------------------- # overwrite method: param_base #-------------------------------------------------------------------------- def param_base(param_id) return self.class.params[param_id, @level] if @level <= 99 return self.class.above_lv99_params(param_id, @level) end #-------------------------------------------------------------------------- # new method: check_levels #-------------------------------------------------------------------------- def check_levels last_level = @level @level = [[@level, max_level].min, 1].max return if @level == last_level change_exp(exp_for_level(@level), false) end end # Game_Actor #============================================================================== # ■ Game_Party #============================================================================== class Game_Party < Game_Unit #-------------------------------------------------------------------------- # overwrite method: max_gold #-------------------------------------------------------------------------- def max_gold; return YEA::LIMIT::GOLD_MAX; end #-------------------------------------------------------------------------- # overwrite method: max_item_number #-------------------------------------------------------------------------- def max_item_number(item); return item.max_limit; end end # Game_Party #============================================================================== # ■ Game_Interpreter #============================================================================== class Game_Interpreter #-------------------------------------------------------------------------- # new method: gain_gold #-------------------------------------------------------------------------- def gain_gold(value); $game_party.gain_gold(value); end #-------------------------------------------------------------------------- # new method: lose_gold #-------------------------------------------------------------------------- def lose_gold(value); $game_party.lose_gold(value); end #-------------------------------------------------------------------------- # new method: gain_item #-------------------------------------------------------------------------- def gain_item(id, amount) return if $data_items[id].nil? $game_party.gain_item($data_items[id], amount) end #-------------------------------------------------------------------------- # new method: lose_item #-------------------------------------------------------------------------- def lose_item(id, amount) return if $data_items[id].nil? $game_party.lose_item($data_items[id], amount) end #-------------------------------------------------------------------------- # new method: gain_weapon #-------------------------------------------------------------------------- def gain_weapon(id, amount) return if $data_weapons[id].nil? $game_party.gain_item($data_weapons[id], amount) end #-------------------------------------------------------------------------- # new method: lose_weapon #-------------------------------------------------------------------------- def lose_weapon(id, amount) return if $data_weapons[id].nil? $game_party.lose_item($data_weapons[id], amount) end #-------------------------------------------------------------------------- # new method: gain_armour #-------------------------------------------------------------------------- def gain_armour(id, amount) return if $data_armors[id].nil? $game_party.gain_item($data_armors[id], amount) end #-------------------------------------------------------------------------- # new method: lose_armour #-------------------------------------------------------------------------- def lose_armour(id, amount) return if $data_armors[id].nil? $game_party.lose_item($data_armors[id], amount) end #-------------------------------------------------------------------------- # new method: gain_armor #-------------------------------------------------------------------------- def gain_armor(id, amount) return if $data_armors[id].nil? $game_party.gain_item($data_armors[id], amount) end #-------------------------------------------------------------------------- # new method: lose_armor #-------------------------------------------------------------------------- def lose_armor(id, amount) return if $data_armors[id].nil? $game_party.lose_item($data_armors[id], amount) end end # Game_Interpreter #============================================================================== # ■ Window_Base #============================================================================== class Window_Base < Window #-------------------------------------------------------------------------- # overwrite method: draw_actor_level #-------------------------------------------------------------------------- def draw_actor_level(actor, dx, dy) dw = text_size(Vocab::level_a + YEA::LIMIT::LEVEL_MAX.to_s).width change_color(system_color) draw_text(dx, dy, dw, line_height, Vocab::level_a) change_color(normal_color) cx = text_size(Vocab::level_a).width draw_text(dx + cx, dy, dw, line_height, actor.level.group, 2) end #-------------------------------------------------------------------------- # overwrite method: draw_actor_param #-------------------------------------------------------------------------- def draw_actor_param(actor, dx, dy, param_id) change_color(system_color) draw_text(dx, dy, 120, line_height, Vocab::param(param_id)) change_color(normal_color) draw_text(dx, dy, 156, line_height, actor.param(param_id).group, 2) end #-------------------------------------------------------------------------- # draw_currency_value #-------------------------------------------------------------------------- def draw_currency_value(value, unit, dx, dy, dw) contents.font.size = YEA::LIMIT::GOLD_FONT cx = gold_icon?(unit) ? 24 : text_size(unit).width change_color(normal_color) text = value.group text = YEA::LIMIT::TOO_MUCH_GOLD if contents.text_size(text).width > dw-cx draw_text(dx, dy, dw - cx - 2, line_height, text, 2) change_color(system_color) draw_icon(Icon.gold, dx+dw-24, dy) if gold_icon?(unit) draw_text(dx, dy, dw, line_height, unit, 2) unless gold_icon?(unit) reset_font_settings end #-------------------------------------------------------------------------- # new method: gold_icon? #-------------------------------------------------------------------------- def gold_icon?(unit) return false if unit != Vocab.currency_unit return YEA::LIMIT::GOLD_ICON > 0 end end # Window_Base #============================================================================== # ■ Window_ItemList #============================================================================== class Window_ItemList < Window_Selectable #-------------------------------------------------------------------------- # overwrite method: draw_item_number #-------------------------------------------------------------------------- def draw_item_number(rect, item) contents.font.size = YEA::LIMIT::ITEM_FONT quantity = $game_party.item_number(item).group text = sprintf(YEA::LIMIT::ITEM_PREFIX, quantity) draw_text(rect, text, 2) reset_font_settings end end # Window_ItemList #============================================================================== # ■ Window_EquipStatus #============================================================================== class Window_EquipStatus < Window_Base #-------------------------------------------------------------------------- # overwrite method: draw_item #-------------------------------------------------------------------------- def draw_item(dx, dy, param_id) draw_param_name(dx + 4, dy, param_id) draw_current_param(dx + 64, dy, param_id) if @actor draw_right_arrow(dx + 110, dy) draw_new_param(dx + 132, dy, param_id) if @temp_actor reset_font_settings end #-------------------------------------------------------------------------- # overwrite method: draw_param_name #-------------------------------------------------------------------------- def draw_param_name(dx, dy, param_id) contents.font.size = YEA::LIMIT::EQUIP_FONT change_color(system_color) draw_text(dx, dy, contents.width, line_height, Vocab::param(param_id)) end #-------------------------------------------------------------------------- # overwrite method: draw_current_param #-------------------------------------------------------------------------- def draw_current_param(dx, dy, param_id) change_color(normal_color) draw_text(0, dy, dx+48, line_height, @actor.param(param_id).group, 2) reset_font_settings end #-------------------------------------------------------------------------- # overwrite method: draw_new_param #-------------------------------------------------------------------------- def draw_new_param(dx, dy, param_id) contents.font.size = YEA::LIMIT::EQUIP_FONT new_value = @temp_actor.param(param_id) change_color(param_change_color(new_value - @actor.param(param_id))) draw_text(0, dy, contents.width-4, line_height, new_value.group, 2) reset_font_settings end end # Window_EquipStatus #============================================================================== # ■ Window_ShopBuy #============================================================================== class Window_ShopBuy < Window_Selectable #-------------------------------------------------------------------------- # overwrite method: draw_item #-------------------------------------------------------------------------- def draw_item(index) item = @data[index] rect = item_rect(index) draw_item_name(item, rect.x, rect.y, enable?(item)) rect.width -= 4 contents.font.size = YEA::LIMIT::SHOP_FONT draw_text(rect, price(item).group, 2) reset_font_settings end end # Window_ShopBuy #============================================================================== # ■ Scene_Load #============================================================================== class Scene_Load < Scene_File #-------------------------------------------------------------------------- # alias method: on_load_success #-------------------------------------------------------------------------- alias on_load_success_al on_load_success def on_load_success on_load_success_al perform_level_check end #-------------------------------------------------------------------------- # new method: perform_level_check #-------------------------------------------------------------------------- def perform_level_check for i in 1..$data_actors.size next if $game_actors[i].nil? $game_actors[i].check_levels end end end # Scene_Load #============================================================================== # # ▼ End of File # #============================================================================== # # ▼ 以下为我的修改,主要为了适应1024*576分辨率。By风宥雪 # #============================================================================== #============================================================================== class Window_EquipStatus < Window_Base #-------------------------------------------------------------------------- # ● 绘制更换装备前的能力值 #-------------------------------------------------------------------------- def draw_current_param(dx, dy, param_id) reset_font_settings change_color(normal_color) draw_text(70, dy, 50, line_height, @actor.param(param_id).group, 1) end #-------------------------------------------------------------------------- # ● 绘制更换装备后的能力值 #-------------------------------------------------------------------------- def draw_new_param(x, y, param_id) new_value = @temp_actor.param(param_id) change = new_value - @actor.param(param_id) change_color(param_change_color(change)) if change > 0 draw_text(120, y, 20, line_height, "↑", 1) elsif change == 0 draw_text(120, y, 20, line_height, "→", 1) else draw_text(120, y, 20, line_height, "↓", 1) end draw_text(140, y, 50, line_height, new_value, 1) end end
fux2 发表于 2017-6-27 09:02
我也是很服你们,遇到问题的时候甚至不愿意多思考一秒,多看一眼。
人家作者把上限写在这真是白写了。 ...
360截图20170627122402542.jpg (27.12 KB, 下载次数: 13)
360截图20170627122415893.jpg (10.56 KB, 下载次数: 13)
360截图20170627122517504.jpg (106.48 KB, 下载次数: 16)
300英雄 发表于 2017-6-27 13:03
其实这也是算搬VA默认脚本的,里面是有基础设定的。你不看那默认设定,VA本身没有问题。自己不看的问题,不 ...
360截图20170627131717676.jpg (96.65 KB, 下载次数: 13)
360截图20170627131733969.jpg (80.11 KB, 下载次数: 13)
寂静的夜里 发表于 2017-6-27 14:09
不能超过1E
建议更换脚本Yanfly 有个脚本 叫 Adjust Limits 可以破限
#============================================================================== # +++ MOG - Boss HP Meter (V1.2) +++ #============================================================================== # By Moghunter # [url]http://www.atelier-rgss.com[/url] #============================================================================== # Apresenta um medidor animado com o HP do inimigo. # #============================================================================== # UTILIZAÇÃO #============================================================================== # Coloque o seguinte comentário na caixa de notas do inimigo. # # <Boss HP Meter> # # Caso desejar ocultar o valor numérico do HP use o código abaixo. # # <Boss HP Hide Number> # #============================================================================== # Caso precisar mudar a posição do medidor no meio do jogo use o código abaixo # # boss_hp_position(X,Y) # #============================================================================== # Serão necessários as imagens. # # Battle_Boss_Meter.png # Battle_Boss_Meter_Layout.png #============================================================================== # FACES (Opcional) #============================================================================== # Nomeie o arquivo da face da seguinte maneira. (Graphics/Faces/) # # Enemy_Name + _F.png (Slime_F.png) # #============================================================================== # Definindo o LEVEL (Opcional) #============================================================================== # Coloque o seguinte comentário na caixa de notas do inimigo. # # <Level = X> # #============================================================================== #============================================================================== # ● Histórico (Version History) #============================================================================== # v 1.2 - Melhoria na performance. # - Não é mais necessário o script Enemy HP. #============================================================================== module MOG_BOSS_HP_METER #Posição geral do layout. LAYOUT_POSITION = [100,35] #Posição do medidor. METER_POSITION = [3,3] #Posição do nome do inimigo. NAME_POSITION = [16,8] #Posição da face. FACE_POSITION = [0,-30] #Posição do level do inimigo. LEVEL_POSITION = [150, -24]#[290, 0] #Posição do numero de HP HP_NUMBER_POSITION = [230, 5] #Definição do espaço da palavra HP e o valor de numérico. HP_STRING_SPACE = 36 # HP_NUMBER_WAVE_EFFECT = true #Definição da palavra Level. LEVEL_WORD = "Level " #Velocidade de animação do medidor METER_ANIMATION_SPEED = 10 #Definição do nome da fonte. FONT_NAME = "Georgia" #Definição do tamanho da fonte. FONT_SIZE = 16 #Ativar contorno na fonte. FONT_BOLD = true #Fonte em itálico. FONT_ITALIC = true #Definição da cor da fonte. FONT_COLOR = Color.new(255,255,255) #Definição da prioridade da HUD. PRIORITY_Z = 101 end #============================================================================== # ■ Game System #============================================================================== class Game_System attr_accessor :boss_hp_meter #-------------------------------------------------------------------------- # ● Initialize #-------------------------------------------------------------------------- alias mog_boss_hp_meter_initialize initialize def initialize ix = MOG_BOSS_HP_METER::LAYOUT_POSITION[0] iy = MOG_BOSS_HP_METER::LAYOUT_POSITION[1] @boss_hp_meter = [ix,iy,false,"",0,1,0,nil,0,false] mog_boss_hp_meter_initialize end end #============================================================================== # ■ Game Enemy #============================================================================== class Game_Enemy < Game_Battler attr_accessor :boss_hp_meter attr_accessor :boss_hp_number attr_accessor :level #-------------------------------------------------------------------------- # ● Initialize #-------------------------------------------------------------------------- alias mog_boss_hp_meter_initialize initialize def initialize(index, enemy_id) mog_boss_hp_meter_initialize(index, enemy_id) @boss_hp_meter = enemy.note =~ /<Boss HP Meter>/ ? true : false @boss_hp_number = enemy.note =~ /<Boss HP Hide Number>/ ? false : true @level = enemy.note =~ /<Level = (\d+)>/i ? $1 : nil end end #============================================================================== # ■ Game Temp #============================================================================== class Game_Temp attr_accessor :battle_end #-------------------------------------------------------------------------- # ● Initialize #-------------------------------------------------------------------------- alias mog_boss_hp_meter_initialize initialize def initialize @battle_end = false mog_boss_hp_meter_initialize end end #============================================================================== # ■ Game Interpreter #============================================================================== class Game_Interpreter #-------------------------------------------------------------------------- # ● Initialize #-------------------------------------------------------------------------- def boss_hp_position(x = 0,y = 0) $game_system.boss_hp_meter[0] = x $game_system.boss_hp_meter[1] = y end end #============================================================================== # ■ Game Temp #============================================================================== class Game_Temp attr_accessor :cache_boss_hp #-------------------------------------------------------------------------- # ● Initialize #-------------------------------------------------------------------------- alias mog_boss_hp_initialize initialize def initialize mog_boss_hp_initialize cache_bosshp end #-------------------------------------------------------------------------- # ● Cache Bosshp #-------------------------------------------------------------------------- def cache_bosshp @cache_boss_hp = [] @cache_boss_hp.push(Cache.system("Battle_Boss_Meter_Layout")) @cache_boss_hp.push(Cache.system("Battle_Boss_Meter")) @cache_boss_hp.push(Cache.system("Battle_Boss_Number")) end end #============================================================================== # ■ Boss HP Meter #============================================================================== class Boss_HP_Meter include MOG_BOSS_HP_METER #-------------------------------------------------------------------------- # ● Initialize #-------------------------------------------------------------------------- def initialize(viewport = nil) clear_enemy_setup @hp_vieport = viewport check_boss_avaliable end #-------------------------------------------------------------------------- # ● Clear Enemy Setup #-------------------------------------------------------------------------- def clear_enemy_setup @name = "" @hp = 0 @hp2 = 0 @hp3 = 0 @maxhp = 0 @hp_old = 0 @level = nil $game_system.boss_hp_meter[2] = false $game_system.boss_hp_meter[3] = "" $game_system.boss_hp_meter[4] = 0 $game_system.boss_hp_meter[5] = 1 $game_system.boss_hp_meter[7] = nil $game_system.boss_hp_meter[8] = 0 $game_system.boss_hp_meter[9] = true end #-------------------------------------------------------------------------- # ● Check Boss Avaliable #-------------------------------------------------------------------------- def check_boss_avaliable return if $game_troop.all_dead? for i in $game_troop.members if i.boss_hp_meter and !i.hidden? and i.hp > 0 create_boss_hp_meter(i) break end end end #-------------------------------------------------------------------------- # ● Create Boss HP Meter #-------------------------------------------------------------------------- def create_boss_hp_meter(i) $game_system.boss_hp_meter[2] = true $game_system.boss_hp_meter[3] = i.name $game_system.boss_hp_meter[4] = i.hp $game_system.boss_hp_meter[5] = i.mhp $game_system.boss_hp_meter[6] = i.hp $game_system.boss_hp_meter[7] = i.level rescue nil $game_system.boss_hp_meter[8] = 0 $game_system.boss_hp_meter[9] = i.boss_hp_number refresh_hp_meter create_layout create_meter create_name create_face create_level create_hp_number end #-------------------------------------------------------------------------- # ● Create Layout #-------------------------------------------------------------------------- def create_layout return if @layout != nil @layout = Sprite.new @layout.bitmap = $game_temp.cache_boss_hp[0] @layout.x = $game_system.boss_hp_meter[0] @layout.y = $game_system.boss_hp_meter[1] @layout.viewport = @hp_vieport @layout.z = PRIORITY_Z end #-------------------------------------------------------------------------- # ● Create Meter #-------------------------------------------------------------------------- def create_meter return if @meter_image != nil hp_setup @meter_image = $game_temp.cache_boss_hp[1] @meter_cw = @meter_image.width / 3 @meter_ch = @meter_image.height / 2 [url=home.php?mod=space&uid=1330256]@meter[/url] = Sprite.new @meter.bitmap = Bitmap.new(@meter_cw,@meter_ch) @meter.z = @layout.z + 1 @meter.x = @layout.x + METER_POSITION[0] @meter.y = @layout.y + METER_POSITION[1] @meter.viewport = @hp_vieport @hp_flow = 0 @hp_flow_max = @meter_cw * 2 update_hp_meter end #-------------------------------------------------------------------------- # ● Create Name #-------------------------------------------------------------------------- def create_name @name_sprite = Sprite.new @name_sprite.bitmap = Bitmap.new(200,32) @name_sprite.z = @layout.z + 2 @name_sprite.x = @layout.x + NAME_POSITION[0] @name_sprite.y = @layout.y + NAME_POSITION[1] @name_sprite.bitmap.font.name = FONT_NAME @name_sprite.bitmap.font.size = FONT_SIZE @name_sprite.bitmap.font.bold = FONT_BOLD @name_sprite.bitmap.font.italic = FONT_ITALIC @name_sprite.bitmap.font.color = FONT_COLOR @name_sprite.viewport = @hp_vieport refresh_name end #-------------------------------------------------------------------------- # ● Create Face #-------------------------------------------------------------------------- def create_face @face_sprite = Sprite.new @face_sprite.x = @layout.x + FACE_POSITION[0] @face_sprite.y = @layout.y + FACE_POSITION[1] @face_sprite.z = @layout.z + 2 @face_sprite.viewport = @hp_vieport refresh_face end #-------------------------------------------------------------------------- # ● Create Level #-------------------------------------------------------------------------- def create_level @level_sprite = Sprite.new @level_sprite.bitmap = Bitmap.new(120,32) @level_sprite.z = @layout.z + 2 @level_sprite.x = @layout.x + LEVEL_POSITION[0] @level_sprite.y = @layout.y + LEVEL_POSITION[1] @level_sprite.bitmap.font.name = FONT_NAME @level_sprite.bitmap.font.size = FONT_SIZE @level_sprite.bitmap.font.bold = FONT_BOLD @level_sprite.bitmap.font.italic = FONT_ITALIC @level_sprite.bitmap.font.color = FONT_COLOR @level_sprite.viewport = @hp_vieport refresh_level end #-------------------------------------------------------------------------- # ● Create HP Number #-------------------------------------------------------------------------- def create_hp_number @hp2 = $game_system.boss_hp_meter[4] @hp3 = @hp2 @hp_old2 = @hp2 @hp_ref = @hp_old2 @hp_refresh = false @hp_number_image = $game_temp.cache_boss_hp[2] @hp_cw = @hp_number_image.width / 10 @hp_ch = @hp_number_image.height / 2 @hp_ch2 = 0 @hp_ch_range = HP_NUMBER_WAVE_EFFECT == true ? @hp_ch / 3 : 0 @hp_number_sprite = Sprite.new @hp_number_sprite.bitmap = Bitmap.new(@hp_number_image.width, @hp_ch * 2) @hp_number_sprite.z = @layout.z + 2 @hp_number_sprite.x = @layout.x + HP_NUMBER_POSITION[0] @hp_number_sprite.y = @layout.y + HP_NUMBER_POSITION[1] @hp_number_sprite.viewport = @hp_vieport @hp_number_sprite.visible = $game_system.boss_hp_meter[9] refresh_hp_number end #-------------------------------------------------------------------------- # ● update_hp_number #-------------------------------------------------------------------------- def update_hp_number return if @hp_number_sprite == nil @hp_number_sprite.visible = $game_system.boss_hp_meter[9] if @hp_old2 < $game_system.boss_hp_meter[4] number_refresh_speed @hp2 += @hp_ref reset_hp_number if @hp2 >= $game_system.boss_hp_meter[4] elsif @hp_old2 > $game_system.boss_hp_meter[4] number_refresh_speed @hp2 -= @hp_ref reset_hp_number if @hp2 <= $game_system.boss_hp_meter[4] end end #-------------------------------------------------------------------------- # ● Number Refresh Speed #-------------------------------------------------------------------------- def number_refresh_speed @hp_refresh = true @hp_ref = (3 * (@hp_old2 - $game_system.boss_hp_meter[4]).abs / 100) rescue nil @hp_ref = 1 if @hp_ref == nil or @hp_ref < 1 end #-------------------------------------------------------------------------- # ● Refresh HP Number #-------------------------------------------------------------------------- def refresh_hp_number return if @hp_number_sprite == nil @hp_refresh = false @hp_number_sprite.bitmap.clear number = @hp2.abs.to_s.split(//) @hp_ch2 = 0 for r in 0..number.size - 1 number_abs = number[r].to_i nsrc_rect = Rect.new(@hp_cw * number_abs, 0, @hp_cw, @hp_ch) @hp_ch2 = @hp_ch2 == @hp_ch_range ? 0 : @hp_ch_range @hp_number_sprite.bitmap.blt(HP_STRING_SPACE + (@hp_cw * r), @hp_ch2, @hp_number_image, nsrc_rect) end nsrc_rect = Rect.new(0, @hp_ch, @hp_number_image.width, @hp_ch) @hp_number_sprite.bitmap.blt(0, 0, @hp_number_image, nsrc_rect) end #-------------------------------------------------------------------------- # ● Reset HP Number #-------------------------------------------------------------------------- def reset_hp_number @hp_refresh = true @hp_old2 = $game_system.boss_hp_meter[4] @hp2 = $game_system.boss_hp_meter[4] @hp_ref = 0 refresh_hp_number end #-------------------------------------------------------------------------- # ● Refresh Level #-------------------------------------------------------------------------- def refresh_level return if @level_sprite == nil @level_sprite.bitmap.clear @level = $game_system.boss_hp_meter[7] return if @level == nil level_text = LEVEL_WORD + @level.to_s @level_sprite.bitmap.draw_text(0,0,120,32,level_text.to_s) end #-------------------------------------------------------------------------- # ● Refresh Face #-------------------------------------------------------------------------- def refresh_face return if @face_sprite == nil dispose_bitmap_face @face_sprite.bitmap = Cache.face(@name + "_f") rescue nil @face_sprite.bitmap = Cache.face("") if @face_sprite.bitmap == nil end #-------------------------------------------------------------------------- # ● Refresh Name #-------------------------------------------------------------------------- def refresh_name return if @name_sprite == nil @name = $game_system.boss_hp_meter[3] @name_sprite.bitmap.clear @name_sprite.bitmap.draw_text(0,0,190,32,@name.to_s) refresh_face refresh_level reset_hp_number @hp_old = @meter_cw * @hp / @maxhp end #-------------------------------------------------------------------------- # ● HP Setup #-------------------------------------------------------------------------- def hp_setup @hp = $game_system.boss_hp_meter[4] @maxhp = $game_system.boss_hp_meter[5] end #-------------------------------------------------------------------------- # ● Dispose #-------------------------------------------------------------------------- def dispose dispose_layout dispose_meter dispose_name dispose_face dispose_level dispose_hp_number @hp_vieport.dispose end #-------------------------------------------------------------------------- # ● Dispose Name #-------------------------------------------------------------------------- def dispose_name return if @name_sprite == nil @name_sprite.bitmap.dispose @name_sprite.dispose @name_sprite = nil end #-------------------------------------------------------------------------- # ● Dispose Layout #-------------------------------------------------------------------------- def dispose_layout return if @layout == nil @layout.dispose @layout = nil end #-------------------------------------------------------------------------- # ● Dispose Meter #-------------------------------------------------------------------------- def dispose_meter return if @meter == nil @meter.bitmap.dispose @meter.dispose @meter = nil end #-------------------------------------------------------------------------- # ● Dispose Face #-------------------------------------------------------------------------- def dispose_face return if @face_sprite == nil dispose_bitmap_face @face_sprite.dispose @face_sprite = nil end #-------------------------------------------------------------------------- # ● Dispose Bitmap Face #-------------------------------------------------------------------------- def dispose_bitmap_face return if @face_sprite == nil return if @face_sprite.bitmap == nil @face_sprite.bitmap.dispose rescue nil @face_sprite.bitmap = nil end #-------------------------------------------------------------------------- # ● Dispose Level #-------------------------------------------------------------------------- def dispose_level return if @level_sprite == nil @level_sprite.bitmap.dispose @level_sprite.dispose @level_sprite = nil end #-------------------------------------------------------------------------- # ● Dispose HP Number #-------------------------------------------------------------------------- def dispose_hp_number return if @hp_number_sprite == nil @hp_number_sprite.bitmap.dispose @hp_number_sprite.dispose end #-------------------------------------------------------------------------- # ● Update #-------------------------------------------------------------------------- def update refresh_hp_meter refresh_hp_number if @hp_refresh update_hp_meter update_hp_number update_fade_end end #-------------------------------------------------------------------------- # ● Update Fade End #-------------------------------------------------------------------------- def update_fade_end return if !$game_temp.battle_end return if @meter_image == nil @layout.opacity -= 5 @meter.opacity -= 5 @name_sprite.opacity -= 5 @face_sprite.opacity -= 5 @level_sprite.opacity -= 5 @hp_number_sprite.opacity -= 5 end #-------------------------------------------------------------------------- # ● Refresh HP Meter #-------------------------------------------------------------------------- def refresh_hp_meter return if !$game_system.boss_hp_meter[2] $game_system.boss_hp_meter[2] = false hp_setup refresh_name if @name != $game_system.boss_hp_meter[3] end #-------------------------------------------------------------------------- # ● Update HP Meter #-------------------------------------------------------------------------- def update_hp_meter return if @meter_image == nil @meter.bitmap.clear hp_width = @meter_cw * @hp / @maxhp execute_damage_flow(hp_width) hp_src_rect = Rect.new(@hp_flow, 0,hp_width, @meter_ch) @meter.bitmap.blt(0,0, @meter_image, hp_src_rect) @hp_flow += METER_ANIMATION_SPEED @hp_flow = 0 if @hp_flow >= @hp_flow_max end #-------------------------------------------------------------------------- # ● Execute Damage Flow #-------------------------------------------------------------------------- def execute_damage_flow(hp_width) return if @hp_old == hp_width n = (@hp_old - hp_width).abs * 3 / 100 damage_flow = [[n, 2].min,0.5].max @hp_old -= damage_flow @hp_old = hp_width if @hp_old <= hp_width src_rect_old = Rect.new(0,@meter_ch, @hp_old, @meter_ch) @meter.bitmap.blt(0,0, @meter_image, src_rect_old) end end #============================================================================== # ■ Spriteset Battle #============================================================================== class Spriteset_Battle #-------------------------------------------------------------------------- # ● Initialize #-------------------------------------------------------------------------- alias mog_enemy_bhp_initialize initialize def initialize mog_enemy_bhp_initialize create_boss_hp_meter end #-------------------------------------------------------------------------- # ● Create Boss HP Meter #-------------------------------------------------------------------------- def create_boss_hp_meter @boss_hp_meter = Boss_HP_Meter.new(@viewport1) end #-------------------------------------------------------------------------- # ● Dispose #-------------------------------------------------------------------------- alias mog_enemy_bhp_dispose dispose def dispose dispose_boss_hp_meter mog_enemy_bhp_dispose end #-------------------------------------------------------------------------- # ● Dispose Boss HP Meter #-------------------------------------------------------------------------- def dispose_boss_hp_meter return if @boss_hp_meter == nil @boss_hp_meter.dispose @boss_hp_meter = nil end #-------------------------------------------------------------------------- # ● Update #-------------------------------------------------------------------------- alias mog_enemy_bhp_update update def update mog_enemy_bhp_update update_boss_hp_meter end #-------------------------------------------------------------------------- # ● Update Boss HP Meter #-------------------------------------------------------------------------- def update_boss_hp_meter return if @boss_hp_meter == nil @boss_hp_meter.update end end #============================================================================== # ■ Game_Battler #============================================================================== class Game_Battler < Game_BattlerBase #-------------------------------------------------------------------------- # ● Item Apply #-------------------------------------------------------------------------- alias mog_boss_hp_item_apply item_apply def item_apply(user, item) check_boss_hp_before mog_boss_hp_item_apply(user, item) check_boss_hp_after end #-------------------------------------------------------------------------- # ● Regenerate HP #-------------------------------------------------------------------------- alias mog_boss_hp_regenerate_hp regenerate_hp def regenerate_hp check_boss_hp_before mog_boss_hp_regenerate_hp check_boss_hp_after end #-------------------------------------------------------------------------- # ● Check Boss HP Before #-------------------------------------------------------------------------- def check_boss_hp_before return if self.is_a?(Game_Actor) return if !self.boss_hp_meter $game_system.boss_hp_meter[6] = self.hp end #-------------------------------------------------------------------------- # ● Check Boss HP After #-------------------------------------------------------------------------- def check_boss_hp_after return if self.is_a?(Game_Actor) return if !self.boss_hp_meter $game_system.boss_hp_meter[2] = true $game_system.boss_hp_meter[3] = self.name $game_system.boss_hp_meter[4] = self.hp $game_system.boss_hp_meter[5] = self.mhp $game_system.boss_hp_meter[7] = self.level rescue nil $game_system.boss_hp_meter[9] = self.boss_hp_number end end #============================================================================== # ■ Game_Interpreter #============================================================================== class Game_Interpreter #-------------------------------------------------------------------------- # ● Check Boss Meter #-------------------------------------------------------------------------- def check_boss_meter return if !SceneManager.scene_is?(Scene_Battle) iterate_enemy_index(@params[0]) do |enemy| if enemy.boss_hp_meter $game_system.boss_hp_meter[2] = true $game_system.boss_hp_meter[3] = enemy.name $game_system.boss_hp_meter[4] = enemy.hp $game_system.boss_hp_meter[5] = enemy.mhp $game_system.boss_hp_meter[6] = enemy.hp $game_system.boss_hp_meter[7] = enemy.level rescue nil $game_system.boss_hp_meter[9] = enemy.boss_hp_number end end end #-------------------------------------------------------------------------- # ● Command 331 #-------------------------------------------------------------------------- alias mog_boss_meter_command_331 command_331 def command_331 mog_boss_meter_command_331 check_boss_meter end #-------------------------------------------------------------------------- # ● Command 334 #-------------------------------------------------------------------------- alias mog_boss_meter_command_334 command_334 def command_334 mog_boss_meter_command_334 check_boss_meter end end #============================================================================== # ■ BattleManager #============================================================================== class << BattleManager #-------------------------------------------------------------------------- # ● Init Members #-------------------------------------------------------------------------- alias mog_boss_meter_init_members init_members def init_members $game_temp.battle_end = false mog_boss_meter_init_members end #-------------------------------------------------------------------------- # ● Process Victory #-------------------------------------------------------------------------- alias mog_boss_meter_process_victory process_victory def process_victory $game_temp.battle_end = true mog_boss_meter_process_victory end #-------------------------------------------------------------------------- # ● Process Abort #-------------------------------------------------------------------------- alias mog_boss_meter_process_abort process_abort def process_abort $game_temp.battle_end = true mog_boss_meter_process_abort end #-------------------------------------------------------------------------- # ● Process Defeat #-------------------------------------------------------------------------- alias mog_boss_meter_process_defeat process_defeat def process_defeat $game_temp.battle_end = true mog_boss_meter_process_defeat end end $mog_rgss3_boss_hp_meter = true
360截图20170627151503655.jpg (59.23 KB, 下载次数: 15)
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |