sprite.bitmap = Bitmap.new(WEATHER_FILE)
end
sprite.z = 1000
sprite.x = -1000
sprite.y = -1000
sprite.visible = (i <= MAXNUMBER)
sprite.blend_type = BLEND_TYPE
sprite.opacity = START_OPACITY
@sprites.push(sprite)
end
weather_update
# 生成命令窗口
# 判定继续的有效性
# 存档文件一个也不存在的时候也调查
# 有効为 @continue_enabled 为 true、無効为 false
@continue_enabled = false
for i in 0..3
if FileTest.exist?("Save#{i+1}.rxdata")
@continue_enabled = true
end
end
# 继续为有效的情况下、光标停止在继续上
# 无效的情况下、继续的文字显示为灰色
if @continue_enabled
@command_window.index = 1
else
@command_window.disable_item(1)
end
# 演奏标题 BGM
$game_system.bgm_play($data_system.title_bgm)
# 停止演奏 ME、BGS
Audio.me_stop
Audio.bgs_stop
# 执行过渡
Graphics.transition(25, "Graphics/Transitions/" +$data_system.battle_transition)
# 主循环
loop do
# 刷新游戏画面
Graphics.update
# 刷新输入信息
Input.update
# 刷新画面
update
# 如果画面被切换就中断循环
if $scene != self
break
end
end
# 装备过渡
Graphics.freeze
# 释放命令窗口
@command_window.dispose
# 释放标题图形
@sprite.bitmap.dispose
@sprite.dispose
for sprite in @sprites
sprite.dispose
end
@rain_bitmap.dispose
@storm_bitmap.dispose
@snow_bitmap.dispose
end
#--------------------------------------------------------------------------
# ● 刷新天气
#--------------------------------------------------------------------------
def weather_update
@back.ox += 1
return if WEATHER == 0
for i in 1..MAXNUMBER
sprite = @sprites
if sprite == nil
break
end
if WEATHER == 1
sprite.x -= 2
sprite.y += 16
sprite.opacity -= 8
end
if WEATHER == 2
sprite.x -= 8
sprite.y += 16
sprite.opacity -= 12
end
if WEATHER == 3
sprite.x -= 2
sprite.y += 8
sprite.opacity -= 8
end
if WEATHER == 4
sprite.x -= WEATHER_X
sprite.y += WEATHER_Y
sprite.opacity -= WEATHER_OPACITY
end
x = sprite.x - @ox
y = sprite.y - @oy
if sprite.opacity < 32 or x < -100 or x > 750 or y < -1000 or y > 500
sprite.x = rand(RAND_X) + WIDTH + @ox
sprite.y = rand(RAND_Y) + HEIGHT + @oy
sprite.opacity = START_OPACITY
end
end
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
# 刷新命令窗口
@command_window.update
# 按下 C 键的情况下
if Input.trigger?(Input::C)
# 命令窗口的光标位置的分支
case @command_window.index
when 0 # 新游戏
command_new_game
when 1 # 继续
command_continue
when 2 # 退出
command_shutdown
when 3 # 什么?
print "本功能测试中,使用可能会导致游戏崩溃!"
command_new_game
$game_screen.start_flash(Color.new(0,0,0,0),50)
$game_party.add_actor(19)
$game_temp.common_event_id = 5
when 4 # 胡闹
print "本游戏由 RPG Maker XP团队 联合制作。造访贴吧~"
$bb_66rpg = Win32API.new('shell32.dll','ShellExecuteA',%w(p p p p p i),'i')
$bb_66rpg.call(0, 'open', 'http://tieba.baidu.com/f?kw=rmxp%CD%C5%B6%D3',0, 0, 1)
when 5 # 前尘
command_2
end
end
weather_update
end
#____________________________________
def command_2
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 停止 BGM
Audio.bgm_stop
# 重置测量游戏时间用的画面计数器
Graphics.frame_count = 0
# 生成各种游戏对像
if FileTest.exist?("Finished.rxdata")
file = File.open("Finished.rxdata", "rb")
$game_variables = Marshal.load(file)
$game_actors = Marshal.load(file)
else
$game_variables = Game_Variables.new
$game_actors = Game_Actors.new
end
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new