$VIPArcherScript ||= {};$VIPArcherScript[:slot_type] = __FILE__
module VIPArcher
ETYPE_ADD_NAME = ["腰带", "鞋子"]
SLOT_TYPE = {
0 => [0,1,2,3,4],
1 => [0,0,2,3,4],
2 => [0,0,0,2,3,4,5],
3 => [4],
4 => [0,2,3,3],
5 => [0,1,2,3,4,5,6]
}
def Vocab.etype(etype_id)
etype_name = $data_system.terms.etypes + ETYPE_ADD_NAME
etype_name[etype_id]
end
end
class RPG::Actor < RPG::BaseItem
alias vip_20141119_equips equips
def equips
add_equips = []
$1.split(",").each {|item|add_equips.push item.to_i} if
@note =~ /<(?:ini_equips|初始装备)[:]\[(.+?)\]>/i
return add_equips if add_equips != []
$1.split(",").each {|item|add_equips.push item.to_i} if
@note =~ /<(?:add_equips|追加初始装备)[:]\[(.+?)\]>/i
vip_20141119_equips.clone + add_equips
end
end
class RPG::Armor < RPG::EquipItem
def etype_id
return @note =~ /<(?:etype_id|装备类型)[:]\s*(.*)>/i ? $1.to_i : @etype_id
end
end
class Game_BattlerBase
def slot_type
slot =[]
feature_objects.each {|obj| slot.push $1.to_i if
obj.note =~ /<(?:slot_type|装备风格)[:]\s*(.*)>/i }
return slot.max || 0
end
alias vip_20141119_equip_type_fixed? equip_type_fixed?
def equip_type_fixed?(etype_id)
fixed_type = []
feature_objects.each {|obj| obj.note.split(/[\r\n]+/).each {|line|
fixed_type.push $1.to_i if line =~ /<(?:fix_equips|固定装备)[:]\s*(.*)>/i}}
fixed_type.include?(etype_id) || vip_20141119_equip_type_fixed?(etype_id)
end
alias vip_20141119_equip_type_sealed? equip_type_sealed?
def equip_type_sealed?(etype_id)
sealed_type = []
feature_objects.each {|obj| obj.note.split(/[\r\n]+/).each {|line|
sealed_type.push $1.to_i if line =~ /<(?:seal_equips|禁用装备)[:]\s*(.*)>/i}}
sealed_type.include?(etype_id) || vip_20141119_equip_type_sealed?(etype_id)
end
end
class Game_Actor < Game_Battler
def init_equips(equips)
type_size = VIPArcher::SLOT_TYPE.values.max_by{|type|type.size}.size
@equips = Array.new(type_size) { Game_BaseItem.new }
equips.each_with_index do |item_id, i|
etype_id = index_to_etype_id(i)
slot_id = empty_slot(etype_id)
@equips[slot_id].set_equip(etype_id == 0, item_id) if slot_id
end
refresh
end
alias vip_20140803_es equip_slots
def equip_slots
return VIPArcher::SLOT_TYPE[slot_type] if
VIPArcher::SLOT_TYPE[slot_type] != nil
vip_20140803_es
end
end
class Scene_Equip < Scene_MenuBase
alias slot_vip_create_slot_window create_slot_window
def create_slot_window
slot_vip_create_slot_window
@slot_window.create_contents
@slot_window.refresh
end
alias slot_vip_on_item_ok on_item_ok
def on_item_ok
slot_vip_on_item_ok
@slot_window.create_contents
@slot_window.refresh
end
alias slot_vip_command_clear command_clear
def command_clear
slot_vip_command_clear
@slot_window.create_contents
@slot_window.refresh
end
alias slot_vip_command_optimize command_optimize
def command_optimize
slot_vip_command_optimize
@slot_window.create_contents
@slot_window.refresh
end
alias slot_vip_on_actor_change on_actor_change
def on_actor_change
slot_vip_on_actor_change
@slot_window.create_contents
@slot_window.refresh
end
end