Project1

标题: 有没有物品使用技能的脚本? [打印本页]

作者: shengfeng    时间: 2017-7-8 21:44
标题: 有没有物品使用技能的脚本?
大神们有没有
作者: 张咚咚    时间: 2017-7-9 07:58
[pre lang="ruby"]
$物品对应技能 = {
17 => 5,
}

class Game_Action
  #--------------------------------------------------------------------------
  # ● 设置物品
  #--------------------------------------------------------------------------
  def set_item(item_id)
    if $物品对应技能.keys.include?(item_id)
      set_skill($物品对应技能[item_id])
    else
      @item.object = $data_items[item_id]
    end
    self
  end
end
class Scene_Battle < Scene_Base
  #--------------------------------------------------------------------------
  # ● 物品“确定”
  #--------------------------------------------------------------------------
  def on_item_ok
   
    if $物品对应技能.keys.include?(@item_window.item.id)
      @skill = $data_skills[$物品对应技能[@item_window.item.id]]
      BattleManager.actor.input.set_skill(@skill.id)
      BattleManager.actor.last_skill.object = @skill
    end
   
    @item = @item_window.item
    BattleManager.actor.input.set_item(@item.id)
    if !@item.need_selection?
      @item_window.hide
      next_command
    elsif @item.for_opponent?
      select_enemy_selection
    else
      select_actor_selection
    end
    $game_party.last_item.object = @item
  end
end[/pre]
作者: 300英雄    时间: 2017-7-9 09:33
等会,物品干嘛要变成技能,本身物品就可以当一次性的技能。或者不消耗此物品就是永久技能(就是所有人都能用)只要你设置该物品效果等于那个技能不就得了。你说物品使用技能好像没意义吧
作者: shengfeng    时间: 2017-7-9 11:26
因为战斗型物品只能单体攻击
作者: shengfeng    时间: 2017-7-9 12:12
写错了因为使用战斗型物品角色会移动到敌人面前在攻击(怎么设置都要移动到敌人面前在攻击)所以求了物品使用技能,使用后正常了




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