查看: 1005|回复: 0

双手持用的武器

[复制链接]

闇吼者の災悪眷族

梦石
0
星屑
1366
在线时间
2881 小时
注册时间
2014-7-29
回帖
6408
发表于 2015-4-27 19:47:01 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
本帖最后由 三途亚梦 于 2016-9-24 12:13 编辑

[pre lang="ruby"]#==============================================================================
# +++ 双手持用武器 +++
#==============================================================================
# 提问区应求脚本 By 三途亚梦
# 脚本原地址:https://rpg.blue/thread-377264-1-1.html
#==============================================================================
# ★ 在数据库武器中备注[双手](中括号必要),则该武器为双手持用武器。
# 双手持用武器:该武器需要双手使用,装备时会自动卸下其它武器和盾牌。
#==============================================================================
# ■ Game_Actor
#------------------------------------------------------------------------------
#  管理角色的类。
#==============================================================================
class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # ● 更换装备
  #     slot_id : 装备栏 ID
  #     item    : 武器/护甲(为 nil 时装备解除)
  #--------------------------------------------------------------------------
  alias amu_20150427_change_equip change_equip
  def change_equip(slot_id, item)
    if item != nil && item.note.include?("[双手]")
      @equips.each_with_index do |weapon|
        if weapon.object != nil && (weapon.object.etype_id == 0 || weapon.object.etype_id == 1)
          trade_item_with_party(nil, weapon.object)
          weapon.object = nil
        end
      end
    elsif item != nil && item.etype_id == 1
      @equips.each_with_index do |weapon|
        if weapon.object != nil && weapon.object.note.include?("[双手]")
          trade_item_with_party(nil, weapon.object)
          weapon.object = nil
        end
      end
    end
    amu_20150427_change_equip(slot_id, item)
  end
end
[/pre]

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本发帖返回顶部