#============================================================================== # ■ VXAce-RGSS3-8-opt スキル習得アイテム(熟練度版) [Ver.1.0.0] by Claimh #------------------------------------------------------------------------------ # ある熟練度以上になっている場合のみスキルを習得できるアイテムです。 #------------------------------------------------------------------------------ # [データベース設定方法] # @使用効果にてスキル習得を設定 # Aメモ欄に @attr_item[属性ID,習得可能レベル] を入力 # ※武器タイプの場合は属性ID=武器タイプID+1000の値を入力 # 例1) @attr_item[3,1] # 炎Lv3必要 # 例2) @attr_item[1001,8] # 斧Lv8必要 # 例3) @attr_item[1004,5] # @attr_item[9,2] # 剣Lv3必要 + 神聖Lv2 #============================================================================== class RPG::UsableItem < RPG::BaseItem #------------------------------------------------------------------------- # ● 熟練度スキル習得可能? #------------------------------------------------------------------------- def attr_skill_enable?(actor) result = @note.scan(/@attr_item\[(\d+),(\d+)\]/) return true if result.nil? or result.empty? result.all? { |c| actor.attr[c[0].to_i].level >= c[1].to_i } end end class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # ● 使用効果のテスト [over ride] #-------------------------------------------------------------------------- def item_effect_test(user, item, effect) return false unless item.attr_skill_enable?(self) super(user, item, effect) end end