#============================================================================== # ★ PANDA_DisableInVehicle #------------------------------------------------------------------------------ # Version 1.0.0 # Modified 2012-08-11 # By panda (werepanda.jp) http://www.werepanda.jp/ #------------------------------------------------------------------------------ # 乗り物に乗っている最中は使用不可のアイテムやスキルを作るスクリプト素材です。 # # 以下の指定文字列をアイテムまたはスキルのメモ欄に記述すると、 # 乗り物に乗っている最中は使用不可になります。 # PANDA::DisableInVehicle #============================================================================== class RPG::UsableItem < RPG::BaseItem #-------------------------------------------------------------------------- # ○ 乗り物に乗っている最中は使用不可(新規定義) #-------------------------------------------------------------------------- def not_in_vehicle? if @not_in_vehicle == nil if @note[/PANDA::DisableInVehicle/i] @not_in_vehicle = true else @not_in_vehicle = false end end return @not_in_vehicle end end class Game_Party #-------------------------------------------------------------------------- # ◎ アイテムの使用可能判定(追加定義) # item : アイテム #-------------------------------------------------------------------------- alias _panda_disabledinvehicle_item_can_use? item_can_use? def item_can_use?(item) return false unless _panda_disabledinvehicle_item_can_use?(item) return false if item.not_in_vehicle? && $game_player.in_vehicle? return true end end class Game_Battler #-------------------------------------------------------------------------- # ◎ スキルの使用可能判定(追加定義) # skill : スキル #-------------------------------------------------------------------------- alias _panda_disabledinvehicle_skill_can_use? skill_can_use? def skill_can_use?(skill) return false unless _panda_disabledinvehicle_skill_can_use?(skill) return false if skill.not_in_vehicle? && $game_player.in_vehicle? return true end end