#--------------------------------------------------------------------------
# ● require Taroxd基础设置
#--------------------------------------------------------------------------
class Game_Party < Game_Unit
#--------------------------------------------------------------------------
# ● 初始化
#--------------------------------------------------------------------------
def_after(:initialize) { @pedometer = [] }
#--------------------------------------------------------------------------
# ● 开始计步器
#--------------------------------------------------------------------------
def start_pedometer(var_id, count = nil)
@pedometer << var_id unless @pedometer.include?(var_id)
$game_variables[var_id] = count if count
end
#--------------------------------------------------------------------------
# ● 停止计步器
#--------------------------------------------------------------------------
def stop_pedometer(var_id = nil)
var_id ? @pedometer.delete(var_id) : @pedometer.clear
end
#--------------------------------------------------------------------------
# ● 计步
#--------------------------------------------------------------------------
def_after :on_player_walk do
@pedometer.each {|var_id| $game_variables[var_id] += 1 }
end
end
class Game_Interpreter
#--------------------------------------------------------------------------
# ● 开始
#--------------------------------------------------------------------------
def start_pedometer(var_id, count = nil)
$game_party.start_pedometer(var_id, count)
end
#--------------------------------------------------------------------------
# ● 停止
#--------------------------------------------------------------------------
def stop_pedometer(var_id = nil)
$game_party.stop_pedometer(var_id)
end
end