Project1

标题: 关于状态的问题…… [打印本页]

作者: q727866714250    时间: 2014-7-15 10:46
标题: 关于状态的问题……
是酱的,我为了丰富游戏,做了好多异常状态(魅惑啊,致盲什么的)
但是,某晚上灵感来了!
状态:凋零,血量低于50%时每回合失去5%的体力,想到是想到了,然后……计算公式错误了
所以,怎么写啊QAQ
作者: taroxd    时间: 2014-7-15 11:07
本帖最后由 taroxd 于 2014-7-18 17:07 编辑

未测试

RUBY 代码复制
  1. class Game_BattlerBase
  2.   alias hrg_without_state hrg
  3.   def hrg
  4.     hrg_without_state - (state?(27) && hp_rate < 0.5 ? 0.05 : 0)
  5.   end
  6. end

作者: VIPArcher    时间: 2014-7-16 14:11
本帖最后由 VIPArcher 于 2014-7-18 17:03 编辑
  1. class Game_Battler < Game_BattlerBase
  2.   #--------------------------------------------------------------------------
  3.   # ● HP 自动恢复
  4.   #--------------------------------------------------------------------------
  5.   def regenerate_hp
  6.     if state?(状态ID)  && hp_rate < 0.5         #判断状态 状态ID为凋零的ID
  7.       newhrg = hrg - 0.05 #更改HP恢复
  8.     else
  9.       newhrg = hrg
  10.     end
  11.     damage = -(mhp * newhrg).to_i
  12.     perform_map_damage_effect if $game_party.in_battle && damage > 0
  13.     @result.hp_damage = [damage, max_slip_damage].min
  14.     self.hp -= @result.hp_damage
  15.   end
  16. end
复制代码
未详细测试

你用这个吧~

作者: q727866714250    时间: 2014-7-18 16:23
啊,这几天没时间测试。。。。感谢大大们
ps:吐槽为什么全是2333.....




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