# 事件脚本: # # 重置指定角色对指定敌人击杀数 # clear_actor_defeat(actor_id, enemy_id) # # 重置全部角色对指定敌人击杀数 # clear_all_defeat(enemy_id) # # 重置指定角色对全部敌人击杀数 # clear_actor_defeat(actor_id) # # 重置全部角色对全部敌人击杀数 # clear_all_defeat class Game_Interpreter def clear_actor_defeat(actor_id, enemy_id=0) hash = $game_actors[actor_id].instance_variable_get(:@defeat) if enemy_id == 0 hash.clear else hash[enemy_id] = 0 end end def clear_all_defeat(enemy_id=0) actors = $game_actors.instance_variable_get(:@data) actors.each do |actor| hash = actor.instance_variable_get(:@defeat) if enemy_id == 0 hash.clear else hash[enemy_id] = 0 end end end end
# 事件脚本:
#
# 重置指定角色对指定敌人击杀数
# clear_actor_defeat(actor_id, enemy_id)
#
# 重置全部角色对指定敌人击杀数
# clear_all_defeat(enemy_id)
#
# 重置指定角色对全部敌人击杀数
# clear_actor_defeat(actor_id)
#
# 重置全部角色对全部敌人击杀数
# clear_all_defeat
class Game_Interpreter
def clear_actor_defeat(actor_id, enemy_id=0)
hash = $game_actors[actor_id].instance_variable_get(:@defeat)
if enemy_id == 0
hash.clear
else
hash[enemy_id] = 0
end
end
def clear_all_defeat(enemy_id=0)
actors = $game_actors.instance_variable_get(:@data)
actors.each do |actor|
hash = actor.instance_variable_get(:@defeat)
if enemy_id == 0
hash.clear
else
hash[enemy_id] = 0
end
end
end
end
未测试。 |