查看: 1372|回复: 1

[已经解决] 这段脚本怎么拆成两段写入事件中?

[复制链接]
梦石
0
星屑
70
在线时间
187 小时
注册时间
2006-9-3
回帖
129
发表于 2012-3-27 20:31:18 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
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

点评

如果是写不下的话把所有空格去掉= =。。一定要拆成两段就用@代替a和t再从if分开吧..  发表于 2012-3-27 20:50
...........

CHN·TY·A

梦石
0
星屑
50
在线时间
212 小时
注册时间
2012-1-14
回帖
202
发表于 2012-3-27 21:28:53 | 显示全部楼层
拆成三段: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
上联:金龙腾飞横扫东洋鬼魅
下联:银蛇劲舞彰显中华国威
横批:春泽钓岛
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部