加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 alexncf125 于 2021-2-19 19:41 编辑
使用方法...往装备的备注栏写上<score:分数>
比如说, 武器A写了<score:10>, 武器B写了<score:200>
写好后...角色装备上武器B时, 会变得不能換装成武器A
注意...这个脚本与最强装备的机制产生了一个小bug...最强装备会是分数最高的装备...但当遇上"最高分数相同的两件装备"的情況时...不会根据两件装备的属性来決定最强装备...所以一是不要写相同的分数, 一是依此折叠内容删除「最强装备」功能
class Game_BattlerBase alias score_equippable? equippable? def equippable?(item) if item item.note =~ /<score:(\d+)>/i new_score = $1.to_i if @equips[item.etype_id].object @equips[item.etype_id].object.note =~ /<score:(\d+)>/i old_score = $1.to_i end end new_score ||= 0; old_score ||= 0 return false if new_score < old_score return score_equippable?(item) end end class Game_Actor < Game_Battler alias score_change_equip change_equip def change_equip(slot_id, item) if item item.note =~ /<score:(\d+)>/i new_score = $1.to_i end if @equips[slot_id].object @equips[slot_id].object.note =~ /<score:(\d+)>/i old_score = $1.to_i end new_score ||= 0; old_score ||= 0 return if new_score < old_score return score_change_equip(slot_id, item) end end class Window_EquipItem < Window_ItemList def include?(item) return true if item == nil return false unless item.is_a?(RPG::EquipItem) return false if @slot_id < 0 return false if item.etype_id != @actor.equip_slots[@slot_id] return true#~ return @actor.equippable?(item) end def enable?(item) return true if item.nil? return @actor.equippable?(item)#~ return true end end
class Game_BattlerBase
alias score_equippable? equippable?
def equippable?(item)
if item
item.note =~ /<score:(\d+)>/i
new_score = $1.to_i
if @equips[item.etype_id].object
@equips[item.etype_id].object.note =~ /<score:(\d+)>/i
old_score = $1.to_i
end
end
new_score ||= 0; old_score ||= 0
return false if new_score < old_score
return score_equippable?(item)
end
end
class Game_Actor < Game_Battler
alias score_change_equip change_equip
def change_equip(slot_id, item)
if item
item.note =~ /<score:(\d+)>/i
new_score = $1.to_i
end
if @equips[slot_id].object
@equips[slot_id].object.note =~ /<score:(\d+)>/i
old_score = $1.to_i
end
new_score ||= 0; old_score ||= 0
return if new_score < old_score
return score_change_equip(slot_id, item)
end
end
class Window_EquipItem < Window_ItemList
def include?(item)
return true if item == nil
return false unless item.is_a?(RPG::EquipItem)
return false if @slot_id < 0
return false if item.etype_id != @actor.equip_slots[@slot_id]
return true#~ return @actor.equippable?(item)
end
def enable?(item)
return true if item.nil?
return @actor.equippable?(item)#~ return true
end
end
|