class Game_Interpreter def 吃猫饭(actor_id,state_id,turn) return if turn < 1 if actor_id == 0 $game_party.members.each{|i| i.add_state(state_id)} b = "members.each{|i| i.remove_state(#{state_id})}" else $game_actors[actor_id].add_state(state_id) b = "$game_actors[#{actor_id}].remove_state(#{state_id})" end $game_party.battle_end_inter_push(turn,b) end end class Game_Party < Game_Unit attr_accessor :battle_end_inter alias :old_initialize :initialize def initialize old_initialize @battle_end_inter = [] end def battle_end_inter_push(turn,s) @battle_end_inter ||= [] if @battle_end_inter[turn - 1].nil? @battle_end_inter[turn - 1] = s else @battle_end_inter[turn - 1] += ";#{s}" end end def on_battle_end super if @battle_end_inter != nil and (r=@battle_end_inter.shift) != nil eval(r) end end end
class Game_Interpreter
def 吃猫饭(actor_id,state_id,turn)
return if turn < 1
if actor_id == 0
$game_party.members.each{|i| i.add_state(state_id)}
b = "members.each{|i| i.remove_state(#{state_id})}"
else
$game_actors[actor_id].add_state(state_id)
b = "$game_actors[#{actor_id}].remove_state(#{state_id})"
end
$game_party.battle_end_inter_push(turn,b)
end
end
class Game_Party < Game_Unit
attr_accessor :battle_end_inter
alias :old_initialize :initialize
def initialize
old_initialize
@battle_end_inter = []
end
def battle_end_inter_push(turn,s)
@battle_end_inter ||= []
if @battle_end_inter[turn - 1].nil?
@battle_end_inter[turn - 1] = s
else
@battle_end_inter[turn - 1] += ";#{s}"
end
end
def on_battle_end
super
if @battle_end_inter != nil and (r=@battle_end_inter.shift) != nil
eval(r)
end
end
end
把上面这段塞到插件脚本
然后, 吃饭时调用事件脚本 : 吃猫饭(角色id, 状态id, 持续几场战斗)
角色id填0的话就是队伍全员 |