# ▼▲▼ No43. アイテム効果のクラス制限 ▼▲▼ # # update 2005/11/22 # #============================================================================== # ■ Game_Battler #============================================================================== class Game_Battler #-------------------------------------------------------------------------- # ○ クラスによるアイテム使用の限定データベース #-------------------------------------------------------------------------- def item_class_limitation(item_id) # アイテムIDによるクラス限定 case item_id #======================================================================== # □ カスタマイズポイント #======================================================================== when 33 return [1,2,3] # # 記述形式: # # when 数値(Numeric) - アイテムID # return 配列(Array) - クラスID配列 # # 記述例:「アイテムID 12(ディスペルハーブ) を # クラスID 7と8(クレリックとメイジ)に対してだけ使用可能にする」 # when 12 # return [7, 8] # # # # when 1 # return [1] # when 4 # return [5] # のように、何行も記述可能。 # # また↓、 [] は「全てのクラスに対して使用可能」を意味する。 # #======================================= カスタマイズポイントここまで =┘ end # その他 return [] end #-------------------------------------------------------------------------- # ● アイテムの効果適用 #-------------------------------------------------------------------------- alias xrxs43_item_effect item_effect def item_effect(item) # 使用可能判定 if self.is_a?(Game_Actor) a = item_class_limitation(item.id) if a != [] and !a.include?(self.class_id) return false end end # 呼び戻す xrxs43_item_effect(item) end end