把你刚才发的VX脚本copy了一下:
#============================================================================== # ■ Game_Battler #------------------------------------------------------------------------------ # 处理战斗者的类。这个类作为 Game_Actor 类与 Game_Enemy 类的 # 超级类来使用。 #============================================================================== SW_SET = [17,18,19,20,21,22,23,24] # 此处设定武器和技能关联的属性id #============================================================================== class Game_Battler #-------------------------------------------------------------------------- # ● 判断是否可以使用技能 # skill : 技能 # self.weapons : 武器id的数组 #-------------------------------------------------------------------------- alias _SkillWeapon_skill_can_use? skill_can_use? def skill_can_use?(skill_id) if self.is_a?(Game_Actor) $data_weapons[0] = RPG::Weapon.new $data_weapons[0].element_set =[] sw_boolean = false # 判断武器和技能关联 s = SW_SET & $data_skills[skill_id].element_set if s.empty? sw_boolean = true else s2 = s & $data_weapons[self.weapon_id].element_set if !s2.empty? sw_boolean = true end end $data_weapons[0] = nil return false if sw_boolean == false end return _SkillWeapon_skill_can_use?(skill_id) end end
#==============================================================================
# ■ Game_Battler
#------------------------------------------------------------------------------
# 处理战斗者的类。这个类作为 Game_Actor 类与 Game_Enemy 类的
# 超级类来使用。
#==============================================================================
SW_SET = [17,18,19,20,21,22,23,24] # 此处设定武器和技能关联的属性id
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# ● 判断是否可以使用技能
# skill : 技能
# self.weapons : 武器id的数组
#--------------------------------------------------------------------------
alias _SkillWeapon_skill_can_use? skill_can_use?
def skill_can_use?(skill_id)
if self.is_a?(Game_Actor)
$data_weapons[0] = RPG::Weapon.new
$data_weapons[0].element_set =[]
sw_boolean = false # 判断武器和技能关联
s = SW_SET & $data_skills[skill_id].element_set
if s.empty?
sw_boolean = true
else
s2 = s & $data_weapons[self.weapon_id].element_set
if !s2.empty?
sw_boolean = true
end
end
$data_weapons[0] = nil
return false if sw_boolean == false
end
return _SkillWeapon_skill_can_use?(skill_id)
end
end
|