Project1

标题: 战斗中关于应用物品效果怎么改? [打印本页]

作者: 幻耶    时间: 2008-1-24 22:56
标题: 战斗中关于应用物品效果怎么改?
想改成队伍编号为4的队员无法使用任何物品,或者处于33号状态的队员无法使用任何物品。(不是指物品使用无效,而是在角色选取物品使用对象的时候直接跳过)只应用于战斗中



我觉得应该是在Game_Battler 3下面这段里改,不知怎么改?

  #--------------------------------------------------------------------------
  # ● 应用物品效果
  #     item : 物品
  #--------------------------------------------------------------------------
  def item_effect(item)
    # 清除会心一击标志
    self.critical = false
    # 物品的效果范围是 HP 1 以上的己方、自己的 HP 为 0、
    # 或者物品的效果范围是 HP 0 的己方、自己的 HP 为 1 以上的情况下
    if ((item.scope == 3 or item.scope == 4) and self.hp == 0) or
       ((item.scope == 5 or item.scope == 6) and self.hp >= 1)
         
      # 过程结束
      return false
    end
作者: superufo    时间: 2008-1-24 22:57
提示: 作者被禁止或删除 内容自动屏蔽
作者: 幻耶    时间: 2008-1-24 23:01
怎么灰掉?比如八人战斗,队伍编号0123可以正常使用,而为4567的队员无法使用任何物品,战斗中选择物品使用对象时4567号直接跳过
作者: superufo    时间: 2008-1-24 23:07
提示: 作者被禁止或删除 内容自动屏蔽
作者: superufo    时间: 2008-1-24 23:09
提示: 作者被禁止或删除 内容自动屏蔽
作者: 幻耶    时间: 2008-1-24 23:13
处于33号状态的队员无法使用任何物品就写成这样??


   @noitems = state?(33)  true : false
    if @noitems
      @actor_command_window.disable_item(3)
    end
作者: superufo    时间: 2008-1-24 23:14
提示: 作者被禁止或删除 内容自动屏蔽
作者: superufo    时间: 2008-1-24 23:16
提示: 作者被禁止或删除 内容自动屏蔽
作者: 幻耶    时间: 2008-1-24 23:20
这样的话进入战斗,怎么连1234号队员也无法使用物品了
作者: superufo    时间: 2008-1-24 23:22
提示: 作者被禁止或删除 内容自动屏蔽
作者: 幻耶    时间: 2008-1-24 23:26
这样?

#--------------------------------------------------------------------------
  # ● 开始选择物品
  #--------------------------------------------------------------------------
  def start_item_select
          unless @noitems
        $game_system.se_play($data_system.buzzer_se)
        return
      end
    # 生成物品窗口
    @item_window = Window_Item.new
    # 关联帮助窗口
    @item_window.help_window = @help_window
    # 无效化角色指令窗口
    @actor_command_window.active = false
    @actor_command_window.visible = false
  end
作者: superufo    时间: 2008-1-24 23:29
提示: 作者被禁止或删除 内容自动屏蔽
作者: superufo    时间: 2008-1-24 23:29
提示: 作者被禁止或删除 内容自动屏蔽
作者: 幻耶    时间: 2008-1-24 23:39
奇怪啊,进入战斗所有的角色都不能用物品啦{/ll}
作者: superufo    时间: 2008-1-24 23:45
提示: 作者被禁止或删除 内容自动屏蔽
作者: 幻耶    时间: 2008-1-24 23:50
这样写:
。。。。。。
    @actor_command_window.back_opacity = 160
    @actor_command_window.active = false
    @actor_command_window.visible = false
   
    @noitems =  @active_battler.state?(33) ? true : false  
    if @noitems
      @actor_command_window.disable_item(3)
    end
作者: superufo    时间: 2008-1-24 23:57
提示: 作者被禁止或删除 内容自动屏蔽
作者: 幻耶    时间: 2008-1-25 00:04
还是谢谢了。。新建了个干净的工程想再试试,添加方法和上面的一样,一遇敌怎么出现这个了?




还有那个Scene_Battle 3里添加的是unless @noitems 还是 unless @noitem?
作者: superufo    时间: 2008-1-25 00:07
提示: 作者被禁止或删除 内容自动屏蔽




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