Project1

标题: 这段脚本怎么拆成两段写入事件中? [打印本页]

作者: he11120    时间: 2012-3-27 20:31
标题: 这段脚本怎么拆成两段写入事件中?
a = $scene.active_battler
for t in $scene.target_battlers
    f=t.damage
    f=0 unless t.damage.is_a?(Integer)
    if t.element_rate(9)>=150
        t.hp=t.last_hp+f;a.hp-=f
        a.damage=t.damage;t.damage=-f if f!=0
    else
        a.hp+=f; a.damage=-f if f!=0
    end
end
$scene.active_battler = a
dsu_plus_rewardpost_czw
作者: iNG.天影-冰    时间: 2012-3-27 21:28
拆成三段:1.@a = $scene.active_battler
2.for t in $scene.target_battlers
    f=t.damage
    f=0 unless t.damage.is_a?(Integer)
    if t.element_rate(9)>=150
        t.hp=t.last_hp+f;@a.hp-=f
        @a.damage=t.damage;t.damage=-f if f!=0
    else
        @a.hp+=f; @a.damage=-f if f!=0
    end
end
3.$scene.active_battler = @a




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1