Project1

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

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

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

作者: 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 ...

先在脚本编辑器里新增一个空白页,插入这段
RUBY 代码复制
  1. class Game_Battler
  2.   def clear_states
  3.     @states = []
  4.     self.hp = [1, self.hp].max
  5.   end
  6. end


游戏里需要用时这样写
RUBY 代码复制
  1. $game_actors[n].clear_states # n换成你角色的编号 比如阿尔西斯是1





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