Project1
标题:
【VA】LZSB脚本系列·第2计时器
[打印本页]
作者:
阿尔西斯的马甲
时间:
2012-1-28 14:10
标题:
【VA】LZSB脚本系列·第2计时器
本帖最后由 阿尔西斯的马甲 于 2012-1-28 14:12 编辑
#==============================================================================
# ■ Game_Interpreter_Self_Timer
#------------------------------------------------------------------------------
# 独立公共事件执行器
#==============================================================================
=begin
独立公共事件执行器用于随时执行公共事件,不受公共事件调用地方的限制。
□使用方法:
1。将脚本插入main前。
2。在需要使用公共事件的地方
插入、
Game_Interpreter_Self_Timer.new(公共事件ID)
□可能的冲突:无
=end
class Game_Interpreter_Self_Timer < Game_Interpreter
def initialize(com_id)
@com_id = com_id
common_event = $data_common_events[@com_id]
setup(common_event.list)
update
clear
end
def command_117
if $data_common_events[@params[0]]
child = Game_Interpreter_Self.new(@params[0])
child.run
else
msgbox "公共事件连存在都不存在还搞什么你妹的执行?!"
end
end
end
#开始第二计时器
#s代表秒数,c代表计时器到期后执行的公共事件ID。如果c是nil则会在到期之后结束战斗:
#$t2.t(s,c)
#冲突可能:修改了DataManager的脚本
module DataManager
def self.create_game_objects
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_timer = Game_Timer1.new
$game_message = Game_Message.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
$t2 = Game_Timer2.new
end
end
class Game_Timer1 < Game_Timer
end
class Game_Timer2 < Game_Timer
def t(s,c)
@commonid=c
start(s * Graphics.frame_rate)
end
def on_expire
if @commonid.nil?
BattleManager.abort
return
end
unless @commonid.is_a?(Integer)
@
[email protected]
_i
end
Game_Interpreter_Self_Timer.new(@commonid)
end
end
class Game_Timer
alias laozishabiupdate update
def update
laozishabiupdate
if self.is_a?(Game_Timer1)
$t2.update
end
end
end
复制代码
引用了九夜神尊的公共执行器。
没错!我就是不折不扣的SB×1.
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1