设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 2124|回复: 4

[已经解决] [已解決]求改進記錄擊殺數腳本

[复制链接]
头像被屏蔽

Lv4.逐梦者 (禁止发言)

梦石
0
星屑
5701
在线时间
922 小时
注册时间
2013-8-29
帖子
1468
发表于 2020-1-10 15:46:51 | 显示全部楼层 |阅读模式
提示: 作者被禁止或删除 内容自动屏蔽

Lv5.捕梦者

梦石
10
星屑
39440
在线时间
1914 小时
注册时间
2010-11-14
帖子
3315

R考场第七期纪念奖

发表于 2020-1-14 19:19:21 | 显示全部楼层
RUBY 代码复制
  1. # 事件脚本:
  2. #
  3. # 重置指定角色对指定敌人击杀数
  4. # clear_actor_defeat(actor_id, enemy_id)
  5. #
  6. # 重置全部角色对指定敌人击杀数
  7. # clear_all_defeat(enemy_id)
  8. #
  9. # 重置指定角色对全部敌人击杀数
  10. # clear_actor_defeat(actor_id)
  11. #
  12. # 重置全部角色对全部敌人击杀数
  13. # clear_all_defeat
  14.  
  15.  
  16. class Game_Interpreter
  17.  
  18.   def clear_actor_defeat(actor_id, enemy_id=0)
  19.     hash = $game_actors[actor_id].instance_variable_get(:@defeat)
  20.     if enemy_id == 0
  21.       hash.clear
  22.     else
  23.       hash[enemy_id] = 0
  24.     end
  25.   end
  26.  
  27.   def clear_all_defeat(enemy_id=0)
  28.     actors = $game_actors.instance_variable_get(:@data)
  29.     actors.each do |actor|
  30.       hash = actor.instance_variable_get(:@defeat)
  31.       if enemy_id == 0
  32.         hash.clear
  33.       else
  34.         hash[enemy_id] = 0
  35.       end
  36.     end
  37.   end
  38.  
  39. end


未测试。
用头画头像,用脚写脚本
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv4.逐梦者 (禁止发言)

梦石
0
星屑
5701
在线时间
922 小时
注册时间
2013-8-29
帖子
1468
 楼主| 发表于 2020-1-14 20:31:02 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
10
星屑
39440
在线时间
1914 小时
注册时间
2010-11-14
帖子
3315

R考场第七期纪念奖

发表于 2020-1-14 22:09:38 | 显示全部楼层
chanszeman1018 发表于 2020-1-14 20:31
大大是唯一一個會回覆我的~
あいしてる~

RUBY 代码复制
  1. # 事件脚本:
  2. #
  3. # 重置指定角色对指定敌人击杀数
  4. # clear_actor_defeat(actor_id, enemy_id)
  5. #
  6. # 重置全部角色对指定敌人击杀数
  7. # clear_all_defeat(enemy_id)
  8. #
  9. # 重置指定角色对全部敌人击杀数
  10. # clear_actor_defeat(actor_id)
  11. #
  12. # 重置全部角色对全部敌人击杀数
  13. # clear_all_defeat
  14.  
  15.  
  16. class Game_Interpreter
  17.  
  18.   def clear_actor_defeat(actor_id, enemy_id=0)
  19.     hash = $game_actors[actor_id].instance_variable_get(:@defeat)
  20.     if enemy_id == 0
  21.       hash.clear
  22.     else
  23.       hash[enemy_id] = 0
  24.     end
  25.   end
  26.  
  27.   def clear_all_defeat(enemy_id=0)
  28.     actors = $game_actors.instance_variable_get(:@data)
  29.     actors.each do |actor|
  30.       next if !(hash = actor.instance_variable_get(:@defeat))
  31.       if enemy_id == 0
  32.         hash.clear
  33.       else
  34.         hash[enemy_id] = 0
  35.       end
  36.     end
  37.   end
  38.  
  39. end


再看一下

点评

我对你的景仰如滔滔江水,连绵不绝,又犹如黄河泛滥,一发不可收拾  发表于 2020-1-14 22:32

评分

参与人数 1+1 收起 理由
chanszeman1018 + 1 认可答案 + 精品文章

查看全部评分

用头画头像,用脚写脚本
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-3-29 20:54

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表