Já viram qual a arte dessa semana?Exposição dos Artistas #8
1 Respostas   123 Visualizações
0 Membros e 1 Visitante estão vendo este tópico.
when 0 # Homem @body[1] = ["Body01"] @hair[1] = ["hair01"]when 1 # Mulher @body[1] = ["Body01"] @hair[1] = ["hair01"]
#==============================================================================# ** Create_Chars#------------------------------------------------------------------------------# By Valentine#==============================================================================class Create_Chars < Window_Base #-------------------------------------------------------------------------- # * Variáveis Públicas #-------------------------------------------------------------------------- attr_accessor :gender attr_reader :grafiche #-------------------------------------------------------------------------- # * Inicialização dos Objetos #-------------------------------------------------------------------------- def initialize super(150, 130, 340, 210) self.contents = Bitmap.new(width-32, height-32) self.back_opacity = 200 self.visible = false self.active = false @title = Title.new(self, Vocab::TITLE3) @name_box = Text_Box.new(self,60,23,104,10) @create_button = Button.new(self,96,170,Vocab::CREATE_CHAR) {create_char} @next_a = Button.new(self,137,48," > ") {next_gender} @prev_a = Button.new(self,60,48," < ") {prev_gender} @next_b = Button.new(self,137,73," > ") {next_class} unless Config::CHANGE_CLASS @prev_b = Button.new(self,60,73," < ") {prev_class} unless Config::CHANGE_CLASS @next_c = Button.new(self,137,98," > ") {next_hair} @prev_c = Button.new(self,60,98," < ") {prev_hair} @next_d = Button.new(self,137,123," > ") {next_gr} @prev_d = Button.new(self,60,123," < ") {prev_gr} if Config::POINTS == true @str = Button.new(self,270, 48, " + ") {add_status(0)} @dex = Button.new(self,270, 73, " + ") {add_status(1)} @agi = Button.new(self,270, 98, " + ") {add_status(2)} @int = Button.new(self,270, 123, " + ") {add_status(3)} end @grafiche = Grafica.new @current_grp = 0 @current_hair = 0 @closable = true end #-------------------------------------------------------------------------- # * Atualização do Frame #-------------------------------------------------------------------------- def update super @title.update end #-------------------------------------------------------------------------- # * Abrindo Janela #-------------------------------------------------------------------------- def open self.visible = true self.active = true @points = Config::POINTS == true ? Config::START_POINTS : 0 @class_id = $game_actors[1].class_id @parameters = [] for i in 0...4 @parameters[i] = 0 end @gender = 0 @name_box.text = "" @name_box.active = true $scene.erro_text = "" reset_graphic end #-------------------------------------------------------------------------- # * Atualização #-------------------------------------------------------------------------- def refresh self.contents.clear self.contents.font.color = normal_color self.contents.draw_text(1, 0, self.width-8, 32, Vocab::CREATE_NAME) self.contents.draw_text(1, 32, 64, 16, Vocab::CREATE_GENDER) self.contents.draw_text(42, 32, 120, 16, Vocab::GENDER[@gender][0], 1) draw_actor_graphic($game_party.actors[@class_id-1], 102, 127) self.contents.draw_text(1, 49, self.width-8, 32, Vocab::CREATE_CLASS) self.contents.draw_text(42, 49, 120, 32, $data_classes[$game_actors[@class_id].class_id].name, 1) self.contents.draw_text(1, 82, 60, 16, Vocab::CREATE_HAIR) self.contents.draw_text(1, 107, 60, 16, Vocab::CREATE_SPRITE) self.contents.draw_text(180, 25, 120, 32, $data_system.words.str) self.contents.draw_text(180, 50, 120, 32, $data_system.words.dex) self.contents.draw_text(180, 75, 120, 32, $data_system.words.agi) self.contents.draw_text(180, 100, 120, 32, $data_system.words.int) self.contents.draw_text(270, 25, 36, 32, ($game_party.actors[@class_id-1].str + @parameters[0]).to_s, 2) self.contents.draw_text(270, 50, 36, 32, ($game_party.actors[@class_id-1].dex + @parameters[1]).to_s, 2) self.contents.draw_text(270, 75, 36, 32, ($game_party.actors[@class_id-1].agi + @parameters[2]).to_s, 2) self.contents.draw_text(270, 100, 36, 32, ($game_party.actors[@class_id-1].int + @parameters[3]).to_s, 2) self.contents.draw_text(180, 0, self.width-8, 32, "#{Vocab::CREATE_POINTS} #{@points}",0) if Config::POINTS == true self.contents.font.color = Config::ERROR_COLOR self.contents.draw_text(1, 122, self.width-20, 32, $scene.erro_text.to_s, 1) end #-------------------------------------------------------------------------- # * Criando Personagem #-------------------------------------------------------------------------- def create_char # Se digitou menos de 3 caracteres if @name_box.text.strip == "" or @name_box.text.size < 3 $scene.erro_text = Vocab::ERROR_NAME $game_system.se_play($data_system.buzzer_se) refresh return end # Impedir números if @name_box.text =~ /\d/ and Config::ENABLE_NUMBER == false $scene.erro_text = "#{Vocab::ERROR_NUMBER}!" $game_system.se_play($data_system.buzzer_se) refresh return end # Verificar caracteres proibidos unless Config::BLOCK.nil? Config::BLOCK.map do |r| if r =~ @name_box.text.downcase $scene.erro_text = Vocab::ERROR_BLOCK $game_system.se_play($data_system.buzzer_se) refresh return end end end # Verificar se já existe uma herói com o nome escolhido if Network.player_exist?(@name_box.text) == true $scene.erro_text = Vocab::CREATE_ERROR_NAME $game_system.se_play($data_system.buzzer_se) refresh return end $game_guild.leader_name = "" $game_guild.points = 0 $game_party.actors[@class_id-1].gender = @gender $game_party.actors[@class_id-1].points = @points $game_actors[@class_id].str += @parameters[0] $game_actors[@class_id].dex += @parameters[1] $game_actors[@class_id].agi += @parameters[2] $game_actors[@class_id].int += @parameters[3] $game_party.actors[@class_id-1].name = @name_box.text $game_party.actors[@class_id-1].group = Network.group Account.character[$scene.select_char_id-1] = Character.new Account.character[$scene.select_char_id-1].name = @name_box.text Account.character[$scene.select_char_id-1].id = $scene.select_char_id Network.save_account(Network.name) Network.create_mailbox(@name_box.text) $game_temp.char_id = $scene.select_char_id Game_Netplay.autosave(@class_id-1) $scene.select_char_id = 0 Network.load_account(Network.name) on_close end #-------------------------------------------------------------------------- # * Próximo Sexo #-------------------------------------------------------------------------- def next_gender @current_grp = 0 @current_hair = 0 if @gender == 1 @gender = 0 else @gender = 1 end reset_graphic end #-------------------------------------------------------------------------- # * Voltando Sexo #-------------------------------------------------------------------------- def prev_gender @current_grp = 0 @current_hair = 0 if @gender == 1 @gender = 0 else @gender = 1 end reset_graphic end #-------------------------------------------------------------------------- # * Resetando Gráfico #-------------------------------------------------------------------------- def reset_graphic return if @class_id.nil? return if @grafiche.nil? @grafiche.setup @current_grp = 0 @current_hair = 0 $game_actors[@class_id].set_graphic(@grafiche.body[$game_actors[@class_id].class_id][@current_grp]) if @grafiche.hair[$game_actors[@class_id].class_id].nil? $game_actors[@class_id].set_hair(nil) else $game_actors[@class_id].set_hair(@grafiche.hair[$game_actors[@class_id].class_id][@current_hair]) end refresh end #-------------------------------------------------------------------------- # * Próxima Classe #-------------------------------------------------------------------------- def next_class if @class_id < @grafiche.body.size - 1 @class_id += 1 else @class_id = 1 end reset_graphic end #-------------------------------------------------------------------------- # * Voltando Classe #-------------------------------------------------------------------------- def prev_class if @class_id == $data_classes.size - 1 @class_id -= 1 reset_graphic return end if @class_id == 1 @class_id = @grafiche.body.size - 1 reset_graphic return end if @class_id < $data_classes.size - 1 @class_id -= 1 else @class_id = 1 end reset_graphic end #-------------------------------------------------------------------------- # * Próximo Gráfico #-------------------------------------------------------------------------- def next_gr if @current_grp <= @grafiche.body[$game_actors[@class_id].class_id].size-2 @current_grp += 1 @grafiche.setup $game_actors[@class_id].set_graphic(@grafiche.body[$game_actors[@class_id].class_id][@current_grp]) refresh end end #-------------------------------------------------------------------------- # * Voltar Gráfico #-------------------------------------------------------------------------- def prev_gr return if @current_grp == 0 if @current_grp >= @grafiche.body[$game_actors[@class_id].class_id].size-2 @current_grp -= 1 @grafiche.setup $game_actors[@class_id].set_graphic(@grafiche.body[$game_actors[@class_id].class_id][@current_grp]) refresh return end if @current_grp <= @grafiche.body[$game_actors[@class_id].class_id].size-2 @current_grp -= 1 @grafiche.setup $game_actors[@class_id].set_graphic(@grafiche.body[$game_actors[@class_id].class_id][@current_grp]) refresh end end #-------------------------------------------------------------------------- # * Próximo Cabelo #-------------------------------------------------------------------------- def next_hair return if @grafiche.hair[$game_actors[@class_id].class_id].nil? if @current_hair <= @grafiche.hair[$game_actors[@class_id].class_id].size-2 @current_hair += 1 @grafiche.setup $game_actors[@class_id].set_hair(@grafiche.hair[$game_actors[@class_id].class_id][@current_hair]) refresh end end #-------------------------------------------------------------------------- # * Voltar Cabelo #-------------------------------------------------------------------------- def prev_hair return if @current_hair == 0 return if @grafiche.hair[$game_actors[@class_id].class_id].nil? if @current_hair >= @grafiche.hair[$game_actors[@class_id].class_id].size-2 @current_hair -= 1 @grafiche.setup $game_actors[@class_id].set_hair(@grafiche.hair[$game_actors[@class_id].class_id][@current_hair]) refresh return end if @current_hair <= @grafiche.hair[$game_actors[@class_id].class_id].size-2 @current_hair -= 1 @grafiche.setup $game_actors[@class_id].set_hair(@grafiche.hair[$game_actors[@class_id].class_id][@current_hair]) refresh end end #-------------------------------------------------------------------------- # * Aumentar Status #-------------------------------------------------------------------------- def add_status(value) if @points >= 1 @points -= 1 @parameters[value] += 1 refresh end endend