class Window_EquipCommand < Window_HorzCommand
def col_max
return 2
end
def make_command_list
add_command(Vocab::equip2, :equip)
add_command(Vocab::clear, :clear)
end
end
RUBY 代码
[Ruby] 纯文本查看复制代码
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