
[Statedef -2]

[State -2, changestate]
type = selfstate
trigger1 = Ishelper(2)
trigger1 = roundstate = 2
trigger1 = Var(30) != gametime
value = 2

[state -2]
type = ctrlset
trigger1 = Ishelper
value = 0

[state 0,0]
type = Changeanim
trigger1 = !Ishelper
trigger1 = anim != 1111
trigger1 = Stateno != 5900
value = 1111

[State -2, 4]
type = HitOverride
trigger1 = 1
slot = 1
attr = SCA, NA,SA,HA,NP,SP,HP
stateno = 5
Time = -1
ignorehitpause=1

[State -2, 4]
type = HitOverride
trigger1 = 1
slot = 2
attr = SCA, NA,SA,HA,NP,SP,HP
stateno = 5
Time = -1
ignorehitpause=1

[State -2, 4]
type = HitOverride
trigger1 = 1
slot = 3
attr = SCA, NA,SA,HA,NP,SP,HP
stateno = 5
Time = -1
ignorehitpause=1

[State -2, 4]
type = HitOverride
trigger1 = 1
slot = 4
attr = SCA, NA,SA,HA,NP,SP,HP
stateno = 5
Time = -1
ignorehitpause=1

[state -2]
type = varset
trigger1 = 1
v = 17
value = helper(2),AnimElemNo(0)

[state -2];常に体力消耗
type = lifeadd
trigger1 = roundstate = 2
trigger1 = movetype != H 
trigger1 = gametime%4 = 0
kill = 0
value = -1

[state -2];ヘルパーが死なぬように
type = lifeset
trigger1 = roundstate = 2
trigger1 = Ishelper
value = 99999

[State -2]
type = Varadd
trigger1 = roundstate = 2
trigger1 = !Ishelper
v = 31
value = 1

[State -2]
type = Varadd
trigger1 = Var(3) = 1
v = 4
value = 1

[state -2]
type = varset
trigger1 = Var(4) >= 500
v = 3
value = 0

[state -2]
type = varset
trigger1 = Var(3) = 0
v = 4
value = 0

[state -2]
type = PalFX
trigger1 = Var(4)%3 = 1
time = 1
add = 180,0,0
mul = 180,0,0

[state -2]
type = PalFX
trigger1 = Var(4)%3 = 2
trigger2 = Var(4)%3 = 0
trigger2 = Var(4) >= 1
time = 1
add = 180,120,120
mul = 180,120,120

;ゲージもどき

[State -2]
type = Explod
trigger1 = Var(2) = 1
trigger1 = Var(18) >= 5
anim = 246
ID = 14
pos = 55,220
postype = left
facing = 1
removetime = 1
scale = .5,.5
ownpal = 1
bindtime = 9999999999
ontop = 1

[State -2]
type = Explod
trigger1 = Var(2) = 1
trigger1 = Var(18) >= 4
anim = 246
ID = 13
pos = 45,220
postype = left
facing = 1
removetime = 1
scale = .5,.5
ownpal = 1
bindtime = 9999999999
ontop = 1

[State -2]
type = Explod
trigger1 = Var(2) = 1
trigger1 = Var(18) >= 3
anim = 246
ID = 12
pos = 35,220
postype = left
facing = 1
removetime = 1
scale = .5,.5
ownpal = 1
bindtime = 9999999999
ontop = 1

[State -2]
type = Explod
trigger1 = Var(2) = 1
trigger1 = Var(18) >= 2
anim = 246
ID = 11
pos = 25,220
postype = left
facing = 1
removetime = 1
scale = .5,.5
ownpal = 1
bindtime = 9999999999
ontop = 1

[State -2]
type = Explod
trigger1 = Var(2) = 1
trigger1 = Var(18) >= 1
anim = 246
ID = 10
pos = 15,220
postype = left
facing = 1
removetime = 1
scale = .5,.5
ownpal = 1
bindtime = 9999999999
ontop = 1

