Project1

标题: 请教一下,技能方面的设置 [打印本页]

作者: baijingxue00    时间: 2014-9-21 11:15
标题: 请教一下,技能方面的设置
如果想制作一个拿着特定武器类型就有特定BUFF效果的被动技能,应该怎么做呢?
比如拿着武器类型为枪,就可以攻击时回血之类的
VA的技能设置,只能说武器为特定的某个武器……
作者: 上贺茂润    时间: 2014-9-21 11:17
横版战斗 攻击特效
作者: chd114    时间: 2014-9-21 11:26
  1. #--------------------------------------------------------------------------
  2. # ● require Taroxd基础设置
  3. #    使用方法:在装备/技能/角色/职业上备注 <attackskill x> / <guardskill x>
  4. #--------------------------------------------------------------------------

  5. compatibility = false # 如果和战斗系统发生冲突,请尝试设为 true

  6. class RPG::BaseItem
  7.   note_i :attack_skill, false
  8.   note_i :guard_skill,  false
  9. end

  10. class Game_Actor < Game_Battler
  11.   #--------------------------------------------------------------------------
  12.   # ● 获取普通攻击的技能 ID
  13.   #--------------------------------------------------------------------------
  14.   def_chain :attack_skill_id do |old|
  15.     note_objects {|item| return item.attack_skill if item.attack_skill }
  16.     old.call
  17.   end
  18.   #--------------------------------------------------------------------------
  19.   # ● 获取防御的技能 ID
  20.   #--------------------------------------------------------------------------
  21.   def_chain :guard_skill_id do |old|
  22.     note_objects {|item| return item.guard_skill if item.guard_skill }
  23.     old.call
  24.   end
  25. end

  26. unless compatibility

  27. class Scene_Battle < Scene_Base
  28.   #--------------------------------------------------------------------------
  29.   # ● 普通攻击无需选择目标的情况
  30.   #--------------------------------------------------------------------------
  31.   def_chain :command_attack do |old|
  32.     skill = $data_skills[BattleManager.actor.attack_skill_id]
  33.     if !skill.need_selection?
  34.       BattleManager.actor.input.set_attack
  35.       next_command
  36.     elsif skill.for_opponent?
  37.       old.call
  38.     else
  39.       BattleManager.actor.input.set_attack
  40.       select_actor_selection
  41.     end
  42.   end
  43.   #--------------------------------------------------------------------------
  44.   # ● 防御需要选择目标的情况
  45.   #--------------------------------------------------------------------------
  46.   def_chain :command_guard do |old|
  47.     skill = $data_skills[BattleManager.actor.guard_skill_id]
  48.     if skill.need_selection?
  49.       BattleManager.actor.input.set_guard
  50.       skill.for_opponent? ? select_enemy_selection : select_actor_selection
  51.     else
  52.       old.call
  53.     end
  54.   end
  55. end

  56. class Window_ActorCommand < Window_Command
  57.   #--------------------------------------------------------------------------
  58.   # ● 更改攻击指令名称
  59.   #--------------------------------------------------------------------------
  60.   def add_attack_command
  61.     name = $data_skills[@actor.attack_skill_id].name
  62.     add_command(name, :attack, @actor.attack_usable?)
  63.   end
  64.   #--------------------------------------------------------------------------
  65.   # ● 更改防御指令名称
  66.   #--------------------------------------------------------------------------
  67.   def add_guard_command
  68.     name = $data_skills[@actor.guard_skill_id].name
  69.     add_command(name, :guard, @actor.guard_usable?)
  70.   end
  71. end

  72. end # unless compatibility
复制代码
@taroxd 的东西- -|||
你把普通攻击的那个技能复制一个,里面放吸血效果,武器里设置装备爱心金刚击枪后习得这个技能,这样的话你的普通攻击就是那个技能而不是1号技能了
作者: chd114    时间: 2014-9-21 11:53
好吧0.0如果上面那个不能用,那可以这样弄

Game_BattlerBase里面有一个
  1.   #--------------------------------------------------------------------------
  2.   # ● 获取普通攻击的技能 ID
  3.   #--------------------------------------------------------------------------
  4.   def attack_skill_id
  5.     return 1
  6.   end
复制代码
在这里加条件分歧···@VIPArcher 交给你吧{:2_254:}VA的是否装备武器X的条件分歧什么的我不会写···




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