Project1

标题: 如何同时显示两个连续伤害的状态减掉的血 [打印本页]

作者: yang1zhi    时间: 2014-10-14 20:09
标题: 如何同时显示两个连续伤害的状态减掉的血
我设置了毒,又设置了烧伤.。都勾了连续伤害状态。
可是实际战斗的时候好象只有减掉毒伤害。烧伤就不显示,好象也没掉血。
作者: yang1zhi    时间: 2014-10-14 21:58
找到一个多个减血的状态脚本。可是也只是输出伤害最高的而已,不能全部输出,也不能合计输出。
RUBY 代码复制
  1. def slip_damage_effect
  2.     if self.state?(3) #默认的毒效果
  3.       # 设置伤害
  4.       self.damage = self.maxhp / 10
  5.       # 分散
  6.       if self.damage.abs > 0
  7.         amp = [self.damage.abs * 15 / 100, 1].max
  8.         self.damage += rand(amp+1) + rand(amp+1) - amp
  9.       end
  10.       # HP 的伤害减法运算
  11.       self.hp -= self.damage
  12.     end
  13.     # 过程结束
  14.     return true
  15.   end
  16.   def slip_damage_effect
  17.     if self.state?(32) #烧伤   
  18.       # 设置伤害
  19.       self.damage = self.hp / 2
  20.       # HP 的伤害减法运算
  21.       self.hp -= self.damage
  22.     end
  23.     # 过程结束
  24.     return true
  25.     end

作者: yang1zhi    时间: 2014-10-14 22:43
我把脚本改成了这样。我发现HP是按照两个状态减的。但是显示只显示一条减HP。

RUBY 代码复制
  1. def slip_damage_effect
  2.     xxxx = self.maxhp / 2
  3.     yyyy = self.hp / 4
  4.     if self.state?(3) and self.state?(34) #默认的毒效果
  5.       self.damage = xxxx + yyyy
  6.       self.hp -= self.damage
  7.       end
  8.     if self.state?(3) #默认的毒效果
  9.       self.damage = xxxx
  10.       self.hp -= self.damage
  11.     end
  12.     if self.state?(34) #烧伤
  13.       self.damage = yyyy
  14.       self.hp -= self.damage
  15.     end
  16.       self.damage = xxxx + yyyy
  17.       self.hp -= self.damage
  18.     # 过程结束
  19.     return true
  20.   end

作者: 蝉岭Cicada    时间: 2014-10-15 09:00
改这样看看
  1. def slip_damage_effect
  2.     xxxx = self.maxhp / 2
  3.     yyyy = self.hp / 4
  4.     if self.state?(3) and self.state?(34) #默认的毒效果
  5.       self.damage = xxxx + yyyy
  6.       self.hp -= self.damage
  7.       return true
  8.     end
  9.     if self.state?(3) #默认的毒效果
  10.       self.damage = xxxx
  11.       self.hp -= self.damage
  12.       return true
  13.     end
  14.     if self.state?(34) #烧伤
  15.       self.damage = yyyy
  16.       self.hp -= self.damage
  17.       return true
  18.     end
  19.     # 过程结束
  20.     return true
  21. end
复制代码

作者: 蝉岭Cicada    时间: 2014-10-15 19:22
还不行的话改成这样
  1. def slip_damage_effect
  2.   xxxx = self.maxhp / 2
  3.   yyyy = self.hp / 4
  4.   if self.state?(3) and self.state?(34) #默认的毒烧伤效果
  5.     self.damage = (xxxx + yyyy)   # (xxxx + yyyy)
  6.     self.hp -= self.damage
  7.     return true
  8.   end
  9.   if self.state?(3) #默认的毒效果
  10.     self.damage = xxxx
  11.     self.hp -= self.damage
  12.     return true
  13.   end
  14.   if self.state?(34) #烧伤
  15.     self.damage = yyyy
  16.     self.hp -= self.damage
  17.     return true
  18.   end
  19.   # 过程结束
  20.   return true
  21. end
复制代码





欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1