| 赞 | 4 |
| VIP | |
| 好人卡 | |
| 积分 | 1 |
| 经验 | |
| 最后登录 | 2020-10-7 |
| 在线时间 | 1028 小时 |
巫女会长
- 梦石
- 0
- 星屑
- 60
- 在线时间
- 1028 小时
- 注册时间
- 2009-10-24
- 回帖
- 3425

|
发表于 2013-11-29 04:49:35
|
显示全部楼层
帮你改好了。把这个新的脚本插入就行。
- =begin
- ===============================================================================
- 副手拓展脚本 by dukesward
- 使用方法:在武器状态哈希添加武器类型。
- SINGLE: 单手武器
- DOUBLE: 双手武器
- BOW: 弓
- WAND: 魔法杖
- GUN: 铳(火枪)
- 然后在防具状态哈希对应的数组中添加防具类型。
- 例如:
- WEAPON_STATE中"SINGLE" => [1], 表示类型1的武器为单手武器。
- ARMOR_STATE中"SINGLE" => [1], 表示类型1的防具必须在使用单手武器的同时装备。
- ===============================================================================
- =end
- #--------------------------------------------------------------------------
- # ● 武器状态哈希定义
- #--------------------------------------------------------------------------
- WEAPON_STATE = {
- "SINGLE" => [1, 2, 4, 5, 7, 8],
- "DOUBLE" => [3, 11],
- "BOW" => [6],
- "WAND" => [9],
- "GUN" => [10],
- }
- #--------------------------------------------------------------------------
- # ● 防具状态哈希定义
- #--------------------------------------------------------------------------
- ARMOR_STATE = {
- "SINGLE" => [5, 6],
- "DOUBLE" => [],
- "BOW" => [8],
- "WAND" => [7],
- "GUN" => [9],
- }
- class RPG::Weapon < RPG::EquipItem
- #--------------------------------------------------------------------------
- # ● 武器为单手武器?
- #--------------------------------------------------------------------------
- def for_single
- return WEAPON_STATE["SINGLE"].include?(wtype_id)
- end
- end
-
- class Game_Actor < Game_Battler
- #--------------------------------------------------------------------------
- # ● 武器装备状态
- #--------------------------------------------------------------------------
- def equip_state
- WEAPON_STATE.keys.each do |key|
- return key if WEAPON_STATE[key].include?(weapons[0].wtype_id)
- end
- return "SINGLE"
- end
- #--------------------------------------------------------------------------
- # ● 判定是否可以更换装备
- # slot_id : 装备栏 ID
- #--------------------------------------------------------------------------
- def equip_change_ok?(slot_id)
- return false if equip_type_fixed?(equip_slots[slot_id])
- return slot_id == 1 ? side_change_ok? : !equip_type_sealed?(equip_slots[slot_id])
- return true
- end
- #--------------------------------------------------------------------------
- # ● 判定是否可以使用副手装备
- # slot_id : 装备栏 ID
- #--------------------------------------------------------------------------
- def side_change_ok?
- return self.weapons.empty? ? true :
- !WEAPON_STATE["DOUBLE"].include?(self.weapons[0].wtype_id)
- end
- #--------------------------------------------------------------------------
- # ● 卸下无法装备的物品
- # item_gain : 卸下的装备是否保留
- #--------------------------------------------------------------------------
- def release_unequippable_items(item_gain = true)
- @equips.each_with_index do |item, i|
- if !equip_allowed?(item.object, i) || item.object.etype_id != equip_slots[i]
- trade_item_with_party(nil, item.object) if item_gain
- item.object = nil
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 判定是否允许装备
- #--------------------------------------------------------------------------
- def equip_allowed?(item, slot_id)
- return slot_id == 1 ? off_hand_equippable?(item) : equippable?(item)
- end
- #--------------------------------------------------------------------------
- # ● 判断副手装备类型
- #--------------------------------------------------------------------------
- def off_hand_equippable?(item)
- return false unless item.is_a?(RPG::EquipItem)
- if item.is_a?(RPG::Weapon)
- return false if weapons && !weapons[0].for_single
- return item.for_single ? true : false
- end
- if item.is_a?(RPG::Armor) && !weapons.empty?
- return false if !ARMOR_STATE[equip_state].include?(item.atype_id)
- end
- return equip_atype_ok?(item.atype_id) if item.is_a?(RPG::Armor)
- return false
- end
- end
- class Window_EquipItem < Window_ItemList
- #--------------------------------------------------------------------------
- # ● 查询使用列表中是否含有此物品
- #--------------------------------------------------------------------------
- def include?(item)
- return true if item == nil
- return false unless item.is_a?(RPG::EquipItem)
- return false if @slot_id < 0
- return false if item.etype_id != @actor.equip_slots[@slot_id]
- return @slot_id == 1 ? @actor.off_hand_equippable?(item) : @actor.equippable?(item)
- end
- end
复制代码 |
|