加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 noanyname 于 2013-10-17 17:12 编辑
搜索到两个关于装备属性的脚本,但是直接在main上新建脚本复制进去没效果,是XP和VX不兼容么,应该怎么改才能用?
他们的效果是,在属性中添加名为属性名+-40%的百分比名,就可以获得不同比例的属性攻击
# 仱仮仱 憰旛懏惈庢摼儔僀僽儔儕 仱仮仱 # # update 2006/ 4/11 # #============================================================================== # --- 憰旛懏惈庢摼儔僀僽儔儕 --- #============================================================================== class Game_Battler #-------------------------------------------------------------------------- # 仜 僗僉儖偺懏惈庢摼 #-------------------------------------------------------------------------- def skill_element_set(skill) return skill.nil? ? [] : skill.element_set end #-------------------------------------------------------------------------- # 仜 慡憰旛偺懏惈庢摼 #-------------------------------------------------------------------------- def equip_element_set return self.element_set + self.guard_element_set end #-------------------------------------------------------------------------- # 仜 慡杊嬶偺懏惈庢摼 #-------------------------------------------------------------------------- def guard_element_set return [] end end class Game_Actor < Game_Battler def guard_element_set set = [] for id in self.armor_ids next if id.nil? armor = $data_armors[id] set += (armor != nil ? armor.guard_element_set : []) end return set end #-------------------------------------------------------------------------- # 仜 晲婍 ID攝楍 #-------------------------------------------------------------------------- def weapon_ids @weapon_ids = [] if @weapon_ids == nil @weapon_ids[0] = @weapon_id return @weapon_ids end #-------------------------------------------------------------------------- # 仜 杊嬶 ID攝楍 #-------------------------------------------------------------------------- def armor_ids @armor_ids = [] if @armor_ids == nil @armor_ids[0] = @armor1_id @armor_ids[1] = @armor2_id @armor_ids[2] = @armor3_id @armor_ids[3] = @armor4_id return @armor_ids end #-------------------------------------------------------------------------- # 仜 憰旛攝楍偺庢摼 #-------------------------------------------------------------------------- def equipments equipments = [] self.weapon_ids.each {|id| equipments.push($data_weapons[id])} self.armor_ids.each {|id| equipments.push($data_armors[id])} return equipments end #-------------------------------------------------------------------------- # 仜 憰旛拞丠 #-------------------------------------------------------------------------- def equiping?(item) case item when RPG::Weapon return self.weapon_ids.include?(item.id) when RPG::Armor return self.armor_ids.include?(item.id) else return false end end end
# 仱仮仱 憰旛懏惈庢摼儔僀僽儔儕 仱仮仱
#
# update 2006/ 4/11
#
#==============================================================================
# --- 憰旛懏惈庢摼儔僀僽儔儕 ---
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# 仜 僗僉儖偺懏惈庢摼
#--------------------------------------------------------------------------
def skill_element_set(skill)
return skill.nil? ? [] : skill.element_set
end
#--------------------------------------------------------------------------
# 仜 慡憰旛偺懏惈庢摼
#--------------------------------------------------------------------------
def equip_element_set
return self.element_set + self.guard_element_set
end
#--------------------------------------------------------------------------
# 仜 慡杊嬶偺懏惈庢摼
#--------------------------------------------------------------------------
def guard_element_set
return []
end
end
class Game_Actor < Game_Battler
def guard_element_set
set = []
for id in self.armor_ids
next if id.nil?
armor = $data_armors[id]
set += (armor != nil ? armor.guard_element_set : [])
end
return set
end
#--------------------------------------------------------------------------
# 仜 晲婍 ID攝楍
#--------------------------------------------------------------------------
def weapon_ids
@weapon_ids = [] if @weapon_ids == nil
@weapon_ids[0] = @weapon_id
return @weapon_ids
end
#--------------------------------------------------------------------------
# 仜 杊嬶 ID攝楍
#--------------------------------------------------------------------------
def armor_ids
@armor_ids = [] if @armor_ids == nil
@armor_ids[0] = @armor1_id
@armor_ids[1] = @armor2_id
@armor_ids[2] = @armor3_id
@armor_ids[3] = @armor4_id
return @armor_ids
end
#--------------------------------------------------------------------------
# 仜 憰旛攝楍偺庢摼
#--------------------------------------------------------------------------
def equipments
equipments = []
self.weapon_ids.each {|id| equipments.push($data_weapons[id])}
self.armor_ids.each {|id| equipments.push($data_armors[id])}
return equipments
end
#--------------------------------------------------------------------------
# 仜 憰旛拞丠
#--------------------------------------------------------------------------
def equiping?(item)
case item
when RPG::Weapon
return self.weapon_ids.include?(item.id)
when RPG::Armor
return self.armor_ids.include?(item.id)
else
return false
end
end
end
module XRXS #-------------------------------------------------------------------------- # 仜 攝楍偑巜掕柤偺懏惈傪帩偮偐敾掕 #-------------------------------------------------------------------------- def XRXS.element_check(set, element_name) returnar = [false, 0, 0, []] # 懚嵼偟偨偐?, 屌掕抣偺崌寁丄%抣偺崌寁 return returnar if !set.is_a?(Array) or set.size == 0 or element_name == "" for i in set if $data_system.elements[i] =~ /^#{element_name}([+-]?[0-9]+)?(%)?/ returnar[0] = true if $2 == nil returnar[1] += $1.to_i returnar[3].push($1.to_i) else returnar[2] += $1.to_i end end end return returnar end def XRXS.element_include?(set, element_name) return element_check(set, element_name)[0] end def XRXS.element_amount(set, element_name) return element_check(set, element_name)[1] end def XRXS.element_percent(set, element_name) return element_check(set, element_name)[2] end def XRXS.element_numbers(set, element_name) return element_check(set, element_name)[3] end end
module XRXS
#--------------------------------------------------------------------------
# 仜 攝楍偑巜掕柤偺懏惈傪帩偮偐敾掕
#--------------------------------------------------------------------------
def XRXS.element_check(set, element_name)
returnar = [false, 0, 0, []] # 懚嵼偟偨偐?, 屌掕抣偺崌寁丄%抣偺崌寁
return returnar if !set.is_a?(Array) or set.size == 0 or element_name == ""
for i in set
if $data_system.elements[i] =~ /^#{element_name}([+-]?[0-9]+)?(%)?/
returnar[0] = true
if $2 == nil
returnar[1] += $1.to_i
returnar[3].push($1.to_i)
else
returnar[2] += $1.to_i
end
end
end
return returnar
end
def XRXS.element_include?(set, element_name)
return element_check(set, element_name)[0]
end
def XRXS.element_amount(set, element_name)
return element_check(set, element_name)[1]
end
def XRXS.element_percent(set, element_name)
return element_check(set, element_name)[2]
end
def XRXS.element_numbers(set, element_name)
return element_check(set, element_name)[3]
end
end
|