[State -2]
type = Explod
trigger1 = Var(2) = -1
trigger1 = Var(18) >= 5
anim = 246
ID = 14
pos = 254,220
postype = left
facing = -1
removetime = 1
scale = .5,.5
ownpal = 1
bindtime = 9999999999
ontop = 1

[State -2]
type = Explod
trigger1 = Var(2) = -1
trigger1 = Var(18) >= 4
anim = 246
ID = 13
pos = 274,220
postype = left
facing = 1
removetime = 1
scale = .5,.5
ownpal = 1
bindtime = 9999999999
ontop = 1

[State -2]
type = Explod
trigger1 = Var(2) = -1
trigger1 = Var(18) >= 3
anim = 246
ID = 12
pos = 284,220
postype = left
facing = 1
removetime = 1
scale = .5,.5
ownpal = 1
bindtime = 9999999999
ontop = 1

[State -2]
type = Explod
trigger1 = Var(2) = -1
trigger1 = Var(18) >= 2
anim = 246
ID = 11
pos = 294,220
postype = left
facing = 1
removetime = 1
scale = .5,.5
ownpal = 1
bindtime = 9999999999
ontop = 1

[State -2]
type = Explod
trigger1 = Var(2) = -1
trigger1 = Var(18) >= 1
anim = 246
ID = 10
pos = 304,220
postype = left
facing = 1
removetime = 1
scale = .5,.5
ownpal = 1
bindtime = 9999999999
ontop = 1

;---------------------------------------------------------------------------
; デバッグ表示
[State -2, Debug Display]
type = DisplayToClipboard
trigger1 = 1
text = "bodydist X=%d,Y=%d : dist x=%d, y=%d, frontedgedist=%d\n"
params = floor(P2BodyDist X) , floor(P2BodyDist Y) , floor(p2dist x), floor(p2dist y), floor(frontedgedist)

[State -2, Debug Display2]
type = AppendToClipboard
trigger1 = 1
text = "stateno =%d, p2stateno = %d, p2statetype=%d "
params = stateno, p2stateno, (p2statetype=S) | (p2statetype=C)*2 | (p2statetype=A)*3 | (p2statetype=L)*4

[State -2, Debug Display2]
type = AppendToClipboard
trigger1 = 0
text = "helper(2),stateno=%d"
params = helper(2),stateno

[State -2]
type = DisplayToClipboard
trigger1 = 1
text = "var(19)=%d,var(20)=%d,var(18)=%d,var(30)=%d"
params = helper(2),var(19),helper(2),var(20),var(18),helper(2),var(30)
;---------------------------------------------------------------------------

[State -2, Floor]
type = Explod
trigger1 = NumExplod(2222) = 0
ignorehitpause = 1
id = 2222
anim = 2222
pos = 0, -30
postype = p1
sprpriority = -3
removetime = -1
scale = 3,2
ownpal = 1

[State 1000, 0]
type = DefenceMulSet
triggerall = numhelper(1) = 1
triggerall = numhelper(2) = 1
trigger1 = helper(1),var(39) >= 2
trigger2 = helper(2),var(39) >= 2
value = 1.8/ifelse( (helper(1),var(39) > helper(2),var(39)), (helper(1),var(39)), (helper(2),var(39)) )

[State 1000, 0]
type = DefenceMulSet
triggerall = numhelper(1) = 1
triggerall = numhelper(2) = 1
trigger1 = helper(1),var(39) = 0
trigger1 = helper(2),var(39) = 0
value = 1.0

[State -2, 1] 
type = NotHitBy 
trigger1 =  1
value = , NT,ST,HT
time = 1

[State -2, 0]
type = AssertSpecial
trigger1 = 1
flag = NoStandGuard
flag2 = NoCrouchGuard
flag3 = NoAirGuard

[State -2, 0]
type = AssertSpecial
trigger1 = movetype = A
flag = NoAutoTurn

[state -2]
type = lifeadd
trigger1 = numhelper(2) = 1
trigger1 = var(42) = 1
value = -2*(helper(2),var(40))

[state -2]
type = varset
trigger1 = var(41) = 1
v = 41
value = 0

[state -2]
type = varset
trigger1 = var(42) = 1
v = 42
value = 0
