石器欺负小朋友系列:(N年前的东西,目前基本退役)
module RWEAPON
#武器组件通用表
W_ATTLIST1 = ["fire1","highatk1","poison1","expensive","killevil","mabi1","defender","terri","zhenghan","ice1","broken","thunder1","highatk2","desposer1","slot1","xixue002"]
W_EVILLIST = ["fire1","highatk1","poison1","terri","dark1","bloody1","ice1","hunduns","anithuman","highatk2","desposer1","slot2","xixue002"]
W_TIEJIANGLIST1 = ["fire1","highatk1","slot1","slot2","slot3","poison1","expensive","mabi1","killevil"]
W_GUNLIST1 = ["gunpower1","gunpower2","gunammo1","gunpowerlow1","gunauto","expensive"]
#检查独一无二物品编号
def RWEAPON::CheckUnique(special)
n = -1
for i in $data_weapons
if i != nil and i.spcical == special
return i.id
end
end
return n
end
#获取可用ID
def RWEAPON::getid
i = 2000
while($game_party.get_un_w.keys.include?(i))
i += 1
end
return i
end
#复制母板
def RWEAPON::makecopy(from,to)
#$data_weapons[to] = $data_weapons[from].clone
$data_weapons[to] = Marshal.load(Marshal.dump($data_weapons[from]))
$data_weapons[to].id = to
$data_weapons[to].equalerid = $data_armors[from].equalerid
#$data_weapons[to].element_set = $data_weapons[from].element_set.clone
#$data_weapons[to].plus_state_set = $data_weapons[from].plus_state_set.clone
#$data_weapons[to].minus_state_set = $data_weapons[from].minus_state_set.clone
end
def RWEAPON::makecopyS(item,to)
# $data_weapons[to] = item.clone
$data_weapons[to] = Marshal.load(Marshal.dump(item))
$data_weapons[to].id = to
$data_weapons[to].equalerid = item.equalerid
# $data_weapons[to].element_set = item.element_set.clone
# $data_weapons[to].plus_state_set = item.clone
# $data_weapons[to].minus_state_set = item.clone
end
#简略封装部件追加函数
def RWEAPON::addcot(to,name)
a = eval("RWEAPON::w_att_#{name}_add(#{to})")
return a
end
#部件选取函数
def RWEAPON::choicepart(list,num)
a = []
while(num > 0 )
k = list[rand(list.size)]
unless a.include?(k)
a.push(k)
num -= 1
end
end
return a
end
#根据列表逐个追加部件
def RWEAPON::addcotlist(to,list)
sce = 0
fail = 0
for i in list
if RWEAPON::addcot(to,i)
sce += 1
else
fail += 1
end
end
end
#武器成品留档
def RWEAPON::done(id)
$game_party.get_un_w[id] = Marshal.load(Marshal.dump($data_weapons[id])) #$data_weapons[id].clone
$game_party.get_un_w[id].buff = []
$game_party.get_un_w[id].buff_end = {}
end