Project1

标题: 如何清除特定角色所有状态-包括永久状态清除 [打印本页]

作者: l734273398    时间: 2019-10-7 08:09
标题: 如何清除特定角色所有状态-包括永久状态清除
本帖最后由 l734273398 于 2019-10-7 11:58 编辑

如题:如何清除特定角色永久状态(永久状态比较多也不清楚具体是哪个),使其恢复到最初的正常状态,最好可以利用脚本直接在对话中清除所有状态
作者: KB.Driver    时间: 2019-10-7 10:04
[pre lang="ruby"]actor = $game_actors[n] # n换成你角色的编号 比如阿尔西斯是1
actor.states = []
actor.hp = [1, actor.hp].max[/pre]
作者: guoxiaomi    时间: 2019-10-7 11:37
最好使用:
  1. actor.recover_all
复制代码
如果目的是清空全部状态,使用:
  1. actor.states.clear
复制代码

作者: KB.Driver    时间: 2019-10-7 12:08
KB.Driver 发表于 2019-10-7 10:04
actor = $game_actors[n] # n换成你角色的编号 比如阿尔西斯是1
actor.states = []
actor.hp = [1, actor.h ...

先在脚本编辑器里新增一个空白页,插入这段
[pre lang="ruby"]class Game_Battler
  def clear_states
    @states = []
    self.hp = [1, self.hp].max
  end
end[/pre]

游戏里需要用时这样写
[pre lang="ruby"]$game_actors[n].clear_states # n换成你角色的编号 比如阿尔西斯是1[/pre]




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