本帖最后由 chanszeman1018 于 2020-2-7 18:10 编辑 @喵呜喵5 大大您好,您的记录击杀数里的重置功能如何加到下面的脚本里去? 下面的脚本可以获取指定角色对指定敌人的击杀数 然而不知道 如何重置指定角色对指定敌 ...
chanszeman1018 发表于 2020-1-14 20:31 大大是唯一一個會回覆我的~ あいしてる~
# 事件脚本:## 重置指定角色对指定敌人击杀数# 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| next if !(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| next if !(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
# 事件脚本: # # 重置指定角色对指定敌人击杀数 # 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
折叠内容标题(非必须)
折叠内容
站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作
GMT+8, 2024-11-16 14:24
Powered by Discuz! X3.1
© 2001-2013 Comsenz Inc.