赞 | 123 |
VIP | 13 |
好人卡 | 16 |
积分 | 194 |
经验 | 38692 |
最后登录 | 2024-11-16 |
在线时间 | 3102 小时 |
Lv4.逐梦者
- 梦石
- 0
- 星屑
- 19428
- 在线时间
- 3102 小时
- 注册时间
- 2013-1-11
- 帖子
- 1291
|
第一个问题,下面这段脚本插到main之前。
- class Window_VVVCommand < Window_Command
- #--------------------------------------------------------------------------
- # ● 初始化对象
- #--------------------------------------------------------------------------
- def initialize
- super(0, 0)
- update_placement
- self.openness = 0
- open
- end
- #--------------------------------------------------------------------------
- # ● 获取窗口的宽度
- #--------------------------------------------------------------------------
- def window_width
- return 160
- end
- #--------------------------------------------------------------------------
- # ● 更新窗口的位置
- #--------------------------------------------------------------------------
- def update_placement
- self.x = (Graphics.width - width) / 2
- self.y = (Graphics.height - height) / 2
- end
- #--------------------------------------------------------------------------
- # ● 生成指令列表
- #--------------------------------------------------------------------------
- def make_command_list
- add_command("重战", :again)
- add_command(Vocab::to_title, :to_title)
- end
- end
- class Scene_Battle < Scene_Base
- #--------------------------------------------------------------------------
- # ● 开始处理
- #--------------------------------------------------------------------------
- alias qqeat_scene_battle_start start
- def start
- File.open('auto_battle.rvdata2', "wb") do |file|
- $game_system.on_before_save
- Marshal.dump(DataManager.make_save_header, file)
- Marshal.dump(DataManager.make_save_contents, file)
- end
- qqeat_scene_battle_start
- end
- end
- module BattleManager
- #--------------------------------------------------------------------------
- # ● 全灭时的处理
- #--------------------------------------------------------------------------
- def self.process_defeat
- $game_message.add(sprintf(Vocab::Defeat, $game_party.name))
- wait_for_message
- if @can_lose
- revive_battle_members
- replay_bgm_and_bgs
- SceneManager.return
- else
- win = Window_VVVCommand.new
- win.set_handler(:again, proc{
- File.open('auto_battle.rvdata2', "rb") do |file|
- Marshal.load(file)
- DataManager.extract_save_contents(Marshal.load(file))
- DataManager.reload_map_if_updated
- end
- SceneManager.goto(Scene_Battle)
- })
- win.set_handler(:to_title, proc{ SceneManager.goto(Scene_Gameover) })
- loop do
- win.update
- Graphics.update
- Input.update
- unless win.active
- win.dispose
- break
- end
- end
- end
- battle_end(2)
- return true
- end
- end
复制代码
第二个问题,你可以手动调用
DataManager.save_game(index)来选择存储到第几个存档位。
|
评分
-
查看全部评分
|