查看: 3394|回复: 2

[已经解决] 求救,想问下伤害处理(不是计算)的脚本是在哪的

[复制链接]
梦石
0
星屑
61
在线时间
696 小时
注册时间
2011-1-4
回帖
176
发表于 2016-3-3 18:07:30 | 显示全部楼层 |阅读模式

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

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

×
蠢新瞎改脚本改出BUG了。。。

现在攻击的时候正常跳出伤害数字,但是血条却不会动。。。也就是说计算血量是正确的,但是实际上并不掉血
根本找不到是哪里出的问题,跪了。想问下默认脚本里这种BUG的话应该是检查哪个部分的啊
梦石
0
星屑
1232
在线时间
1017 小时
注册时间
2011-4-30
回帖
1464
发表于 2016-3-3 18:43:37 | 显示全部楼层

这里吗???

  1. //执行伤害
  2. Game_Action.prototype.executeDamage = function(target, value) {
  3.     var result = target.result();
  4.     if (value === 0) {
  5.         result.critical = false;
  6.     }
  7.     if (this.isHpEffect()) {
  8.         this.executeHpDamage(target, value);
  9.     }
  10.     if (this.isMpEffect()) {
  11.         this.executeMpDamage(target, value);
  12.     }
  13. };
  14. //执行hp伤害
  15. Game_Action.prototype.executeHpDamage = function(target, value) {
  16.     if (this.isDrain()) {
  17.         value = Math.min(target.hp, value);
  18.     }
  19.     this.makeSuccess(target);
  20.     target.gainHp(-value);
  21.     if (value > 0) {
  22.         target.onDamage(value);
  23.     }
  24.     this.gainDrainedHp(value);
  25. };
  26. //执行mp伤害
  27. Game_Action.prototype.executeMpDamage = function(target, value) {
  28.     if (!this.isMpRecover()) {
  29.         value = Math.min(target.mp, value);
  30.     }
  31.     if (value !== 0) {
  32.         this.makeSuccess(target);
  33.     }
  34.     target.gainMp(-value);
  35.     this.gainDrainedMp(value);
  36. };
  37. //获得消耗hp
  38. Game_Action.prototype.gainDrainedHp = function(value) {
  39.     if (this.isDrain()) {
  40.         this.subject().gainHp(value);
  41.     }
  42. };
  43. //获取消耗mp
  44. Game_Action.prototype.gainDrainedMp = function(value) {
  45.     if (this.isDrain()) {
  46.         this.subject().gainMp(value);
  47.     }
  48. };
复制代码
回复

使用道具 举报

梦石
0
星屑
61
在线时间
696 小时
注册时间
2011-1-4
回帖
176
 楼主| 发表于 2016-3-3 19:35:41 | 显示全部楼层
汪汪 发表于 2016-3-3 18:43
这里吗???

我找到原因了。。是在这之前的地方,有两个脚本冲突了,在显示伤害数字的语句后面
两个脚本把伤害值一反一正直接加成了0。。。
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部