#============================================================================== # Menu Horizontal [XP] #------------------------------------------------------------------------------ # Modifica o menu padr?o do RPG Maker XP e adiciona algumas novas janelas. #------------------------------------------------------------------------------ # Autor: Kyo Panda (http://www.mundorpgmaker.com/) # Atualiza??o: 08/03/2010 # Vers?o: 1.0 #============================================================================== #============================================================================== # Fun??es: #------------------------------------------------------------------------------ # - Muda o estilo do menu padr?o do RPG Maker XP, tornando a escolha de # personagem via horizontal. # - Adiciona o medidor de experi?ncia para o pr?ximo n?vel e as janelas de # nome do mapa, n?mero de passos e tempo de jogo. # - Muda o modo de escolha de comando do menu de palavras para ?cones. # - Possui suporte para grupos grandes (mais de 4 personagens). #============================================================================== #============================================================================== # Hist?rico de vers?es: #------------------------------------------------------------------------------ # Vers?o 1.0 (08/03/2010): # * Primeira vers?o do Menu Horizontal. #============================================================================== #============================================================================== # Como usar: #------------------------------------------------------------------------------ # # #-------------------------------------------------------------------------- # # Instala??o: # #-------------------------------------------------------------------------- # # Cole o script acima do "Main" e abaixo das "Scene_" no Editor de Scripts # do RPG Maker XP. # # #-------------------------------------------------------------------------- # # Configura??o: # #-------------------------------------------------------------------------- # # Configure o script no guia "Configura??o" logo abaixo se julgar necess?rio. #============================================================================== #============================================================================== # PANDA_MH #------------------------------------------------------------------------------ # Este ? o m?dulo que define as configura??es padr?es do Menu Horizontal. #============================================================================== module PANDA_MH #-------------------------------------------------------------------------- # Configura??o #-------------------------------------------------------------------------- # Defina aqui quais menus do Menu Horizontal ser?o utilizados ou n?o. # Defina true para sim e false para n?o. HORIZONTAL_MENU_MAIN = true # Menu Principal HORIZONTAL_MENU_STATUS = true # Menu de Status # Defina aqui quais janelas voc? deseja que estajam vis?veis ou n?o no Menu # Principal. # Defina true para vis?vel e false para invis?vel. MAPNAME_ACTIVE = true # Nome do mapa GOLD_ACTIVE = true # Dinheiro STEPS_ACTIVE = true # Passos TIME_ACTIVE = true # Tempo de jogo # Defina aqui os backgrounds dos menus. # O arquivo deve estar contido na pasta "Graphics/Panoramas". # O nome do arquivo deve estar entre aspas ("") ou ap?strofes (''). # Defina como "" ou '' para n?o utilizar MENU_BACK = "004-CloudySky01" # Menu Principal STATUS_BACK = "003-StarlitSky01" # Menu de Status # Defina aqui o nome da fonte utilizada nos menus. # A fonte ser? lida por ordem de index na array, se a primeira fonte n?o # existir ele procurar? a segunda e assim em diante. MENU_FONT = ["Calibri", "Arial", "Verdana"] # Fonte do Menu Principal MENU_FONT_SIZE = 22 # Tamanho da fonte do Menu Principal STATUS_FONT = ["Calibri", "Arial", "Verdana"] # Fonte do Menu de Status STATUS_FONT_SIZE = 22 # Tamanho da fonte do Menu de Status # Defina aqui os ?cones utilizados no Menu Principal, por index do ?cone. # O arquivo deve estar contido na pasta "Graphics/Icons". # O nome do arquivo deve estar entre aspas ("") ou ap?strofes (''). ITENS_ICON = "032-Item01" # Itens SKILL_ICON = "044-Skill01" # Habilidades EQUIP_ICON = "013-Body01" # Equipamento STATUS_ICON = "045-Skill02" # Status SAVE_ICON = "040-Item09" # Salvar EXIT_ICON = "047-Skill04" # Sair MAPNAME_ICON = "038-Item07" # Nome do mapa GOLD_ICON = "035-Item04" # Dinheiro STEPS_ICON = "020-Accessory05" # Passos TIME_ICON = "039-Item08" # Tempo de jogo # Defina aqui a opacidade dos menus. (0 = Transl?cido, 255 = Opaco) MENU_OPACITY = 200 # Menu Principal STATUS_OPACITY = 200 # Menu de Status # Defina aqui o n?mero de itens existente no menu de comando, para scroll. # Para scripters, n?o mude o valor se deseja apenas as seis op??es padr?es. ITEM_NUMBER = 6 #-------------------------------------------------------------------------- # Fim da configura??o #-------------------------------------------------------------------------- end #============================================================================== # Game_Temp #------------------------------------------------------------------------------ # Esta classe controla dados que n?o s?o salvos pelo jogo, os dados tempor?rios # Pode ser acessada utilizando $game_temp #============================================================================== class Game_Temp #-------------------------------------------------------------------------- # Vari?veis p?blicas #-------------------------------------------------------------------------- attr_accessor :background_bitmap # Bitmap de fundo #-------------------------------------------------------------------------- # Alias da inicializa??o do objeto #-------------------------------------------------------------------------- alias horizontal_menu_initialize initialize #-------------------------------------------------------------------------- # Inicializa??o do objeto #-------------------------------------------------------------------------- def initialize # Roda o m?todo original horizontal_menu_initialize @background_bitmap = Bitmap.new(1, 1) end end #============================================================================== # Scene_Base #------------------------------------------------------------------------------ # Classe superior ? todas as classes Scene_. #============================================================================== class Scene_Base #-------------------------------------------------------------------------- # Processo principal #-------------------------------------------------------------------------- def main start # Inicia o processo perform_transition # Executa a transi??o post_start # Processo p?s-inicializa??o Input.update # Atualiza as informa??es inseridas loop do Graphics.update # Atualiza os gr?ficos Input.update # Atualiza as informa??es inseridas update # Atualiza??o break if $scene != self # Descontinua??o do loop end Graphics.update pre_terminate # Prepara??o para finaliza??o Graphics.freeze # Congelamento dos gr?ficos terminate # Fim end #-------------------------------------------------------------------------- # Inicializa??o do processo #-------------------------------------------------------------------------- def start end #-------------------------------------------------------------------------- # Execu??o da transi??o #-------------------------------------------------------------------------- def perform_transition Graphics.transition(10) end #-------------------------------------------------------------------------- # Processo p?s-inicializa??o #-------------------------------------------------------------------------- def post_start end #-------------------------------------------------------------------------- # Atualiza??o da tela #-------------------------------------------------------------------------- def update end #-------------------------------------------------------------------------- # Prepara??o para finaliza??o #-------------------------------------------------------------------------- def pre_terminate end #-------------------------------------------------------------------------- # Fim do processo #-------------------------------------------------------------------------- def terminate end #-------------------------------------------------------------------------- # Prepara??o do background para uma tela diferente #-------------------------------------------------------------------------- def snapshot_for_background $game_temp.background_bitmap.dispose $game_temp.background_bitmap = Graphics.snap_to_bitmap $game_temp.background_bitmap.blur end #-------------------------------------------------------------------------- # Cria??o do background do menu #-------------------------------------------------------------------------- def create_menu_background @menuback_sprite = Sprite.new @menuback_sprite.bitmap = $game_temp.background_bitmap @menuback_sprite.color.set(16, 16, 16, 128) update_menu_background end #-------------------------------------------------------------------------- # Dispose do background do menu #-------------------------------------------------------------------------- def dispose_menu_background @menuback_sprite.dispose end #-------------------------------------------------------------------------- # Atualiza??o do background do menu #-------------------------------------------------------------------------- def update_menu_background end end #============================================================================== # Vocab #------------------------------------------------------------------------------ # Esta classe controla o vocabul?rio e mensagens do jogo. Algumas mensagens # s?o adquiridas utilizando a vari?vel global $data_system. #============================================================================== module Vocab # N?vel def self.level return "N?vel" end # N?vel (abreviado) def self.level_a return "LV" end # HP (abreviado) def self.hp_a return "HP" end # MP (abreviado) def self.mp_a return "SP" end # Equipamento def self.equip return "Equipamento" end # Frases de status ExpTotal = "Exp" ExpNext = "Next" # Taxa de acerto def self.hit return "Acerto %" end # Taxa de evas?o def self.eva return "Evas?o %" end # Taxa de acerto def self.cri return "Cr?tico %" end # Taxa de sorte def self.odds return "Sorte %" end end #============================================================================== # Window_HorizontalSelectable #------------------------------------------------------------------------------ # Classe que tem a fun??o de gerenciar os movimentos do cursor nas janelas # de sele??o no sentido horizontal. #------------------------------------------------------------------------------ # Autor: Kyo Panda (http://www.mundorpgmaker.com/) # Lan?ado em: 25/01/2010 # Vers?o: 1.0 #============================================================================== class Window_HorizontalSelectable < Window_Base #-------------------------------------------------------------------------- # Vari?veis p?blicas #-------------------------------------------------------------------------- attr_reader :item_max # M?ximo de items attr_reader :row_max # M?ximo de linhas attr_reader :index # Posi??o do cursor attr_reader :help_window # Janela de ajuda #-------------------------------------------------------------------------- # Inicializa??o do objeto # x : coordenada X da janela # y : coordenada Y da janela # width : largura da janela # height : altura da janela # spacing : espa?amento entre items localizados pr?ximos #-------------------------------------------------------------------------- def initialize(x, y, width, height, spacing = 32) @item_max = 1 @row_max = 1 @index = -1 @spacing = spacing super(x, y, width, height) end #-------------------------------------------------------------------------- # Cria??o do conte?do da janela #-------------------------------------------------------------------------- def create_contents self.contents.dispose self.contents = Bitmap.new([width - 32, column_max * 32].max, height - 32) end #-------------------------------------------------------------------------- # Posicionamento do cursor # index : o novo cursor #-------------------------------------------------------------------------- def index=(index) @index = index update_cursor call_update_help end #-------------------------------------------------------------------------- # N?mero de colunas #-------------------------------------------------------------------------- def column_max return (@item_max + @row_max - 1) / @row_max end #-------------------------------------------------------------------------- # Resgate da informa??o da primeira coluna #-------------------------------------------------------------------------- def top_column return self.ox / 24 end #-------------------------------------------------------------------------- # Configura??o da primeira coluna # column : exibi??o da primeira coluna #-------------------------------------------------------------------------- def top_column=(column) column = 0 if column < 0 column = column_max - 1 if column > column_max - 1 self.ox = column * 24 end #-------------------------------------------------------------------------- # M?ximo de colunas em uma p?gina #-------------------------------------------------------------------------- def page_column_max return (self.width - 32) / 24 end #-------------------------------------------------------------------------- # M?ximo de itens em uma p?gina #-------------------------------------------------------------------------- def page_item_max return page_column_max * @row_max end #-------------------------------------------------------------------------- # Resgate da informa??o da ?ltima coluna #-------------------------------------------------------------------------- def bottom_column return top_column + page_column_max - 1 end #-------------------------------------------------------------------------- # Configura??o da ?ltima coluna # column : exibi??o da ?ltima coluna #-------------------------------------------------------------------------- def bottom_column=(column) self.top_column = column - (page_column_max - 1) end #-------------------------------------------------------------------------- # Configura??o do ret?ngulo onde o item ? desenhado # index : n?mero de itens #-------------------------------------------------------------------------- def item_rect(index) rect = Rect.new(0, 0, 0, 0) rect.width = 24 rect.height = (contents.height + @spacing) / @row_max - @spacing rect.x = index / @row_max * 24 rect.y = index % @row_max * (rect.height + @spacing) return rect end #-------------------------------------------------------------------------- # Configura??es da janela de ajuda # help_window : nova janela de ajuda #-------------------------------------------------------------------------- def help_window=(help_window) @help_window = help_window call_update_help end #-------------------------------------------------------------------------- # Verifica??o da possibilidade de movimento do cursor #-------------------------------------------------------------------------- def cursor_movable? return false if (not visible or not active) return false if (index < 0 or index > @item_max or @item_max == 0) return false if (@opening or @closing) return true end #-------------------------------------------------------------------------- # Mover cursor para direita # wrap : permiss?o de wrap #-------------------------------------------------------------------------- def cursor_right(wrap = false) if (@index < @item_max - @row_max) or (wrap and @row_max == 1) @index = (@index + @row_max) % @item_max end end #-------------------------------------------------------------------------- # Mover cursor para esquerda # wrap : permiss?o de wrap #-------------------------------------------------------------------------- def cursor_left(wrap = false) if (@index >= @row_max) or (wrap and @row_max == 1) @index = (@index - @row_max + @item_max) % @item_max end end #-------------------------------------------------------------------------- # Mover cursor para cima # wrap : permiss?o de wrap #-------------------------------------------------------------------------- def cursor_up(wrap = false) if (@row_max >= 2) and (@index < @item_max - 1 or (wrap and page_column_max == 1)) @index = (@index + 1) % @item_max end end #-------------------------------------------------------------------------- # Mover cursor para baixo # wrap : permiss?o de wrap #-------------------------------------------------------------------------- def cursor_down(wrap = false) if (@row_max >= 2) and (@index > 0 or (wrap and page_column_max == 1)) @index = (@index - 1 + @item_max) % @item_max end end #-------------------------------------------------------------------------- # Volta uma p?gina com o cursor #-------------------------------------------------------------------------- def cursor_pagedown if top_column + page_column_max < column_max @index = [@index + page_item_max, @item_max - 1].min self.top_column += page_column_max end end #-------------------------------------------------------------------------- # Avan?a uma p?gina com o cursor #-------------------------------------------------------------------------- def cursor_pageup if top_column > 0 @index = [@index - page_item_max, 0].max self.top_column -= page_column_max end end #-------------------------------------------------------------------------- # Atualiza??o da tela #-------------------------------------------------------------------------- def update super if cursor_movable? last_index = @index if Input.repeat?(Input::DOWN) cursor_down(Input.trigger?(Input::DOWN)) end if Input.repeat?(Input::UP) cursor_up(Input.trigger?(Input::UP)) end if Input.repeat?(Input::RIGHT) cursor_right(Input.trigger?(Input::RIGHT)) end if Input.repeat?(Input::LEFT) cursor_left(Input.trigger?(Input::LEFT)) end if Input.repeat?(Input::R) cursor_pagedown end if Input.repeat?(Input::L) cursor_pageup end if @index != last_index $game_system.se_play($data_system.cursor_se) end end update_cursor call_update_help end #-------------------------------------------------------------------------- # Atualiza??o do cursor #-------------------------------------------------------------------------- def update_cursor if @index < 0 # Se o cursor for menor que 0 self.cursor_rect.empty # Desabilita o cursor else # Ou se o cursor for maior que 0 column = @index / @row_max # Pegue a coluna atual if column < top_column # Aparece na primeira coluna self.top_column = column # A coluna atual se torna uma "scroll" end if column > bottom_column # ? exibida a partir do final self.bottom_column = column # A coluna atual se torna uma "scroll" end rect = item_rect(@index) # Escolhe items que o ret?ngulo pega rect.x -= self.ox # Scroll da posi??o retangular self.cursor_rect = rect # Atualiza??o do cursor retangular end end #-------------------------------------------------------------------------- # Atualiza??o da janela de ajuda #-------------------------------------------------------------------------- def call_update_help if self.active and @help_window != nil update_help end end #-------------------------------------------------------------------------- # Atualiza??o da janela de ajuda (quando hereditariedade est? definida) #-------------------------------------------------------------------------- def update_help end end #============================================================================== # Ellipse #------------------------------------------------------------------------------ # Armazena um objeto el?ptico. #============================================================================== class Ellipse #-------------------------------------------------------------------------- # Vari?veis p?blicas #-------------------------------------------------------------------------- attr_reader :a # A largura do c?rculo attr_reader :b # A altura do c?rculo attr_reader :x # O posicionamento horizontal attr_reader :y # O posicionamento vertical attr_reader :h # O posicionamento horizontal em sua origem attr_reader :k # O posicionamento vertical em sua origem #-------------------------------------------------------------------------- # Inicializa??o do objeto # x : o posicionamento horizontal # y : o posicionamento vertical # a : a largura do c?rculo em sua origem do seu lado # b : a altura do c?rculo em sua origem. Se nil, ? o radius do c?rculo #-------------------------------------------------------------------------- def initialize (x, y, a, b = nil) @x = x @y = y @a = a @b = b.nil? ? a : b @h = x + a @k = y + @b end #-------------------------------------------------------------------------- # Em conjunto? # x : a coordenada horizontal sendo testada # y : a coordenada vertical sendo testada #-------------------------------------------------------------------------- def within? (x, y) x_square = ((x - @h)*(x - @h)).to_f / (@a*@a) y_square = ((y - @k)*(y - @k)).to_f / (@b*@b) # Se "radius" <= 1, ent?o isso deve estar em conjunto com a ellipse return (x_square + y_square) <= 1 end end #============================================================================== # Bitmap #------------------------------------------------------------------------------ # Classe que comanda toda e qualquer imagem exibida no jogo. #------------------------------------------------------------------------------ # Sum?rio de mudan?as: # - Novos m?todos: outiline_ellipse, fill_ellipse e fill_rounded_rect. #============================================================================== class Bitmap #-------------------------------------------------------------------------- # Contorno da elipse # ellipse : a elipse sendo desenhada # width : a largura da barra # colour : a cor do contorno #-------------------------------------------------------------------------- def outline_ellipse (ellipse, colour = font.color, width = 1, steps = 0) # Para organiza??o, define as vari?veis locais a e b para as vari?veis de elipse a, b = ellipse.a, ellipse.b # Usa a aproxima??o de Ramanujan para a circunfer?ncia da elipse steps = Math::PI*(3*(a + b) - Math.sqrt((3*a + b)*(a + 3*b))) if steps == 0 radian_modifier = (2*Math::PI) / steps for i in 0...steps t = (radian_modifier*i) % (2*Math::PI) # Expressada parametricamente: # x = h + acos(t), y = k + bsin(t) : onde t vai de 0 a 2pi x = (ellipse.h + (a*Math.cos(t))) y = (ellipse.k + (b*Math.sin(t))) set_pixel (x, y, colour) end # Refor?a a linha if width > 1 ellipse = Ellipse.new (ellipse.x + 1, ellipse.y + 1, ellipse.a - 1, ellipse.b - 1) outline_ellipse (ellipse, colour, width - 1, steps) end end #-------------------------------------------------------------------------- # Preenche a elipse # ellipse : a elipse sendo desenhada # colour : a cor do contorno #-------------------------------------------------------------------------- def fill_ellipse (ellipse, colour = font.color, steps = 0) # Para organiza??o, define as vari?veis locais a e b para as vari?veis de elipse a, b = ellipse.a, ellipse.b # Usa a aproxima??o de Ramanujan para a circunfer?ncia da elipse steps = Math::PI*(3*(a + b) - Math.sqrt((3*a + b)*(a + 3*b))) if steps == 0 radian_modifier = (2*Math::PI) / steps for i in 0...(steps / 2) t = (radian_modifier*i) % (2*Math::PI) # Expressada parametricamente: # x = h + acos(t), y = k + bsin(t) : onde t vai de 0 a 2pi x = ellipse.h + (a*Math.cos(t)) y = ellipse.k - (b*Math.sin(t)) fill_rect (x, y, 1, 2*(ellipse.k - y), colour) end end #-------------------------------------------------------------------------- # Preenche ret?ngulo circular # rect : o ret?ngulo sendo desenhado # colour : a cor do contorno # w : o n?mero de pixels para cobrir o c?rculo #-------------------------------------------------------------------------- # Usado para preencher ret?ngulos com cantos circulares #-------------------------------------------------------------------------- def fill_rounded_rect (rect, colour = font.color, w = 8) # Desenha o corpo do ret?ngulo fill_rect (rect.x + w, rect.y, rect.width - 2*w, rect.height, colour) # Desenha o ret?ngulo horizontal fill_rect (rect.x, rect.y + w, w, rect.height - 2*w, colour) # Desenha o ret?ngulo vertical x = rect.x + rect.width - w fill_rect (x, rect.y + w, w, rect.height - 2*w, colour) # Faz um c?rculo circle = Ellipse.new (0, 0, w) for i in 0...w for j in 0...w # Canto superior esquerdo set_pixel (rect.x + i, rect.y + j, colour) if circle.within? (i, j) # Canto superior direito set_pixel (rect.x + rect.width - w + i, rect.y + j, colour) if circle.within? (i + w, j) # Canto inferior esquerdo set_pixel (rect.x + i, rect.y + rect.height - w + j, colour) if circle.within? (i, j + w) # Canto inferior direito set_pixel (rect.x + rect.width - w + i, rect.y + rect.height - w + j, colour) if circle.within? (i + w, j + w) end end end end #============================================================================== # Game_Map #------------------------------------------------------------------------------ # Esta classe controla o mapa do jogo. Fun??es como passagem, scroll e loop # s?o definidas aqui. Pode ser acessada utilizando $game_map. #============================================================================== class Game_Map #-------------------------------------------------------------------------- # Converte e carrega o nome do mapa #-------------------------------------------------------------------------- def map_name map_name = load_data("Data/MapInfos.rxdata") return map_name[@map_id].name end end #============================================================================== # Game_Actor #------------------------------------------------------------------------------ # Esta classe controla os personagens do jogo. Ela ? utilizada dentro das # classes Game_Actors ($game_actors) e Game_Party ($game_party). #============================================================================== class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # Pontos de EXP restando para o pr?ximo n?vel #-------------------------------------------------------------------------- def next_rest_exp return @exp_list[@level + 1] > 0 ? (@exp_list[@level + 1] - @exp) : 0 end #-------------------------------------------------------------------------- # Pontos de EXP restando para o pr?ximo n?vel da EXP m?xima #-------------------------------------------------------------------------- def next_max_exp return @exp_list[@level + 1] - @exp_list[@level] end end #============================================================================== # Window_Base #------------------------------------------------------------------------------ # Esta ? a classe superior ? todas as classes de janelas do jogo. #============================================================================== class Window_Base < Window #-------------------------------------------------------------------------- # Configura??o da cor do HP # actor : her?i #-------------------------------------------------------------------------- def hp_color(actor) return knockout_color if actor.hp == 0 return crisis_color if actor.hp < actor.maxhp / 4 return normal_color end #-------------------------------------------------------------------------- # Configura??o da cor do MP # actor : her?i #-------------------------------------------------------------------------- def mp_color(actor) return crisis_color if actor.sp < actor.maxsp / 4 return normal_color end #-------------------------------------------------------------------------- # Exibi??o da EXP # actor : her?i # x : exibe na coordenada X # y : exibe na coordenada Y # width : largura #-------------------------------------------------------------------------- def draw_actor_exp_menu(actor, x, y, width = 120) draw_actor_exp_gauge_menu(actor, x, y, width) xr = x + width - 80 self.contents.font.color = system_color if actor.next_max_exp > 0 self.contents.draw_text(x + 5, y, 40, 24, Vocab::level_a) self.contents.font.color = normal_color self.contents.draw_text(x, y, 50 , 24, actor.level.to_s, 2) self.contents.draw_text(x, y, 59 , 24, ":".to_s, 2) self.contents.draw_text(xr, y, 75 , 24, actor.next_rest_exp_s.to_s, 2) end end #-------------------------------------------------------------------------- # Exibi??o do medidor da EXP # actor : her?i # x : exibe na coordenada X # y : exibe na coordenada Y # width : largura #-------------------------------------------------------------------------- def draw_actor_exp_gauge_menu(actor, x, y, width = 120) max = actor.next_max_exp gw = width * (max - actor.next_rest_exp) / max self.contents.fill_rect(x, y + 24 - 4, width, 6, Color.new(32, 32, 64, 255)) self.contents.fill_rect(x, y + 24 + 1, width, 1, Color.new(132, 132, 164, 255)) self.contents.fill_rect(x + width -1, y + 24 - 4, 1, 6, Color.new(132, 132, 164, 255)) self.contents.fill_rect(x, y + 24 - 4, gw, 6, Color.new(192, 128, 255, 255)) end #-------------------------------------------------------------------------- # Exibi??o do HP # actor : her?i # x : exibe na coordenada X # y : exibe na coordenada Y # width : largura #-------------------------------------------------------------------------- def draw_actor_hp_menu(actor, x, y, width = 120) draw_actor_hp_gauge_menu(actor, x, y, width) self.contents.font.color = system_color self.contents.draw_text(x, y, 30, 24, Vocab::hp_a) self.contents.font.color = hp_color(actor) xr = x + width if width < 120 self.contents.draw_text(xr - 40, y, 40, 24, actor.hp.to_s, 2) else self.contents.draw_text(xr - 90, y, 40, 24, actor.hp.to_s, 2) self.contents.font.color = normal_color self.contents.draw_text(xr - 50, y, 10, 24, "/", 2) self.contents.draw_text(xr - 40, y, 40, 24, actor.maxhp.to_s, 2) end end #-------------------------------------------------------------------------- # Exibi??o do medidor de HP # actor : her?i # x : exibe na coordenada X # y : exibe na coordenada Y # width : largura #-------------------------------------------------------------------------- def draw_actor_hp_gauge_menu(actor, x, y, width = 120) gw = width * actor.hp / actor.maxhp self.contents.fill_rect(x, y + 24 - 4, width, 6, Color.new(32, 32, 64, 255)) self.contents.fill_rect(x, y + 24 + 1, width, 1, Color.new(132, 132, 164, 255)) self.contents.fill_rect(x + width -1, y + 24 - 4, 1, 6, Color.new(132, 132, 164, 255)) self.contents.fill_rect(x, y + 24 - 4, gw, 6, Color.new(240, 192, 64, 255)) end #-------------------------------------------------------------------------- # Exibi??o do MP # actor : her?i # x : exibe na coordenada X # y : exibe na coordenada Y # width : largura #-------------------------------------------------------------------------- def draw_actor_mp_menu(actor, x, y, width = 120) draw_actor_mp_gauge_menu(actor, x, y, width) self.contents.font.color = system_color self.contents.draw_text(x, y, 30, 24, Vocab::mp_a) self.contents.font.color = mp_color(actor) xr = x + width if width < 120 self.contents.draw_text(xr - 40, y, 40, 24, actor.sp.to_s, 2) else self.contents.draw_text(xr - 90, y, 40, 24, actor.sp.to_s, 2) self.contents.font.color = normal_color self.contents.draw_text(xr - 50, y, 10, 24, "/", 2) self.contents.draw_text(xr - 40, y, 40, 24, actor.maxsp.to_s, 2) end end #-------------------------------------------------------------------------- # Exibi??o do medidor de MP # actor : her?i # x : exibe na coordenada X # y : exibe na coordenada Y # width : largura #-------------------------------------------------------------------------- def draw_actor_mp_gauge_menu(actor, x, y, width = 120) gw = width * actor.sp / [actor.maxsp, 1].max self.contents.fill_rect(x, y + 24 - 4, width, 6, Color.new(32, 32, 64, 255)) self.contents.fill_rect(x, y + 24 + 1, width, 1, Color.new(132, 132, 164, 255)) self.contents.fill_rect(x + width -1, y + 24 - 4, 1, 6, Color.new(132, 132, 164, 255)) self.contents.fill_rect(x, y + 24 - 4, gw, 6, Color.new(64, 192, 240, 255)) end #-------------------------------------------------------------------------- # Exibi??o da unidade monet?ria com valor em posse # value : valor em posse # x : exibe na coordenada X # y : exibe na coordenada Y # width : largura #-------------------------------------------------------------------------- def draw_currency_value(value, x, y, width) cx = contents.text_size($data_system.words.gold).width self.contents.font.color = normal_color self.contents.draw_text(x, y, width-cx-2, 24, value.to_s, 2) self.contents.font.color = system_color self.contents.draw_text(x, y, width, 24, $data_system.words.gold, 2) end #-------------------------------------------------------------------------- # Exibi??o do n?mero de passos dados # value : passos # x : exibe na coordenada X # y : exibe na coordenada Y # width : largura #-------------------------------------------------------------------------- def draw_currency_steps_value(value, x, y, width) self.contents.draw_text(x, y, width - 2, 24, value.to_s, 2) end #-------------------------------------------------------------------------- # Exibi??o dos par?metros # actor : her?i # x : exibe na coordenada X # y : exibe na coordenada Y # type : tipo do valor (0~3) #-------------------------------------------------------------------------- def draw_actor_parameter_menu(actor, x, y, type) case type when 0 parameter_name = $data_system.words.atk parameter_value = actor.atk when 1 parameter_name = $data_system.words.pdef parameter_value = actor.pdef when 2 parameter_name = $data_system.words.mdef parameter_value = actor.mdef when 3 parameter_name = $data_system.words.str parameter_value = actor.str when 4 parameter_name = $data_system.words.dex parameter_value = actor.dex when 5 parameter_name = $data_system.words.agi parameter_value = actor.agi when 6 parameter_name = $data_system.words.int parameter_value = actor.int when 7 parameter_name = Vocab.hit parameter_value = actor.hit when 8 parameter_name = Vocab.eva parameter_value = actor.eva end self.contents.font.color = system_color self.contents.draw_text(x, y, 120, 32, parameter_name) self.contents.font.color = normal_color self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s, 2) end end #-------------------------------------------------------------------------- # Defini??o da utiiza??o do Menu Horizontal #-------------------------------------------------------------------------- unless PANDA_MH::HORIZONTAL_MENU_MAIN != true #============================================================================== # Window_MenuCommand #------------------------------------------------------------------------------ # Janela de comandos do menu. #============================================================================== class Window_MenuCommand < Window_HorizontalSelectable #-------------------------------------------------------------------------- # Inclus?o das constantes do m?dulo PANDA_MH #-------------------------------------------------------------------------- include PANDA_MH #-------------------------------------------------------------------------- # Inicializa??o do objeto # x : coordenada X da janela # y : coordenada Y da janela #-------------------------------------------------------------------------- def initialize(x, y) @selection_rect = false @selection_x = 0 super(x, y, 320, 24 + 32) self.active = true self.back_opacity = MENU_OPACITY self.index = 0 # Define @iw (icon width: largura do ?cone) para organiza??o @iw = (320 / 6) - (32 / 6) width = 320 extra_width = (@iw * (ITEM_NUMBER - 6)) if ITEM_NUMBER > 0 width += extra_width end self.contents = Bitmap.new(width - 32, height - 32) self.width = 320 refresh end #-------------------------------------------------------------------------- # Atualiza??o #-------------------------------------------------------------------------- def refresh if @selection_rect color = Color.new(0, 0, 0, 160) self.contents.fill_rect(@selection_x, 0, @iw, 24, color) end @data = [] @data.push(0) @data.push(1) @data.push(2) @data.push(3) @data.push(4) @data.push(5) self.contents.clear @item_max = @data.size for i in 0 .. @item_max draw_item(i) end end #-------------------------------------------------------------------------- # Desenho do item # index : n?mero (ID) do item #-------------------------------------------------------------------------- def draw_item(index, enabled = true) # Define @iw (icon width: largura do ?cone) para organiza??o @iw = (320 / 6) - (32 / 6) case index when 0 # Itens if $game_party.actors.size == 0 icon = RPG::Cache.icon(ITENS_ICON) rect = Rect.new(0, 0, icon.width, icon.height) self.contents.blt(12, 0, icon, rect, 128) else icon = RPG::Cache.icon(ITENS_ICON) rect = Rect.new(0, 0, icon.width, icon.height) self.contents.blt(12, 0, icon, rect) end when 1 # Habilidades if $game_party.actors.size == 0 icon = RPG::Cache.icon(SKILL_ICON) rect = Rect.new(0, 0, icon.width, icon.height) self.contents.blt((@iw) + 12, 0, icon, rect, 128) else icon = RPG::Cache.icon(SKILL_ICON) rect = Rect.new(0, 0, icon.width, icon.height) self.contents.blt((@iw) + 12, 0, icon, rect) end when 2 # Equipamento if $game_party.actors.size == 0 icon = RPG::Cache.icon(EQUIP_ICON) rect = Rect.new(0, 0, icon.width, icon.height) self.contents.blt((2 * @iw) + 12, 0, icon, rect, 128) else icon = RPG::Cache.icon(EQUIP_ICON) rect = Rect.new(0, 0, icon.width, icon.height) self.contents.blt((2 * @iw) + 12, 0, icon, rect) end when 3 # Status if $game_party.actors.size == 0 icon = RPG::Cache.icon(STATUS_ICON) rect = Rect.new(0, 0, icon.width, icon.height) self.contents.blt((3 * @iw) + 12, 0, icon, rect, 128) else icon = RPG::Cache.icon(STATUS_ICON) rect = Rect.new(0, 0, icon.width, icon.height) self.contents.blt((3 * @iw) + 12, 0, icon, rect) end when 4 # Salvar if $game_system.save_disabled icon = RPG::Cache.icon(SAVE_ICON) rect = Rect.new(0, 0, icon.width, icon.height) self.contents.blt((4 * @iw) + 12, 0, icon, rect, 128) else icon = RPG::Cache.icon(SAVE_ICON) rect = Rect.new(0, 0, icon.width, icon.height) self.contents.blt((4 * @iw) + 12, 0, icon, rect) end when 5 # Sair icon = RPG::Cache.icon(EXIT_ICON) rect = Rect.new(0, 0, icon.width, icon.height) self.contents.blt((5 * @iw) + 12, 0, icon, rect) end end #-------------------------------------------------------------------------- # Defini??o do ret?ngulo de sele??o #-------------------------------------------------------------------------- def set_selection_rect(index) @selection_rect = true @selection_x = index * @iw refresh end #-------------------------------------------------------------------------- # Limpar ret?ngulo de sele??o #-------------------------------------------------------------------------- def clear_selection_rect @selection_rect = false refresh end #-------------------------------------------------------------------------- # Atualiza??o do cursor #-------------------------------------------------------------------------- def update_cursor if @index < 0 # Sem cursor self.cursor_rect.empty return end # Adquirir primeira coluna column = @index / @row_max if column < self.top_column self.top_column = column end # Reiniciar para a primeira coluna se no fim da lista if column > self.top_column + (self.page_column_max - 1) self.top_column = column - (self.page_column_max - 1) end x = @index / @row_max * @iw - self.ox # Defini??o do cursor self.cursor_rect.set(x, 0, @iw, 24) end #-------------------------------------------------------------------------- # Resgate da informa??o da primeira coluna #-------------------------------------------------------------------------- def top_column # Define @iw (icon width: largura do ?cone) para organiza??o @iw = (320 / 6) - (32 / 6) return self.ox / @iw end #-------------------------------------------------------------------------- # Configura??o da primeira coluna # column : exibi??o da primeira coluna #-------------------------------------------------------------------------- def top_column=(column) if column < 0 column = 0 end if column > column_max - 1 column = column_max - 1 end self.ox = column * @iw end #-------------------------------------------------------------------------- # M?ximo de colunas em uma p?gina #-------------------------------------------------------------------------- def page_column_max return 6 end end #============================================================================== # Window_MapName #------------------------------------------------------------------------------ # Janela que exibe o nome do mapa no jogo. #============================================================================== class Window_MapName < Window_Base #-------------------------------------------------------------------------- # Inclus?o das constantes do m?dulo PANDA_MH #-------------------------------------------------------------------------- include PANDA_MH #-------------------------------------------------------------------------- # Inicializa??o do objeto # x : coordenada X da janela # y : coordenada Y da janela #-------------------------------------------------------------------------- def initialize(x, y) super(x, y, 320, 24 + 32) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface self.contents.font.size = $fontsize self.active = MAPNAME_ACTIVE self.visible = MAPNAME_ACTIVE self.back_opacity = MENU_OPACITY refresh end #-------------------------------------------------------------------------- # Atualiza??o de tela #-------------------------------------------------------------------------- def update super end #-------------------------------------------------------------------------- # Atualiza??o #-------------------------------------------------------------------------- def refresh self.contents.clear icon = RPG::Cache.icon(MAPNAME_ICON) rect = Rect.new(0, 0, icon.width, icon.height) self.contents.blt(0, 0, icon, rect) self.contents.font.name = MENU_FONT self.contents.font.size = MENU_FONT_SIZE self.contents.draw_text(24 + 8, 0, 320 - 32 - 24 + 8, 24, $game_map.map_name.to_s) end end #============================================================================== # Window_HorizontalMenuStatus #------------------------------------------------------------------------------ # Janela que exibe os status dos membros da equipe no menu. #============================================================================== class Window_HorizontalMenuStatus < Window_HorizontalSelectable #-------------------------------------------------------------------------- # Inclus?o das constantes do m?dulo PANDA_MH #-------------------------------------------------------------------------- include PANDA_MH #-------------------------------------------------------------------------- # Inicializa??o do objeto # x : coordenada X da janela # y : coordenada Y da janela #-------------------------------------------------------------------------- def initialize(x, y) @selection_rect = false @selection_x = 0 super(x, y, 640, 368) self.active = false self.index = -1 self.back_opacity = MENU_OPACITY # Define @fw (face width: largura da face) para organiza??o @fw = 640 / 4 - 8 width = 640 extra_width = (@fw * ($game_party.actors.size - 4)) if $game_party.actors.size > 0 width += extra_width end self.contents = Bitmap.new(width - 32, height - 32) self.width = 640 refresh end #-------------------------------------------------------------------------- # Atualiza??o #-------------------------------------------------------------------------- def refresh self.contents.clear if @selection_rect color = Color.new(0, 0, 0, 160) self.contents.fill_rect(@selection_x, 24, @fw, 96, color) end @item_max = $game_party.actors.size # Define @fw (face width: largura da face) para organiza??o @fw = 640 / 4 - 6 for actor in $game_party.actors # Exibi??o dos nomes dos personagens self.contents.font.color = system_color self.contents.font.name = MENU_FONT self.contents.font.size = MENU_FONT_SIZE self.contents.draw_text(actor.index * @fw - 6, 0, @fw, 24, actor.name, 1) # Exibi??o dos arquivos de gr?fico dos personagens draw_actor_graphic(actor, actor.index * @fw + 72, 96) # Exibi??o das classes dos personagens self.contents.font.color = normal_color self.contents.draw_text(actor.index * @fw - 6, 96 + 24, @fw, 24, actor.class_name, 1) # Exibi??o do estado f?sico dos personagens text = make_battler_state_text(actor, @fw, true) self.contents.font.color = actor.hp == 0 ? knockout_color : normal_color self.contents.draw_text(actor.index * @fw - 6, 24 * 2 + 96, @fw, 24, text, 1) # Exibi??o da n?vel dos personagens draw_actor_exp_menu(actor, actor.index * @fw, 24 * 3 + 96, @fw - 8) # Exibi??o do HP dos personagens draw_actor_hp_menu(actor, actor.index * @fw, 24 * 5 + 96, @fw - 8) # Exibi??o do MP dos personagens draw_actor_mp_menu(actor, actor.index * @fw, 24 * 6 + 96, @fw - 8) end end #-------------------------------------------------------------------------- # Defini??o do ret?ngulo de sele??o #-------------------------------------------------------------------------- def set_selection_rect(index) @selection_rect = true @selection_x = index * @fw refresh end #-------------------------------------------------------------------------- # Limpar ret?ngulo de sele??o #-------------------------------------------------------------------------- def clear_selection_rect @selection_rect = false refresh end #-------------------------------------------------------------------------- # Atualiza??o do cursor #-------------------------------------------------------------------------- def update_cursor if @index < 0 # Sem cursor self.cursor_rect.empty return end # Adquirir primeira coluna column = @index / @row_max if column < self.top_column self.top_column = column end # Reiniciar para a primeira coluna se no fim da lista if column > self.top_column + (self.page_column_max - 1) self.top_column = column - (self.page_column_max - 1) end x = @index / @row_max * @fw - self.ox # Defini??o do cursor self.cursor_rect.set(x, 24, @fw - 6, 96) end #-------------------------------------------------------------------------- # Resgate da informa??o da primeira coluna #-------------------------------------------------------------------------- def top_column # Define @fw (face width: largura da face) para organiza??o @fw = 640 / 4 - 6 return self.ox / @fw end #-------------------------------------------------------------------------- # Configura??o da primeira coluna # column : exibi??o da primeira coluna #-------------------------------------------------------------------------- def top_column=(column) if column < 0 column = 0 end if column > column_max - 1 column = column_max - 1 end self.ox = column * @fw end #-------------------------------------------------------------------------- # M?ximo de colunas em uma p?gina #-------------------------------------------------------------------------- def page_column_max return 4 end end #============================================================================== # Window_MenuGold #------------------------------------------------------------------------------ # Janela respons?vel pela exibi??o do dinheiro no menu. #============================================================================== class Window_MenuGold < Window_Base #-------------------------------------------------------------------------- # Inclus?o das constantes do m?dulo PANDA_MH #-------------------------------------------------------------------------- include PANDA_MH #-------------------------------------------------------------------------- # Inicializa??o do objeto # x : coordenada X da janela # y : coordenada Y da janela #-------------------------------------------------------------------------- def initialize(x, y) super(x, y, 213, 24 + 32) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface self.contents.font.size = $fontsize self.active = GOLD_ACTIVE self.visible = GOLD_ACTIVE self.back_opacity = MENU_OPACITY refresh end #-------------------------------------------------------------------------- # Atualiza??o #-------------------------------------------------------------------------- def refresh self.contents.clear self.contents.font.name = MENU_FONT self.contents.font.size = MENU_FONT_SIZE icon = RPG::Cache.icon(GOLD_ICON) rect = Rect.new(0, 0, icon.width, icon.height) self.contents.blt(0, 0, icon, rect) draw_currency_value($game_party.gold, 0, 0, 213 - 24 - 8) end end #============================================================================== # Window_Steps #------------------------------------------------------------------------------ # Janela respons?vel pela exibi??o dos passos. #============================================================================== class Window_StepsMenu < Window_Base #-------------------------------------------------------------------------- # Inclus?o das constantes do m?dulo PANDA_MH #-------------------------------------------------------------------------- include PANDA_MH #-------------------------------------------------------------------------- # Inicializa??o do objeto # x : coordenada X da janela # y : coordenada Y da janela #-------------------------------------------------------------------------- def initialize(x, y) super(x, y, 214, 24 + 32) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface self.contents.font.size = $fontsize self.active = STEPS_ACTIVE self.visible = STEPS_ACTIVE self.back_opacity = MENU_OPACITY refresh end #-------------------------------------------------------------------------- # Atualiza??o #-------------------------------------------------------------------------- def refresh self.contents.clear icon = RPG::Cache.icon(STEPS_ICON) rect = Rect.new(0, 0, icon.width, icon.height) self.contents.blt(0, 0, icon, rect) self.contents.font.name = MENU_FONT self.contents.font.size = MENU_FONT_SIZE draw_currency_steps_value($game_party.steps, 0, 0, 213 - 24 - 8) end end #============================================================================== # Window_PlayTime #------------------------------------------------------------------------------ # Janela respons?vel pela exibi??o do tempo de jogo. #============================================================================== class Window_PlayTimeMenu < Window_Base #-------------------------------------------------------------------------- # Inclus?o das constantes do m?dulo PANDA_MH #-------------------------------------------------------------------------- include PANDA_MH #-------------------------------------------------------------------------- # Inicializa??o do objeto #-------------------------------------------------------------------------- def initialize(x, y) super(x, y, 213, 24 + 32) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface self.contents.font.size = $fontsize self.active = TIME_ACTIVE self.visible = TIME_ACTIVE self.back_opacity = MENU_OPACITY refresh end #-------------------------------------------------------------------------- # Atualiza??o #-------------------------------------------------------------------------- def refresh self.contents.clear @total_sec = Graphics.frame_count / Graphics.frame_rate hour = @total_sec / 60 / 60 min = @total_sec / 60 % 60 sec = @total_sec % 60 text = sprintf("%02d:%02d:%02d", hour, min, sec) self.contents.font.color = normal_color self.contents.font.name = MENU_FONT self.contents.font.size = MENU_FONT_SIZE icon = RPG::Cache.icon(TIME_ICON) rect = Rect.new(0, 0, icon.width, icon.height) self.contents.blt(0, 0, icon, rect) self.contents.draw_text(0, 0, 213 - 24 - 8, 24, text, 2) end #-------------------------------------------------------------------------- # Atualiza??o da tela #-------------------------------------------------------------------------- def update super if Graphics.frame_count / Graphics.frame_rate != @total_sec refresh end end end #============================================================================== # Scene_Menu #------------------------------------------------------------------------------ # Classe de opera??es na tela do menu. #============================================================================== class Scene_Menu < Scene_Base #-------------------------------------------------------------------------- # Inclus?o das contantes do m?dulo PANDA_MH #-------------------------------------------------------------------------- include PANDA_MH #-------------------------------------------------------------------------- # Cria??o do background do menu #-------------------------------------------------------------------------- unless MENU_BACK == "" or MENU_BACK == '' or MENU_BACK == nil def create_menu_background @menuback_sprite = Plane.new viewport = Viewport.new(0, 0, 640, 480) @menuback_sprite.bitmap = RPG::Cache.panorama(MENU_BACK, 255) update_menu_background end end #-------------------------------------------------------------------------- # Alias da inicializa??o do objeto #-------------------------------------------------------------------------- alias horizontal_menu_initialize initialize #-------------------------------------------------------------------------- # Inicializa??o do objeto # menu_index : posi??o inicial do cursor #-------------------------------------------------------------------------- def initialize(menu_index = 0) @menu_index = menu_index end #-------------------------------------------------------------------------- # Alias da inicializa??o do processo #-------------------------------------------------------------------------- alias horizontal_menu_start start #-------------------------------------------------------------------------- # Inicializa??o do processo #-------------------------------------------------------------------------- def start super create_menu_background create_command_window @mapname_window = Window_MapName.new(320, 0) @status_window = Window_HorizontalMenuStatus.new(0, 56) @gold_window = Window_MenuGold.new(0, 424) @steps_window = Window_StepsMenu.new(213, 424) @playtime_window = Window_PlayTimeMenu.new(427, 424) end #-------------------------------------------------------------------------- # Alias do fim do processo #-------------------------------------------------------------------------- alias horizontal_menu_terminate terminate #-------------------------------------------------------------------------- # Fim do processo #-------------------------------------------------------------------------- def terminate super dispose_menu_background @command_window.dispose @mapname_window.dispose @status_window.dispose @gold_window.dispose @steps_window.dispose @playtime_window.dispose end #-------------------------------------------------------------------------- # Alias da atualiza??o de tela #-------------------------------------------------------------------------- alias horizontal_menu_update update #-------------------------------------------------------------------------- # Atualiza??o da tela #-------------------------------------------------------------------------- def update super update_menu_background @command_window.update @mapname_window.update @status_window.update @gold_window.update @steps_window.update @playtime_window.update if @command_window.active update_command_selection elsif @status_window.active update_actor_selection end end #-------------------------------------------------------------------------- # Cria??o da janela de comandos #-------------------------------------------------------------------------- def create_command_window @command_window = Window_MenuCommand.new(0, 0) @command_window.index = @menu_index if $game_party.actors.size == 0 # Se n?o houver membros na equipe @command_window.draw_item(0, false) # Desabilita "Items" @command_window.draw_item(1, false) # Desabilita "Habilidades" @command_window.draw_item(2, false) # Desabilita "Equipamentos" @command_window.draw_item(3, false) # Desabilita "Status" end if $game_system.save_disabled # Se salvar for proibido @command_window.draw_item(4, false) # Desabilita "Salvar" end end #-------------------------------------------------------------------------- # Atualiza??o da escolha de comando #-------------------------------------------------------------------------- def update_command_selection if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) $scene = Scene_Map.new elsif Input.trigger?(Input::C) if $game_party.actors.size == 0 and @command_window.index < 4 $game_system.se_play($data_system.buzzer_se) return elsif $game_system.save_disabled and @command_window.index == 4 $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) case @command_window.index when 0 # Item $scene = Scene_Item.new when 1, 2, 3 # Habilidades, equipamento, status start_actor_selection when 4 # Salvar $scene = Scene_Save.new when 5 # Fim de jogo $scene = Scene_End.new end end end #-------------------------------------------------------------------------- # In?cio da sele??o de her?i #-------------------------------------------------------------------------- def start_actor_selection @command_window.active = false @status_window.active = true @status_window.index = 0 end #-------------------------------------------------------------------------- # Fim da sele??o de her?i #-------------------------------------------------------------------------- def end_actor_selection @command_window.active = true @status_window.active = false @status_window.index = - 1 end #-------------------------------------------------------------------------- # Atualiza??o da sele??o de her?i #-------------------------------------------------------------------------- def update_actor_selection if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) end_actor_selection elsif Input.trigger?(Input::C) $game_system.se_play($data_system.decision_se) case @command_window.index when 1 # Habilidades $scene = Scene_Skill.new(@status_window.index) when 2 # Equipamento $scene = Scene_Equip.new(@status_window.index) when 3 # Status $scene = Scene_Status.new(@status_window.index) end end end end end # Fim da defini??o #-------------------------------------------------------------------------- # Defini??o da utiiza??o do Menu Horizontal Status #-------------------------------------------------------------------------- unless PANDA_MH::HORIZONTAL_MENU_STATUS != true #============================================================================== # Window_Status #------------------------------------------------------------------------------ # Janela que exibe os status dos personagens. #============================================================================== class Window_Status < Window_Base #-------------------------------------------------------------------------- # Inclus?o das constantes do m?dulo PANDA_MH #-------------------------------------------------------------------------- include PANDA_MH #-------------------------------------------------------------------------- # Alias da inicializa??o do objeto #-------------------------------------------------------------------------- alias horizontal_menu_initialize initialize #-------------------------------------------------------------------------- # Inicializa??o do objeto #-------------------------------------------------------------------------- def initialize(actor) # Roda o m?todo original horizontal_menu_initialize(actor) self.back_opacity = STATUS_OPACITY end #-------------------------------------------------------------------------- # Alias da atualiza??o #-------------------------------------------------------------------------- alias horizontal_menu_status_refresh refresh #-------------------------------------------------------------------------- # Atualiza??o #-------------------------------------------------------------------------- def refresh self.contents.clear # Exibi??o do perfil do her?i draw_actor_profile # Exibi??o da informa??o b?sica do her?i draw_basic_info # Exibi??o dos par?metros do her?i draw_parameters # Exibi??o do equipamento do her?i draw_equipments # Exibi??o de informa??es adicionais draw_extra end #-------------------------------------------------------------------------- # Exibi??o do perfil do her?i #-------------------------------------------------------------------------- def draw_actor_profile # Define @fw (face width: largura da face) para organiza??o @fw = 544 / 4 - 8 # Cria um ret?ngulo rect = Rect.new(0, 0, @fw, 96 + (2 * 24)) # Define o ret?ngulo como circular self.contents.fill_rounded_rect(rect, system_color, 10) # Define novos valores para x e y rect.x, rect.y = rect.x + 2, rect.y + 2 # Define novos valores para largura e altura rect.width, rect.height = rect.width - 4, rect.height - 4 # Define um novo ret?ngulo circular com os novos valores self.contents.fill_rounded_rect(rect, Color.new (0, 0, 0, 0), 10) # Cria um ret?ngulo rect = Rect.new(0, 24, @fw, 96) # Preenche o ret?ngulo self.contents.fill_rect(rect, system_color) # Define novos valores para x e y rect.x, rect.y = rect.x + 2, rect.y + 2 # Define novos valores para largura e altura rect.width, rect.height = rect.width - 4, rect.height - 4 # Define um novo ret?ngulo com os novos valores self.contents.fill_rect(rect, Color.new (0, 0, 0, 0)) # Exibi??o do nome do her?i self.contents.font.name = STATUS_FONT self.contents.font.size = STATUS_FONT_SIZE self.contents.font.color = system_color self.contents.draw_text(0, 0, @fw, 24, @actor.name, 1) # Exibi??o dos arquivos de faces dos personagens bitmap = RPG::Cache.character(@actor.character_name, @actor.character_hue) cw = bitmap.width / 4 ch = bitmap.height / 4 src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(48, 48, bitmap, src_rect) # draw_face(@actor.face_name, @actor.face_index, 16, 24, 96) # Exibi??o do nome da classe do her?i self.contents.font.color = normal_color self.contents.draw_text(0, 96 + 24, @fw, 24, @actor.class_name, 1) end #-------------------------------------------------------------------------- # Exibi??o de informa??es b?sicas # x : exibe na coordenada X # y : exibe na coordenada Y #-------------------------------------------------------------------------- def draw_basic_info # Cria um ret?ngulo rect = Rect.new(@fw + 32 - 16, 0, 640 - (@fw + 32) - 16, 96 + (2 * 24)) # Define o ret?ngulo como circular self.contents.fill_rounded_rect(rect, system_color, 10) # Define novos valores para x e y rect.x, rect.y = rect.x + 2, rect.y + 2 # Define novos valores para largura e altura rect.width, rect.height = rect.width - 4, rect.height - 4 # Define um novo ret?ngulo circular com os novos valores self.contents.fill_rounded_rect(rect, Color.new (0, 0, 0, 0), 10) # Cria um ret?ngulo rect = Rect.new(@fw + 32 - 16, 24, 640 - (@fw + 32) - 16, 96) # Preenche o ret?ngulo self.contents.fill_rect(rect, system_color) # Define novos valores para x e y rect.x, rect.y = rect.x + 2, rect.y + 2 # Define novos valores para largura e altura rect.width, rect.height = rect.width - 4, rect.height - 4 # Define um novo ret?ngulo com os novos valores self.contents.fill_rect(rect, Color.new (0, 0, 0, 0)) # Exibi??o do nome Status self.contents.font.color = system_color self.contents.draw_text(@fw + 32 - 16, 0, 640 - (@fw + 32) - 16, 24, "Status", 1) self.contents.font.color = normal_color # Exibi??o da n?vel dos personagens draw_actor_exp_menu(@actor, @fw + 32, 24, @fw - 8) # Exibi??o do HP dos personagens draw_actor_hp_menu(@actor, @fw + 32, 24 * 2, @fw - 8) # Exibi??o do MP dos personagens draw_actor_mp_menu(@actor, @fw + 32, 24 * 3, @fw - 8) # Exibi??o do estado f?sico dos personagens draw_actor_state(@actor, @fw + 32, 24 * 5 - 4, 640 - (@fw + 32) - 48) # Define a string para a experi?ncia total e restante para o pr?ximo n?vel s1 = @actor.exp_s s2 = @actor.next_rest_exp_s s_next = sprintf(Vocab::ExpNext, Vocab.level) # Exibi??o da experi?ncia total e restante para o pr?ximo n?vel self.contents.font.color = system_color self.contents.draw_text(2 * @fw + 160 , 24, 180, 24, Vocab::ExpTotal) self.contents.draw_text(2 * @fw + 160, 24 * 3, 180, 24, s_next) self.contents.font.color = normal_color self.contents.draw_text(2 * @fw + 160, 24 * 2, 180, 24, s1, 2) self.contents.draw_text(2 * @fw + 160, 24 * 4, 180, 24, s2, 2) end #-------------------------------------------------------------------------- # Exibi??o dos par?metros # x : exibe na coordenada X # y : exibe na coordenada Y #-------------------------------------------------------------------------- def draw_parameters # Cria um ret?ngulo rect = Rect.new(0, 96 + (2 * 24) + 16, 640 / 2 - 24, 480 - (96 + (2 * 24)) - 48 - 80) # Define o ret?ngulo como circular self.contents.fill_rounded_rect(rect, system_color, 10) # Define novos valores para x e y rect.x, rect.y = rect.x + 2, rect.y + 2 # Define novos valores para largura e altura rect.width, rect.height = rect.width - 4, rect.height - 4 # Define um novo ret?ngulo circular com os novos valores self.contents.fill_rounded_rect(rect, Color.new (0, 0, 0, 0), 10) # Cria um ret?ngulo rect = Rect.new(0, 96 + (3 * 24) + 16, 640 / 2 - 24, 2) # Preenche o ret?ngulo self.contents.fill_rect(rect, system_color) # Exibi??o do nome Par?metros self.contents.font.color = system_color self.contents.draw_text(0, 96 + (2 * 24) + 16, 640 / 2 - 24, 24, "Par?metros", 1) self.contents.font.color = normal_color # Exibi??o dos par?metros dos personagens draw_actor_parameter_menu(@actor, 70, 96 + (2 * 24) + 16 + (24 * 1), 0) draw_actor_parameter_menu(@actor, 70, 96 + (2 * 24) + 16 + (24 * 2), 1) draw_actor_parameter_menu(@actor, 70, 96 + (2 * 24) + 16 + (24 * 3), 2) draw_actor_parameter_menu(@actor, 70, 96 + (2 * 24) + 16 + (24 * 4), 3) draw_actor_parameter_menu(@actor, 70, 96 + (2 * 24) + 16 + (24 * 5), 4) draw_actor_parameter_menu(@actor, 70, 96 + (2 * 24) + 16 + (24 * 6), 5) draw_actor_parameter_menu(@actor, 70, 96 + (2 * 24) + 16 + (24 * 7), 6) end #-------------------------------------------------------------------------- # Exibi??o dos equipamentos # x : exibe na coordenada X # y : exibe na coordenada Y #-------------------------------------------------------------------------- def draw_equipments # Cria um ret?ngulo rect = Rect.new(640 / 2 - 8, 96 + (2 * 24) + 16, 640 / 2 - 24, 480 - (96 + (5 * 24)) - 48 - 64) # Define o ret?ngulo como circular self.contents.fill_rounded_rect(rect, system_color, 10) # Define novos valores para x e y rect.x, rect.y = rect.x + 2, rect.y + 2 # Define novos valores para largura e altura rect.width, rect.height = rect.width - 4, rect.height - 4 # Define um novo ret?ngulo circular com os novos valores self.contents.fill_rounded_rect(rect, Color.new (0, 0, 0, 0), 10) # Cria um ret?ngulo rect = Rect.new(640 / 2 - 8, 96 + (3 * 24) + 16, 640 / 2 - 24, 2) # Preenche o ret?ngulo self.contents.fill_rect(rect, system_color) # Exibi??o do nome Equipamento self.contents.font.color = system_color self.contents.draw_text(640 / 2 - 8, 96 + (2 * 24) + 16, 640 / 2 - 24, 24, Vocab.equip, 1) # Exibi??o dos nomes dos tipos de equipamentos self.contents.draw_text(640 / 2 - 8 + 16, 96 + (3 * 24) + 16, 640 / 2 - 24 - 172, 24, $data_system.words.weapon + ":") self.contents.draw_text(640 / 2 - 8 + 16, 96 + (4 * 24) + 16, 640 / 2 - 24 - 172, 24, $data_system.words.armor1 + ":") self.contents.draw_text(640 / 2 - 8 + 16, 96 + (5 * 24) + 16, 640 / 2 - 24 - 172, 24, $data_system.words.armor2 + ":") self.contents.draw_text(640 / 2 - 8 + 16, 96 + (6 * 24) + 16, 640 / 2 - 24 - 172, 24, $data_system.words.armor3 + ":") self.contents.draw_text(640 / 2 - 8 + 16, 96 + (7 * 24) + 16, 640 / 2 - 24 - 172, 24, $data_system.words.armor4 + ":") # Exibi??o dos equipamentos do her?i draw_item_name($data_weapons[@actor.weapon_id], 640 - 172 - 48, (96 + (2 * 24) + 16) + 24 * (0 + 1)) draw_item_name($data_armors[@actor.armor1_id], 640 - 172 - 48, (96 + (2 * 24) + 16) + 24 * (1 + 1)) draw_item_name($data_armors[@actor.armor2_id], 640 - 172 - 48, (96 + (2 * 24) + 16) + 24 * (2 + 1)) draw_item_name($data_armors[@actor.armor3_id], 640 - 172 - 48, (96 + (2 * 24) + 16) + 24 * (3 + 1)) draw_item_name($data_armors[@actor.armor4_id], 640 - 172 - 48, (96 + (2 * 24) + 16) + 24 * (4 + 1)) end #-------------------------------------------------------------------------- # Exibi??o das informa??es adicional #-------------------------------------------------------------------------- def draw_extra # Cria um ret?ngulo rect = Rect.new(640 / 2 - 8, 2 * (96 + (2 * 24) + 20) + 64, 640 / 2 - 24, 480 - (2 * (96 + (5 * 24) - 36)) - 64) # Define o ret?ngulo como circular self.contents.fill_rounded_rect(rect, system_color, 10) # Define novos valores para x e y rect.x, rect.y = rect.x + 2, rect.y + 2 # Define novos valores para largura e altura rect.width, rect.height = rect.width - 4, rect.height - 4 # Define um novo ret?ngulo circular com os novos valores self.contents.fill_rounded_rect(rect, Color.new (0, 0, 0, 0), 10) # Cria um ret?ngulo rect = Rect.new(640 / 2 - 8, 2 * (96 + (2 * 24) + 20) + 24 + 64, 640 / 2 - 24, 2) # Preenche o ret?ngulo self.contents.fill_rect(rect, system_color) self.contents.font.color = system_color self.contents.draw_text(640 / 2 - 8, 2 * (96 + (2 * 24) + 20) + 64, 640 / 2 - 24, 24, "Pressione", 1) self.contents.draw_text(640 / 2 - 8, 2 * (96 + (2 * 24) + 20) + 24 + 4 + 64, 640 / 2 - 24, 24, " Anterior | Pr?ximo ", 1) end end #============================================================================== # Scene_Status #------------------------------------------------------------------------------ # Classe de opera??es na tela de status. #============================================================================== class Scene_Status < Scene_Base #-------------------------------------------------------------------------- # Inclus?o das contantes do m?dulo PANDA_MH #-------------------------------------------------------------------------- include PANDA_MH #-------------------------------------------------------------------------- # Cria??o do background do menu #-------------------------------------------------------------------------- unless STATUS_BACK == "" or STATUS_BACK == '' or STATUS_BACK == nil def create_menu_background @menuback_sprite = Plane.new viewport = Viewport.new(0, 0, 640, 480) @menuback_sprite.bitmap = RPG::Cache.panorama(STATUS_BACK, 255) update_menu_background end end #-------------------------------------------------------------------------- # Inicializa??o do objeto # actor_index : index do her?i #-------------------------------------------------------------------------- def initialize(actor_index = 0) @actor_index = actor_index end #-------------------------------------------------------------------------- # Inicializa??o do processo #-------------------------------------------------------------------------- def start super create_menu_background @actor = $game_party.actors[@actor_index] @status_window = Window_Status.new(@actor) end #-------------------------------------------------------------------------- # Fim do processo #-------------------------------------------------------------------------- def terminate super dispose_menu_background @status_window.dispose end #-------------------------------------------------------------------------- # Retornar ? tela original #-------------------------------------------------------------------------- def return_scene $scene = Scene_Menu.new(3) end #-------------------------------------------------------------------------- # Troca para a tela do pr?ximo her?i #-------------------------------------------------------------------------- def next_actor @actor_index += 1 @actor_index %= $game_party.actors.size $scene = Scene_Status.new(@actor_index) end #-------------------------------------------------------------------------- # Troca para a tela do her?i anterior #-------------------------------------------------------------------------- def prev_actor @actor_index += $game_party.actors.size - 1 @actor_index %= $game_party.actors.size $scene = Scene_Status.new(@actor_index) end #-------------------------------------------------------------------------- # Atualiza??o #-------------------------------------------------------------------------- def update update_menu_background @status_window.update if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) return_scene elsif Input.trigger?(Input::R) $game_system.se_play($data_system.cursor_se) next_actor elsif Input.trigger?(Input::L) $game_system.se_play($data_system.cursor_se) prev_actor elsif Input.trigger?(Input::RIGHT) $game_system.se_play($data_system.cursor_se) next_actor elsif Input.trigger?(Input::LEFT) $game_system.se_play($data_system.cursor_se) prev_actor end super end end end