Project1

标题: 如何让某角色不参加战斗 [打印本页]

作者: 欧买歌    时间: 2014-12-20 13:55
标题: 如何让某角色不参加战斗
比如说地图上角色只显示阿尔西斯,实际上阿尔西斯不参加战斗
作者: chd114    时间: 2014-12-20 16:35
  1. #======================================================
  2. # 某些角色不参与战斗,柳柳@66rpg.com
  3. #======================================================
  4. class Scene_Battle
  5.   #====================================================
  6.   # 不参与战斗的编号写在这里
  7.   #====================================================
  8.   I_AM_NPC = [1, 2, 3]
  9.   # 不参与战斗的角色,进入战斗的时候临时轰走
  10.   alias o_start start unless $@
  11.   def start
  12.     @no_fight = []
  13.     for aid in I_AM_NPC
  14.       if $game_party.members.include?($game_actors[aid])
  15.         @no_fight.push(aid)
  16.         $game_party.remove_actor(aid)
  17.       end
  18.     end
  19.     o_start
  20.   end
  21.   
  22.   # 被轰走的角色,结束战斗的时候叫回来
  23.   alias o_terminate terminate unless $@
  24.   def terminate
  25.     o_terminate
  26.     for aid in @no_fight
  27.       $game_party.add_actor(aid)
  28.     end
  29.   end
  30.   
  31. end
复制代码





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