查看: 4628|回复: 2

[已经解决] 角色的死亡判定

[复制链接]
梦石
0
星屑
50
在线时间
57 小时
注册时间
2013-11-2
回帖
5
发表于 2016-6-12 19:00:43 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
求问各位大大,怎么设置角色在HP MP TP均为0的时候才会死亡,任意一个不为0人物就会复活?
梦石
0
星屑
165
在线时间
85 小时
注册时间
2016-4-26
回帖
14
发表于 2016-6-13 22:06:51 | 显示全部楼层
您可以尝试把Game_Battler.prototype.refresh由:
  1. Game_Battler.prototype.refresh = function() {
  2.     Game_BattlerBase.prototype.refresh.call(this);
  3.     if (this.hp === 0) {
  4.         this.addState(this.deathStateId());
  5.     } else {
  6.         this.removeState(this.deathStateId());
  7.     }
  8. };
复制代码
改为:
  1. Game_Battler.prototype.refresh = function() {
  2.     Game_BattlerBase.prototype.refresh.call(this);
  3.     if (this.hp === 0 && this.mp === 0 && this.tp === 0) {
  4.         this.addState(this.deathStateId());
  5.     } else {
  6.         this.removeState(this.deathStateId());
  7.     }
  8. };
复制代码
回复

使用道具 举报

梦石
0
星屑
50
在线时间
57 小时
注册时间
2013-11-2
回帖
5
 楼主| 发表于 2016-6-14 01:19:53 | 显示全部楼层
DoubleX 发表于 2016-6-13 22:06
您可以尝试把Game_Battler.prototype.refresh由:改为:

亲测可用,非常感谢(=゚ω゚)=
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部