#============================================================================== # +++ 区域限定物品是否可以使用 +++ # 作者 By:VIPArcher [email: VIPArcher@sina.com] # -- 本脚本来自 https://rpg.blue 使用或转载请保留以上信息。 #============================================================================== # 备注的道具只能站在区域ID为X的位置才可使用(对技能同样有效) # 可以备注多个区域例如 区域ID之间隔开就可以了 #============================================================================== $VIPArcherScript ||= {};$VIPArcherScript[:use_area] = 20141101 #-------------------------------------------------------------------------------- class Game_BattlerBase #-------------------------------------------------------------------------- # ● 检查是否可以使用技能/物品 #-------------------------------------------------------------------------- alias area_occasion? occasion_ok? def occasion_ok?(item) area_occasion?(item) && area_usable?(item) end #-------------------------------------------------------------------------- # ● 有备注的道具只能站在区域ID为X的位置才可使用 #-------------------------------------------------------------------------- def area_usable?(item) item.note =~ //i return true if $1.nil? $1.scan(/\d+/).include?($game_player.region_id.to_s) end end