# XRXS_BP 7. Ʋ ͽŬ ver.2 # by ޾ #============================================================================== # Ŀ͸ Ʈ #============================================================================== module XRXS_BP7 # # Ʋ ͽ ١ # HIDE = false # # ġ ء(0: 㡡1:߾ӡ2: ) # ALIGN = 0 # # Ȯϴ [:~κ] # MAX = 4 end #============================================================================== # Window_BattleStatus #============================================================================== class Window_BattleStatus < Window_Base #-------------------------------------------------------------------------- # Ʈ ʱȭ #-------------------------------------------------------------------------- alias xrxs_bp7_initialize initialize def initialize # ʱȭ @previous_hp = [] @previous_sp = [] @previous_states = [] # ȯŲ xrxs_bp7_initialize # if XRXS_BP7::HIDE self.opacity = 0 self.back_opacity = 0 end end #-------------------------------------------------------------------------- # [] #-------------------------------------------------------------------------- def refresh # /--- # [ȭ ó] # ϴ , (ֹ ó ̱ 氨) @item_max = $game_party.actors.size bool = false for i in 0...@item_max actor = $game_party.actors[i] if (@previous_hp[i] != actor.hp) or (@previous_sp[i] != actor.sp) or (@previous_states[i] != actor.states) bool = true # @previous_hp[i] = actor.hp @previous_sp[i] = actor.sp @previous_states[i] = actor.states.dup end end return unless bool # # # ---/ self.contents.clear @item_max = $game_party.actors.size for i in 0...$game_party.actors.size actor = $game_party.actors[i] width = [self.width*3/4 / XRXS_BP7::MAX, 80].max space = self.width / XRXS_BP7::MAX case XRXS_BP7::ALIGN when 0 actor_x = i * space + 4 when 1 actor_x = (space * ((XRXS_BP7::MAX - $game_party.actors.size)/2.0 + i)).floor when 2 actor_x = (i + XRXS_BP7::MAX - $game_party.actors.size) * space + 4 end actor_x += self.x # Ʋ ͽ draw_battlestatus(i, actor_x, width) end end #-------------------------------------------------------------------------- # ۹Ʋ ͽ #-------------------------------------------------------------------------- def draw_battlestatus(i, x, width) actor = $game_party.actors[i] # ij ׷ draw_actor_graphic(actor, x + 7, 116) # HP/SP draw_actor_hp_meter_line(actor, x+16, 72, width*4/5, 12) draw_actor_sp_meter_line(actor, x+16, 104, width*4/5, 12) # HPġ self.contents.font.size = 24 # HP/SPġ ũ self.contents.font.color = Color.new(0,0,0,192) self.contents.draw_text(x+16, 60, width*3/4, 24, actor.hp.to_s, 2) self.contents.font.color = actor.hp == 0 ? knockout_color : actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color self.contents.draw_text(x+14, 58, width*3/4, 24, actor.hp.to_s, 2) # SPġ self.contents.font.color = Color.new(0,0,0,192) self.contents.draw_text(x+16, 92, width*3/4, 24, actor.sp.to_s, 2) self.contents.font.color = actor.maxsp == 0 ? disabled_color : actor.sp == 0 ? knockout_color : actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color self.contents.draw_text(x+14, 90, width*3/4, 24, actor.sp.to_s, 2) # HP SP self.contents.font.size = 12 # HP/SP ũ self.contents.font.color = Color.new(0,0,0,192) self.contents.draw_text(x+18, 62, 96, 12, $data_system.words.hp) self.contents.draw_text(x+18, 94, 96, 12, $data_system.words.sp) self.contents.font.color = system_color # HP/SP self.contents.draw_text(x+16, 60, 96, 12, $data_system.words.hp) self.contents.draw_text(x+16, 92, 96, 12, $data_system.words.sp) # Ʈ draw_actor_state(actor, x+16, 100) end end #============================================================================== # Window_Base #============================================================================== class Window_Base < Window #-------------------------------------------------------------------------- # HP ȭ #-------------------------------------------------------------------------- def draw_actor_hp_meter_line(actor, x, y, width = 156, height = 4) w = width * actor.hp / actor.maxhp color_0 = Color.new( 0, 0, 0, 128) color_1 = Color.new(255, 0, 0, 192) color_2 = Color.new(255, 255, 0, 192) self.contents.fill_rect(x+8, y+4, width, (height/4).floor, color_0) self.contents.draw_line(x, y, x + w, y, color_1, (height/4).floor, color_2) x -= 1 y += (height/4).floor self.contents.fill_rect(x+8, y+4, width, (height/4).ceil, color_0) self.contents.draw_line(x, y, x + w, y, color_1, (height/4).ceil , color_2) x -= 1 y += (height/4).ceil self.contents.fill_rect(x+8, y+4, width, (height/4).ceil, color_0) self.contents.draw_line(x, y, x + w, y, color_1, (height/4).ceil , color_2) x -= 1 y += (height/4).ceil self.contents.fill_rect(x+8, y+4, width, (height/4).floor, color_0) self.contents.draw_line(x, y, x + w, y, color_1, (height/4).floor, color_2) end #-------------------------------------------------------------------------- # SP ȭ #-------------------------------------------------------------------------- def draw_actor_sp_meter_line(actor, x, y, width = 156, height = 4) return if actor.maxsp == 0 w = width * actor.sp / actor.maxsp color_0 = Color.new( 0, 0, 0, 128) color_1 = Color.new( 0, 0, 255, 192) color_2 = Color.new( 0, 255, 255, 192) self.contents.fill_rect(x+8, y+4, width, (height/4).floor, color_0) self.contents.draw_line(x, y, x + w, y, color_1, (height/4).floor, color_2) x -= 1 y += (height/4).floor self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , color_0) self.contents.draw_line(x, y, x + w, y, color_1, (height/4).ceil , color_2) x -= 1 y += (height/4).ceil self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , color_0) self.contents.draw_line(x, y, x + w, y, color_1, (height/4).ceil , color_2) x -= 1 y += (height/4).ceil self.contents.fill_rect(x+8, y+4, width, (height/4).floor, color_0) self.contents.draw_line(x, y, x + w, y, color_1, (height/4).floor, color_2) end #-------------------------------------------------------------------------- # ̸ ȭ #-------------------------------------------------------------------------- alias xrxs_bp7_draw_actor_name draw_actor_name def draw_actor_name(actor, x, y) xrxs_bp7_draw_actor_name(actor, x, y) if @draw_ban != true end #-------------------------------------------------------------------------- # Ʈ ȭ #-------------------------------------------------------------------------- alias xrxs_bp7_draw_actor_state draw_actor_state def draw_actor_state(actor, x, y, width = 120) xrxs_bp7_draw_actor_state(actor, x, y, width) if @draw_ban != true end #-------------------------------------------------------------------------- # HP ȭ #-------------------------------------------------------------------------- alias xrxs_bp7_draw_actor_hp draw_actor_hp def draw_actor_hp(actor, x, y, width = 144) xrxs_bp7_draw_actor_hp(actor, x, y, width) if @draw_ban != true end #-------------------------------------------------------------------------- # ܺ ̺귯 #-------------------------------------------------------------------------- alias xrxs_bp7_draw_actor_sp draw_actor_sp def draw_actor_sp(actor, x, y, width = 144) xrxs_bp7_draw_actor_sp(actor, x, y, width) if @draw_ban != true end end #============================================================================== # OCu #============================================================================== class Bitmap #-------------------------------------------------------------------------- # ۶ ȭ by ޾ #-------------------------------------------------------------------------- def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color) # Ÿ .ū distance = (start_x - end_x).abs + (start_y - end_y).abs # if end_color == start_color for i in 1..distance x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i if width == 1 self.set_pixel(x, y, start_color) else self.fill_rect(x, y, width, width, start_color) end end else for i in 1..distance x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i r = start_color.red * (distance-i)/distance + end_color.red * i/distance g = start_color.green * (distance-i)/distance + end_color.green * i/distance b = start_color.blue * (distance-i)/distance + end_color.blue * i/distance a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance if width == 1 self.set_pixel(x, y, Color.new(r, g, b, a)) else self.fill_rect(x, y, width, width, Color.new(r, g, b, a)) end end end end end