# 风属性武器的伤害累加
if $game_party.actors[0].weapon_id != 0 and $data_weapons[$game_party.actors[0].weapon_id].element_set.include?(6)
wf = 10
else
wf = 0
end
# 镶嵌所添加的风属性
if $game_party.actors[0].weapon_id != 0 and $data_weapons[$game_party.actors[0].weapon_id].element_set.include?(91)
wfk1 = 2
elsif $game_party.actors[0].weapon_id != 0 and $data_weapons[$game_party.actors[0].weapon_id].element_set.include?(92)
wfk1 = 4
elsif $game_party.actors[0].weapon_id != 0 and $data_weapons[$game_party.actors[0].weapon_id].element_set.include?(93)
wfk1 = 6
elsif $game_party.actors[0].weapon_id != 0 and $data_weapons[$game_party.actors[0].weapon_id].element_set.include?(94)
wfk1 = 8
else
wfk1 = 0
end
for i in 1..20
if $game_variables[5] == i and $game_map.events[i].name.include?("f")
$game_variables[36] = (wf.to_i+wfk1.to_i+wfk2.to_i+wfk3.to_i)/2
break
elsif $game_variables[5] == i and $game_map.events[i].name.include?("h")
$game_variables[36] = 0
break
elsif $game_variables[5] == i and $game_map.events[i].name.include?("t")
$game_variables[36] = (wf.to_i+wfk1.to_i+wfk2.to_i+wfk3.to_i)*2
break
else
$game_variables[36] = wf.to_i+wfk1.to_i
end
end作者: 囧之达人 时间: 2009-7-6 14:59
RUBY是一行一行执行的,所以你写哪里都没关系作者: ONEWateR 时间: 2009-7-6 15:03
估计会~
def update
。。。。。
def attack
# 风属性武器的伤害累加
if $game_party.actors[0].weapon_id != 0 and $data_weapons[$game_party.actors[0].weapon_id].element_set.include?(6)
wf = 10
else
wf = 0
end
# 镶嵌所添加的风属性
if $game_party.actors[0].weapon_id != 0 and $data_weapons[$game_party.actors[0].weapon_id].element_set.include?(91)
wfk1 = 2
elsif $game_party.actors[0].weapon_id != 0 and $data_weapons[$game_party.actors[0].weapon_id].element_set.include?(92)
wfk1 = 4
elsif $game_party.actors[0].weapon_id != 0 and $data_weapons[$game_party.actors[0].weapon_id].element_set.include?(93)
wfk1 = 6
elsif $game_party.actors[0].weapon_id != 0 and $data_weapons[$game_party.actors[0].weapon_id].element_set.include?(94)
wfk1 = 8
else
wfk1 = 0
end
for i in 1..20
if $game_variables[5] == i and $game_map.events.name.include?("f")
$game_variables[36] = (wf.to_i+wfk1.to_i+wfk2.to_i+wfk3.to_i)/2
break
elsif $game_variables[5] == i and $game_map.events.name.include?("h")
$game_variables[36] = 0
break
elsif $game_variables[5] == i and $game_map.events.name.include?("t")
$game_variables[36] = (wf.to_i+wfk1.to_i+wfk2.to_i+wfk3.to_i)*2
break
else
$game_variables[36] = wf.to_i+wfk1.to_i
end
end
end
if Input.trigger?(Input::C)
attack
end
。。。。。。作者: IamI 时间: 2009-7-6 16:01
你不能把def attack拿到外面去嘛……= =方法套方法让人看得眼花缭乱
应该是这样
def update
######
if Input.trigger?(Input::C)
attack
end
end
def attack
#####
end
def update
…………
…………
if Input.trigger?(Input::C)
attack
end
end
def attack
# 风属性武器的伤害累加
if $game_party.actors[0].weapon_id != 0 and $data_weapons[$game_party.actors[0].weapon_id].element_set.include?(6)
wf = 10
else
wf = 0
end
# 镶嵌所添加的风属性
if $game_party.actors[0].weapon_id != 0 and $data_weapons[$game_party.actors[0].weapon_id].element_set.include?(91)
wfk1 = 2
elsif $game_party.actors[0].weapon_id != 0 and $data_weapons[$game_party.actors[0].weapon_id].element_set.include?(92)
wfk1 = 4
elsif $game_party.actors[0].weapon_id != 0 and $data_weapons[$game_party.actors[0].weapon_id].element_set.include?(93)
wfk1 = 6
elsif $game_party.actors[0].weapon_id != 0 and $data_weapons[$game_party.actors[0].weapon_id].element_set.include?(94)
wfk1 = 8
else
wfk1 = 0
end
for i in 1..20
if $game_variables[5] == i and $game_map.events.name.include?("f")
$game_variables[36] = (wf.to_i+wfk1.to_i+wfk2.to_i+wfk3.to_i)/2
break
elsif $game_variables[5] == i and $game_map.events.name.include?("h")
$game_variables[36] = 0
break
elsif $game_variables[5] == i and $game_map.events.name.include?("t")
$game_variables[36] = (wf.to_i+wfk1.to_i+wfk2.to_i+wfk3.to_i)*2
break
else
$game_variables[36] = wf.to_i+wfk1.to_i
end
end
end