Project1

标题: 如何让中毒攻击根据角色等级改变 [打印本页]

作者: 求把AK47    时间: 2008-7-29 21:39
提示: 作者被禁止或删除 内容自动屏蔽
作者: IamI    时间: 2008-7-29 21:43
看不懂{/fd}只能告诉LZ关于中毒【连续伤害】的位置在于脚本Scene_Battle4当中130至133行,还有就是参考资料:
http://rpg.blue/web/htm/news539.htm
作者: 凌冰    时间: 2008-7-29 22:01
即插即用式脚本
下面的i为中毒状态的ID

  1. class Game_Battler
  2. def slip_damage_effect
  3.     # 设置伤害
  4.     self.damage = self.level * 100
  5.     self.damage /= (2**($data_states[i].hold_turn-@states_turn[i]))
  6.     # 分散
  7.     if self.damage.abs > 0
  8.       amp = [self.damage.abs * 15 / 100, 1].max
  9.       self.damage += rand(amp+1) + rand(amp+1) - amp
  10.     end
  11.     # HP 的伤害减法运算
  12.     self.hp -= self.damage
  13.     # 过程结束
  14.     return true
  15.   end
  16. end
复制代码


[LINE]1,#dddddd[/LINE]系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
作者: 求把AK47    时间: 2008-7-29 22:06
提示: 作者被禁止或删除 内容自动屏蔽
作者: 凌冰    时间: 2008-7-29 22:18
在main之前,随便找个地方插入一下就行了
作者: 求把AK47    时间: 2008-7-29 22:19
提示: 作者被禁止或删除 内容自动屏蔽
作者: IamI    时间: 2008-7-29 22:20
自我屏蔽,眼残频发
作者: 凌冰    时间: 2008-7-29 22:21
self.damage /= (2**($data_states.hold_turn-@states_turn))

两个i
作者: 求把AK47    时间: 2008-7-30 17:58
提示: 作者被禁止或删除 内容自动屏蔽
作者: IamI    时间: 2008-7-30 18:00
把两个i替换成ID号即可= =难道凌冰说的还不清楚咩?
(如果效果没问题的话……)
作者: 求把AK47    时间: 2008-7-30 18:07
提示: 作者被禁止或删除 内容自动屏蔽
作者: 凌冰    时间: 2008-7-30 18:26
以下引用求把AK47于2008-7-30 10:07:02的发言:


以下引用IamI于2008-7-30 10:00:50的发言:

把两个i替换成ID号即可= =难道凌冰说的还不清楚咩?
(如果效果没问题的话……)




换了不过不掉血!


那个,我脑残了,修改一下
class Game_Battler
def slip_damage?
    for i in @states
      if $data_states.slip_damage
        return true
      end
    end
    @poison_turn = []
    return false
  end
def slip_damage_effect
  # 设置伤害
  self.damage = self.level * 100
  @poison_turn = [] if @poison_turn == nil
  @poison_turn = 0 if @poison_turn == 0
  self.damage /= (2**@poison_turn) if @poison_turn <= 20
  self.damage = 0 if @poison_turn > 20
  @poison_turn += 1
  # 分散
  if self.damage.abs > 0
    amp = [self.damage.abs * 15 / 100, 1].max
    self.damage += rand(amp+1) + rand(amp+1) - amp
  end
  # HP 的伤害减法运算
  self.hp -= self.damage
  # 过程结束
  return true
end
end


作者: IamI    时间: 2008-7-30 18:27
抓LS,self.level
Game_Enemy.level? unmethod will happen= =
作者: 凌冰    时间: 2008-7-30 18:37
那改变一下类好了
敌人仍然调用原来的公式
class Game_Actor < Game_Battler
def slip_damage?
   result = super
   @poison_turn = [] if !result
   return result
end
def slip_damage_effect
# 设置伤害
self.damage = self.level * 100
@poison_turn = [] if @poison_turn == nil
@poison_turn = 0 if @poison_turn == 0
self.damage /= (2**@poison_turn) if @poison_turn <= 20
self.damage = 0 if @poison_turn > 20
@poison_turn += 1
# 分散
if self.damage.abs > 0
   amp = [self.damage.abs * 15 / 100, 1].max
   self.damage += rand(amp+1) + rand(amp+1) - amp
end
# HP 的伤害减法运算
self.hp -= self.damage
# 过程结束
return true
end
end

作者: 求把AK47    时间: 2008-7-30 20:33
提示: 作者被禁止或删除 内容自动屏蔽




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