Project1
标题:
Game_Interpreter 里的内容在其他位置调用
[打印本页]
作者:
neverstop
时间:
2015-9-4 13:53
标题:
Game_Interpreter 里的内容在其他位置调用
class Game_Interpreter
def m5_20150211_get_time
v = $game_variables
v[M5TP20150211::VAR] = Array.new unless v[M5TP20150211::VAR].is_a?(Array)
return v[M5TP20150211::VAR]
end
def m5_20150211_judge_time(id,type,pass)
time = m5_20150211_get_time[id] || m5_save_time(id)
reslut = type == 0 ? Time.now - time[0] : $game_system.playtime - time[1]
return pass ? reslut >= pass.abs : reslut
end
def m5_save_time(id = 1)
m5_20150211_get_time[id] = [Time.now, $game_system.playtime]
end
def sys_time_judge(id = 1, pass = nil); m5_20150211_judge_time(id,0,pass);end
def ply_time_judge(id = 1, pass = nil); m5_20150211_judge_time(id,1,pass);end
end
复制代码
以上的喵呜大的在线礼包脚本的部分,
我想要在另一个脚本(Game_Actor)里调用相应的内容(sys_time_judge(a, b) ),该怎么做哇?
麻烦了~
作者:
喵呜喵5
时间:
2015-9-4 14:30
脚本已更新
https://rpg.blue/home.php?mod=sp ... o=blog&id=12038
在其他地方,你可以这么调用脚本:
保存当前时间:M5TP20150211.save(id)
判断系统时间:M5TP20150211.sys(id,pass)
判断游戏时间:M5TP20150211.ply(id,pass)
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1