#============================================================================== # ○部位別装備固定 & 無装備禁止 Ver1.00 # for RGSS2 # 西瓜 / Space not far # http://muspell.raindrop.jp/ # 装備の変更を指定した部位のみ禁止するスクリプトです。 # また、無装備状態を禁止するだけの機能、固定部位の色変更のオプションがあります。 #============================================================================== module SNF #部位別装備固定 EQUIP_FIX = [] # 初期化 # 0   1 2 3  4 # 武器 盾 頭 身体 装飾品 # EQUIP_FIX[アクターID] = [固定部位] # ↓設定例 EQUIP_FIX[1] = [2,3] # ラルフの頭と身体装備の固定 EQUIP_FIX[2] = [0,1,2,3] # ウルリカ装飾品以外固定 FIXCOLORCHANGE = true # 固定装備の色変更をしない場合はfalse。 FIXCOLOR = 0 # 固定装備色の指定。要領は\C[N]と同じ。 FIXTRANSLUCENT = true # 半透明にする場合はtrue、しない場合はfalse。 #無装備状態禁止 EQUIP_PROHIBITING = true # 無装備禁止機能を使わない場合はfalse。 EQUIP_PROHIBIT = [] # 初期化 # EQUIP_PROHIBIT[アクターID] = [無装備禁止部位] # ↓設定例 EQUIP_PROHIBIT[3] = [0] # ベネットの武器無装備禁止 EQUIP_PROHIBIT[4] = [1,4] # イルヴァの盾と装飾品の無装備禁止 end class Scene_Equip < Scene_Base def update_equip_selection if Input.trigger?(Input::B) Sound.play_cancel return_scene elsif Input.trigger?(Input::R) Sound.play_cursor next_actor elsif Input.trigger?(Input::L) Sound.play_cursor prev_actor elsif Input.trigger?(Input::C) SNF::EQUIP_FIX[@actor.id] = [] if SNF::EQUIP_FIX[@actor.id] == nil if @actor.fix_equipment or SNF::EQUIP_FIX[@actor.id].include?(@equip_window.index) Sound.play_buzzer else Sound.play_decision @equip_window.active = false @item_window.active = true @item_window.index = 0 end end end end if SNF::FIXCOLORCHANGE class Window_Equip < Window_Selectable def refresh self.contents.clear @data = [] for item in @actor.equips do @data.push(item) end @item_max = @data.size self.contents.font.color = system_color if @actor.two_swords_style self.contents.draw_text(4, WLH * 0, 92, WLH, Vocab::weapon1) self.contents.draw_text(4, WLH * 1, 92, WLH, Vocab::weapon2) else self.contents.draw_text(4, WLH * 0, 92, WLH, Vocab::weapon) self.contents.draw_text(4, WLH * 1, 92, WLH, Vocab::armor1) end self.contents.draw_text(4, WLH * 2, 92, WLH, Vocab::armor2) self.contents.draw_text(4, WLH * 3, 92, WLH, Vocab::armor3) self.contents.draw_text(4, WLH * 4, 92, WLH, Vocab::armor4) for i in 0..4 SNF::EQUIP_FIX[@actor.id] = [] if SNF::EQUIP_FIX[@actor.id] == nil if @actor.fix_equipment or SNF::EQUIP_FIX[@actor.id].include?(i) self.contents.font.color = text_color(SNF::FIXCOLOR) enabled = SNF::FIXTRANSLUCENT ? false : true draw_item_name2(@data[i], 92, WLH * i, enabled) else draw_item_name(@data[i], 92, WLH * i) end end end end class Window_Base def draw_item_name2(item, x, y, enabled = true) if item != nil draw_icon(item.icon_index, x, y, enabled) self.contents.font.color.alpha = enabled ? 255 : 128 self.contents.draw_text(x + 24, y, 172, WLH, item.name) end end end end if SNF::EQUIP_PROHIBITING class Scene_Equip < Scene_Base def update_item_selection if Input.trigger?(Input::B) Sound.play_cancel @equip_window.active = true @item_window.active = false @item_window.index = -1 elsif Input.trigger?(Input::C) SNF::EQUIP_PROHIBIT[@actor.id] = [] if SNF::EQUIP_PROHIBIT[@actor.id] == nil if SNF::EQUIP_PROHIBIT[@actor.id].include?(@equip_window.index) and @item_window.item==nil Sound.play_buzzer return false end Sound.play_equip @actor.change_equip(@equip_window.index, @item_window.item) @equip_window.active = true @item_window.active = false @item_window.index = -1 @equip_window.refresh for item_window in @item_windows item_window.refresh end end end end end