Kingartur2 Posted November 19, 2009 Share Posted November 19, 2009 (edited) Nome Script DescrizioneAggiunge numerose funzioni alla scene_debug tra le quali quella di cambiare gli attributi deipersonaggi, di cambiare oggetti,armi,armature e denaro o di teletrasportarsi in una mappa specifica e altreancora AutoreRTH tradotto da kingartur2 AllegatiN/AIstruzioni per l'usoMettete lo script sopra main ################################################################################ ################################################################################ ########################### RTH_New_Debug ######################################### ################################################################################ ################################################################################ #=============================================================================== # Criado por Renan Tsuneo Hangai Junior #=============================================================================== # Permite ter um scene_debug com mais opções, ajudando no desenvolvimento de seu # jogo # Para chamar o Scene_Debug aperte a tecla F9 #=============================================================================== $RTHScript = {} if $RTHScript.nil? $RTHScript["New_Debug"] = true class Scene_Debug #-------------------------------------------------------------------------- # - Método Inicial #-------------------------------------------------------------------------- def initialize(index=0) @index = index end #-------------------------------------------------------------------------- # - Método Principal #-------------------------------------------------------------------------- def main @help_window = Window_Help.new @debug_commands = Window_Degub_Commands.new @debug_commands.index = @index @debug_commands.help_window = @help_window @debug_left = Window_New_DebugLeft.new(0) @debug_left.active = false @debug_left.visible = false @debug_switches = Window_DebugRight.new @debug_switches.y = 128 @debug_switches.visible = false @debug_switches.active = false @debug_variables = Window_DebugRight.new @debug_variables.y = 128 @debug_variables.mode = 1 @debug_variables.visible = false @debug_variables.active = false @debug_maps = Window_Map_Select.new @debug_maps.visible = false @debug_maps.active = false @debug_select_map = Debug_Map.new @debug_select_map.visible = false @debug_select_map.active = false @debug_gold_window = Window_Gold.new @debug_gold_window.visible = false @debug_gold_window.z = 9999 @debug_gold_window.x = 320 - (@debug_gold_window.width / 2) @debug_gold_window.y = 240 - (@debug_gold_window.height / 2) @debug_items = Window_Deubg_Party.new(0) @debug_armors = Window_Deubg_Party.new(1) @debug_weapons = Window_Deubg_Party.new(2) @debug_call_scene = Window_Debug_Call_Scene.new @debug_call_scene.visible = false @debug_party_heros_window = Window_Debug_Party_Herois.new @debug_party_heros_window.visible = false @debug_party_heros_window.active = false @debug_heros_window = Window_Debug_Herois.new @debug_heros_window.visible = false @debug_heros_window.active = false @debug_atributes = Window_Debug_Party_Herois.new @debug_atributes.visible = false @debug_atributes.active = false @debug_change_atributes = Window_Debug_Hero_Atributes.new(1) @debug_change_atributes.visible = false @debug_change_atributes.active = false @debug_monster_fight = Window_Debug_Troop_Select.new @debug_monster_fight.visible = false @debug_monster_fight.active = false Graphics.transition(20) while $scene == self Graphics.update Input.update update end Graphics.freeze $game_map.need_refresh = true for txt in self.instance_variables next if txt.nil? eval("#{txt}.dispose if (#{txt}.is_a?(Window) or #{txt}.is_a?(Sprite)) and !#{txt}.disposed?") end @debug_select_map.dispose end #-------------------------------------------------------------------------- # - Atualização da scene #-------------------------------------------------------------------------- def update @help_window.update if @debug_commands.active update_degub_commands elsif @debug_left.visible update_debug_left elsif @debug_maps.active update_map_select elsif @debug_select_map.active update_place_select elsif @debug_gold_window.visible update_debug_gold elsif @debug_items.active update_debug_items elsif @debug_armors.active update_debug_armors elsif @debug_weapons.active update_debug_weapons elsif @debug_call_scene.visible while @debug_call_scene.visible Graphics.update Teclas_Input.update update_call_scene end elsif @debug_heros_window.active or @debug_party_heros_window.active update_change_party elsif @debug_atributes.active or @debug_change_atributes.active update_change_atrib elsif @debug_monster_fight.active update_monster_fight end end #-------------------------------------------------------------------------- # - Atualização da janela de seleção de comandos #-------------------------------------------------------------------------- def update_degub_commands @debug_commands.update if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) $scene = Scene_Map.new return end if Input.trigger?(Input::C) $game_system.se_play($data_system.decision_se) case @debug_commands.index when 0 @debug_commands.active = false @debug_commands.visible = false @debug_left.tipo = 0 @debug_left.index = 0 @debug_left.active = true @debug_left.visible = true @debug_switches.active = false @debug_switches.visible = true @help_window.height = 128 text1 = "C (Intro) : Ativar / Desativar" @help_window.contents.dispose @help_window.contents = nil @help_window.contents = Bitmap.new(@help_window.width - 32, @help_window.height - 32) @help_window.contents.draw_text(4, 0, 406, 32, text1) when 1 @debug_commands.active = false @debug_commands.visible = false @debug_left.tipo = 1 @debug_left.index = 0 @debug_left.active = true @debug_left.visible = true @debug_variables.active = false @debug_variables.visible = true @help_window.height = 128 @help_window.contents.dispose @help_window.contents = nil @help_window.contents = Bitmap.new(@help_window.width - 32, @help_window.height - 32) text1 = "← : -1 → : +1" text2 = "Q : -10" text3 = "W : +10" @help_window.contents.draw_text(4, 0, 406, 32, text1) @help_window.contents.draw_text(4, 32, 406, 32, text2) @help_window.contents.draw_text(4, 64, 406, 32, text3) when 2 @debug_commands.active = false @debug_gold_window.visible = true when 3 @debug_commands.active = false @debug_commands.visible = false @debug_maps.visible = true @debug_maps.active = true when 4 @debug_items.index = 0 @debug_commands.active = false @debug_commands.visible = false @debug_items.visible = true @debug_items.active = true @help_window.height = 128 @help_window.contents.dispose @help_window.contents = nil @help_window.contents = Bitmap.new(@help_window.width - 32, @help_window.height - 32) text1 = "← : -1 → : +1" text2 = "Q : -10" text3 = "W : +10" @help_window.contents.draw_text(4, 0, 406, 32, text1) @help_window.contents.draw_text(4, 32, 406, 32, text2) @help_window.contents.draw_text(4, 64, 406, 32, text3) when 5 @debug_armors.index = 0 @debug_armors.visible = true @debug_armors.active = true @debug_commands.active = false @debug_commands.visible = false @help_window.height = 128 @help_window.contents.dispose @help_window.contents = nil @help_window.contents = Bitmap.new(@help_window.width - 32, @help_window.height - 32) text1 = "← : -1 → : +1" text2 = "Q : -10" text3 = "W : +10" @help_window.contents.draw_text(4, 0, 406, 32, text1) @help_window.contents.draw_text(4, 32, 406, 32, text2) @help_window.contents.draw_text(4, 64, 406, 32, text3) when 6 @debug_weapons.index = 0 @debug_commands.active = false @debug_commands.visible = false @debug_weapons.visible = true @debug_weapons.active = true @debug_weapons.index = 0 @help_window.height = 128 @help_window.contents.dispose @help_window.contents = nil @help_window.contents = Bitmap.new(@help_window.width - 32, @help_window.height - 32) text1 = "← : -1 → : +1" text2 = "Q : -10" text3 = "W : +10" @help_window.contents.draw_text(4, 0, 406, 32, text1) @help_window.contents.draw_text(4, 32, 406, 32, text2) @help_window.contents.draw_text(4, 64, 406, 32, text3) when 7 @debug_commands.active = false @debug_commands.visible = false @debug_party_heros_window.active = true @debug_party_heros_window.visible = true @debug_party_heros_window.index = 0 @debug_heros_window.visible = true @debug_heros_window.index = -1 when 8 @debug_commands.active = false @debug_commands.visible = false @debug_atributes.active = true @debug_atributes.visible = true @debug_atributes.index = 0 @debug_change_atributes.visible = true when 9 @debug_commands.active = false @debug_commands.visible = false @debug_monster_fight.active = true @debug_monster_fight.visible = true @debug_monster_fight.index = 0 when 10 @debug_commands.active = false @debug_commands.visible = false @debug_call_scene.visible = true when 11 $scene = Scene_Map.new end end end #-------------------------------------------------------------------------- # - Atualização da janela de seleção de variaveis ou switchse #-------------------------------------------------------------------------- def update_debug_left @debug_left.update if @debug_switches.visible update_debug_switches elsif @debug_variables.visible update_debug_variables end end #-------------------------------------------------------------------------- # - Atualização da janela de switches #-------------------------------------------------------------------------- def update_debug_switches @debug_switches.update @debug_switches.top_id = @debug_left.top_id if Input.trigger?(Input::C) $game_system.se_play($data_system.decision_se) if @debug_switches.active sid = @debug_switches.top_id + @debug_switches.index $game_switches[sid] = (not $game_switches[sid]) @debug_switches.refresh else @debug_switches.active = true @debug_switches.index = 0 @debug_left.active = false end elsif Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) if @debug_switches.active @debug_switches.active = false @debug_left.active = true else @debug_commands.active = true @debug_commands.visible = true @debug_left.active = false @debug_left.visible = false @debug_switches.active = false @debug_switches.visible = false @help_window.height = 64 @help_window.contents.dispose @help_window.contents = nil @help_window.contents = Bitmap.new(@help_window.width - 32, @help_window.height - 32) end end end #-------------------------------------------------------------------------- # - Atualização das escolhas de variáveis #-------------------------------------------------------------------------- def update_debug_variables @debug_variables.update @debug_variables.top_id = @debug_left.top_id vid = @debug_variables.top_id + @debug_variables.index if Input.trigger?(Input::C) $game_system.se_play($data_system.decision_se) if !@debug_variables.active @debug_variables.active = true @debug_variables.index = 0 @debug_left.active = false end elsif Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) if @debug_variables.active @debug_variables.active = false @debug_left.active = true else @debug_commands.active = true @debug_commands.visible = true @debug_left.active = false @debug_left.visible = false @debug_variables.active = false @debug_variables.visible = false @help_window.height = 64 @help_window.contents.dispose @help_window.contents = nil @help_window.contents = Bitmap.new(@help_window.width - 32, @help_window.height - 32) end elsif Input.repeat?(Input::LEFT) $game_system.se_play($data_system.cursor_se) $game_variables[vid] = [[$game_variables[vid] - 1, -99999999].max, 99999999].min @debug_variables.refresh elsif Input.repeat?(Input::RIGHT) $game_system.se_play($data_system.cursor_se) $game_variables[vid] = [[$game_variables[vid] + 1, -99999999].max, 99999999].min @debug_variables.refresh elsif Input.repeat?(Input::L) $game_system.se_play($data_system.cursor_se) $game_variables[vid] = [[$game_variables[vid] - 10, -99999999].max, 99999999].min @debug_variables.refresh elsif Input.repeat?(Input::R) $game_system.se_play($data_system.cursor_se) $game_variables[vid] = [[$game_variables[vid] + 10, -99999999].max, 99999999].min @debug_variables.refresh end end #-------------------------------------------------------------------------- # - Atualização das escolhas dos mapas #-------------------------------------------------------------------------- def update_map_select @debug_maps.update if Input.trigger?(Input::C) Graphics.freeze $game_system.se_play($data_system.decision_se) @help_window.visible = false @debug_maps.active = false @debug_maps.visible = false @debug_select_map.map_id = @debug_maps.map_id @debug_select_map.active = true @debug_select_map.visible = true Graphics.transition(20) return end if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @debug_maps.active = false @debug_maps.visible = false @debug_commands.active = true @debug_commands.visible = true return end end #-------------------------------------------------------------------------- # - Atualização das escolhas do local no mapa #-------------------------------------------------------------------------- def update_place_select @debug_select_map.update if Input.trigger?(Input::C) $game_system.se_play($data_system.decision_se) $game_map.setup(@debug_select_map.map_id) $game_player.moveto(*@debug_select_map.pos) $scene = Scene_Map.new return end if Input.trigger?(Input::B) Graphics.freeze $game_system.se_play($data_system.cancel_se) @help_window.visible = true @debug_select_map.active = false @debug_select_map.visible = false @debug_maps.active = true @debug_maps.visible = true Graphics.transition(20) return end end #-------------------------------------------------------------------------- # - Atualização das escolhas do local no mapa #-------------------------------------------------------------------------- def update_debug_gold @debug_gold_window.update if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @debug_gold_window.visible = false @debug_commands.active = true @debug_commands.visible = true return elsif Input.repeat?(Input::LEFT) $game_system.se_play($data_system.cursor_se) if Input.trigger?(Input::LEFT) $game_party.lose_gold(1) @count = 0 @debug_gold_window.refresh return end @count += 1 rate = (@count > 30 ? 500 : @count > 15 ? 100 : 10) $game_party.lose_gold(rate) @debug_gold_window.refresh elsif Input.repeat?(Input::RIGHT) $game_system.se_play($data_system.cursor_se) if Input.trigger?(Input::RIGHT) $game_party.gain_gold(1) @count = 0 @debug_gold_window.refresh return end @count += 1 rate = (@count > 30 ? 500 : @count > 15 ? 100 : 10) $game_party.gain_gold(rate) @debug_gold_window.refresh end end #-------------------------------------------------------------------------- # - Atualização das escolhas dos items #-------------------------------------------------------------------------- def update_debug_items @debug_items.update if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @debug_commands.active = true @debug_commands.visible = true @debug_items.active = false @debug_items.visible = false @help_window.height = 64 @help_window.contents.dispose @help_window.contents = nil @help_window.contents = Bitmap.new(@help_window.width - 32, @help_window.height - 32) return elsif Input.repeat?(Input::LEFT) if $game_party.item_number(@debug_items.index + 1) - 1 < 0 $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.cursor_se) $game_party.gain_item((@debug_items.index + 1), -1) @debug_items.refresh elsif Input.repeat?(Input::RIGHT) if $game_party.item_number(@debug_items.index + 1) + 1 > 99 $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.cursor_se) $game_party.gain_item((@debug_items.index + 1), 1) @debug_items.refresh elsif Input.repeat?(Input::L) if $game_party.item_number(@debug_items.index + 1) - 10 < 0 $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.cursor_se) $game_party.gain_item(@debug_items.index + 1, -10) @debug_items.refresh elsif Input.repeat?(Input::R) if $game_party.item_number(@debug_items.index + 1) + 10 > 99 $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.cursor_se) $game_party.gain_item((@debug_items.index + 1), 10) @debug_items.refresh end end #-------------------------------------------------------------------------- # - Atualização das escolhas das Armaduras #-------------------------------------------------------------------------- def update_debug_armors @debug_armors.update if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @debug_commands.active = true @debug_commands.visible = true @debug_armors.active = false @debug_armors.visible = false @help_window.height = 64 @help_window.contents.dispose @help_window.contents = nil @help_window.contents = Bitmap.new(@help_window.width - 32, @help_window.height - 32) return elsif Input.repeat?(Input::LEFT) if $game_party.armor_number(@debug_armors.index + 1) - 1 < 0 $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.cursor_se) $game_party.gain_armor((@debug_armors.index + 1), -1) @debug_armors.refresh elsif Input.repeat?(Input::RIGHT) if $game_party.armor_number(@debug_armors.index + 1) + 1 > 99 $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.cursor_se) $game_party.gain_armor((@debug_armors.index + 1), 1) @debug_armors.refresh elsif Input.repeat?(Input::L) if $game_party.armor_number(@debug_armors.index + 1) - 10 < 0 $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.cursor_se) $game_party.gain_armor(@debug_armors.index + 1, -10) @debug_armors.refresh elsif Input.repeat?(Input::R) if $game_party.armor_number(@debug_armors.index + 1) + 10 > 99 $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.cursor_se) $game_party.gain_armor((@debug_armors.index + 1), 10) @debug_armors.refresh end end #-------------------------------------------------------------------------- # - Atualização das escolhas das Armaduras #-------------------------------------------------------------------------- def update_debug_weapons @debug_weapons.update if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @debug_commands.active = true @debug_commands.visible = true @debug_weapons.active = false @debug_weapons.visible = false @help_window.height = 64 @help_window.contents.dispose @help_window.contents = nil @help_window.contents = Bitmap.new(@help_window.width - 32, @help_window.height - 32) return elsif Input.repeat?(Input::LEFT) if $game_party.weapon_number(@debug_weapons.index + 1) - 1 < 0 $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.cursor_se) $game_party.gain_weapon((@debug_weapons.index + 1), -1) @debug_weapons.refresh elsif Input.repeat?(Input::RIGHT) if $game_party.weapon_number(@debug_weapons.index + 1) + 1 > 99 $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.cursor_se) $game_party.gain_weapon((@debug_weapons.index + 1), 1) @debug_weapons.refresh elsif Input.repeat?(Input::L) if $game_party.weapon_number(@debug_weapons.index + 1) - 10 < 0 $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.cursor_se) $game_party.gain_weapon(@debug_weapons.index + 1, -10) @debug_weapons.refresh elsif Input.repeat?(Input::R) if $game_party.weapon_number(@debug_weapons.index + 1) + 10 > 99 $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.cursor_se) $game_party.gain_weapon((@debug_weapons.index + 1), 10) @debug_weapons.refresh end end #-------------------------------------------------------------------------- # - Atualização das escolhas das Armaduras #-------------------------------------------------------------------------- def update_call_scene @help_window.set_text("Digita il nome della scena senza il '.new' ESC - Esci ENTER - Conferma") @help_window.update @debug_call_scene.update pre_text = @debug_call_scene.text.dup if Teclas_Input.trigger?(Teclas_Input::Enter) begin eval("nscene = #{@debug_call_scene.text}.new") rescue $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) eval("$scene = #{@debug_call_scene.text}.new") @debug_call_scene.visible = false elsif Teclas_Input.trigger?(Teclas_Input::Esc) $game_system.se_play($data_system.cancel_se) @debug_commands.active = true @debug_commands.visible = true @debug_call_scene.visible = false @debug_call_scene.text = "" return elsif Teclas_Input.repeat?(8) unless @debug_call_scene.can_delete? $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.cursor_se) @debug_call_scene.delete_last return elsif Teclas_Input.repeat?(Teclas_Input::Underscore) $game_system.se_play($data_system.cursor_se) @debug_call_scene.text += (Teclas_Input.press?(Teclas_Input::Shift) ? "_" : "-") end for letra, valor in Teclas_Input::Letters if Teclas_Input.repeat?(valor) $game_system.se_play($data_system.cursor_se) @debug_call_scene.text += (Teclas_Input.press?(Teclas_Input::Shift) ? letra.upcase : letra.downcase) break end end if pre_text == @debug_call_scene.text for number, valor in Teclas_Input::Numberpad if Teclas_Input.repeat?(valor) $game_system.se_play($data_system.cursor_se) @debug_call_scene.text += number.to_s break end end end if pre_text == @debug_call_scene.text for number, valor in Teclas_Input::Numberkeys if Teclas_Input.repeat?(valor) $game_system.se_play($data_system.cursor_se) @debug_call_scene.text += number.to_s break end end end end def update_change_party @debug_party_heros_window.update @debug_heros_window.update if Input.trigger?(Input::C) if @debug_party_heros_window.active $game_system.se_play($data_system.decision_se) @debug_party_heros_window.active = false @debug_heros_window.active = true @debug_heros_window.index = 0 elsif @debug_heros_window.active if @debug_heros_window.actor_id <= 0 and @debug_party_heros_window.actor_id > 0 if $game_party.actors.size <= 1 $game_system.se_play($data_system.buzzer_se) return end end $game_system.se_play($data_system.decision_se) $game_party.remove_actor(@debug_party_heros_window.actor_id) if @debug_party_heros_window.actor_id > 0 $game_party.add_actor(@debug_heros_window.actor_id) if @debug_heros_window.actor_id > 0 @debug_party_heros_window.active = true @debug_heros_window.active = false @debug_heros_window.index = -1 @debug_heros_window.refresh @debug_party_heros_window.refresh end elsif Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) if @debug_heros_window.active @debug_party_heros_window.active = true @debug_heros_window.active = false @debug_heros_window.index = -1 elsif @debug_party_heros_window.active @debug_party_heros_window.active = false @debug_party_heros_window.visible = false @debug_heros_window.active = false @debug_heros_window.visible = false @debug_commands.active = true @debug_commands.visible = true end end end def update_change_atrib @debug_atributes.update @debug_change_atributes.update @debug_change_atributes.actor_id = @debug_atributes.actor_id if @debug_atributes.actor_id > 0 if Input.trigger?(Input::C) if @debug_change_atributes.active == false if @debug_atributes.actor_id <= 0 $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) @debug_change_atributes.actor_id = @debug_atributes.actor_id @debug_change_atributes.index = 0 @debug_change_atributes.active = true @debug_atributes.active = false end elsif Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) if @debug_change_atributes.active @debug_change_atributes.active = false @debug_atributes.active = true else @debug_change_atributes.active = false @debug_change_atributes.visible = false @debug_atributes.active = false @debug_atributes.visible = false @debug_commands.active = true @debug_commands.visible = true end elsif @debug_change_atributes.active if Input.repeat?(Input::LEFT) $game_system.se_play($data_system.cursor_se) if Input.trigger?(Input::LEFT) eval("$game_actors[#{@debug_atributes.actor_id}].#{@debug_change_atributes.status} -= 1") @debug_change_atributes.refresh @debug_atributes.refresh @count = 0 return end @count += 1 rate = (@count > 30 ? 500 : @count > 15 ? 100 : 10) eval("$game_actors[#{@debug_atributes.actor_id}].#{@debug_change_atributes.status} -= rate") @debug_change_atributes.refresh @debug_atributes.refresh elsif Input.repeat?(Input::RIGHT) $game_system.se_play($data_system.cursor_se) if Input.trigger?(Input::RIGHT) eval("$game_actors[#{@debug_atributes.actor_id}].#{@debug_change_atributes.status} += 1") @debug_change_atributes.refresh @debug_atributes.refresh @count = 0 return end @count += 1 rate = (@count > 30 ? 500 : @count > 15 ? 100 : 10) eval("$game_actors[#{@debug_atributes.actor_id}].#{@debug_change_atributes.status} += rate") @debug_change_atributes.refresh @debug_atributes.refresh end end end def update_monster_fight @debug_monster_fight.update if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) @debug_commands.active = true @debug_commands.visible = true @debug_monster_fight.active = false @debug_monster_fight.visible = false return end if Input.trigger?(Input::C) call_battle(@debug_monster_fight.troop_id) end end def call_battle(troop_id) if $data_troops[troop_id] != nil $game_temp.battle_abort = true $game_temp.battle_troop_id = troop_id $game_temp.battle_can_escape = true $game_temp.battle_can_lose = true $game_temp.battle_calling = false $game_player.make_encounter_count $game_temp.map_bgm = $game_system.playing_bgm $game_system.bgm_stop $game_system.se_play($data_system.battle_start_se) $game_system.bgm_play($game_system.battle_bgm) $scene = Scene_Battle.new end end end class Window_Debug_Troop_Select < Window_Selectable def initialize super(0, 64, 640, 480 - 64) @troops = $data_troops.dup @item_max = @troops.size @column_max = 1 self.contents = Bitmap.new(self.width - 32, @item_max * 32) refresh end def refresh self.contents.clear y = 0 @data = [] for troop in @troops next if troop.nil? @data.push(troop) self.contents.draw_text(4, y, 640 - 32, 32, troop.name) y += 32 end end def troop_id return @data[self.index].id end end class Window_New_DebugLeft < Window_DebugLeft #-------------------------------------------------------------------------- # - Inicialização dos Objetos #-------------------------------------------------------------------------- def initialize(tipo) @tipo = tipo super() self.x = 0 self.y = 128 self.height = 480 - 128 end #-------------------------------------------------------------------------- # - Atualização #-------------------------------------------------------------------------- def refresh if self.contents != nil self.contents.dispose self.contents = nil end @switch_max = ($data_system.switches.size - 1 + 9) / 10 @variable_max = ($data_system.variables.size - 1 + 9) / 10 @item_max = (@tipo == 0 ? @switch_max : @variable_max) self.contents = Bitmap.new(width - 32, @item_max * 32) self.contents.font.name = $fontface self.contents.font.size = $fontsize if @tipo == 0 for i in 0...@switch_max text = sprintf("I [%04d-%04d]", i*10+1, i*10+10) self.contents.draw_text(4, i * 32, 152, 32, text) end else for i in 0...@variable_max text = sprintf("V [%04d-%04d]", i*10+1, i*10+10) self.contents.draw_text(4, i * 32, 152, 32, text) end end end def tipo=(valor) return if @tipo == valor @tipo = valor refresh end #-------------------------------------------------------------------------- # - Mostrar opções do ID #-------------------------------------------------------------------------- def top_id return (self.index * 10 + 1) end end class Window_Debug_Party_Herois < Window_Selectable def initialize super(0, 64, 320, 480-64) @item_max = 4 self.contents = Bitmap.new(self.width - 32, self.height - 32) refresh end def refresh self.contents.clear for i in 0...$game_party.actors.size x = 44 y = i * 96 actor = $game_party.actors[i] draw_actor_graphic(actor, x - 20, y + 80) draw_actor_name(actor, x + 32, y) draw_actor_level(actor, x + 150, y) draw_actor_hp(actor, x + 32, y + 25) draw_actor_sp(actor, x + 32, y + 50) end end def update_cursor_rect if @index < 0 self.cursor_rect.empty return end row = @index / @column_max self.top_row = (row < self.top_row ? row : row > self.top_row + (self.page_row_max - 1) ? row - (self.page_row_max - 1) : self.top_row) cursor_width = self.width / @column_max - 32 x = @index % @column_max * (cursor_width + 32) y = @index / @column_max * 96 - self.oy self.cursor_rect.set(x, y, cursor_width, 96) end def actor_id return $game_party.actors[self.index].nil? ? 0 : $game_party.actors[self.index].id end def top_row return self.oy / 96 end def top_row=(row) row = [[row, 0].max, row_max - 1].min self.oy = row * 96 end def page_row_max return (self.height - 32) / 96 end def page_item_max return page_row_max * @column_max end end class Window_Debug_Herois < Window_Selectable def initialize super(320, 64, 320, 480-64) self.active = true self.visible = true self.index = 0 refresh end def refresh @item_max = $data_actors.size - $game_party.actors.size if self.contents != nil self.contents.dispose self.contents = nil end self.contents = Bitmap.new(self.width - 32, @item_max * 96) a = 0 @data = [] for i in 0..$data_actors.size if i == $data_actors.size self.contents.draw_text(0, (a * 96) + 32, 320-32, 32, "Remover", 1) next end next if $data_actors[i].nil? actor = $game_actors[i] next if actor.nil? next if $game_party.actors.include?(actor) @data.push(actor) x = 44 y = a * 96 draw_actor_graphic(actor, x - 20, y + 80) draw_actor_name(actor, x + 32, y) draw_actor_level(actor, x + 150, y) draw_actor_hp(actor, x + 32, y + 25) draw_actor_sp(actor, x + 32, y + 50) a += 1 end end def actor_id return @data[self.index].nil? ? 0 : @data[self.index].id end def update_cursor_rect if @index < 0 self.cursor_rect.empty return end row = @index / @column_max self.top_row = (row < self.top_row ? row : row > self.top_row + (self.page_row_max - 1) ? row - (self.page_row_max - 1) : self.top_row) cursor_width = self.width / @column_max - 32 x = @index % @column_max * (cursor_width + 32) y = @index / @column_max * 96 - self.oy self.cursor_rect.set(x, y, cursor_width, 96) end def top_row return self.oy / 96 end def top_row=(row) row = [[row, 0].max, row_max - 1].min self.oy = row * 96 end def page_row_max return (self.height - 32) / 96 end def page_item_max return page_row_max * @column_max end end class Window_Debug_Hero_Atributes < Window_Selectable def initialize(actor_id) super(320, 64, 320, 480 - 64) @item_max = 9 @actor = $game_actors[actor_id] @atributos = ["level", "hp", "sp", "maxhp", "maxsp", "str", "dex", "agi", "int"] @commands = ["Livello", "HP", "SP", "Max-HP", "Max-MP", $data_system.words.str, $data_system.words.dex, $data_system.words.agi, $data_system.words.int] self.contents = Bitmap.new(self.width - 32, @item_max * 32) refresh end def actor_id=(valor) return if @actor.id == valor @actor = $game_actors[valor] refresh end def status return @atributos[self.index] end def refresh self.contents.clear for i in 0...@commands.size text = @commands[i] text2 = "" eval("text2 = @actor.#{@atributos[i]}.to_s") y = i * 32 self.contents.draw_text(4, y, 320-36, 32, text) self.contents.draw_text(4, y, 320-36, 32, text2, 1) end end end class Window_Degub_Commands < Window_Selectable def initialize super(0, 64, 640, 480 - 64) s1 = ["Switches", "Permette di modificare le switch"] s2 = ["Variabili", "Permette di cambiare i valori delle variabili"] s3 = ["Denaro", "Permette di modificare il denaro del personaggio"] s4 = ["Mappe", "Permette di teletrasportarsi in una mappa precisa"] s5 = ["Oggetti", "Permette di cambiare gli oggetti posseduti"] s6 = ["Protezioni", "Permette di cambiare le protezioni possedute"] s7 = ["Armi", "Permette di cambiare le armi possedute"] s8 = ["Gruppo", "Permette di cambiare il gruppo"] s9 = ["Parametri", "Permette di cambiare i parametri dei personaggi"] s10 = ["Battaglia", "Permette di povare delle battaglie"] s11 = ["Chiama scena", "Permette di cambiare una scena"] s12 = ["Esci", "Esci"] @commands = [] @help_texts = [] for i in 1..12 eval("@commands.push(s#{i}[0])") eval("@help_texts.push(s#{i}[1])") end self.contents = Bitmap.new(self.width - 32, @commands.size * 32) @item_max = @commands.size @column_max = 1 self.active = true self.visible = true refresh end def update_help if @help_window != nil if self.active @help_window.set_text(@help_texts[self.index]) end end end def refresh self.contents.clear for i in 0...@commands.size draw_item(i) end end def draw_item(id) self.contents.draw_text(4, id * 32, self.contents.width, 32, @commands[id]) end end class Window_Deubg_Party < Window_Selectable def initialize(tipo) super(0, 128, 640, 480 - 128) @tipo = tipo @names = ["$data_items", "$data_armors", "$data_weapons"] @numbers = ["item_number", "armor_number", "weapon_number"] self.index = -1 self.active = false self.visible = false @column_max = 1 refresh end def refresh if self.contents != nil self.contents.dispose self.contents = nil end @data = [] @array = [] eval("@array = #{@names[@tipo]}") for item in @array next if item.nil? @data.push(item) end @item_max = @data.size self.contents = Bitmap.new(self.width - 32, @item_max * 32) for i in 0...@data.size draw_item(i) end end def draw_item(id) item = @data[id] if item == nil return end bitmap = RPG::Cache.icon(item.icon_name) x = 4 y = id * 32 self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24)) self.contents.font.color = normal_color self.contents.draw_text(x + 28, y, 212, 32, item.name) eval("self.contents.draw_text(x + 28, y, 640 - 68, 32, $game_party.#{@numbers[@tipo]}(id + 1).to_s, 2)") end def item_id return @data[self.index].id end end class Window_Map_Select < Window_Command def initialize @mapas = load_data("Data/MapInfos.rxdata") @commands = [] @data = [] for i in 1..@mapas.keys.size map = @mapas[i] next if map.nil? @commands.push(map.name) @data.push(i) end @item_max = @commands.size @column_max = 1 super(640, @commands) self.height = 480 - 64 self.y = 64 refresh end def map_id return @data[self.index] end end class Debug_Map attr_reader :active attr_reader :visible #-------------------------------------------------------------------------- # - Inicialização dos Objetos #-------------------------------------------------------------------------- def initialize(id=0) @active = false if @active.nil? @visible = false if @visible.nil? @map = Game_Map.new return if id == 0 @map.mmsetup(id) # Criar pontos de vista @viewport1 = Viewport.new(0, 0, 640, 480) @viewport2 = Viewport.new(0, 0, 640, 480) @viewport3 = Viewport.new(0, 0, 640, 480) @viewport2.z = 200 @viewport3.z = 50000 @bitmap_select = Sprite.new(@viewport3) @bitmap_select.bitmap = Bitmap.new(32, 32) @bitmap_select.bitmap.fill_rect(0, 0, 32, 32, Color.new(255, 255, 255)) @bitmap_select.bitmap.fill_rect(2, 2, 28, 28, Color.new(0, 0, 0, 0)) @bitmap_select.z = 50000 @bsx = 0 @bsy = 0 # Aqui é criado um tilemap que comporta o tileset e seus autotiles @tilemap = Tilemap.new(@viewport1) @tilemap.tileset = RPG::Cache.tileset(@map.tileset_name) for i in 0..6 autotile_name = @map.autotile_names[i] @tilemap.autotiles[i] = RPG::Cache.autotile(autotile_name) end @tilemap.map_data = @map.data @tilemap.priorities = @map.priorities # Aqui é criado um plano para o Panorama @panorama = Plane.new(@viewport1) @panorama.z = -1000 # Aqui é criado outro plano, para a Névoa @fog = Plane.new(@viewport1) @fog.z = 3000 @bitmap_select.visible = self.active update end #-------------------------------------------------------------------------- # - Exibição #-------------------------------------------------------------------------- def dispose if @bitmap_select.nil? return end @bitmap_select.dispose # Disposição do Tilemap @tilemap.tileset.dispose for i in 0..6 @tilemap.autotiles[i].dispose end @tilemap.dispose # Disposição do plano do Panorama @panorama.dispose # Disposição do plano da Névoa @fog.dispose # Disposição dos pontos de vista @viewport1.dispose @viewport2.dispose @viewport3.dispose end def map_id=(valor) dispose initialize(valor) end def map_id return @map.map_id end def active return @active end def active=(valor) @active = valor @bitmap_select.visible = valor unless @bitmap_select.nil? end def visible=(valor) @visible = valor @tilemap.visible = valor unless @tilemap.nil? @bitmap_select.visible = valor unless @bitmap_select.nil? end def pos return [@bsx, @bsy] end #-------------------------------------------------------------------------- # - Atualização do Frame #-------------------------------------------------------------------------- def update @bitmap_select.update @bitmap_select.visible = @active if @active if Input.repeat?(Input::LEFT) @bsx = [[@bsx - 1, 0].max, (@map.width - 1)].min elsif Input.repeat?(Input::RIGHT) @bsx = [[@bsx + 1, 0].max, (@map.width - 1)].min end if Input.repeat?(Input::UP) @bsy = [[@bsy - 1, 0].max, (@map.height - 1)].min elsif Input.repeat?(Input::DOWN) @bsy = [[@bsy + 1, 0].max, (@map.height - 1)].min end nx = (0 - @tilemap.ox) + (@bsx * 32) ny = (0 - @tilemap.oy) + (@bsy * 32) if nx > 640 - 32 @tilemap.ox += 32 elsif nx < 0 @tilemap.ox -= 32 end if ny > 480 - 32 @tilemap.oy += 32 elsif ny < 0 @tilemap.oy -= 32 end @bitmap_select.x = (0 - @tilemap.ox) + (@bsx * 32) @bitmap_select.y = (0 - @tilemap.oy) + (@bsy * 32) end # Se o Panorama for diferente do atual if @panorama_name != @map.panorama_name or @panorama_hue != @map.panorama_hue @panorama_name = @map.panorama_name @panorama_hue = @map.panorama_hue if @panorama.bitmap != nil @panorama.bitmap.dispose @panorama.bitmap = nil end if @panorama_name != "" @panorama.bitmap = RPG::Cache.panorama(@panorama_name, @panorama_hue) end Graphics.frame_reset end @tilemap.update @viewport1.tone = $game_screen.tone @viewport1.ox = $game_screen.shake @viewport3.color = $game_screen.flash_color @viewport1.update @viewport3.update end end class Window_Debug_Call_Scene < Window_Base attr_accessor :text def initialize super(0, 480 / 2 - 64, 640, 64) @text = "" self.contents = Bitmap.new(self.width - 32, self.height - 32) refresh end def can_delete? return (@text != "" and @text.size > 0) end def delete_last ntext = @text.dup txt = "" while ((c = ntext.slice!(/./m)) != nil) newc = ntext.slice(/./m) break if newc.nil? txt += c end @text = txt.dup refresh end def update if @pre_text != @text refresh end end def refresh @pre_text = @text.dup self.contents.clear self.contents.draw_text(0, 0, 608, 32, @text, 1) end end module Teclas_Input @keys = [] @pressed = [] @repeat_count = 0 Back= 8 Enter = 13 Shift = 16 Ctrl = 17 Alt = 18 Esc = 27 LEFT = 37 UP = 38 RIGHT = 39 DOWN = 40 Space = 32 Numberkeys = {} Numberkeys[0] = 48 Numberkeys[1] = 49 Numberkeys[2] = 50 Numberkeys[3] = 51 Numberkeys[4] = 52 Numberkeys[5] = 53 Numberkeys[6] = 54 Numberkeys[7] = 55 Numberkeys[8] = 56 Numberkeys[9] = 57 for k, v in Numberkeys eval("Nk#{k.to_s} = #{v}") end Numberpad = {} Numberpad[0] = 96 Numberpad[1] = 97 Numberpad[2] = 98 Numberpad[3] = 99 Numberpad[4] = 100 Numberpad[5] = 101 Numberpad[6] = 102 Numberpad[7] = 103 Numberpad[8] = 104 Numberpad[9] = 105 for k, v in Numberpad eval("Np#{k.to_s} = #{v}") end Letters = {} Letters["A"] = 65 Letters["B"] = 66 Letters["C"] = 67 Letters["D"] = 68 Letters["E"] = 69 Letters["F"] = 70 Letters["G"] = 71 Letters["H"] = 72 Letters["I"] = 73 Letters["J"] = 74 Letters["K"] = 75 Letters["L"] = 76 Letters["M"] = 77 Letters["N"] = 78 Letters["O"] = 79 Letters["P"] = 80 Letters["Q"] = 81 Letters["R"] = 82 Letters["S"] = 83 Letters["T"] = 84 Letters["U"] = 85 Letters["V"] = 86 Letters["W"] = 87 Letters["X"] = 88 Letters["Y"] = 89 Letters["Z"] = 90 Collon = 186 Equal = 187 Comma = 188 Underscore = 189 Dot = 190 Backslash = 191 Lb = 219 Rb = 221 Quote = 222 State = Win32API.new("user32","GetKeyState",['i'],'i') Key = Win32API.new("user32","GetAsyncKeyState",['i'],'i') #-------------------------------------------------------------------------- def self.getstate(key) return (not State.call(key).between?(0, 1)) end #-------------------------------------------------------------------------- def self.testkey(key) return (Key.call(key) & 0x01 == 1) end #-------------------------------------------------------------------------- def self.update @keys.clear @pressed.clear if @repeat_count > 0 @repeat_count -= 1 end for i in 1..230 @keys.push(i) if self.testkey(i) @pressed.push(i) if self.getstate(i) end end #-------------------------------------------------------------------------- def self.trigger?(key) return @keys.include?(key) end #-------------------------------------------------------------------------- def self.repeat?(key) if @pressed.include?(key) and @repeat_count <= 0 @repeat_count = 5 return true end return false end def self.press?(key) return @pressed.include?(key) end end unless $RTHScript["Mini_Map"] class Game_Map def mmsetup(id) @map_id = id @map = load_data(sprintf("Data/Map%03d.rxdata", @map_id)) tilesets = load_data("Data/Tilesets.rxdata") tileset = tilesets[@map.tileset_id] @tileset_name = tileset.tileset_name @autotile_names = tileset.autotile_names @priorities = tileset.priorities end end end Bugs e Conflitti Noti N/AAltri DettagliPer chi non sapesse cos'è la Scene_Debug è quella scena che compare nel test premendo F9 Edited April 26, 2013 by Dilos Script monoriga sistemato. Per qualsiasi motivo non aprite questo spoiler. Ho detto di non aprirlo ! Se lo apri ancora esplode il mondo. Aaaaaa è un vizio. Contento? Il mondo è esploso, sono tutti morti per colpa della tua curiosità . Vuoi che ti venga anche il morbillo, la varicella e l'AIDS??? O bravo ora sei un malato terminale e nessuno ti puo curare, sono tutti morti ! Se clicchi ancora una volta il PC esplode. E dai smettila !! Uff!! Hai cliccato tante volte che ho dovuto sostituirlo con un codebox. http://s8.postimg.org/yntv9nxld/Banner.png http://img204.imageshack.us/img204/8039/sccontest3octpl3.gif Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now