#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ #_/¡¡¡¡¡ßHP/SPÇ¥½Ã °³Á¶ £­ KGC_HPSPAlter¡ß #_/---------------------------------------------------------------------------- #_/¡¡HP/SPÀÇ °ÔÀÌÁö Ç¥½Ã 󸮸¦ Ãß°¡ÇÕ´Ï´Ù. #_/============================================================================ #_/ ¡¸½Ã½ºÅ۰衹½ºÅ©¸³Æ® ÃÖ»óºÎ #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ #============================================================================== # ¡Ú Ä¿½ºÅ͸¶ÀÌÁî Ç׸ñ ¡Ú #============================================================================== module KGC # ¡ßHP/SP¸íĪ ÀÏ°ý Ç¥½Ã HPSP_DRAW_NAME_LUMP = true # ¡ßÀüÅõÁß ½ºÅ×ÀÌÅͽº±×¸²ÀÚ ¹®ÀÚÈ­ # (µµÀÔÇÑ ±â´É¿¡ ÀÇÇØ º¯È­ÇÏ´Â °æ¿ì ÀÖ¾î) HPSP_BATTLE_STATUS_SHADOW = false # ¡ßÀüÅõ½ÃHP°ÔÀÌÁö À§Ä¡ [x, y] HPSP_HP_POSITION_BATTLE = [0, 0] # ¡ßÀüÅõ½ÃSP°ÔÀÌÁö À§Ä¡ [x, y] HPSP_SP_POSITION_BATTLE = [0, 0] # ¡ßºñÀüÅõ½ÃHP°ÔÀÌÁö À§Ä¡ [x, y] HPSP_HP_POSITION_NOT_BATTLE = [0, 0] # ¡ßºñÀüÅõ½ÃSP°ÔÀÌÁö À§Ä¡ [x, y] HPSP_SP_POSITION_NOT_BATTLE = [0, 0] # ¡ß°ÔÀÌÁö È­»óÀ» ºñ½ºµëÇÏ°Ô ÇÏ´Â HPSP_GAUGE_SLANT = true # ¡ß°¨¼Ò °ÔÀÌÁö¸¦ ¹¦È­ HPSP_GAUGE_DECREASE = true # ¡ß°¨¼Ò °ÔÀÌÁöÀÇ »ö HPSP_GAUGE_DECREASE_COLOR = Color.new(255, 64, 64) end class Window_Base < Window # ¡ß°ÔÀÌÁö È­»ó @@_hpsp_gauge = RPG::Cache.picture("gauge.png") end #¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú $imported = {} if $imported == nil $imported["HPSPAlter"] = true #============================================================================== # ¡á Game_Actor #============================================================================== if KGC::HPSP_DRAW_NAME_LUMP class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # ¡Ü ¹èƲ È­¸é X ÁÂÇ¥ÀÇ Ãëµæ #-------------------------------------------------------------------------- def screen_x # ÆÄƼ³»ÀÇ ÁÙ¼ø¼­·ÎºÎÅÍ X ÁÂÇ¥¸¦ °è»êÇØ µ¹·ÁÁÖ´Â if self.index != nil if $imported["LargeParty"] && KGC::BATTIE_AUTO_POSITION return 80 + self.index * 592 / $game_party.actors.size else return 80 + self.index * 156 end else return 0 end end end end #¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú #============================================================================== # ¡á Window_Base #============================================================================== class Window_Base < Window #-------------------------------------------------------------------------- # ¡Ü ¿ÀºêÁ§Æ® ÃʱâÈ­ #-------------------------------------------------------------------------- alias initialize_KGC_HPSPAlter_Base initialize def initialize(x, y, width, height) @hpsp_gauge = @@_hpsp_gauge.dup @g_width = @hpsp_gauge.width / 3 @g_height = (@hpsp_gauge.height - 2) / 4 # ¿øÀÇ Ã³¸®¸¦ ½ÇÇà initialize_KGC_HPSPAlter_Base(x, y, width, height) end #-------------------------------------------------------------------------- # ¡Ü °ÔÀÌÁö È­»ó(¸¶½ºÅÍ)¸¦ Ãëµæ #-------------------------------------------------------------------------- def _hpsp_gauge return @@_hpsp_gauge end #-------------------------------------------------------------------------- # ¡Ü °ÔÀÌÁö È­»ó(¸¶½ºÅÍ)¸¦ ¼³Á¤ #-------------------------------------------------------------------------- def _hpsp_gauge=(new_bitmap) @@_hpsp_gauge = new_bitmap @hpsp_gauge.dispose @hpsp_gauge = @@_hpsp_gauge.dup end #-------------------------------------------------------------------------- # ¡Ü °ÔÀÌÁö È­»óÀ» Ãëµæ #-------------------------------------------------------------------------- def hpsp_gauge return @hpsp_gauge end #-------------------------------------------------------------------------- # ¡Ü °ÔÀÌÁö È­»óÀ» ¼³Á¤ #-------------------------------------------------------------------------- def hpsp_gauge=(new_bitmap) @hpsp_gauge = new_bitmap end #-------------------------------------------------------------------------- # ¡Ü Çعæ #-------------------------------------------------------------------------- alias dispose_KGC_HPSPAlter dispose def dispose if @hpsp_gauge != nil @hpsp_gauge.dispose end # ¿øÀÇ Ã³¸®¸¦ ½ÇÇà dispose_KGC_HPSPAlter end #-------------------------------------------------------------------------- # ¡Ü HP ÀÇ ¹¦È­ # actor : ¿¢ÅÍ # x : ¹¦È­Ã³ X ÁÂÇ¥ # y : ¹¦È­Ã³ Y ÁÂÇ¥ # width : ¹¦È­Ã³ÀÇ Æø #-------------------------------------------------------------------------- alias draw_actor_hp_KGC_HPSPAlter draw_actor_hp def draw_actor_hp(actor, x, y, width = 144) draw_actor_hp_gauge(actor, x, y, width) # ¿øÀÇ Ã³¸®¸¦ ½ÇÇà draw_actor_hp_KGC_HPSPAlter(actor, x, y, width) end #-------------------------------------------------------------------------- # ¡Ü SP ÀÇ ¹¦È­ # actor : ¿¢ÅÍ # x : ¹¦È­Ã³ X ÁÂÇ¥ # y : ¹¦È­Ã³ Y ÁÂÇ¥ # width : ¹¦È­Ã³ÀÇ Æø #-------------------------------------------------------------------------- alias draw_actor_sp_KGC_HPSPAlter draw_actor_sp def draw_actor_sp(actor, x, y, width = 144) draw_actor_sp_gauge(actor, x, y, width) # ¿øÀÇ Ã³¸®¸¦ ½ÇÇà draw_actor_sp_KGC_HPSPAlter(actor, x, y, width) end #-------------------------------------------------------------------------- # ¡Ü HP °ÔÀÌÁöÀÇ ¹¦È­ #-------------------------------------------------------------------------- def draw_actor_hp_gauge(actor, x, y, width) # °ÔÀÌÁöÆø °è»ê if $game_temp.in_battle && self.is_a?(Window_BattleStatus) @gs_hp[actor.index] = actor.hp if @gs_hp[actor.index] == nil dx = actor.screen_x + 52 - @g_width dy = y + 27 dx -= 16 unless KGC::HPSP_DRAW_NAME_LUMP gw = @gs_hp[actor.index] * @g_width / actor.maxhp @gw_hp_prev[actor.index] = gw if @gw_hp_prev[actor.index] == nil else @gauge_x = 0 dx, dy = x + width - @g_width - 13, y + 27 gw = actor.hp * @g_width / actor.maxhp end if $game_temp.in_battle dx += KGC::HPSP_HP_POSITION_BATTLE[0] dy += KGC::HPSP_HP_POSITION_BATTLE[1] else dx += KGC::HPSP_HP_POSITION_NOT_BATTLE[0] dy += KGC::HPSP_HP_POSITION_NOT_BATTLE[1] end # ±â¿ï±â ¹¦È­ if KGC::HPSP_GAUGE_SLANT self.contents.fill_rect(dx, dy, @g_width + 7, 6, Color.new(0, 0, 0, 0)) # ¹üÀ§ ¹¦È­ gy = @g_height + 1 (@g_height + 2).times { |i| self.contents.blt(dx + i, dy + gy - i, @hpsp_gauge, Rect.new(0, gy - i, @g_width + 2, 1)) } # º»Ã¼ ¹¦È­ gy -= 1 gy2 = @g_height * 2 + 1 @g_height.times { |i| self.contents.blt(dx + i + 2, dy + gy - i, @hpsp_gauge, Rect.new(@gauge_x, gy2 - i, gw, 1)) } # °¨¼Ò °ÔÀÌÁö ¹¦È­ if $game_temp.in_battle && self.is_a?(Window_BattleStatus) if KGC::HPSP_GAUGE_DECREASE && @gw_hp_prev[actor.index] > gw gw2 = @gw_hp_prev[actor.index] - gw @gw_hp_prev[actor.index] -= 0.3 else gw2 = 0 @gw_hp_prev[actor.index] = 0 end if gw2 > 0 @g_height.times { |i| self.contents.fill_rect(dx + i + gw + 2, dy + gy - i, gw2, 1, KGC::HPSP_GAUGE_DECREASE_COLOR) } end end # Åë»ó ¹¦È­ else self.contents.fill_rect(dx, dy, @g_width + 2, 6, Color.new(0, 0, 0, 0)) self.contents.blt(dx, dy, @hpsp_gauge, Rect.new(0, 0, @g_width + 2, @g_height + 2)) self.contents.blt(dx + 1, dy + 1, @hpsp_gauge, Rect.new(@gauge_x, @g_height + 2, gw, @g_height)) if $game_temp.in_battle && self.is_a?(Window_BattleStatus) if KGC::HPSP_GAUGE_DECREASE && @gw_hp_prev[actor.index] > gw gw2 = @gw_hp_prev[actor.index] - gw self.contents.fill_rect(dx + gw + 1, dy + 1, gw2, @g_height, KGC::HPSP_GAUGE_DECREASE_COLOR) @gw_hp_prev[actor.index] -= 0.3 else @gw_hp_prev[actor.index] = 0 end end end end #-------------------------------------------------------------------------- # ¡Ü SP °ÔÀÌÁöÀÇ ¹¦È­ # actor : ¿¢ÅÍ #-------------------------------------------------------------------------- def draw_actor_sp_gauge(actor, x, y, width) # °ÔÀÌÁöÆø °è»ê if $game_temp.in_battle && self.is_a?(Window_BattleStatus) @gs_sp[actor.index] = actor.sp if @gs_sp[actor.index] == nil dx = actor.screen_x + 52 - @g_width dy = y + 27 dx -= 16 unless KGC::HPSP_DRAW_NAME_LUMP if actor.maxsp > 0 gw = @gs_sp[actor.index] * @g_width / actor.maxsp else gw = 0 end @gw_sp_prev[actor.index] = gw if @gw_sp_prev[actor.index] == nil else @gauge_x = 0 dx, dy = x + width - @g_width - 13, y + 27 if actor.maxsp > 0 gw = actor.sp * @g_width / actor.maxsp else gw = 0 end end if $game_temp.in_battle dx += KGC::HPSP_SP_POSITION_BATTLE[0] dy += KGC::HPSP_SP_POSITION_BATTLE[1] else dx += KGC::HPSP_SP_POSITION_NOT_BATTLE[0] dy += KGC::HPSP_SP_POSITION_NOT_BATTLE[1] end # ±â¿ï±â ¹¦È­ if KGC::HPSP_GAUGE_SLANT self.contents.fill_rect(dx, dy, @g_width + 7, 6, Color.new(0, 0, 0, 0)) # ¹üÀ§ ¹¦È­ gy = @g_height + 1 (@g_height + 2).times { |i| self.contents.blt(dx + i, dy + gy - i, @hpsp_gauge, Rect.new(0, gy - i, @g_width + 2, 1)) } # º»Ã¼ ¹¦È­ gy -= 1 gy2 = @g_height * 3 + 1 @g_height.times { |i| self.contents.blt(dx + i + 2, dy + gy - i, @hpsp_gauge, Rect.new(@gauge_x, gy2 - i, gw, 1)) } # °¨¼Ò °ÔÀÌÁö ¹¦È­ if $game_temp.in_battle && self.is_a?(Window_BattleStatus) if KGC::HPSP_GAUGE_DECREASE && @gw_sp_prev[actor.index] > gw gw2 = @gw_sp_prev[actor.index] - gw @gw_sp_prev[actor.index] -= 0.3 else gw2 = 0 @gw_sp_prev[actor.index] = 0 end if gw2 > 0 @g_height.times { |i| self.contents.fill_rect(dx + i + gw + 2, dy + gy - i, gw2, 1, KGC::HPSP_GAUGE_DECREASE_COLOR) } end end # Åë»ó ¹¦È­ else self.contents.fill_rect(dx, dy, @g_width + 2, 6, Color.new(0, 0, 0, 0)) self.contents.blt(dx, dy, @hpsp_gauge, Rect.new(0, 0, @g_width + 2, @g_height + 2)) self.contents.blt(dx + 1, dy + 1, @hpsp_gauge, Rect.new(@gauge_x, @g_height * 2 + 2, gw, @g_height)) if $game_temp.in_battle && self.is_a?(Window_BattleStatus) if KGC::HPSP_GAUGE_DECREASE && @gw_sp_prev[actor.index] > gw gw2 = @gw_sp_prev[actor.index] - gw self.contents.fill_rect(dx + gw + 1, dy + 1, gw2, @g_height, KGC::HPSP_GAUGE_DECREASE_COLOR) @gw_sp_prev[actor.index] -= 0.3 else @gw_sp_prev[actor.index] = 0 end end end end end #¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú¡Ù¡Ú #============================================================================== # ¡á Window_BattleStatus #============================================================================== class Window_BattleStatus < Window_Base #-------------------------------------------------------------------------- # ¡Ü ¿ÀºêÁ§Æ® ÃʱâÈ­ #-------------------------------------------------------------------------- alias initialize_KGC_HPSPAlter initialize def initialize @hpsp_gauge = @@_hpsp_gauge.dup @g_width = @hpsp_gauge.width / 3 @g_height = (@hpsp_gauge.height - 2) / 4 # °ÔÀÌÁö À§Ä¡ Á¤ÀÇ @gauge_x = @g_width * 2 # °ÔÀÌÁö µ¿±â¿ë @gs_hp, @gs_sp = [], [] # °ÔÀÌÁö ¾Ö´Ï¸ÞÀ̼ǿë @gw_hp_prev, @gw_sp_prev = [], [] $game_party.actors.each { |actor| @gw_hp_prev[actor.index] = actor.hp * @g_width / actor.maxhp @gs_hp[actor.index] = actor.hp @gs_sp[actor.index] = actor.sp if actor.maxsp > 0 @gw_sp_prev[actor.index] = actor.sp * @g_width / actor.maxsp else @gw_sp_prev[actor.index] = 0 end } # ¿øÀÇ Ã³¸®¸¦ ½ÇÇà initialize_KGC_HPSPAlter end #-------------------------------------------------------------------------- # ¡Ü À̸§ÀÇ ¹¦È­ # actor : ¿¢ÅÍ # x : ¹¦È­Ã³ X ÁÂÇ¥ # y : ¹¦È­Ã³ Y ÁÂÇ¥ #-------------------------------------------------------------------------- alias draw_actor_name_KGC_HPSPAlter draw_actor_name def draw_actor_name(actor, x, y) x2 = actor.screen_x - 48 x2 -= 16 unless KGC::HPSP_DRAW_NAME_LUMP # ¿øÀÇ Ã³¸®¸¦ ½ÇÇà draw_actor_name_KGC_HPSPAlter(actor, x2, y) end #-------------------------------------------------------------------------- # ¡Ü ½ºÅ×ÀÌÆ®ÀÇ ¹¦È­ #-------------------------------------------------------------------------- alias draw_actor_state_KGC_HPSPAlter draw_actor_state def draw_actor_state(actor, x, y, width = 120) x2 = actor.screen_x - 48 x2 -= 16 unless KGC::HPSP_DRAW_NAME_LUMP # ¿øÀÇ Ã³¸®¸¦ ½ÇÇà draw_actor_state_KGC_HPSPAlter(actor, x2, y, width) end #-------------------------------------------------------------------------- # ¡Ü HP ÀÇ ¹¦È­ #-------------------------------------------------------------------------- alias draw_actor_hp_KGC_HPSPAlter_in_battle draw_actor_hp def draw_actor_hp(actor, x, y, width = 120) unless KGC::HPSP_DRAW_NAME_LUMP x2 = actor.screen_x - 64 draw_actor_hp_gauge(actor, x2, y, width) return draw_actor_hp_KGC_HPSPAlter_in_battle(actor, x2, y, width) end draw_actor_hp_gauge(actor, x, y, width) mw = width / 2 - 12 cx = [self.contents.text_size(actor.maxhp.to_s).width, mw].min hp_x = actor.screen_x + width - 68 - cx * 2 # HP ¸¦ ¹¦È­ self.contents.font.color = actor.hp == 0 ? knockout_color : actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color if KGC::HPSP_BATTLE_STATUS_SHADOW self.contents.draw_text(hp_x, y, cx, 32, actor.hp.to_s, 2) else self.contents.draw_text(hp_x, y, cx, 32, actor.hp.to_s, 2) end # MaxHP ¸¦ ¹¦È­ self.contents.font.color = normal_color if KGC::HPSP_BATTLE_STATUS_SHADOW self.contents.draw_text(hp_x + cx, y, 12, 32, "/", 1) self.contents.draw_ext(hp_x + cx + 12, y, cx, 32, actor.maxhp.to_s) else self.contents.draw_text(hp_x + cx, y, 12, 32, "/", 1) self.contents.draw_text(hp_x + cx + 12, y, cx, 32, actor.maxhp.to_s) end end #-------------------------------------------------------------------------- # ¡Ü SP ÀÇ ¹¦È­ #-------------------------------------------------------------------------- alias draw_actor_sp_KGC_HPSPAlter_in_battle draw_actor_sp def draw_actor_sp(actor, x, y, width = 120) unless KGC::HPSP_DRAW_NAME_LUMP x2 = actor.screen_x - 64 draw_actor_sp_gauge(actor, x2, y, width) return draw_actor_sp_KGC_HPSPAlter_in_battle(actor, x2, y, width) end draw_actor_sp_gauge(actor, x, y, width) mw = width / 2 - 12 cx = [self.contents.text_size(actor.maxsp.to_s).width, mw].min sp_x = actor.screen_x + width - 68 - cx * 2 # SP ¸¦ ¹¦È­ self.contents.font.color = actor.sp == 0 ? knockout_color : actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color if KGC::HPSP_BATTLE_STATUS_SHADOW self.contents.draw_text(sp_x, y, cx, 32, actor.sp.to_s, 2) else self.contents.draw_text(sp_x, y, cx, 32, actor.sp.to_s, 2) end # MaxSP ¸¦ ¹¦È­ self.contents.font.color = normal_color if KGC::HPSP_BATTLE_STATUS_SHADOW self.contents.draw_text(sp_x + cx, y, 12, 32, "/", 1) self.contents.draw_text(sp_x + cx + 12, y, cx, 32, actor.maxsp.to_s) else self.contents.draw_text(sp_x + cx, y, 12, 32, "/", 1) self.contents.draw_text(sp_x + cx + 12, y, cx, 32, actor.maxsp.to_s) end end #-------------------------------------------------------------------------- # ¡Ü ¸®ÇÁ·¹½¬ #-------------------------------------------------------------------------- alias refresh_KGC_HPSPAlter refresh def refresh $game_party.actors.each_with_index { |actor, i| if @gs_hp[i] != actor.hp if @gw_hp_prev[i] == 0 @gw_hp_prev[i] = @gs_hp[i] * @g_width / actor.maxhp end @gs_hp[i] = actor.hp end if @gs_sp[i] != actor.sp if actor.maxsp > 0 if @gw_sp_prev[i] == 0 @gw_sp_prev[i] = @gs_sp[i] * @g_width / actor.maxsp end else @gw_sp_prev[i] = 0 end @gs_sp[i] = actor.sp end } # ¿øÀÇ Ã³¸®¸¦ ½ÇÇà refresh_KGC_HPSPAlter if KGC::HPSP_DRAW_NAME_LUMP self.contents.font.size = 18 self.contents.font.color = system_color self.contents.draw_text(0, 28, 24, 32, $data_system.words.hp) self.contents.draw_text(0, 56, 24, 32, $data_system.words.sp) self.contents.font.size = 22 self.contents.font.color = normal_color end end #-------------------------------------------------------------------------- # ¡Ü ÇÁ·¹ÀÓ °»½Å #-------------------------------------------------------------------------- alias update_KGC_HPSPAlter update def update # ¿øÀÇ Ã³¸®¸¦ ½ÇÇà update_KGC_HPSPAlter # °ÔÀÌÁö È­»óÀ» È긮´Â @gauge_x -= [@g_width / 20, 1].max @gauge_x = @g_width * 2 if @gauge_x < 0 $game_party.actors.each_with_index { |actor, i| actor_x = i * 160 + 4 w = $imported["LargeParty"] ? 120 - (KGC::LP_MAX_MEMBER - 4) * 32 : 120 draw_actor_hp_gauge(actor, actor_x, 32, w) draw_actor_sp_gauge(actor, actor_x, 64, w) } end end