Project1

标题: 我想让角色行动命令因人而异,该怎么办? [打印本页]

作者: szzyc0    时间: 2013-12-22 10:06
标题: 我想让角色行动命令因人而异,该怎么办?
比如1号阿尔西斯是攻击、特技、防御、物品,而2号帕吉尔是突刺、绝技、抵抗、道具。
作者: 恐惧剑刃    时间: 2013-12-22 10:20
本帖最后由 恋′挂机 于 2013-12-22 10:22 编辑

@actor_index

@actor_index 是角色的索引,可以分歧$game_actors[@actor_index]实现
在指令窗口(复制一份Window_Command)refresh后边加上参数(actor = nil)
分歧
unless actor.nil?
case actor.id
when 1
  @commands = %|攻击 特技 防御 物品|
when 2
  @commands = %|突刺 绝技 抵抗 道具|
end
end

去改变他的字符串序列即可
作者: szzyc0    时间: 2013-12-22 11:42
http://rpg.blue/forum.php?mod=viewthread&tid=129370
我竟然搜到了。就这样吧。
作者: 恐惧剑刃    时间: 2013-12-22 11:57
  1. # 放在Scene_Battle4下边

  2. class Window_Command < Window_Selectable
  3.   def refresh(actor = nil)
  4.     self.contents.clear
  5.     if $scene.is_a?(Scene_Battle)
  6.       if not actor.nil?
  7.         case actor.id
  8.         when 2
  9.           @commands = ["突刺", "绝技", "抵抗", "道具"]
  10.         else
  11.           @commands = ["攻击", "特技", "防御", "物品"]
  12.         end
  13.         @item_max = @commands.size
  14.       end
  15.     end
  16.     for i in 0...@item_max
  17.       draw_item(i, normal_color)
  18.     end
  19.   end
  20. end

  21. class Scene_Battle
  22.   alias update_command_case update
  23.   def update
  24.     if @actor_index != nil and @ac_index != @actor_index
  25.       @ac_index = @actor_index
  26.       @actor_command_window.contents.clear
  27.       @actor_command_window.refresh($game_party.actors[@actor_index])
  28.     end
  29.     update_command_case
  30.   end
  31. end
复制代码





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