Project1
标题: 求助 随机装备前缀的随机问题 [打印本页]
作者: liujianxiong520 时间: 2013-12-28 17:29
标题: 求助 随机装备前缀的随机问题 RT..........金庸无双2的装备系统用了随机装备 有前缀 我想把它的随机前缀设置成其中的某一个 要怎么设置 求指教
class Game_Party
def gain_weapon(weapon_id, n,ran = true)
if $scene.is_a?(Scene_Equip) or $scene.is_a?(Scene_Shop) or ran == false
@weapons[weapon_id] = [[weapon_number(weapon_id) + n, 0].max, 99].min
return
end
case rand(100)
when (0..100)
equip_class=",A"
ext_damage=15
ext_power=5
else
end
new_qz = $qianzui_weapons[randg(1,$qianzui_weapons.size-1)]
new_weapon = $data_weapons[weapon_id].dup#clone
new_weapon.id = $data_weapons.size
new_weapon.name = new_qz.name+new_weapon.name+equip_class
for i in weapon_id...$data_weapons.size
if $data_weapons[i].name == new_weapon.name
@weapons[i] = [[weapon_number(i) + n, 0].max, 99].min
return
end
end
new_weapon.atk = randg(0,new_qz.atk)+new_weapon.atk+ext_damage
new_weapon.pdef = randg(0,new_qz.pdef)+new_weapon.pdef
new_weapon.mdef = randg(0,new_qz.mdef)+new_weapon.mdef
new_weapon.str_plus = randg(0,new_qz.str_plus) + new_weapon.str_plus+ext_power
new_weapon.dex_plus = randg(0,new_qz.dex_plus) + new_weapon.dex_plus+ext_power
new_weapon.agi_plus = randg(0,new_qz.agi_plus) + new_weapon.agi_plus+ext_power
new_weapon.int_plus = randg(0,new_qz.int_plus) + new_weapon.int_plus+ext_power
#new_weapon.rang = randg(0,new_qz.rang) + new_weapon.rang 停用附加值
new_weapon.rang = new_weapon.rang
#new_weapon.time = randg(0,new_qz.time) + new_weapon.time 停用附加值
new_weapon.description = new_weapon.description + new_qz.description
new_weapon.element_set = $data_weapons[weapon_id].element_set.dup
new_qz.element_set.each{|ele|new_weapon.element_set.push(ele)}
new_weapon.plus_state_set = $data_weapons[weapon_id].plus_state_set.dup
new_qz.plus_state_set.each{|ele|new_weapon.plus_state_set.push(ele)}
new_weapon.minus_state_set = $data_weapons[weapon_id].minus_state_set.dup
new_qz.minus_state_set.each{|ele|new_weapon.minus_state_set.push(ele)}
$data_weapons.push(new_weapon)
for i in 1...$data_classes.size
if $data_classes[i].weapon_set.include?(weapon_id)
$data_classes[i].weapon_set.push(new_weapon.id)
end
end
@weapons[new_weapon.id] = [[weapon_number(new_weapon.id) + n, 0].max, 99].min
end
def gain_armor(armor_id, n, ran = true)
if $scene.is_a?(Scene_Equip) or $scene.is_a?(Scene_Shop) or ran == false
@armors[armor_id] = [[armor_number(armor_id) + n, 0].max, 99].min
return
end
case rand(100)
when (0..100)
equip_class=",A"
ext_defence=15
ext_power=5
when (0..100)
equip_class=",A"
ext_defence=15
ext_power=5
when (0..100)
equip_class=",A"
ext_defence=15
ext_power=5
when (0..100)
equip_class=",A"
ext_defence=15
ext_power=5
when (0..100)
equip_class=",A"
ext_defence=15
ext_power=5
else
end
new_qz = $qianzui_armors[randg(1,$qianzui_armors.size-1)]
new_armor = $data_armors[armor_id].dup#clone
new_armor.id = $data_armors.size
new_armor.name = new_qz.name+new_armor.name+equip_class
for i in armor_id...$data_armors.size
if $data_armors[i].name == new_armor.name
@armors[i] = [[armor_number(i) + n, 0].max, 99].min
return
end
end
new_armor.eva = new_qz.eva+new_armor.eva
new_armor.pdef = new_qz.pdef+new_armor.pdef+ext_defence
new_armor.mdef = new_qz.mdef+new_armor.mdef+ext_defence
new_armor.str_plus = new_qz.str_plus + new_armor.str_plus+ext_power
new_armor.dex_plus = new_qz.dex_plus + new_armor.dex_plus+ext_power
new_armor.agi_plus = new_qz.agi_plus + new_armor.agi_plus+ext_power
new_armor.int_plus = new_qz.int_plus + new_armor.int_plus+ext_power
new_armor.description = new_armor.description + new_qz.description
new_armor.guard_element_set = $data_armors[armor_id].guard_element_set.dup
new_qz.guard_element_set.each{|ele|new_armor.guard_element_set.push(ele)}
new_armor.guard_state_set = $data_armors[armor_id].guard_state_set .dup
new_qz.guard_state_set .each{|ele|new_armor.guard_state_set .push(ele)}
$data_armors.push(new_armor)
for i in 1...$data_classes.size
if $data_classes[i].armor_set.include?(armor_id)
$data_classes[i].armor_set.push(new_armor.id)
end
end
@armors[new_armor.id] = [[armor_number(new_armor.id) + n, 0].max, 99].min
end
def lose_weapon(weapon_id, n)
if weapon_id > 0
@weapons[weapon_id] = [@weapons[weapon_id] - n, 0].max
end
end
def lose_armor(armor_id, n)
if armor_id > 0
@armors[armor_id] = [@armors[armor_id] - n, 0].max
end
end
end
这就是随机装备的脚本了
=begin
武器/防具詳細說明及套裝界面
從window_help 分離, 由vioyrbr設計及整合 20130615
依附於main 的顏色及字型設定
=end
class Window_Help < Window_Base
#==========================================================
def set_weapon(weapon)
if weapon.nil?
self.visible = false
return
else
self.visible = true
end
return if weapon == @item
self.width = 240
self.height = 330
self.z += 20
self.contents = Bitmap.new(self.width, self.height)
self.windowskin = RPG::Cache.windowskin("equip")
self.contents.font.name = $font_spec_name
self.contents.font.size = 18
h = 0
suffix = ""
case weapon.equip_class
when 'A'
self.contents.font.color = font_color("金")
suffix = "「傳說」"
when 'B'
self.contents.font.color = font_color("紫")
suffix = "「史詩」"
when 'C'
self.contents.font.color = font_color("紅")
suffix = "「完美」"
when 'D'
self.contents.font.color = font_color("藍")
suffix = "「精良」"
when 'E'
self.contents.font.color = font_color("綠")
suffix = "「優秀」"
else
self.contents.font.color = font_color("白")
end
self.contents.draw_text(0,h*ch,cw(weapon.name+suffix),ch,weapon.name+suffix)
self.contents.font.size = 16
h += 1
self.contents.font.color = font_color("黃")
h += description(0,h,weapon.description)
if weapon.price != 0
h += 1
#if $scene.is_a?(Scene_BuyShop)
#self.contents.draw_text(0,h*ch,cw("購買價格 :")+cw(weapon.price.to_s),ch,"購買價格 :"+weapon.price.to_s)
#else
#self.contents.draw_text(0,h*ch,cw("出售價格 :")+cw((weapon.price/2).to_s),ch,"出售價格 :"+(weapon.price/2).to_s)
#end
end
self.contents.font.color = font_color("綠")
if weapon.atk != 0
h += 1
self.contents.draw_text(0,h*ch,cw("攻擊力 #{weapon.atk}"),ch,"攻擊力 #{weapon.atk}")
end
if weapon.pdef != 0
h += 1
self.contents.draw_text(0,h*ch,cw("外功防御 #{weapon.pdef}"),ch,"外功防御 #{weapon.pdef}")
end
if weapon.mdef != 0
h += 1
self.contents.draw_text(0,h*ch,cw("內功防禦 #{weapon.mdef}"),ch,"內功防禦 #{weapon.mdef}")
end
self.contents.font.color = font_color("紅")
if weapon.str_plus != 0
h += 1
self.contents.draw_text(0,h*ch,cw("剛勁 #{weapon.str_plus}"),ch,"剛勁 #{weapon.str_plus}")
end
if weapon.dex_plus != 0
h += 1
self.contents.draw_text(0,h*ch,cw("癒勁 #{weapon.dex_plus}"),ch,"癒勁 #{weapon.dex_plus}")
end
if weapon.agi_plus != 0
h += 1
self.contents.draw_text(0,h*ch,cw("輕勁 #{weapon.agi_plus}"),ch,"輕勁 #{weapon.agi_plus}")
end
if weapon.int_plus != 0
h += 1
self.contents.draw_text(0,h*ch,cw("柔勁 #{weapon.int_plus}"),ch,"柔勁 #{weapon.int_plus}")
end
self.contents.font.color = font_color("紫")
if weapon.plus_state_set.size != 0
strtemp=""
weapon.plus_state_set.each{|id|
if strtemp==""
strtemp = "附加狀態 " + $data_states[id].name
else
strtemp = strtemp + $data_states[id].name
h+=1
self.contents.draw_text(0,h*ch,cw(strtemp),ch,strtemp)
strtemp = ""
end
}
if strtemp != ""
h+=1
self.contents.draw_text(0,h*ch,cw(strtemp),ch,strtemp)
strtemp = ""
end
end
@item = weapon
end
#==========================================================
def set_armor(armor)
if armor.nil?
self.visible = false
return
else
self.visible = true
end
return if armor == @item
self.width = 240
self.height = 330
self.z += 20
self.contents = Bitmap.new(self.width, self.height)
self.windowskin = RPG::Cache.windowskin("equip")
self.contents.font.name = $font_spec_name
self.contents.font.size = 18
h = 0
suffix = ""
case armor.equip_class
when 'A'
self.contents.font.color = font_color("金")
suffix = "「傳說」"
when 'B'
self.contents.font.color = font_color("紫")
suffix = "「史詩」"
when 'C'
self.contents.font.color = font_color("紅")
suffix = "「完美」"
when 'D'
self.contents.font.color = font_color("藍")
suffix = "「精良」"
when 'E'
self.contents.font.color = font_color("綠")
suffix = "「優秀」"
else
self.contents.font.color = font_color("白")
end
self.contents.draw_text(0,h*ch,cw(armor.name+suffix),ch,armor.name+suffix)
self.contents.font.size = 16
h += 1
self.contents.font.color = font_color("黃")
h += description(0,h,armor.description)
if armor.price != 0
h += 1
#if $scene.is_a?(Scene_BuyShop)
#self.contents.draw_text(0,h*ch,cw("購買價格 :")+cw(armor.price.to_s),ch,"購買價格 :"+armor.price.to_s)
#else
#self.contents.draw_text(0,h*ch,cw("出售價格 :")+cw((armor.price/2).to_s),ch,"出售價格 :"+(armor.price/2).to_s)
#end
end
self.contents.font.color = font_color("綠")
if armor.pdef != 0
h += 1
self.contents.draw_text(0,h*ch,cw("外功防禦 #{armor.pdef}"),ch,"外功防禦 #{armor.pdef}")
end
if armor.mdef != 0
h += 1
self.contents.draw_text(0,h*ch,cw("內功防禦 #{armor.mdef}"),ch,"內功防禦 #{armor.mdef}")
end
self.contents.font.color = font_color("紅")
if armor.str_plus != 0
h += 1
self.contents.draw_text(0,h*ch,cw("剛勁 #{armor.str_plus}"),ch,"剛勁 #{armor.str_plus}")
end
if armor.dex_plus != 0
h += 1
self.contents.draw_text(0,h*ch,cw("癒勁 #{armor.dex_plus}"),ch,"癒勁 #{armor.dex_plus}")
end
if armor.agi_plus != 0
h += 1
self.contents.draw_text(0,h*ch,cw("輕勁 #{armor.agi_plus}"),ch,"輕勁 #{armor.agi_plus}")
end
if armor.int_plus != 0
h += 1
self.contents.draw_text(0,h*ch,cw("柔勁 #{armor.int_plus}"),ch,"柔勁 #{armor.int_plus}")
end
self.contents.font.color = font_color("紫")
if armor.guard_state_set.size != 0
strtemp=""
armor.guard_state_set.each{|id|
if strtemp==""
strtemp = "抵禦狀態 " + $data_states[id].name
else
strtemp = strtemp + $data_states[id].name
h+=1
self.contents.draw_text(0,h*ch,cw(strtemp),ch,strtemp)
strtemp = ""
end
}
if strtemp != ""
h+=1
self.contents.draw_text(0,h*ch,cw(strtemp),ch,strtemp)
strtemp = ""
end
end
@item = armor
end
#==========================================================
# 套裝顯示(武器) -- 遊戲內設定是沒有武器套裝, 缺功能, 只作備用
#==========================================================
def suit_weapon(weapon)
self.visible = false
return
end
#==========================================================
# 套裝顯示(防具)
#==========================================================
def suit_armor(armor)
if armor.nil?
self.visible = false
return
else
self.visible = true
end
return if armor == @item
local_suit_list = []
SUIT_LIST.each{ |key,value|
if value.include?(armor.id)
local_suit_list.push(key)
end
}
if local_suit_list == []
self.visible = false
return
end
self.width = 180
self.z += 20
self.contents = Bitmap.new(self.width, self.height)
self.windowskin = RPG::Cache.windowskin("equip")
self.contents.font.name = $font_spec_name
self.contents.font.color = font_color("黃")
self.contents.font.size = 18
h=0
self.contents.draw_text(0,h*ch,cw("套裝內容"),ch,"套裝內容")
h+=2
self.contents.font.size = 14
local_suit_list.each {|result|
self.contents.draw_text(0,h*ch,cw(result),ch,result)
h+=1
}
self.height = [h * ch + 32,330].min
end
#==========================================================
# 套裝顯示(防具) -- 已安裝後
#==========================================================
def suit_armor_check(actor)
self.contents.clear
suitname = actor.suit_matching
if suitname.nil?
self.visible = false
return
end
effects = SUIT_EFFECT[suitname]
begin
self.width = 160
self.z += 20
self.contents = Bitmap.new(self.width, self.height)
self.windowskin = RPG::Cache.windowskin("equip")
self.contents.font.name = $font_spec_name
self.contents.font.color = font_color("黃")
self.contents.font.size = 18
h=0
self.contents.draw_text(0,h*ch,cw("套裝效果"),ch,"套裝效果")
h+=2
x = 90
self.contents.font.size = 14
self.contents.draw_text(0,h*ch,cw("氣血上限"),ch,"氣血上限")
self.contents.draw_text(x,h*ch,cw(effects[0].to_s),ch, effects[0].to_s)
h+=1
self.contents.draw_text(0,h*ch,cw("內力上限"),ch,"內力上限")
self.contents.draw_text(x,h*ch,cw(effects[1].to_s),ch, effects[1].to_s)
h+=1
self.contents.draw_text(0,h*ch,cw("剛勁"),ch,"剛勁")
self.contents.draw_text(x,h*ch,cw(effects[2].to_s),ch, effects[2].to_s)
h+=1
self.contents.draw_text(0,h*ch,cw("癒勁"),ch,"癒勁")
self.contents.draw_text(x,h*ch,cw(effects[3].to_s),ch, effects[3].to_s)
h+=1
self.contents.draw_text(0,h*ch,cw("輕勁"),ch,"輕勁")
self.contents.draw_text(x,h*ch,cw(effects[4].to_s),ch, effects[4].to_s)
h+=1
self.contents.draw_text(0,h*ch,cw("柔勁"),ch,"柔勁")
self.contents.draw_text(x,h*ch,cw(effects[5].to_s),ch, effects[5].to_s)
h+=1
end
self.height = [h * 14 + 32,330].min
end
end
这里是在装备栏里面显示的脚本 我想把前缀指定为某一个 而不是在几十件装备里面随机 求教啊
作者: tan12345 时间: 2013-12-28 20:36
VA有另外一个随机前缀的装备脚本,你可以用那个。
作者: liujianxiong520 时间: 2013-12-28 22:00
大哥
这是游戏里面的源脚本
我想把前缀指定为某一个 而且 这个是RPGXP的...........
作者: batfjtn 时间: 2013-12-29 14:43
首先先来一段游戏中的源代码:
class Game_Party
def gain_weapon( weapon_id, n,ran = true )
if $scene .is_a ?( Scene_Equip) or $scene .is_a ?( Scene_Shop) or ran == false
@weapons [ weapon_id] = [ [ weapon_number( weapon_id) + n, 0 ] .max , 99 ] .min
return
end
case rand ( 100 )
when ( 98 ..100 )
equip_class=",A"
ext_damage=15
ext_power=5
when ( 92 ..97 )
equip_class=",B"
ext_damage=12
ext_power=4
when ( 82 ..93 )
equip_class=",C"
ext_damage=8
ext_power=3
when ( 70 ..81 )
equip_class=",D"
ext_damage=5
ext_power=2
when ( 50 ..69 )
equip_class=",E"
ext_damage=3
ext_power=1
else
equip_class=""
ext_damage=0
ext_power=0
end
new_qz = $qianzui_weapons [ randg( 1 ,$qianzui_weapons.size -1 ) ]
new_weapon = $data_weapons [ weapon_id] .dup #clone
new_weapon.id = $data_weapons .size
new_weapon.name = new_qz.name +new_weapon.name +equip_class
for i in weapon_id...$data_weapons.size
if $data_weapons [ i] .name == new_weapon.name
@weapons [ i] = [ [ weapon_number( i) + n, 0 ] .max , 99 ] .min
return
end
end
new_weapon.atk = randg( 0 ,new_qz.atk ) +new_weapon.atk +ext_damage
new_weapon.pdef = randg( 0 ,new_qz.pdef ) +new_weapon.pdef
new_weapon.mdef = randg( 0 ,new_qz.mdef ) +new_weapon.mdef
new_weapon.str_plus = randg( 0 ,new_qz.str_plus ) + new_weapon.str_plus +ext_power
new_weapon.dex_plus = randg( 0 ,new_qz.dex_plus ) + new_weapon.dex_plus +ext_power
new_weapon.agi_plus = randg( 0 ,new_qz.agi_plus ) + new_weapon.agi_plus +ext_power
new_weapon.int_plus = randg( 0 ,new_qz.int_plus ) + new_weapon.int_plus +ext_power
#new_weapon.rang = randg(0,new_qz.rang) + new_weapon.rang 停用附加值
new_weapon.rang = new_weapon.rang
#new_weapon.time = randg(0,new_qz.time) + new_weapon.time 停用附加值
new_weapon.description = new_weapon.description + new_qz.description
new_weapon.element_set = $data_weapons [ weapon_id] .element_set .dup
new_qz.element_set .each { |ele|new_weapon.element_set .push ( ele) }
new_weapon.plus_state_set = $data_weapons [ weapon_id] .plus_state_set .dup
new_qz.plus_state_set .each { |ele|new_weapon.plus_state_set .push ( ele) }
new_weapon.minus_state_set = $data_weapons [ weapon_id] .minus_state_set .dup
new_qz.minus_state_set .each { |ele|new_weapon.minus_state_set .push ( ele) }
$data_weapons .push ( new_weapon)
for i in 1 ...$data_classes.size
if $data_classes [ i] .weapon_set .include ?( weapon_id)
$data_classes [ i] .weapon_set .push ( new_weapon.id )
end
end
@weapons [ new_weapon.id ] = [ [ weapon_number( new_weapon.id ) + n, 0 ] .max , 99 ] .min
end
def gain_armor( armor_id, n, ran = true )
if $scene .is_a ?( Scene_Equip) or $scene .is_a ?( Scene_Shop) or ran == false
@armors [ armor_id] = [ [ armor_number( armor_id) + n, 0 ] .max , 99 ] .min
return
end
case rand ( 100 )
when ( 98 ..100 )
equip_class=",A"
ext_defence=15
ext_power=5
when ( 92 ..97 )
equip_class=",B"
ext_defence=12
ext_power=4
when ( 82 ..93 )
equip_class=",C"
ext_defence=8
ext_power=3
when ( 70 ..81 )
equip_class=",D"
ext_defence=5
ext_power=2
when ( 50 ..69 )
equip_class=",E"
ext_defence=3
ext_power=1
else
equip_class=""
ext_defence=0
ext_power=0
end
new_qz = $qianzui_armors [ randg( 1 ,$qianzui_armors.size -1 ) ]
new_armor = $data_armors [ armor_id] .dup #clone
new_armor.id = $data_armors .size
new_armor.name = new_qz.name +new_armor.name +equip_class
for i in armor_id...$data_armors.size
if $data_armors [ i] .name == new_armor.name
@armors [ i] = [ [ armor_number( i) + n, 0 ] .max , 99 ] .min
return
end
end
new_armor.eva = new_qz.eva +new_armor.eva
new_armor.pdef = new_qz.pdef +new_armor.pdef +ext_defence
new_armor.mdef = new_qz.mdef +new_armor.mdef +ext_defence
new_armor.str_plus = new_qz.str_plus + new_armor.str_plus +ext_power
new_armor.dex_plus = new_qz.dex_plus + new_armor.dex_plus +ext_power
new_armor.agi_plus = new_qz.agi_plus + new_armor.agi_plus +ext_power
new_armor.int_plus = new_qz.int_plus + new_armor.int_plus +ext_power
new_armor.description = new_armor.description + new_qz.description
new_armor.guard_element_set = $data_armors [ armor_id] .guard_element_set .dup
new_qz.guard_element_set .each { |ele|new_armor.guard_element_set .push ( ele) }
new_armor.guard_state_set = $data_armors [ armor_id] .guard_state_set .dup
new_qz.guard_state_set .each { |ele|new_armor.guard_state_set .push ( ele) }
$data_armors .push ( new_armor)
for i in 1 ...$data_classes.size
if $data_classes [ i] .armor_set .include ?( armor_id)
$data_classes [ i] .armor_set .push ( new_armor.id )
end
end
@armors [ new_armor.id ] = [ [ armor_number( new_armor.id ) + n, 0 ] .max , 99 ] .min
end
def lose_weapon( weapon_id, n)
if weapon_id > 0
@weapons [ weapon_id] = [ @weapons[ weapon_id] - n, 0 ] .max
end
end
def lose_armor( armor_id, n)
if armor_id > 0
@armors [ armor_id] = [ @armors[ armor_id] - n, 0 ] .max
end
end
end
class Game_Party
def gain_weapon( weapon_id, n,ran = true )
if $scene .is_a ?( Scene_Equip) or $scene .is_a ?( Scene_Shop) or ran == false
@weapons [ weapon_id] = [ [ weapon_number( weapon_id) + n, 0 ] .max , 99 ] .min
return
end
case rand ( 100 )
when ( 98 ..100 )
equip_class=",A"
ext_damage=15
ext_power=5
when ( 92 ..97 )
equip_class=",B"
ext_damage=12
ext_power=4
when ( 82 ..93 )
equip_class=",C"
ext_damage=8
ext_power=3
when ( 70 ..81 )
equip_class=",D"
ext_damage=5
ext_power=2
when ( 50 ..69 )
equip_class=",E"
ext_damage=3
ext_power=1
else
equip_class=""
ext_damage=0
ext_power=0
end
new_qz = $qianzui_weapons [ randg( 1 ,$qianzui_weapons.size -1 ) ]
new_weapon = $data_weapons [ weapon_id] .dup #clone
new_weapon.id = $data_weapons .size
new_weapon.name = new_qz.name +new_weapon.name +equip_class
for i in weapon_id...$data_weapons.size
if $data_weapons [ i] .name == new_weapon.name
@weapons [ i] = [ [ weapon_number( i) + n, 0 ] .max , 99 ] .min
return
end
end
new_weapon.atk = randg( 0 ,new_qz.atk ) +new_weapon.atk +ext_damage
new_weapon.pdef = randg( 0 ,new_qz.pdef ) +new_weapon.pdef
new_weapon.mdef = randg( 0 ,new_qz.mdef ) +new_weapon.mdef
new_weapon.str_plus = randg( 0 ,new_qz.str_plus ) + new_weapon.str_plus +ext_power
new_weapon.dex_plus = randg( 0 ,new_qz.dex_plus ) + new_weapon.dex_plus +ext_power
new_weapon.agi_plus = randg( 0 ,new_qz.agi_plus ) + new_weapon.agi_plus +ext_power
new_weapon.int_plus = randg( 0 ,new_qz.int_plus ) + new_weapon.int_plus +ext_power
#new_weapon.rang = randg(0,new_qz.rang) + new_weapon.rang 停用附加值
new_weapon.rang = new_weapon.rang
#new_weapon.time = randg(0,new_qz.time) + new_weapon.time 停用附加值
new_weapon.description = new_weapon.description + new_qz.description
new_weapon.element_set = $data_weapons [ weapon_id] .element_set .dup
new_qz.element_set .each { |ele|new_weapon.element_set .push ( ele) }
new_weapon.plus_state_set = $data_weapons [ weapon_id] .plus_state_set .dup
new_qz.plus_state_set .each { |ele|new_weapon.plus_state_set .push ( ele) }
new_weapon.minus_state_set = $data_weapons [ weapon_id] .minus_state_set .dup
new_qz.minus_state_set .each { |ele|new_weapon.minus_state_set .push ( ele) }
$data_weapons .push ( new_weapon)
for i in 1 ...$data_classes.size
if $data_classes [ i] .weapon_set .include ?( weapon_id)
$data_classes [ i] .weapon_set .push ( new_weapon.id )
end
end
@weapons [ new_weapon.id ] = [ [ weapon_number( new_weapon.id ) + n, 0 ] .max , 99 ] .min
end
def gain_armor( armor_id, n, ran = true )
if $scene .is_a ?( Scene_Equip) or $scene .is_a ?( Scene_Shop) or ran == false
@armors [ armor_id] = [ [ armor_number( armor_id) + n, 0 ] .max , 99 ] .min
return
end
case rand ( 100 )
when ( 98 ..100 )
equip_class=",A"
ext_defence=15
ext_power=5
when ( 92 ..97 )
equip_class=",B"
ext_defence=12
ext_power=4
when ( 82 ..93 )
equip_class=",C"
ext_defence=8
ext_power=3
when ( 70 ..81 )
equip_class=",D"
ext_defence=5
ext_power=2
when ( 50 ..69 )
equip_class=",E"
ext_defence=3
ext_power=1
else
equip_class=""
ext_defence=0
ext_power=0
end
new_qz = $qianzui_armors [ randg( 1 ,$qianzui_armors.size -1 ) ]
new_armor = $data_armors [ armor_id] .dup #clone
new_armor.id = $data_armors .size
new_armor.name = new_qz.name +new_armor.name +equip_class
for i in armor_id...$data_armors.size
if $data_armors [ i] .name == new_armor.name
@armors [ i] = [ [ armor_number( i) + n, 0 ] .max , 99 ] .min
return
end
end
new_armor.eva = new_qz.eva +new_armor.eva
new_armor.pdef = new_qz.pdef +new_armor.pdef +ext_defence
new_armor.mdef = new_qz.mdef +new_armor.mdef +ext_defence
new_armor.str_plus = new_qz.str_plus + new_armor.str_plus +ext_power
new_armor.dex_plus = new_qz.dex_plus + new_armor.dex_plus +ext_power
new_armor.agi_plus = new_qz.agi_plus + new_armor.agi_plus +ext_power
new_armor.int_plus = new_qz.int_plus + new_armor.int_plus +ext_power
new_armor.description = new_armor.description + new_qz.description
new_armor.guard_element_set = $data_armors [ armor_id] .guard_element_set .dup
new_qz.guard_element_set .each { |ele|new_armor.guard_element_set .push ( ele) }
new_armor.guard_state_set = $data_armors [ armor_id] .guard_state_set .dup
new_qz.guard_state_set .each { |ele|new_armor.guard_state_set .push ( ele) }
$data_armors .push ( new_armor)
for i in 1 ...$data_classes.size
if $data_classes [ i] .armor_set .include ?( armor_id)
$data_classes [ i] .armor_set .push ( new_armor.id )
end
end
@armors [ new_armor.id ] = [ [ armor_number( new_armor.id ) + n, 0 ] .max , 99 ] .min
end
def lose_weapon( weapon_id, n)
if weapon_id > 0
@weapons [ weapon_id] = [ @weapons[ weapon_id] - n, 0 ] .max
end
end
def lose_armor( armor_id, n)
if armor_id > 0
@armors [ armor_id] = [ @armors[ armor_id] - n, 0 ] .max
end
end
end
前缀的得到方式为:
case rand ( 100 )
when ( 98 ..100 )
equip_class=",A"
ext_defence=15
ext_power=5
when ( 92 ..97 )
equip_class=",B"
ext_defence=12
ext_power=4
when ( 82 ..93 )
equip_class=",C"
ext_defence=8
ext_power=3
when ( 70 ..81 )
equip_class=",D"
ext_defence=5
ext_power=2
when ( 50 ..69 )
equip_class=",E"
ext_defence=3
ext_power=1
else
equip_class=""
ext_defence=0
ext_power=0
end
case rand ( 100 )
when ( 98 ..100 )
equip_class=",A"
ext_defence=15
ext_power=5
when ( 92 ..97 )
equip_class=",B"
ext_defence=12
ext_power=4
when ( 82 ..93 )
equip_class=",C"
ext_defence=8
ext_power=3
when ( 70 ..81 )
equip_class=",D"
ext_defence=5
ext_power=2
when ( 50 ..69 )
equip_class=",E"
ext_defence=3
ext_power=1
else
equip_class=""
ext_defence=0
ext_power=0
end
那你就就应该知道如何修改了~~!!
直接随机数字改为固定选项~~!!
比如:
case rand ( 1 )
when 1
equip_class=",A"
ext_defence=15
ext_power=5
when ( 92 ..97 )
equip_class=",B"
ext_defence=12
ext_power=4
when ( 82 ..93 )
equip_class=",C"
ext_defence=8
ext_power=3
when ( 70 ..81 )
equip_class=",D"
ext_defence=5
ext_power=2
when ( 50 ..69 )
equip_class=",E"
ext_defence=3
ext_power=1
else
equip_class=""
ext_defence=0
ext_power=0
end
case rand ( 1 )
when 1
equip_class=",A"
ext_defence=15
ext_power=5
when ( 92 ..97 )
equip_class=",B"
ext_defence=12
ext_power=4
when ( 82 ..93 )
equip_class=",C"
ext_defence=8
ext_power=3
when ( 70 ..81 )
equip_class=",D"
ext_defence=5
ext_power=2
when ( 50 ..69 )
equip_class=",E"
ext_defence=3
ext_power=1
else
equip_class=""
ext_defence=0
ext_power=0
end
这样得出来的装备属性就会只得到一下选项:
equip_class=",A"
ext_defence=15
ext_power=5
然后就对应到下面的脚本:
=begin
武器/防具詳細說明及套裝界面
從window_help 分離, 由vioyrbr設計及整合 20130615
依附於main 的顏色及字型設定
=end
class Window_Help < Window_Base
#==========================================================
def set_weapon( weapon)
if weapon.nil ?
self .visible = false
return
else
self .visible = true
end
return if weapon == @item
self .width = 240
self .height = 330
self .z += 20
self .contents = Bitmap.new ( self .width , self .height )
self .windowskin = RPG::Cache .windowskin ( "equip" )
self .contents .font .name = $font_spec_name
self .contents .font .size = 18
h = 0
suffix = ""
case weapon.equip_class
when 'A'
self .contents .font .color = font_color( "金" )
suffix = "「傳說」"
when 'B'
self .contents .font .color = font_color( "紫" )
suffix = "「史詩」"
when 'C'
self .contents .font .color = font_color( "紅" )
suffix = "「完美」"
when 'D'
self .contents .font .color = font_color( "藍" )
suffix = "「精良」"
when 'E'
self .contents .font .color = font_color( "綠" )
suffix = "「優秀」"
else
self .contents .font .color = font_color( "白" )
end
self .contents .draw_text ( 0 ,h*ch,cw( weapon.name +suffix) ,ch,weapon.name +suffix)
self .contents .font .size = 16
h += 1
self .contents .font .color = font_color( "黃" )
h += description( 0 ,h,weapon.description )
if weapon.price != 0
h += 1
#if $scene.is_a?(Scene_BuyShop)
#self.contents.draw_text(0,h*ch,cw("購買價格 :")+cw(weapon.price.to_s),ch,"購買價格 :"+weapon.price.to_s)
#else
#self.contents.draw_text(0,h*ch,cw("出售價格 :")+cw((weapon.price/2).to_s),ch,"出售價格 :"+(weapon.price/2).to_s)
#end
end
self .contents .font .color = font_color( "綠" )
if weapon.atk != 0
h += 1
self .contents .draw_text ( 0 ,h*ch,cw( "攻擊力 #{weapon.atk}" ) ,ch,"攻擊力 #{weapon.atk}" )
end
if weapon.pdef != 0
h += 1
self .contents .draw_text ( 0 ,h*ch,cw( "外功防御 #{weapon.pdef}" ) ,ch,"外功防御 #{weapon.pdef}" )
end
if weapon.mdef != 0
h += 1
self .contents .draw_text ( 0 ,h*ch,cw( "內功防禦 #{weapon.mdef}" ) ,ch,"內功防禦 #{weapon.mdef}" )
end
self .contents .font .color = font_color( "紅" )
if weapon.str_plus != 0
h += 1
self .contents .draw_text ( 0 ,h*ch,cw( "剛勁 #{weapon.str_plus}" ) ,ch,"剛勁 #{weapon.str_plus}" )
end
if weapon.dex_plus != 0
h += 1
self .contents .draw_text ( 0 ,h*ch,cw( "癒勁 #{weapon.dex_plus}" ) ,ch,"癒勁 #{weapon.dex_plus}" )
end
if weapon.agi_plus != 0
h += 1
self .contents .draw_text ( 0 ,h*ch,cw( "輕勁 #{weapon.agi_plus}" ) ,ch,"輕勁 #{weapon.agi_plus}" )
end
if weapon.int_plus != 0
h += 1
self .contents .draw_text ( 0 ,h*ch,cw( "柔勁 #{weapon.int_plus}" ) ,ch,"柔勁 #{weapon.int_plus}" )
end
self .contents .font .color = font_color( "紫" )
if weapon.plus_state_set .size != 0
strtemp=""
weapon.plus_state_set .each { |id|
if strtemp==""
strtemp = "附加狀態 " + $data_states [ id] .name
else
strtemp = strtemp + $data_states [ id] .name
h+=1
self .contents .draw_text ( 0 ,h*ch,cw( strtemp) ,ch,strtemp)
strtemp = ""
end
}
if strtemp != ""
h+=1
self .contents .draw_text ( 0 ,h*ch,cw( strtemp) ,ch,strtemp)
strtemp = ""
end
end
@item = weapon
end
#==========================================================
def set_armor( armor)
if armor.nil ?
self .visible = false
return
else
self .visible = true
end
return if armor == @item
self .width = 240
self .height = 330
self .z += 20
self .contents = Bitmap.new ( self .width , self .height )
self .windowskin = RPG::Cache .windowskin ( "equip" )
self .contents .font .name = $font_spec_name
self .contents .font .size = 18
h = 0
suffix = ""
case armor.equip_class
when 'A'
self .contents .font .color = font_color( "金" )
suffix = "「傳說」"
when 'B'
self .contents .font .color = font_color( "紫" )
suffix = "「史詩」"
when 'C'
self .contents .font .color = font_color( "紅" )
suffix = "「完美」"
when 'D'
self .contents .font .color = font_color( "藍" )
suffix = "「精良」"
when 'E'
self .contents .font .color = font_color( "綠" )
suffix = "「優秀」"
else
self .contents .font .color = font_color( "白" )
end
self .contents .draw_text ( 0 ,h*ch,cw( armor.name +suffix) ,ch,armor.name +suffix)
self .contents .font .size = 16
h += 1
self .contents .font .color = font_color( "黃" )
h += description( 0 ,h,armor.description )
if armor.price != 0
h += 1
#if $scene.is_a?(Scene_BuyShop)
#self.contents.draw_text(0,h*ch,cw("購買價格 :")+cw(armor.price.to_s),ch,"購買價格 :"+armor.price.to_s)
#else
#self.contents.draw_text(0,h*ch,cw("出售價格 :")+cw((armor.price/2).to_s),ch,"出售價格 :"+(armor.price/2).to_s)
#end
end
self .contents .font .color = font_color( "綠" )
if armor.pdef != 0
h += 1
self .contents .draw_text ( 0 ,h*ch,cw( "外功防禦 #{armor.pdef}" ) ,ch,"外功防禦 #{armor.pdef}" )
end
if armor.mdef != 0
h += 1
self .contents .draw_text ( 0 ,h*ch,cw( "內功防禦 #{armor.mdef}" ) ,ch,"內功防禦 #{armor.mdef}" )
end
self .contents .font .color = font_color( "紅" )
if armor.str_plus != 0
h += 1
self .contents .draw_text ( 0 ,h*ch,cw( "剛勁 #{armor.str_plus}" ) ,ch,"剛勁 #{armor.str_plus}" )
end
if armor.dex_plus != 0
h += 1
self .contents .draw_text ( 0 ,h*ch,cw( "癒勁 #{armor.dex_plus}" ) ,ch,"癒勁 #{armor.dex_plus}" )
end
if armor.agi_plus != 0
h += 1
self .contents .draw_text ( 0 ,h*ch,cw( "輕勁 #{armor.agi_plus}" ) ,ch,"輕勁 #{armor.agi_plus}" )
end
if armor.int_plus != 0
h += 1
self .contents .draw_text ( 0 ,h*ch,cw( "柔勁 #{armor.int_plus}" ) ,ch,"柔勁 #{armor.int_plus}" )
end
self .contents .font .color = font_color( "紫" )
if armor.guard_state_set .size != 0
strtemp=""
armor.guard_state_set .each { |id|
if strtemp==""
strtemp = "抵禦狀態 " + $data_states [ id] .name
else
strtemp = strtemp + $data_states [ id] .name
h+=1
self .contents .draw_text ( 0 ,h*ch,cw( strtemp) ,ch,strtemp)
strtemp = ""
end
}
if strtemp != ""
h+=1
self .contents .draw_text ( 0 ,h*ch,cw( strtemp) ,ch,strtemp)
strtemp = ""
end
end
@item = armor
end
#==========================================================
# 套裝顯示(武器) -- 遊戲內設定是沒有武器套裝, 缺功能, 只作備用
#==========================================================
def suit_weapon( weapon)
self .visible = false
return
end
#==========================================================
# 套裝顯示(防具)
#==========================================================
def suit_armor( armor)
if armor.nil ?
self .visible = false
return
else
self .visible = true
end
return if armor == @item
local_suit_list = [ ]
SUIT_LIST.each { |key,value|
if value.include ?( armor.id )
local_suit_list.push ( key)
end
}
if local_suit_list == [ ]
self .visible = false
return
end
self .width = 180
self .z += 20
self .contents = Bitmap.new ( self .width , self .height )
self .windowskin = RPG::Cache .windowskin ( "equip" )
self .contents .font .name = $font_spec_name
self .contents .font .color = font_color( "黃" )
self .contents .font .size = 18
h=0
self .contents .draw_text ( 0 ,h*ch,cw( "套裝內容" ) ,ch,"套裝內容" )
h+=2
self .contents .font .size = 14
local_suit_list.each { |result|
self .contents .draw_text ( 0 ,h*ch,cw( result) ,ch,result)
h+=1
}
self .height = [ h * ch + 32 ,330 ] .min
end
#==========================================================
# 套裝顯示(防具) -- 已安裝後
#==========================================================
def suit_armor_check( actor)
self .contents .clear
suitname = actor.suit_matching
if suitname.nil ?
self .visible = false
return
end
effects = SUIT_EFFECT[ suitname]
begin
self .width = 160
self .z += 20
self .contents = Bitmap.new ( self .width , self .height )
self .windowskin = RPG::Cache .windowskin ( "equip" )
self .contents .font .name = $font_spec_name
self .contents .font .color = font_color( "黃" )
self .contents .font .size = 18
h=0
self .contents .draw_text ( 0 ,h*ch,cw( "套裝效果" ) ,ch,"套裝效果" )
h+=2
x = 90
self .contents .font .size = 14
self .contents .draw_text ( 0 ,h*ch,cw( "氣血上限" ) ,ch,"氣血上限" )
self .contents .draw_text ( x,h*ch,cw( effects[ 0 ] .to_s ) ,ch, effects[ 0 ] .to_s )
h+=1
self .contents .draw_text ( 0 ,h*ch,cw( "內力上限" ) ,ch,"內力上限" )
self .contents .draw_text ( x,h*ch,cw( effects[ 1 ] .to_s ) ,ch, effects[ 1 ] .to_s )
h+=1
self .contents .draw_text ( 0 ,h*ch,cw( "剛勁" ) ,ch,"剛勁" )
self .contents .draw_text ( x,h*ch,cw( effects[ 2 ] .to_s ) ,ch, effects[ 2 ] .to_s )
h+=1
self .contents .draw_text ( 0 ,h*ch,cw( "癒勁" ) ,ch,"癒勁" )
self .contents .draw_text ( x,h*ch,cw( effects[ 3 ] .to_s ) ,ch, effects[ 3 ] .to_s )
h+=1
self .contents .draw_text ( 0 ,h*ch,cw( "輕勁" ) ,ch,"輕勁" )
self .contents .draw_text ( x,h*ch,cw( effects[ 4 ] .to_s ) ,ch, effects[ 4 ] .to_s )
h+=1
self .contents .draw_text ( 0 ,h*ch,cw( "柔勁" ) ,ch,"柔勁" )
self .contents .draw_text ( x,h*ch,cw( effects[ 5 ] .to_s ) ,ch, effects[ 5 ] .to_s )
h+=1
end
self .height = [ h * 14 + 32 ,330 ] .min
end
end
=begin
武器/防具詳細說明及套裝界面
從window_help 分離, 由vioyrbr設計及整合 20130615
依附於main 的顏色及字型設定
=end
class Window_Help < Window_Base
#==========================================================
def set_weapon( weapon)
if weapon.nil ?
self .visible = false
return
else
self .visible = true
end
return if weapon == @item
self .width = 240
self .height = 330
self .z += 20
self .contents = Bitmap.new ( self .width , self .height )
self .windowskin = RPG::Cache .windowskin ( "equip" )
self .contents .font .name = $font_spec_name
self .contents .font .size = 18
h = 0
suffix = ""
case weapon.equip_class
when 'A'
self .contents .font .color = font_color( "金" )
suffix = "「傳說」"
when 'B'
self .contents .font .color = font_color( "紫" )
suffix = "「史詩」"
when 'C'
self .contents .font .color = font_color( "紅" )
suffix = "「完美」"
when 'D'
self .contents .font .color = font_color( "藍" )
suffix = "「精良」"
when 'E'
self .contents .font .color = font_color( "綠" )
suffix = "「優秀」"
else
self .contents .font .color = font_color( "白" )
end
self .contents .draw_text ( 0 ,h*ch,cw( weapon.name +suffix) ,ch,weapon.name +suffix)
self .contents .font .size = 16
h += 1
self .contents .font .color = font_color( "黃" )
h += description( 0 ,h,weapon.description )
if weapon.price != 0
h += 1
#if $scene.is_a?(Scene_BuyShop)
#self.contents.draw_text(0,h*ch,cw("購買價格 :")+cw(weapon.price.to_s),ch,"購買價格 :"+weapon.price.to_s)
#else
#self.contents.draw_text(0,h*ch,cw("出售價格 :")+cw((weapon.price/2).to_s),ch,"出售價格 :"+(weapon.price/2).to_s)
#end
end
self .contents .font .color = font_color( "綠" )
if weapon.atk != 0
h += 1
self .contents .draw_text ( 0 ,h*ch,cw( "攻擊力 #{weapon.atk}" ) ,ch,"攻擊力 #{weapon.atk}" )
end
if weapon.pdef != 0
h += 1
self .contents .draw_text ( 0 ,h*ch,cw( "外功防御 #{weapon.pdef}" ) ,ch,"外功防御 #{weapon.pdef}" )
end
if weapon.mdef != 0
h += 1
self .contents .draw_text ( 0 ,h*ch,cw( "內功防禦 #{weapon.mdef}" ) ,ch,"內功防禦 #{weapon.mdef}" )
end
self .contents .font .color = font_color( "紅" )
if weapon.str_plus != 0
h += 1
self .contents .draw_text ( 0 ,h*ch,cw( "剛勁 #{weapon.str_plus}" ) ,ch,"剛勁 #{weapon.str_plus}" )
end
if weapon.dex_plus != 0
h += 1
self .contents .draw_text ( 0 ,h*ch,cw( "癒勁 #{weapon.dex_plus}" ) ,ch,"癒勁 #{weapon.dex_plus}" )
end
if weapon.agi_plus != 0
h += 1
self .contents .draw_text ( 0 ,h*ch,cw( "輕勁 #{weapon.agi_plus}" ) ,ch,"輕勁 #{weapon.agi_plus}" )
end
if weapon.int_plus != 0
h += 1
self .contents .draw_text ( 0 ,h*ch,cw( "柔勁 #{weapon.int_plus}" ) ,ch,"柔勁 #{weapon.int_plus}" )
end
self .contents .font .color = font_color( "紫" )
if weapon.plus_state_set .size != 0
strtemp=""
weapon.plus_state_set .each { |id|
if strtemp==""
strtemp = "附加狀態 " + $data_states [ id] .name
else
strtemp = strtemp + $data_states [ id] .name
h+=1
self .contents .draw_text ( 0 ,h*ch,cw( strtemp) ,ch,strtemp)
strtemp = ""
end
}
if strtemp != ""
h+=1
self .contents .draw_text ( 0 ,h*ch,cw( strtemp) ,ch,strtemp)
strtemp = ""
end
end
@item = weapon
end
#==========================================================
def set_armor( armor)
if armor.nil ?
self .visible = false
return
else
self .visible = true
end
return if armor == @item
self .width = 240
self .height = 330
self .z += 20
self .contents = Bitmap.new ( self .width , self .height )
self .windowskin = RPG::Cache .windowskin ( "equip" )
self .contents .font .name = $font_spec_name
self .contents .font .size = 18
h = 0
suffix = ""
case armor.equip_class
when 'A'
self .contents .font .color = font_color( "金" )
suffix = "「傳說」"
when 'B'
self .contents .font .color = font_color( "紫" )
suffix = "「史詩」"
when 'C'
self .contents .font .color = font_color( "紅" )
suffix = "「完美」"
when 'D'
self .contents .font .color = font_color( "藍" )
suffix = "「精良」"
when 'E'
self .contents .font .color = font_color( "綠" )
suffix = "「優秀」"
else
self .contents .font .color = font_color( "白" )
end
self .contents .draw_text ( 0 ,h*ch,cw( armor.name +suffix) ,ch,armor.name +suffix)
self .contents .font .size = 16
h += 1
self .contents .font .color = font_color( "黃" )
h += description( 0 ,h,armor.description )
if armor.price != 0
h += 1
#if $scene.is_a?(Scene_BuyShop)
#self.contents.draw_text(0,h*ch,cw("購買價格 :")+cw(armor.price.to_s),ch,"購買價格 :"+armor.price.to_s)
#else
#self.contents.draw_text(0,h*ch,cw("出售價格 :")+cw((armor.price/2).to_s),ch,"出售價格 :"+(armor.price/2).to_s)
#end
end
self .contents .font .color = font_color( "綠" )
if armor.pdef != 0
h += 1
self .contents .draw_text ( 0 ,h*ch,cw( "外功防禦 #{armor.pdef}" ) ,ch,"外功防禦 #{armor.pdef}" )
end
if armor.mdef != 0
h += 1
self .contents .draw_text ( 0 ,h*ch,cw( "內功防禦 #{armor.mdef}" ) ,ch,"內功防禦 #{armor.mdef}" )
end
self .contents .font .color = font_color( "紅" )
if armor.str_plus != 0
h += 1
self .contents .draw_text ( 0 ,h*ch,cw( "剛勁 #{armor.str_plus}" ) ,ch,"剛勁 #{armor.str_plus}" )
end
if armor.dex_plus != 0
h += 1
self .contents .draw_text ( 0 ,h*ch,cw( "癒勁 #{armor.dex_plus}" ) ,ch,"癒勁 #{armor.dex_plus}" )
end
if armor.agi_plus != 0
h += 1
self .contents .draw_text ( 0 ,h*ch,cw( "輕勁 #{armor.agi_plus}" ) ,ch,"輕勁 #{armor.agi_plus}" )
end
if armor.int_plus != 0
h += 1
self .contents .draw_text ( 0 ,h*ch,cw( "柔勁 #{armor.int_plus}" ) ,ch,"柔勁 #{armor.int_plus}" )
end
self .contents .font .color = font_color( "紫" )
if armor.guard_state_set .size != 0
strtemp=""
armor.guard_state_set .each { |id|
if strtemp==""
strtemp = "抵禦狀態 " + $data_states [ id] .name
else
strtemp = strtemp + $data_states [ id] .name
h+=1
self .contents .draw_text ( 0 ,h*ch,cw( strtemp) ,ch,strtemp)
strtemp = ""
end
}
if strtemp != ""
h+=1
self .contents .draw_text ( 0 ,h*ch,cw( strtemp) ,ch,strtemp)
strtemp = ""
end
end
@item = armor
end
#==========================================================
# 套裝顯示(武器) -- 遊戲內設定是沒有武器套裝, 缺功能, 只作備用
#==========================================================
def suit_weapon( weapon)
self .visible = false
return
end
#==========================================================
# 套裝顯示(防具)
#==========================================================
def suit_armor( armor)
if armor.nil ?
self .visible = false
return
else
self .visible = true
end
return if armor == @item
local_suit_list = [ ]
SUIT_LIST.each { |key,value|
if value.include ?( armor.id )
local_suit_list.push ( key)
end
}
if local_suit_list == [ ]
self .visible = false
return
end
self .width = 180
self .z += 20
self .contents = Bitmap.new ( self .width , self .height )
self .windowskin = RPG::Cache .windowskin ( "equip" )
self .contents .font .name = $font_spec_name
self .contents .font .color = font_color( "黃" )
self .contents .font .size = 18
h=0
self .contents .draw_text ( 0 ,h*ch,cw( "套裝內容" ) ,ch,"套裝內容" )
h+=2
self .contents .font .size = 14
local_suit_list.each { |result|
self .contents .draw_text ( 0 ,h*ch,cw( result) ,ch,result)
h+=1
}
self .height = [ h * ch + 32 ,330 ] .min
end
#==========================================================
# 套裝顯示(防具) -- 已安裝後
#==========================================================
def suit_armor_check( actor)
self .contents .clear
suitname = actor.suit_matching
if suitname.nil ?
self .visible = false
return
end
effects = SUIT_EFFECT[ suitname]
begin
self .width = 160
self .z += 20
self .contents = Bitmap.new ( self .width , self .height )
self .windowskin = RPG::Cache .windowskin ( "equip" )
self .contents .font .name = $font_spec_name
self .contents .font .color = font_color( "黃" )
self .contents .font .size = 18
h=0
self .contents .draw_text ( 0 ,h*ch,cw( "套裝效果" ) ,ch,"套裝效果" )
h+=2
x = 90
self .contents .font .size = 14
self .contents .draw_text ( 0 ,h*ch,cw( "氣血上限" ) ,ch,"氣血上限" )
self .contents .draw_text ( x,h*ch,cw( effects[ 0 ] .to_s ) ,ch, effects[ 0 ] .to_s )
h+=1
self .contents .draw_text ( 0 ,h*ch,cw( "內力上限" ) ,ch,"內力上限" )
self .contents .draw_text ( x,h*ch,cw( effects[ 1 ] .to_s ) ,ch, effects[ 1 ] .to_s )
h+=1
self .contents .draw_text ( 0 ,h*ch,cw( "剛勁" ) ,ch,"剛勁" )
self .contents .draw_text ( x,h*ch,cw( effects[ 2 ] .to_s ) ,ch, effects[ 2 ] .to_s )
h+=1
self .contents .draw_text ( 0 ,h*ch,cw( "癒勁" ) ,ch,"癒勁" )
self .contents .draw_text ( x,h*ch,cw( effects[ 3 ] .to_s ) ,ch, effects[ 3 ] .to_s )
h+=1
self .contents .draw_text ( 0 ,h*ch,cw( "輕勁" ) ,ch,"輕勁" )
self .contents .draw_text ( x,h*ch,cw( effects[ 4 ] .to_s ) ,ch, effects[ 4 ] .to_s )
h+=1
self .contents .draw_text ( 0 ,h*ch,cw( "柔勁" ) ,ch,"柔勁" )
self .contents .draw_text ( x,h*ch,cw( effects[ 5 ] .to_s ) ,ch, effects[ 5 ] .to_s )
h+=1
end
self .height = [ h * 14 + 32 ,330 ] .min
end
end
这个就是随机之后选择的名称代码`~!!
case weapon.equip_class
when 'A'
self .contents .font .color = font_color( "金" )
suffix = "「傳說」"
when 'B'
self .contents .font .color = font_color( "紫" )
suffix = "「史詩」"
when 'C'
self .contents .font .color = font_color( "紅" )
suffix = "「完美」"
when 'D'
self .contents .font .color = font_color( "藍" )
suffix = "「精良」"
when 'E'
self .contents .font .color = font_color( "綠" )
suffix = "「優秀」"
else
self .contents .font .color = font_color( "白" )
end
case weapon.equip_class
when 'A'
self .contents .font .color = font_color( "金" )
suffix = "「傳說」"
when 'B'
self .contents .font .color = font_color( "紫" )
suffix = "「史詩」"
when 'C'
self .contents .font .color = font_color( "紅" )
suffix = "「完美」"
when 'D'
self .contents .font .color = font_color( "藍" )
suffix = "「精良」"
when 'E'
self .contents .font .color = font_color( "綠" )
suffix = "「優秀」"
else
self .contents .font .color = font_color( "白" )
end
如果按照我上面修改的最后得到的装备名称就是:
when 'A'
self.contents.font.color = font_color("金")
suffix = "「傳說」"
作者: liujianxiong520 时间: 2013-12-29 16:26
大神 你还是没懂我的意思啊!!!!我想改的是前缀啊前缀!!! 到底在哪里改 怎么改啊 大神 跪求赐教
QQ截图20131229153908.png
(75.79 KB, 下载次数: 8)
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1