赞 | 42 |
VIP | 91 |
好人卡 | 5 |
积分 | 111 |
经验 | 80759 |
最后登录 | 2024-11-24 |
在线时间 | 4432 小时 |
Lv4.逐梦者
- 梦石
- 1
- 星屑
- 10085
- 在线时间
- 4432 小时
- 注册时间
- 2005-10-22
- 帖子
- 6959
|
本帖最后由 orochi2k 于 2013-3-16 03:58 编辑
石器欺负小朋友系列:(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
#随机武器生成部件##########################
def RWEAPON::w_att_fire1_add(to) #追加灼热烧伤攻击效果
if $data_weapons[to].plus_state_set.include?(72)
return false
end
$data_weapons[to].plus_state_set.push(72)
$data_weapons[to].name = "烈焰"+ $data_weapons[to].name
$data_weapons[to].description = "攻击附带烧伤效果 " + $data_weapons[to].w_description
$data_weapons[to].price += (1000 + rand(1000))
$data_weapons[to].atk += rand(20)
$data_weapons[to].ico_hue = rand(250)
return true
end
def RWEAPON::w_att_highatk1_add(to) #追加33%攻击力
k = ($data_weapons[to].atk / 3)
$data_weapons[to].description = "额外#{k}的攻击力 " + $data_weapons[to].w_description
$data_weapons[to].name = "强攻"+ $data_weapons[to].name
$data_weapons[to].price += ($data_weapons[to].price / 5 + rand($data_weapons[to].price / 5) )
$data_weapons[to].atk += rand($data_weapons[to].atk / 8)
$data_weapons[to].atk += k
$data_weapons[to].ico_hue = rand(250)
return true
end
def RWEAPON::w_att_defender_add(to) #武器有+25再乘2防御
k = ((25 + $data_weapons[to].pdef ) * 2)
$data_weapons[to].description = "额外#{k}的防御力 " + $data_weapons[to].w_description
$data_weapons[to].name = "坚守"+ $data_weapons[to].name
$data_weapons[to].price += ($data_weapons[to].price / 5 + rand($data_weapons[to].price / 5) )
$data_weapons[to].pdef += k
$data_weapons[to].ico_hue = rand(250)
return true
end
def RWEAPON::w_att_poison1_add(to) #追加毒攻击效果
if $data_weapons[to].plus_state_set.include?(3)
return false
end
$data_weapons[to].plus_state_set.push(3)
$data_weapons[to].name = "毒性"+ $data_weapons[to].name
$data_weapons[to].description = "攻击附带中毒效果 " + $data_weapons[to].w_description
$data_weapons[to].price += (1200 + rand(1000))
$data_weapons[to].atk += rand($data_weapons[to].atk / 8)
$data_weapons[to].ico_hue = rand(250)
return true
end
def RWEAPON::w_att_expensive_add(to) #只是单纯的价格比较高 囧
$data_weapons[to].name = "高贵"+ $data_weapons[to].name
$data_weapons[to].description = "该武器拥有华丽的外观 " + $data_weapons[to].w_description
$data_weapons[to].price += rand(2 * $data_weapons[to].price)
$data_weapons[to].atk += (rand($data_weapons[to].atk / 6) + rand(34))
$data_weapons[to].ico_hue = rand(250)
return true
end
def RWEAPON::w_att_killevil_add(to) #对不死和恶魔额外伤害
$data_weapons[to].name = "破邪"+ $data_weapons[to].name
$data_weapons[to].description = "对邪恶生物额外伤害" + $data_weapons[to].w_description
$data_weapons[to].price += rand($data_weapons[to].price / 10)
$data_weapons[to].element_set.push(15)
$data_weapons[to].element_set.push(9)
$data_weapons[to].atk += (rand($data_weapons[to].atk / 8) + rand(25))
$data_weapons[to].ico_hue = rand(250)
return true
end
def RWEAPON::w_att_mabi1_add(to) #追加麻痹效果
if $data_weapons[to].plus_state_set.include?(8)
return false
end
$data_weapons[to].name = "麻痹"+ $data_weapons[to].name
$data_weapons[to].description = "攻击附带麻痹效果" + $data_weapons[to].w_description
$data_weapons[to].price += rand($data_weapons[to].price / 10)
$data_weapons[to].atk += (rand($data_weapons[to].atk / 8) + rand(15))
$data_weapons[to].plus_state_set.push(8)
$data_weapons[to].ico_hue = rand(250)
return true
end
def RWEAPON::w_att_terri_add(to) #追加恐惧效果
if $data_weapons[to].plus_state_set.include?(37)
return false
end
$data_weapons[to].name = "恐怖"+ $data_weapons[to].name
$data_weapons[to].description = "攻击附带恐吓效果 " + $data_weapons[to].w_description
$data_weapons[to].price += rand($data_weapons[to].price / 5)
$data_weapons[to].atk += (rand($data_weapons[to].atk / 8) + rand(22))
$data_weapons[to].plus_state_set.push(37)
$data_weapons[to].ico_hue = rand(250)
return true
end
def RWEAPON::w_att_zhenghan_add(to) #追加晕眩效果
if $data_weapons[to].plus_state_set.include?(2)
return false
end
$data_weapons[to].name = "震撼"+ $data_weapons[to].name
$data_weapons[to].description = "攻击附带眩晕效果 " + $data_weapons[to].w_description
$data_weapons[to].price += rand($data_weapons[to].price / 3)
$data_weapons[to].atk += (rand($data_weapons[to].atk / 10) + rand(12))
$data_weapons[to].plus_state_set.push(2)
$data_weapons[to].ico_hue = rand(250)
return true
end
def RWEAPON::w_att_dark1_add(to) #追加失明效果,武器暗属性
$data_weapons[to].name = "黑暗"+ $data_weapons[to].name
$data_weapons[to].description = "暗属性,攻击附带失明效果 " + $data_weapons[to].w_description
$data_weapons[to].price += (500 + rand($data_weapons[to].price / 10))
$data_weapons[to].atk += (rand($data_weapons[to].atk / 10) + rand(32))
$data_weapons[to].plus_state_set.push(39)
$data_weapons[to].element_set.push(8)
$data_weapons[to].ico_hue = rand(250)
return true
end
def RWEAPON::w_att_bloody1_add(to) #攻击吸血10%
$data_weapons[to].name = "嗜血"+ $data_weapons[to].name
$data_weapons[to].description = "物理伤害10%吸收为生命 " + $data_weapons[to].w_description
$data_weapons[to].price += (500 + rand($data_weapons[to].price / 5))
$data_weapons[to].atk += (rand($data_weapons[to].atk / 10) + rand(42))
$data_weapons[to].element_set.push(101)
$data_weapons[to].ico_hue = rand(250)
return true
end
def RWEAPON::w_att_ice1_add(to) #冰属性带麻痹
if $data_weapons[to].plus_state_set.include?(8)
return false
end
$data_weapons[to].name = "寒冷"+ $data_weapons[to].name
$data_weapons[to].description = "冰属性,攻击附带麻痹效果" + $data_weapons[to].w_description
$data_weapons[to].price += rand($data_weapons[to].price / 8)
$data_weapons[to].atk += (rand($data_weapons[to].atk / 10) + rand(22))
$data_weapons[to].plus_state_set.push(8)
$data_weapons[to].element_set.push(2)
$data_weapons[to].ico_hue = rand(250)
return true
end
def RWEAPON::w_att_broken_add(to) #损坏的
$data_weapons[to].name = "破旧的"+ $data_weapons[to].name
$data_weapons[to].description = "有所破损的" + $data_weapons[to].w_description
$data_weapons[to].price -= rand($data_weapons[to].price / 4)
$data_weapons[to].atk -= rand($data_weapons[to].atk / 2)
$data_weapons[to].ico_hue = rand(250)
return true
end
def RWEAPON::w_att_hunduns_add(to)
$data_weapons[to].name = "混沌"+ $data_weapons[to].name
$data_weapons[to].description = "属性严重扭曲的" + $data_weapons[to].w_description
$data_weapons[to].price += rand($data_weapons[to].price * 2)
$data_weapons[to].atk += (rand($data_weapons[to].atk * 2) - $data_weapons[to].atk)
$data_weapons[to].pdef += (10 + rand($data_weapons[to].pdef * 2) - $data_weapons[to].pdef)
$data_weapons[to].mdef += (10 + rand($data_weapons[to].mdef * 2) - $data_weapons[to].mdef)
$data_weapons[to].str_plus += (10 + rand($data_weapons[to].str_plus * 2) - $data_weapons[to].str_plus)
$data_weapons[to].dex_plus += (10 + rand($data_weapons[to].dex_plus * 2) - $data_weapons[to].dex_plus)
$data_weapons[to].agi_plus += (10 + rand($data_weapons[to].agi_plus * 2) - $data_weapons[to].agi_plus)
$data_weapons[to].int_plus += (10 + rand($data_weapons[to].int_plus * 2) - $data_weapons[to].int_plus)
$data_weapons[to].ico_hue = rand(250)
return true
end
def RWEAPON::w_att_anithuman_add(to)
$data_weapons[to].name = "反人类"+ $data_weapons[to].name
$data_weapons[to].description = "对人类拥有额外伤害效果" + $data_weapons[to].w_description
$data_weapons[to].price += rand($data_weapons[to].price / 5)
$data_weapons[to].atk += rand(21)
$data_weapons[to].element_set.push(11)
$data_weapons[to].ico_hue = rand(250)
return true
end
def RWEAPON::w_att_thunder1_add(to) #雷属性带麻痹
if $data_weapons[to].plus_state_set.include?(8)
return false
end
$data_weapons[to].name = "雷鸣"+ $data_weapons[to].name
$data_weapons[to].description = "雷属性,攻击附带麻痹效果" + $data_weapons[to].w_description
$data_weapons[to].price += rand($data_weapons[to].price / 8)
$data_weapons[to].atk += (rand($data_weapons[to].atk / 10) + rand(22))
$data_weapons[to].plus_state_set.push(8)
$data_weapons[to].element_set.push(3)
$data_weapons[to].ico_hue = rand(250)
return true
end
def RWEAPON::w_att_highatk2_add(to) #追加50%攻击力 但其它属性下降
k = ($data_weapons[to].atk / 2)
$data_weapons[to].description = "额外#{k}的攻击力 但其余属性受影响" + $data_weapons[to].w_description
$data_weapons[to].name = "背水"+ $data_weapons[to].name
$data_weapons[to].price += ($data_weapons[to].price / 5 + rand($data_weapons[to].price / 5) )
$data_weapons[to].atk += rand($data_weapons[to].atk / 8)
$data_weapons[to].atk += k
$data_weapons[to].agi_plus -= k * 2
$data_weapons[to].dex_plus -= k * 2
$data_weapons[to].pdef = 0
$data_weapons[to].mdef = 0
$data_weapons[to].ico_hue = rand(250)
return true
end
def RWEAPON::w_att_desposer1_add(to) #净化
$data_weapons[to].description = "可消除攻击目标的一些正面状态" + $data_weapons[to].w_description
$data_weapons[to].name = "净化"+ $data_weapons[to].name
$data_weapons[to].price += ($data_weapons[to].price / 10 + rand($data_weapons[to].price / 5) )
$data_weapons[to].minus_state_set.push(13,14,20,22,33,52,53,54)
$data_weapons[to].ico_hue = rand(250)
return true
end
def RWEAPON::w_att_slot1_add(to) #一格武器凹槽
if $data_weapons[to].insertpoint != nil and $data_weapons[to].insertpoint >= 1
return false
end
$data_weapons[to].description = "拥有一个凹槽 " + $data_weapons[to].w_description
$data_weapons[to].price += ($data_weapons[to].price / 10)
$data_weapons[to].insertpoint = 1
$data_weapons[to].ico_hue = rand(250)
return true
end
def RWEAPON::w_att_slot2_add(to) #2格武器凹槽
if $data_weapons[to].insertpoint != nil and $data_weapons[to].insertpoint != 0
return false
end
$data_weapons[to].description = "拥有两个凹槽 " + $data_weapons[to].w_description
$data_weapons[to].price += ($data_weapons[to].price / 5)
$data_weapons[to].insertpoint = 2
$data_weapons[to].ico_hue = rand(250)
return true
end
def RWEAPON::w_att_slot3_add(to) #3格武器凹槽
if $data_weapons[to].insertpoint != nil and $data_weapons[to].insertpoint != 0
return false
end
$data_weapons[to].description = "拥有三个凹槽 " + $data_weapons[to].w_description
$data_weapons[to].price *= 2
$data_weapons[to].insertpoint = 3
$data_weapons[to].ico_hue = rand(250)
return true
end
def RWEAPON::w_att_xixue002_add(to) #2%吸血
if $data_weapons[to].co["vampiric"] != nil
return false
end
$data_weapons[to].name = "吸血的"+ $data_weapons[to].name
$data_weapons[to].description = "物理攻击2%吸血效果 " + $data_weapons[to].w_description
$data_weapons[to].price *= 1.2
$data_weapons[to].price = $data_weapons[to].price.to_i
$data_weapons[to].co["vampiric"] = 0.02
$data_weapons[to].ico_hue = rand(250)
return true
end
#######################################################
#枪械类
def RWEAPON::w_att_gunpower1_add(to) #伤害加强
$data_weapons[to].name = "大口径"+ $data_weapons[to].name
$data_weapons[to].description = "拥有较大威力和后坐力 " + $data_weapons[to].w_description
$data_weapons[to].price *= 1.3
$data_weapons[to].price = $data_weapons[to].price.to_i
$data_weapons[to].gun_power *= 1.2
$data_weapons[to].gun_power = $data_weapons[to].gun_power.to_i
$data_weapons[to].gun_recoil *= 1.2
$data_weapons[to].gun_recoil = $data_weapons[to].gun_recoil.to_i
$data_weapons[to].ico_hue = rand(250)
return true
end
def RWEAPON::w_att_gunpower2_add(to) #伤害加强
$data_weapons[to].name = "超大口径"+ $data_weapons[to].name
$data_weapons[to].description = "拥有较大威力和后坐力 " + $data_weapons[to].w_description
$data_weapons[to].price *= 1.6
$data_weapons[to].price = $data_weapons[to].price.to_i
$data_weapons[to].gun_power *= 1.5
$data_weapons[to].gun_power = $data_weapons[to].gun_power.to_i
$data_weapons[to].gun_recoil *= 1.5
$data_weapons[to].gun_recoil = $data_weapons[to].gun_recoil.to_i
$data_weapons[to].ico_hue = rand(250)
return true
end
def RWEAPON::w_att_gunammo1_add(to) #弹药增加
$data_weapons[to].name = "大弹夹"+ $data_weapons[to].name
$data_weapons[to].description = "拥有较多弹药 " + $data_weapons[to].w_description
$data_weapons[to].price *= 1.5
$data_weapons[to].price = $data_weapons[to].price.to_i
$data_weapons[to].gun_ammo *= 1.33
$data_weapons[to].gun_ammo = $data_weapons[to].gun_ammo.to_i
$data_weapons[to].ico_hue = rand(250)
return true
end
def RWEAPON::w_att_gunpowerlow1_add(to) #威力降低
$data_weapons[to].name = "破损的"+ $data_weapons[to].name
$data_weapons[to].description = "威力有所降低 " + $data_weapons[to].w_description
$data_weapons[to].price *= 0.8
$data_weapons[to].price = $data_weapons[to].price.to_i
$data_weapons[to].gun_power *= 0.8
$data_weapons[to].gun_power = $data_weapons[to].gun_power.to_i
$data_weapons[to].ico_hue = rand(250)
return true
end
def RWEAPON::w_att_gunauto_add(to) #自动化
if($data_weapons[to].gun_autofire == true)
return false
end
$data_weapons[to].name = "自动化"+ $data_weapons[to].name
$data_weapons[to].description = "可以进行扫射 " + $data_weapons[to].w_description
$data_weapons[to].price *= 1.2
$data_weapons[to].price = $data_weapons[to].price.to_i
$data_weapons[to].gun_autofire = true
$data_weapons[to].ico_hue = rand(250)
return true
end
#######################################################
end |
|