赞 | 123 |
VIP | 13 |
好人卡 | 16 |
积分 | 195 |
经验 | 38692 |
最后登录 | 2024-11-27 |
在线时间 | 3112 小时 |
Lv4.逐梦者
- 梦石
- 0
- 星屑
- 19488
- 在线时间
- 3112 小时
- 注册时间
- 2013-1-11
- 帖子
- 1292
|
本帖最后由 张咚咚 于 2017-10-30 09:55 编辑
- #打开一号开关,2,4,6的武器和1,3,5的防具自动卸下且不可装备
- $equips = {:s=>1,:w=>[2,4,6],:a=>[1,3,5]}
- class Window_EquipItem < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 项目的描绘
- # index : 项目符号
- #--------------------------------------------------------------------------
- alias qqeat_window_equipitem_draw_item draw_item
- def draw_item(index)
- item = @data[index]
- if $game_switches[$equips[:s]] and ((item.is_a?(RPG::Weapon) and $equips[:w].include?(item.id)) or (item.is_a?(RPG::Armor) and $equips[:a].include?(item.id)))
- self.contents.font.color = disabled_color
- item.instance_variable_set(:@no_equip, true)
- else
- self.contents.font.color = normal_color
- item.instance_variable_set(:@no_equip, false)
- end
- qqeat_window_equipitem_draw_item(index)
- end
- end
- class Scene_Equip
- #--------------------------------------------------------------------------
- # ● 刷新画面 (物品窗口被激活的情况下)
- #--------------------------------------------------------------------------
- alias qqeat_scene_equip_update_item update_item
- def update_item
- if Input.trigger?(Input::C) and $game_switches[$equips[:s]] and @item_window.item != nil and @item_window.item.instance_variable_get(:@no_equip)
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- qqeat_scene_equip_update_item
- end
- end
- class Game_Switches
- #--------------------------------------------------------------------------
- # ● 设置开关
- # switch_id : 开关 ID
- # value : ON (true) / OFF (false)
- #--------------------------------------------------------------------------
- alias qqeat_game_switches_eee []=
- def []=(switch_id, value)
- $game_party.actors.each do |actor|
- break if switch_id != $equips[:s] or !value
- equip = [actor.weapon_id,actor.armor1_id,actor.armor2_id,actor.armor3_id,actor.armor4_id]
- equip.length.times do |index|
- actor.equip(index, 0) if $equips[(index == 0 ? :w : :a)].include?(equip[index])
- end
- end
- qqeat_game_switches_eee(switch_id, value)
- end
- end
复制代码
|
|