| 赞 | 402 |
| VIP | |
| 好人卡 | |
| 积分 | 251 |
| 经验 | |
| 最后登录 | 2024-7-2 |
| 在线时间 | 3339 小时 |
- 梦石
- 1
- 星屑
- 24088
- 在线时间
- 3339 小时
- 注册时间
- 2011-7-8
- 回帖
- 3862

|
发表于 2017-6-9 22:46:59
|
显示全部楼层
修改 Game_Battler 的 hp= 方法,原来的方法在这里,新增的部分在 def 下面第 1 行:
[pre lang="ruby"]class Game_Battler
#--------------------------------------------------------------------------
# ● 更改 HP
# hp : 新的 HP
#--------------------------------------------------------------------------
def hp=(hp)
return if state?(10) && hp >= @hp # 拥有状态10 ,阻止回复
@hp = [[hp, maxhp].min, 0].max
if @hp == 0 and not state?(1) and not @immortal
add_state(1) # 附加「无法战斗」状态(1号状态)
@added_states.push(1)
elsif @hp > 0 and state?(1)
remove_state(1) # 移除「无法战斗」状态(1号状态)
@removed_states.push(1)
end
end
end[/pre] |
评分
-
查看全部评分
|