Go で書き直した Ikemen
修订版 | 07f269f63dfa05e26a65687d7600c6d03a259fad (tree) |
---|---|
时间 | 2017-01-03 01:33:53 |
作者 | SUEHIRO <supersuehiro@user...> |
Commiter | SUEHIRO |
評価順を固定
@@ -2097,7 +2097,8 @@ func (sc explod) Run(c *Char, _ []int32) bool { | ||
2097 | 2097 | case explod_removeongethit: |
2098 | 2098 | e.removeongethit = exp[0].evalB(c) |
2099 | 2099 | case explod_trans: |
2100 | - e.alpha = [2]int32{exp[0].evalI(c), exp[1].evalI(c)} | |
2100 | + e.alpha[0] = exp[0].evalI(c) | |
2101 | + e.alpha[1] = exp[1].evalI(c) | |
2101 | 2102 | if len(exp) >= 3 { |
2102 | 2103 | e.alpha[0] = Max(0, Min(255, e.alpha[0])) |
2103 | 2104 | e.alpha[1] = Max(0, Min(255, e.alpha[1])) |
@@ -2437,11 +2438,17 @@ func (sc palFX) runSub(c *Char, pfd *PalFXDef, | ||
2437 | 2438 | case palFX_color: |
2438 | 2439 | pfd.color = MaxF(0, MinF(1, exp[0].evalF(c)/256)) |
2439 | 2440 | case palFX_add: |
2440 | - pfd.add = [3]int32{exp[0].evalI(c), exp[1].evalI(c), exp[2].evalI(c)} | |
2441 | + pfd.add[0] = exp[0].evalI(c) | |
2442 | + pfd.add[1] = exp[1].evalI(c) | |
2443 | + pfd.add[2] = exp[2].evalI(c) | |
2441 | 2444 | case palFX_mul: |
2442 | - pfd.mul = [3]int32{exp[0].evalI(c), exp[1].evalI(c), exp[2].evalI(c)} | |
2445 | + pfd.mul[0] = exp[0].evalI(c) | |
2446 | + pfd.mul[1] = exp[1].evalI(c) | |
2447 | + pfd.mul[2] = exp[2].evalI(c) | |
2443 | 2448 | case palFX_sinadd: |
2444 | - pfd.sinadd = [3]int32{exp[0].evalI(c), exp[1].evalI(c), exp[2].evalI(c)} | |
2449 | + pfd.sinadd[0] = exp[0].evalI(c) | |
2450 | + pfd.sinadd[1] = exp[1].evalI(c) | |
2451 | + pfd.sinadd[2] = exp[2].evalI(c) | |
2445 | 2452 | if len(exp) > 3 { |
2446 | 2453 | pfd.cycletime = exp[3].evalI(c) |
2447 | 2454 | } |
@@ -3848,7 +3855,8 @@ func (sc trans) Run(c *Char, _ []int32) bool { | ||
3848 | 3855 | StateControllerBase(sc).run(c, func(id byte, exp []BytecodeExp) bool { |
3849 | 3856 | switch id { |
3850 | 3857 | case trans_trans: |
3851 | - c.alpha = [2]int32{exp[0].evalI(c), exp[1].evalI(c)} | |
3858 | + c.alpha[0] = exp[0].evalI(c) | |
3859 | + c.alpha[1] = exp[1].evalI(c) | |
3852 | 3860 | if len(exp) >= 3 { |
3853 | 3861 | c.alpha[0] = Max(0, Min(255, c.alpha[0])) |
3854 | 3862 | c.alpha[1] = Max(0, Min(255, c.alpha[1])) |