111.png (32 KB, 下载次数: 16)
1.07 MB, 下载次数: 63
#============================================================================== # ■ Scene_Start #------------------------------------------------------------------------------ # 跳过画面的类。 #============================================================================== class Scene_Start < Scene_Base #-------------------------------------------------------------------------- # ● 主处理 #-------------------------------------------------------------------------- def main if $BTEST # 战斗测试的情况 battle_test # 开始处理战斗测试 else # 一般处理 super # 返回原来的主处理 end end #-------------------------------------------------------------------------- # ● 开始处理 #-------------------------------------------------------------------------- def start super load_database # 读取数据库 create_game_objects # 生成游戏对象 check_continue # 继续游戏的有效判定 command_new_game end #-------------------------------------------------------------------------- # ● 执行过渡 #-------------------------------------------------------------------------- def perform_transition Graphics.transition(20) end #-------------------------------------------------------------------------- # ● 结束处理 #-------------------------------------------------------------------------- def terminate super snapshot_for_background end #-------------------------------------------------------------------------- # ● 读取数据库 #-------------------------------------------------------------------------- def load_database $data_actors = load_data("Data/Actors.rvdata") $data_classes = load_data("Data/Classes.rvdata") $data_skills = load_data("Data/Skills.rvdata") $data_items = load_data("Data/Items.rvdata") $data_weapons = load_data("Data/Weapons.rvdata") $data_armors = load_data("Data/Armors.rvdata") $data_enemies = load_data("Data/Enemies.rvdata") $data_troops = load_data("Data/Troops.rvdata") $data_states = load_data("Data/States.rvdata") $data_animations = load_data("Data/Animations.rvdata") $data_common_events = load_data("Data/CommonEvents.rvdata") $data_system = load_data("Data/System.rvdata") $data_areas = load_data("Data/Areas.rvdata") end #-------------------------------------------------------------------------- # ● 战斗测试用的读取数据库 #-------------------------------------------------------------------------- def load_bt_database $data_actors = load_data("Data/BT_Actors.rvdata") $data_classes = load_data("Data/BT_Classes.rvdata") $data_skills = load_data("Data/BT_Skills.rvdata") $data_items = load_data("Data/BT_Items.rvdata") $data_weapons = load_data("Data/BT_Weapons.rvdata") $data_armors = load_data("Data/BT_Armors.rvdata") $data_enemies = load_data("Data/BT_Enemies.rvdata") $data_troops = load_data("Data/BT_Troops.rvdata") $data_states = load_data("Data/BT_States.rvdata") $data_animations = load_data("Data/BT_Animations.rvdata") $data_common_events = load_data("Data/BT_CommonEvents.rvdata") $data_system = load_data("Data/BT_System.rvdata") end #-------------------------------------------------------------------------- # ● 做成各种游戏对象 #-------------------------------------------------------------------------- def create_game_objects $game_temp = Game_Temp.new $game_message = Game_Message.new $game_system = Game_System.new $game_switches = Game_Switches.new $game_variables = Game_Variables.new $game_self_switches = Game_SelfSwitches.new $game_actors = Game_Actors.new $game_party = Game_Party.new $game_troop = Game_Troop.new $game_map = Game_Map.new $game_player = Game_Player.new end #-------------------------------------------------------------------------- # ● 继续游戏的有效判定 #-------------------------------------------------------------------------- def check_continue $continue_enabled = (Dir.glob('Save*.rvdata').size > 0) end #-------------------------------------------------------------------------- # ● 指令 : 新的游戏 #-------------------------------------------------------------------------- def command_new_game if FileTest.exist?("Finished.rvdata")#二周目 $game_switches[300] = true end confirm_player_location $game_party.setup_starting_members # 初期队伍 $game_map.setup($data_system.start_map_id) # 初期位置的地图 $game_player.moveto($data_system.start_x, $data_system.start_y) $game_player.refresh $scene = Scene_Title.new Graphics.frame_count = 0 $game_map.autoplay end #-------------------------------------------------------------------------- # ● 检查玩家的初期位置 #-------------------------------------------------------------------------- def confirm_player_location if $data_system.start_map_id == 0 print "还没设置玩家的初期位置。" exit end end #-------------------------------------------------------------------------- # ● 指令 : 继续游戏 #-------------------------------------------------------------------------- def command_continue if $continue_enabled Sound.play_decision $scene = Scene_File.new(false, true, false) else Sound.play_buzzer end end #-------------------------------------------------------------------------- # ● 指令 : 离开游戏 #-------------------------------------------------------------------------- def command_shutdown Sound.play_decision RPG::BGM.fade(800) RPG::BGS.fade(800) RPG::ME.fade(800) $scene = nil end #-------------------------------------------------------------------------- # ● 战斗测试 #-------------------------------------------------------------------------- def battle_test load_bt_database # 战斗测试用数据库读取 create_game_objects # 作成游戏对象 Graphics.frame_count = 0 # 初期化游戏时间 $game_party.setup_battle_test_members $game_troop.setup($data_system.test_troop_id) $game_troop.can_escape = true $game_system.battle_bgm.play snapshot_for_background $scene = Scene_Battle.new end end
Graphics.resize_screen(350, 700) #============================================================================== # ■ Main #------------------------------------------------------------------------------ # 各定义结束后,从这里开始实际处理。 #============================================================================== # 一些常用的字体 Font.default_name = ["SimHei", "黑体", "DFKai-SB", "標楷體", "Verdana", "Arial Unicode MS"] begin Graphics.freeze #这个脚本已经变更了!注意一下!因为标题的意义被改写。 $scene = Scene_Start.new $scene.main while $scene != nil Graphics.transition(30) rescue Errno::ENOENT filename = $!.message.sub("无此文件或文件夹 - ", "") print("无法找到文件 #{filename}.") end
#============================================================================== # ■ Scene_Title #------------------------------------------------------------------------------ # 标题画面。 #============================================================================== class Scene_Title < Scene_Base #-------------------------------------------------------------------------- # ● 开始处理 #-------------------------------------------------------------------------- def start [url=home.php?mod=space&uid=268194]@Button[/url] = Button.new("兽族",45,15) @button.set_double_click(Mouse::LKEY,"$scene = Scene_Map.new ;$game_temp.common_event_id = 1") @button2 = Button.new("人族",145,15) @button2.set_double_click(Mouse::LKEY,"p '左键双击完成任务二'") @button4 = Button.new("魔族",245,15) @button4.set_double_click(Mouse::LKEY,"p '左键双击完成任务二'") end def update # 正常Mouse.update会处于Scene_Base的main Mouse.update @button.update @button2.update @button4.update end def 调取公共事件 #(失败了,放弃) # $scene = Scene_Map.new # $game_temp.common_event_id = 事件编号 end end
121.02 KB, 下载次数: 24
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |