#-=====================-#
# 计时器清零
#-=====================-#
def clear()
if @perf_flag
@qpCounter.call(@time_start)
else
@time_start=[@tGetTime.call(),0].pack('LL')
end
end
#-==============================-#
# 帧错...
#-==============================-#
def debug(now_time)
if @decimal>0
now_time = (now_time * (10**@decimal)).floor/(10.0**@decimal)
else
now_time = now_time.floor
end
return now_time
#以下用于debug模式
if now_time < 0
p "Timer Wrong!! Clear...",now_time,\
@perf_flag,@qpCounter,@tGetTime,
@time_now.unpack('LL')[0],@time_now.unpack('LL')[1],
@time_start.unpack('LL')[0],@time_start.unpack('LL')[1]
self.clear()
return 0.0
else
return now_time
end
end
#-=====================-#
# 获取时间比例因数
#-=====================-#
def scale()
return @time_scale[0]+\
@time_scale[1]*0xffffffff
end
#-=====================-#
# 获取起始滴答数
#-=====================-#
def start()
return @time_start.unpack('LL')[0]+\
@time_start.unpack('LL')[1]*0xffffffff
end
#-=====================-#
# 获取当前的嘀哒数
#-=====================-#
def timer()
if @perf_flag
@qpCounter.call(@time_now)
else
@time_now=[@tGetTime.call(),0].pack('LL')
end
return @time_now.unpack('LL')[0]+\
@time_now.unpack('LL')[1]*0xffffffff
end
end
#-------------------------------------#
# 初始化自身成一个全局变量
#-------------------------------------#
$sys_timer=SystemTimer.new()
#-------------------------------------#
#==============================================================================
# ■ Scene_Map
#------------------------------------------------------------------------------
# 处理地图画面的类。
#==============================================================================
class Scene_Map
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
alias mtv_scenemap_update update
def update
@mtv_window.refresh
mtv_scenemap_update
end
#--------------------------------------------------------------------------
# ● 主处理
#--------------------------------------------------------------------------
alias mtv_scenemap_main main
def main
@mtv_window = Window_MTV.new
mtv_scenemap_main
@mtv_window.dispose
end
#--------------------------------------------------------------------------
# ● 调用战斗 (调整自动切换BGM)
#--------------------------------------------------------------------------
def call_battle
# 清除战斗调用标志
$game_temp.battle_calling = false
# 清除菜单调用标志
$game_temp.menu_calling = false
$game_temp.menu_beep = false
# 生成遇敌计数
$game_player.make_encounter_count
# 记忆地图 BGM 、停止 BGM
$game_temp.map_bgm = $game_system.playing_bgm
unless MTV.mtv?
$game_system.bgm_play($game_system.battle_bgm)
# 演奏战斗开始 SE
$game_system.se_play($data_system.battle_start_se)
end
# 矫正主角姿势
$game_player.straighten
# 切换到战斗画面
$scene = Scene_Battle.new
end
end
#==============================================================================
# ■ Scene_Battle
#------------------------------------------------------------------------------
# 处理战斗的类。
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
alias mtv_scenebattle_update update
def update
@mtv_window.refresh
mtv_scenebattle_update
end
#--------------------------------------------------------------------------
# ● 主处理
#--------------------------------------------------------------------------
alias mtv_scenebattle_main main
def main
@mtv_window = Window_MTV.new
mtv_scenebattle_main
@mtv_window.dispose
end
end