; Link The Hylian Knight
; Constants and state file.

[Data]
life = 1000
power = 3000
attack = 100
defence = 100
fall.defence_up = 60
liedown.time = 50
airjuggle = 15
sparkno = -1
guard.sparkno = -1
KO.echo = 0
volume = 50
IntPersistIndex = 60
FloatPersistIndex = 40

[Size]
xscale = 1
yscale = 1
ground.back = 18
ground.front = 22
air.back = 15
air.front = 15
height = 55
attack.dist = 160
proj.attack.dist = 90
proj.doscale = 0
head.pos = 0,-70
mid.pos = 0,-40
shadowoffset = 0
draw.offset = 0,0

[Velocity]
walk.fwd = 2.7
walk.back = -2.4
run.fwd = 6.5, 0
run.back = -5,-4.5
jump.neu = 0,-7.75
jump.back = -2.7
jump.fwd = 2.7
runjump.back = -3
runjump.fwd = 4
airjump.neu = 0,-8.1
airjump.back = -2.7
airjump.fwd = 2.7

[Movement]
airjump.num = 0
airjump.height = 35
yaccel = .35
stand.friction = .85
crouch.friction = .82

;---------------------------------------------------------------------------
; Stand
[Statedef 0]
type = S
physics = S
sprpriority = 0
hitcountpersist = (enemy, movetype = H)

[State 0, 1]
type = ChangeAnim
trigger1 = Anim != 0 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 0

[State 0, 2]
type = VelSet
trigger1 = Time = 0
y = 0

[State 0, 3]
type = VelSet
trigger1 = abs(vel x) < 2
trigger2 = Time = 4
x = 0

;---------------------------------------------------------------------------
; Stand to Crouch
[Statedef 10]
type    = C
physics = C
anim = 10
hitcountpersist = (enemy, movetype = H)

[State 10, 1]
type = VelMul
trigger1 = Time = 0
x = .75

[State 10, 2]
type = Changestate
trigger1 = AnimTime = 0
trigger2 = var(51) != 0
trigger2 = animelemtime(animelemno(0)+1) = 0
trigger2 = animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1) - ifelse(animelemtime(animelemno(0)+1)=0,animtime,0) > 1
trigger2 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0))-animtime)/2
value = 11

[State 10, 3]
type = Changestate
trigger1 = prevstateno != 120
trigger1 = var(2) = 1
value = 120

;---------------------------------------------------------------------------
; Crouching
[Statedef 11]
type    = C
physics = C
anim = 11
sprpriority = 0
hitcountpersist = (enemy, movetype = H)

[State 11, 1]
type = Changeanim
trigger1 = Anim = 6 && AnimTime = 0
value = 11

[State 11, 2]
type = Changestate
;trigger1 = prevstateno != 120
trigger1 = var(2) = 1
value = 120

;---------------------------------------------------------------------------
; Crouch to Stand
[Statedef 12]
type    = S
physics = S
anim = 12
hitcountpersist = (enemy, movetype = H)

[State 12, 1]
type = Changestate
trigger1 = AnimTime = 0
trigger2 = var(51) != 0
trigger2 = animelemtime(animelemno(0)+1) = 0
trigger2 = animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1) - ifelse(animelemtime(animelemno(0)+1)=0,animtime,0) > 1
trigger2 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0))-animtime)/2
value = 0

;---------------------------------------------------------------------------
; Walk
[Statedef 20]
type    = S
physics = N
sprpriority = 0
hitcountpersist = (enemy, movetype = H)

[State 20, 1]
type = VelSet
trigger1 = command = "holdfwd"
x = const(velocity.walk.fwd.x)

[State 20, 2]
type = VelSet
trigger1 = command = "holdback"
x = const(velocity.walk.back.x)

[State 20, 3]
type = Changeanim
triggerall = vel x > 0
trigger1 = Anim != 20 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 20

[State 20, 4]
type = Changeanim
triggerall = vel x < 0
trigger1 = Anim != 21 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 21

[State 20, 5]
type = Changestate
trigger1 = anim = [20,21]
trigger1 = prevstateno != 120
trigger1 = var(1) = 1
value = 120

;---------------------------------------------------------------------------
; Jump Start
[Statedef 40]
type    = S
physics = S
anim = 40
ctrl = 0
sprpriority = 1
hitcountpersist = (enemy, movetype = H)

[State 40, 1]
type = VarSet
trigger1 = Time = 0
sysvar(1) = 0

[State 40, 2]
type = VarSet
trigger1 = command = "holdfwd"
sysvar(1) = 1

[State 40, 3]
type = VarSet
trigger1 = command = "holdback"
sysvar(1) = -1

[State 40, 4]
type = VelSet
trigger1 = AnimTime = 0
x = ifelse(sysvar(1)=0, const(velocity.jump.neu.x), ifelse(sysvar(1)=1, const(velocity.jump.fwd.x), const(velocity.jump.back.x)))
;y = const(velocity.jump.y)

[State 40, 5]
type = VelSet
trigger1 = AnimTime = 0
trigger1 = prevstateno = 100 ;RUN_FWD
trigger1 = sysvar(1) = 1
x = const(velocity.runjump.fwd.x)

[State 40, 6]
type = ChangeState
trigger1 = AnimTime = 0
value = 50
ctrl = 1

;---------------------------------------------------------------------------
; AirJump Start
[Statedef 45]
type    = A
physics = N
ctrl = 0
velset = 0,0

[State 45, 1]
type = ChangeAnim
trigger1 = SelfAnimExist(44)
value = 44

[State 45, 2]
type = ChangeAnim
trigger1 = !SelfAnimExist(44)
value = 41

[State 45, 3]
type = VarSet
trigger1 = Time = 0
sysvar(1) = 0

[State 45, 4]
type = VarSet
trigger1 = command = "holdfwd"
sysvar(1) = 1

[State 45, 5]
type = VarSet
trigger1 = command = "holdback"
sysvar(1) = -1

[State 45, 6]
type = VelSet
trigger1 = Time = 2
x = ifelse(sysvar(1)=0, const(velocity.airjump.neu.x), ifelse(sysvar(1)=1, const(velocity.airjump.fwd.x), const(velocity.airjump.back.x)))
y = const(velocity.airjump.y)

[State 45, 7]
type = ChangeState
trigger1 = Time = 2
value = 50
ctrl = 1

;---------------------------------------------------------------------------
; Jump Up
[Statedef 50]
type    = A
physics = A
velset = vel x, ifelse(command="holdup",const(velocity.jump.y),-5.8)
hitcountpersist = (enemy, movetype = H)

[State 50, 0]
type = Playsnd
trigger1 = time = 0
value = 40,0

[State 50, 1]
type = VarSet
trigger1 = Time = 0
sysvar(1) = 0

[State 50, 2]
type = Changeanim
trigger1 = Time = 0
value = ifelse((vel x)=0, 41, ifelse((vel x)>0, 42, 43))

[State 50, 3]
type = Changeanim
trigger1 = Vel y > -2
trigger1 = SelfAnimExist(anim + 3)
value = Anim + 3
persistent = 0

[State 50, 4]
type = Changestate
trigger1 = pos y < -40
trigger1 = command = "up2" && command != "up3"
trigger1 = prevstateno != 45
value = 45

;---------------------------------------------------------------------------
; Jump Down
[Statedef 51]
type    = A
physics = A

[State 51, 1]
type = Null
trigger1 = 1

;---------------------------------------------------------------------------
; Jump Land
[Statedef 52]
type    = S
physics = S
ctrl = 0
anim = 47
hitcountpersist = (enemy, movetype = H)

[State 52, 1]
type = Destroyself
trigger1 = ishelper

[State 52, 2]
type = Changestate
trigger1 = time = 0
value = 53
ctrl = 1

;---------------------------------------------------------------------------
; Jump Land
[Statedef 53]
type    = S
physics = S
ctrl = 0
anim = 47
hitcountpersist = (enemy, movetype = H)

[State 53, 0]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = time = 0
value = 52,0

[State 53, 1]
type = VelSet
trigger1 = Time = 0
y = 0

[State 53, 2]
type = PosSet
trigger1 = Time = 0
y = 0

[State 53, 3]
type = CtrlSet
trigger1 = Time = 3
value = 1

[State 53, 4]
type = Explod
trigger1 = time = 1
anim = 50
sprpriority = 0
ownpal = 1

[State 53, 5]
type = Changestate
trigger1 = AnimTime = 0
trigger2 = var(51) != 0
trigger2 = animelemtime(animelemno(0)+1) = 0
trigger2 = animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1) - ifelse(animelemtime(animelemno(0)+1)=0,animtime,0) > 1
trigger2 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0))-animtime)/2
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Superjump
[Statedef 90]
type = S
physics = S
anim = 90
ctrl = 0
sprpriority = 1
hitcountpersist = (enemy, movetype = H)

[State 90, 1]
type = Playsnd
trigger1 = time = 0
value = 40,0

[State 90, 2]
type = Playsnd
trigger1 = time = 0
value = 90,0

[State 90, 3]
type = VarSet
trigger1 = Time = 0
sysvar(1) = 0

[State 90, 4]
type = VarSet
trigger1 = command = "holdfwd"
sysvar(1) = 1

[State 90, 5]
type = VarSet
trigger1 = command = "holdback"
sysvar(1) = -1

[State 90, 6]
type = VelSet
trigger1 = AnimTime = 0
x = ifelse(sysvar(1)=0, const(velocity.jump.neu.x), ifelse(sysvar(1)=1, const(velocity.jump.fwd.x), const(velocity.jump.back.x)))
y = -15

[State 90, 7]
type = Changestate
trigger1 = AnimTime = 0
value = 91
ctrl = 1

[Statedef 91]
type = A
physics = A
hitcountpersist = (enemy, movetype = H)

[State 91, 1]
type = Turn
trigger1 = p2dist x <= 0

[State 91, 2]
type = Varset
trigger1 = time = 0
var(9) = 1

[State 91, 3]
type = Changeanim
trigger1 = time = 0
value = ifelse((vel x)=0, 41, ifelse((vel x)>0, 42, 43))

[State 91, 4]
type = Changestate
trigger1 = pos y < -40
trigger1 = command = "up2" && command != "up3"
trigger1 = prevstateno != 45
value = 45

;---------------------------------------------------------------------------
; Combojump
[Statedef 95]
type = A
physics = A
hitcountpersist = (enemy, movetype = H)

[State 95, 1]
type = Varset
trigger1 = time = 0
var(9) = -1

[State 95, 2]
type = Velset
trigger1 = time = 0
y = -11.5

[State 95, 3]
type = Playsnd
trigger1 = time = 0
value = 90,0

[State 95, 4]
type = VarSet
trigger1 = Time = 0
sysvar(1) = 0

[State 95, 5]
type = Changeanim
trigger1 = Time = 0
value = ifelse((vel x)=0, 41, ifelse((vel x)>0, 42, 43))

[State 95, 6]
type = Changeanim
trigger1 = Vel y > -2
trigger1 = SelfAnimExist(anim + 3)
value = Anim + 3
persistent = 0

;---------------------------------------------------------------------------
; RUN_FWD
[Statedef 100]
type    = S
physics = N
anim = 100
sprpriority = 1
hitcountpersist = (enemy, movetype = H)

[State 100, 1]
type = Playsnd
trigger1 = time%floor(tickspersecond*4.1) = 0
value = 100,0
volume = 100
channel = 24

[State 100, 2]
type = Varset
trigger1 = time = 0
var(11) = 0

[State 100, 3]
type = Varadd
trigger1 = time > 0
trigger1 = time > var(11)
var(11) = (random/250)+1

[State 100, 4]
type = Explod
trigger1 = time = var(11)
anim = 110+random/200
pos = -10-random/20,-random/10
postype = p1
sprpriority = 5
ownpal = 1

[State 100, 5]
type = VelSet
trigger1 = 1
x = const(velocity.run.fwd.x)

[State 100, 6]
type = AssertSpecial
trigger1 = 1
flag = NoWalk

[State 100, 7]
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State 100, 8]
type = Changestate
trigger1 = command != "holdfwd"
value = 0

;---------------------------------------------------------------------------
; RUN_BACK
[Statedef 105]
type    = A
physics = A
ctrl = 0
anim = 105
sprpriority = 1
hitcountpersist = (enemy, movetype = H)

[State 105, 1]
type = Playsnd
trigger1 = time = 0
value = 40,0

[State 105, 2]
type = Varset
trigger1 = time = 0
var(11) = 0

[State 105, 3]
type = Varadd
trigger1 = time > 0
trigger1 = time > var(11)
var(11) = (random/250)+1

[State 105, 4]
type = Explod
trigger1 = time = var(11)
anim = 110+random/200
pos = 10+random/20,10-random/10
postype = p1
sprpriority = 5
ownpal = 1

[State 105, 5]
type = VelSet
trigger1 = Time = 0
x = const(velocity.run.back.x)
y = const(velocity.run.back.y)

[State 105, 6]
type = CtrlSet
trigger1 = Time = 2
value = 1

[State 105, 7]
type = Changestate
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 106

;---------------------------------------------------------------------------
; RUN_BACK2 (land)
[Statedef 106]
type    = S
physics = S
ctrl = 0
anim = 47
hitcountpersist = (enemy, movetype = H)

[State 106, 1]
type = VelSet
trigger1 = Time = 0
y = 0

[State 106, 2]
type = PosSet
trigger1 = Time = 0
y = 0

[State 106, 3]
type = Explod
trigger1 = timemod = 6,0
anim = 909
pos = 2,-4
postype = p1
sprpriority = 5
ownpal = 1

[State 106, 4]
type = Playsnd
trigger1 = time = 0
value = 52,0

[State 106, 5]
type = Changestate
trigger1 = Time = 7
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; GUARD (start)
[Statedef 120]
type = U
physics = U
hitcountpersist = (enemy, movetype = H)

[State 120, 1]
type = Hitoverride
trigger1 = var(1) = 1
attr = SA, HA, HP
stateno = 150
time = 1

[State 120, 2]
type = Hitoverride
trigger1 = var(2) = 1
attr = C, HA
stateno = 152
time = 1

[State 120, 3]
type = Hitoverride
trigger1 = var(2) = 1
attr = SC, HP
stateno = 152
time = 1

[State 120, 4]
type = Ctrlset
trigger1 = var(1) = 1
value = 1

[State 120, 5]
type = Changeanim
trigger1 = var(1) = 0 && var(2) = 0
trigger1 = Time = 0
value = 120 + (statetype = C) + (statetype = A)*2

[State 120, 6]
type = StateTypeSet
trigger1 = var(1) = 0 && var(2) = 0
trigger1 = Time = 0 && statetype = S
physics = S

[State 120, 7]
type = StateTypeSet
trigger1 = var(1) = 0 && var(2) = 0
trigger1 = Time = 0 && statetype = C
physics = C

[State 120, 8]
type = StateTypeSet
trigger1 = var(1) = 0 && var(2) = 0
trigger1 = Time = 0 && statetype = A
physics = A

[State 120, 9]
type = Changestate
trigger1 = anim = 20
;trigger1 = anim != [120,152]
;trigger1 = anim != [5,6]
;trigger1 = anim != 500
trigger1 = command != "holdfwd2"
trigger1 = var(1) = 0
trigger2 = anim = 5
trigger2 = animtime = 0
value = ifelse(command = "holdfwd",20,0)

[State 120, 10]
type = Changestate
trigger1 = anim = [10,11]
;trigger1 = anim != [120,152]
;trigger1 = anim != [5,6]
;trigger1 = anim != 500
trigger1 = command != "holddown2"
trigger1 = var(2) = 0
value = 11

[State 120, 11]
type = Changestate
trigger1 = var(1) = 1
trigger1 = command = "holdup"
value = 40

[State 120, 12]
type = Changestate
trigger1 = var(1) = 1
trigger1 = command = "holddown2"
value = 10

[State 120, 13]
type = Changestate
;trigger1 = var(1) = 1
trigger1 = anim = 20
trigger1 = time = 6
;trigger1 = anim != 500
value = 20

[State 120, 14]
type = Changestate
;trigger1 = var(1) = 1
trigger1 = anim = [10,11]
trigger1 = time = 6
;trigger1 = anim != 500
value = 11

[State 120, 15]
type = Changestate
trigger1 = var(1) = 0 && var(2) = 0
trigger1 = AnimTime = 0
value = 130 + (statetype = C) + (statetype = A)*2

;---------------------------------------------------------------------------
; STAND GUARD (guarding)
[Statedef 130]
type    = S
physics = S

[State 130, 1]
type = Changeanim
trigger1 = Anim != 130
value = 130

;---------------------------------------------------------------------------
; CROUCH GUARD (guarding)
[Statedef 131]
type    = C
physics = C

[State 131, 1]
type = Changeanim
trigger1 = Anim != 131
value = 131

;---------------------------------------------------------------------------
; AIR GUARD (guarding)
[Statedef 132]
type    = A
physics = N

[State 132, 1]
type = Changeanim
trigger1 = Anim != 132
value = 132

[State 132, 2]
type = VelAdd
trigger1 = 1
y = Const(movement.yaccel)

[State 132, 3]
type = VarSet
trigger1 = 1
sysvar(0) = (pos y >= 0) && (vel y > 0)

[State 132, 4]
type = VelSet
trigger1 = sysvar(0)
y = 0

[State 132, 5]
type = PosSet
trigger1 = sysvar(0)
y = 0

[State 132, 6]
type = Changestate
trigger1 = sysvar(0)
trigger1 = command != "holdback"
value = 52

[State 132, 7]
type = Changestate
trigger1 = sysvar(0)
value = 130

;---------------------------------------------------------------------------
; GUARD (end)
[Statedef 140]
type = U    ;Leave state type unchanged
physics = U ;Leave physics unchanged
ctrl = 1

[State 140, 1]
type = Changeanim
trigger1 = Time = 0
value = 140 + (statetype = C) + (statetype = A)*2

[State 140, 2]
type = StateTypeSet
trigger1 = Time = 0 && statetype = S
physics = S

[State 140, 3]
type = StateTypeSet
trigger1 = Time = 0 && statetype = C
physics = C

[State 140, 4]
type = StateTypeSet
trigger1 = Time = 0 && statetype = A
physics = A

;[State 140, 5] ;Implemented within engine
;type = Changestate
;trigger1 = AnimTime = 0
;value = (statetype = C)*11 + (statetype = A)*51

;---------------------------------------------------------------------------
; SGUARDHIT (shaking)
[Statedef 150]
type    = S
movetype= H
physics = N
velset = 0,0

[State 150, 1]
type = Changestate
trigger1 = var(1) = 1
value = 500

[State 150, 2]
type = Changeanim
trigger1 = var(1) = 0
value = 150

[State 150, 3]
type = Changestate
trigger1 = var(1) = 0
trigger1 = HitShakeOver
value = 151

[State 150, 4]
type = ForceFeedback
trigger1 = var(1) = 0
trigger1 = time = 0
waveform = square
time = 3

;---------------------------------------------------------------------------
; SGUARDHIT2 (knocked back)
[Statedef 151]
type    = S
movetype= H
physics = S
anim = 150

[State 151, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1

[State 151, 2]
type = VelSet
trigger1 = Time = GetHitVar(slidetime)
trigger2 = Time >= GetHitVar(hittime)
x = 0

[State 151, 3]
type = CtrlSet
trigger1 = Time = GetHitVar(ctrltime)
value = 1

[State 151, 4]
type = Changestate
trigger1 = Time >= GetHitVar(hittime)
value = 130
ctrl = 1

;---------------------------------------------------------------------------
; CGUARDHIT (shaking)
[Statedef 152]
type    = C
movetype= H
physics = N
velset = 0,0

[State 152, 1]
type = Changestate
trigger1 = var(2) = 1
value = 501

[State 152, 2]
type = Changeanim
trigger1 = var(2) = 0
value = 151

[State 152, 3]
type = Changestate
trigger1 = var(2) = 0
trigger1 = HitShakeOver
value = 153

[State 152, 4]
type = ForceFeedback
trigger1 = var(2) = 0
trigger1 = time = 0
waveform = square
time = 4

;---------------------------------------------------------------------------
; CGUARDHIT2 (knocked back)
[Statedef 153]
type    = C
movetype= H
physics = C
anim = 151

[State 153, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1

[State 153, 2]
type = VelSet
trigger1 = Time = GetHitVar(slidetime)
trigger2 = Time >= GetHitVar(hittime)
x = 0

[State 153, 3]
type = CtrlSet
trigger1 = Time = GetHitVar(ctrltime)
value = 1

[State 153, 4]
type = Changestate
trigger1 = Time >= GetHitVar(hittime)
value = 131
ctrl = 1

;---------------------------------------------------------------------------
; AGUARDHIT (shaking)
[Statedef 154]
type    = A
movetype= H
physics = N
velset = 0,0

[State 154, 1]
type = Changeanim
trigger1 = 1
value = 152

[State 154, 2]
type = Changestate
trigger1 = HitShakeOver
value = 155 ;AGUARDHIT2

[State 154, 3]
type = ForceFeedback
trigger1 = time = 0
waveform = square
time = 4

;---------------------------------------------------------------------------
; AGUARDHIT2 (knocked away)
[Statedef 155]
type    = A
movetype= H
physics = N
anim = 152

[State 155, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1
y = 1

[State 155, 2]
type = VelAdd
trigger1 = 1
y = Const(movement.yaccel)

[State 155, 3]
type = CtrlSet
trigger1 = Time = GetHitVar(ctrltime)
value = 1

[State 155, 4]
type = VarSet
trigger1 = 1
sysvar(0) = (pos y >= 0) && (vel y > 0)

[State 155, 5]
type = VelSet
trigger1 = sysvar(0)
y = 0

[State 155, 6]
type = PosSet
trigger1 = sysvar(0)
y = 0

[State 155, 7]
type = Changestate
trigger1 = sysvar(0)
trigger1 = command != "holdback"
value = 52

[State 155, 8]
type = Changestate
trigger1 = sysvar(0)
value = 130

;---------------------------------------------------------------------------
; Lose by Time Over
[Statedef 170]
type = S
anim = 170
velset = 0,0
ctrl = 0

[State 170, 1]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

;---------------------------------------------------------------------------
; Win State decider
[Statedef 180]
type = S

[State 180, 1]
type = Changestate
trigger1 = roundno = 1
value = 181

[State 180, 2]
type = Changestate
trigger1 = roundno != 1
value = 182

; Win pose 1
[Statedef 181]
type = S
anim = 181
velset = 0,0
ctrl = 0

[State 181, 1]
type = AssertSpecial
trigger1 = Time <= 250
flag = RoundNotOver

[State 181, 2]
type = Explod
trigger1 = time = 45
anim = 183
sprpriority = 6
ownpal = 1

[State 181, 3]
type = Explod
trigger1 = time = 60
anim = 184
sprpriority = 4
ownpal = 1

[State 181, 4]
type = Explod
trigger1 = time = 75
anim = 185
sprpriority = 1
ownpal = 1

[State 181, 5]
type = Explod
trigger1 = time = 79
anim = 186
sprpriority = 4
ownpal = 1

[State 181, 6]
type = Playsnd
trigger1 = time = 45
value = 181,0

[State 181, 7]
type = Playsnd
trigger1 = time = 79
trigger2 = time = 177
trigger3 = time = 110
value = 181,1

; Win pose 2
[Statedef 182]
type = S
anim = 182
velset = 0,0
ctrl = 0

[State 182, 1]
type = AssertSpecial
trigger1 = time <= 10*tickspersecond
flag = RoundNotOver

[State 182, 2]
type = Playsnd
trigger1 = animelem = 10
value = 182,0

;---------------------------------------------------------------------------
; Introduction
[Statedef 191]
type = S
anim = 190
velset = 0,0
ctrl = 0

[State 191, 1]
type = Changeanim
trigger1 = RoundState = 0
value = 190

[State 191, 2]
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 191, 3]
type = Screenbound
trigger1 = 1
value = 0
movecamera = 0,0

[State 191, 4]
type = Posadd
trigger1 = time = 0
x = -128

[State 191, 5]
type = Velset
trigger1 = animelemtime(1) = 1
x = 2

[State 191, 6]
type = Explod
trigger1 = time = 84
anim = 191
sprpriority = 3
ownpal = 1
removeongethit = 1

[State 191, 7]
type = Playsnd
trigger1 = time = 85
value = 190,0

[State 191, 8]
type = Playsnd
trigger1 = time = 115
value = 190,1

[State 191, 9]
type = Playsnd
trigger1 = time = 158
value = 190,3

[State 191, 10]
type = Velset
trigger1 = animelem = 9
x = 0

[State 191, 11]
type = Changestate
trigger1 = animtime = 0
value = 0

;---------------------------------------------------------------------------
; Taunt
[Statedef 195]
type = S
movetype = I
physics = S
anim = 195
velset = 0,0
ctrl = 0
sprpriority = 2

[State 195, 1]
type = CtrlSet
trigger1 = Time = 20
value = 1

[State 195, 2]
type = Changestate
trigger1 = animtime = 0
trigger2 = var(51) != 0
trigger2 = animelemtime(animelemno(0)+1) = 0
trigger2 = animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1) - ifelse(animelemtime(animelemno(0)+1)=0,animtime,0) > 1
trigger2 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0))-animtime)/2
value = 0
ctrl = 1

;--------------------------------------------------------------------------
; Stand Light Punch
[Statedef 200]
type = S
movetype = A
physics = S
anim = 200
velset = 0,0
ctrl = 0
poweradd = 20
juggle = 4
sprpriority = 2
hitcountpersist = (enemy, movetype = H)

[State 200, 1]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 3
value = 0,2+random/500

[State 200, 2]
type = HitDef
trigger1 = animelem = 3
attr = S, NA
hitflag = MAF
guardflag = MA
animtype = Light
damage = 25/((ishelper)+1)
pausetime = (8/((var(40)!=0)+1))*(ishelper=0),(8/((var(40)!=0)+1))*(ishelper=0)
sparkno = S903
guard.sparkno = S907
sparkxy = 0,-43
hitsound = S5,3
guardsound = S5,8
ground.type = High
ground.slidetime = 6
ground.hittime = 12
ground.velocity = -4
air.velocity = -2,-3

[State 200, 3]
type = Changeanim
trigger1 = ishelper
trigger1 = time < 11+25*(parent,var(41)-3)
value = anim
elem = 1

[State 200, 4]
type = Assertspecial
trigger1 = ishelper
flag = invisible

[State 200, 5]
type = Nothitby
trigger1 = ishelper
value = SCA

[State 200, 6]
type = Screenbound
trigger1 = ishelper
movecamera = 0,0

[State 200, 7]
type = Attackmulset
triggerall = ishelper
trigger1 = enemy, movetype != H
trigger2 = parent, var(15) = 0
value = 1

[State 200, 8]
type = Attackmulset
trigger1 = ishelper
trigger1 = enemy, movetype = H
trigger1 = parent, var(15) = [1,33]
value = 0.66 - 0.02*(parent,var(15))
persistent = 0

[State 200, 9]
type = Parentvaradd
trigger1 = ishelper
trigger1 = movehit
var(15) = 1
persistent = 0

[State 200, 10]
type = Destroyself
triggerall = ishelper
trigger1 = animtime = 0
trigger2 = parent, var(40) = 0

[State 200, 11]
type = Changestate
trigger1 = animtime = 0
trigger2 = var(51) != 0
trigger2 = animelemtime(animelemno(0)+1) = 0
trigger2 = animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1) - ifelse(animelemtime(animelemno(0)+1)=0,animtime,0) > 1
trigger2 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0))-animtime)/2
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Stand Medium Punch
[Statedef 210]
type = S
movetype = A
physics = S
anim = 210
velset = 0,0
ctrl = 0
poweradd = 45
juggle = 8
sprpriority = 2
hitcountpersist = (enemy, movetype = H)

[State 210, 1]
type = Explod
trigger1 = var(8) = 0
trigger1 = ishelper = 0
trigger1 = animelem = 3
anim = 211 + (var(51)!=0)
bindtime = -1
sprpriority = 6
ownpal = 1
removeongethit = 1

[State 210, 2]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 3
value = 0,random/500

[State 210, 3]
type = HitDef
trigger1 = animelem = 3
attr = S, NA
hitflag = MAF
guardflag = MA
animtype = Medium
damage = 45/((ishelper)+1)
pausetime = (9/((var(40)!=0)+1))*(ishelper=0),(9/((var(40)!=0)+1))*(ishelper=0)
sparkno = S905
guard.sparkno = S907
sparkxy = 0,-80
hitsound = S5,4
guardsound = S5,8
ground.type = High
ground.slidetime = 12
ground.hittime = 15
ground.velocity = -5
air.velocity = -2.5,-4

[State 210, 4]
type = Changeanim
trigger1 = ishelper
trigger1 = time < 11+25*(parent,var(41)-3)
value = anim
elem = 1

[State 210, 5]
type = Assertspecial
trigger1 = ishelper
flag = invisible

[State 210, 6]
type = Nothitby
trigger1 = ishelper
value = SCA

[State 210, 7]
type = Screenbound
trigger1 = ishelper
movecamera = 0,0

[State 210, 8]
type = Attackmulset
triggerall = ishelper
trigger1 = enemy, movetype != H
trigger2 = parent, var(15) = 0
value = 1

[State 210, 9]
type = Attackmulset
trigger1 = ishelper
trigger1 = enemy, movetype = H
trigger1 = parent, var(15) = [1,33]
value = 0.66 - 0.02*(parent,var(15))
persistent = 0

[State 210, 10]
type = Parentvaradd
trigger1 = ishelper
trigger1 = movehit
var(15) = 1
persistent = 0

[State 210, 11]
type = Destroyself
triggerall = ishelper
trigger1 = animtime = 0
trigger2 = parent, var(40) = 0

[State 210, 12]
type = Changestate
trigger1 = animtime = 0
trigger2 = var(51) != 0
trigger2 = animelemtime(animelemno(0)+1) = 0
trigger2 = animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1) - ifelse(animelemtime(animelemno(0)+1)=0,animtime,0) > 1
trigger2 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0))-animtime)/2
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Stand Strong Punch
[Statedef 220]
type = S
movetype = A
physics = S
anim = 220
velset = 0,0
ctrl = 0
poweradd = 70
juggle = 12
sprpriority = 2
hitcountpersist = (enemy, movetype = H)

[State 220, 1]
type = Explod
trigger1 = var(8) = 0
trigger1 = ishelper = 0
trigger1 = animelem = 3
anim = 221 + (var(51)!=0)
bindtime = -1
sprpriority = 6
ownpal = 1
removeongethit = 1

[State 220, 2]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 3
value = 0,random/500

[State 220, 3]
type = HitDef
trigger1 = animelem = 3
attr = S, NA
hitflag = MAF
guardflag = MA
animtype = Hard
damage = ifelse(prevstateno=230 && hitcount=1,75/((ishelper)+1),65/((ishelper)+1))
pausetime = (10/((var(40)!=0)+1))*(ishelper=0),(10/((var(40)!=0)+1))*(ishelper=0)
sparkno = S904
guard.sparkno = S907
sparkxy = -10,-43
hitsound = S5,5
guardsound = S5,8
ground.type = High
ground.slidetime = 12
ground.hittime = 15
ground.velocity = -6
air.velocity = -2.5,-4

[State 220, 4]
type = Changeanim
trigger1 = ishelper
trigger1 = time < 11+25*(parent,var(41)-3)
value = anim
elem = 1

[State 220, 5]
type = Assertspecial
trigger1 = ishelper
flag = invisible

[State 220, 6]
type = Nothitby
trigger1 = ishelper
value = SCA

[State 220, 7]
type = Screenbound
trigger1 = ishelper
movecamera = 0,0

[State 220, 8]
type = Attackmulset
triggerall = ishelper
trigger1 = enemy, movetype != H
trigger2 = parent, var(15) = 0
value = 1

[State 220, 9]
type = Attackmulset
trigger1 = ishelper
trigger1 = enemy, movetype = H
trigger1 = parent, var(15) = [1,33]
value = 0.66 - 0.02*(parent,var(15))
persistent = 0

[State 220, 10]
type = Parentvaradd
trigger1 = ishelper
trigger1 = movehit
var(15) = 1
persistent = 0

[State 220, 11]
type = Destroyself
triggerall = ishelper
trigger1 = animtime = 0
trigger2 = parent, var(40) = 0

[State 220, 12]
type = Changestate
trigger1 = animtime = 0
trigger2 = var(51) != 0
trigger2 = animelemtime(animelemno(0)+1) = 0
trigger2 = animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1) - ifelse(animelemtime(animelemno(0)+1)=0,animtime,0) > 1
trigger2 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0))-animtime)/2
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Standing Light Kick
[Statedef 230]
type = S
movetype = A
physics = S
anim = 230
velset = 0,0
ctrl = 0
poweradd = 20
juggle = 4
sprpriority = 2
hitcountpersist = (enemy, movetype = H)

[State 230, 1]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 1
value = 1,random/250

[State 230, 2]
type = HitDef
trigger1 = animelem = 2
hitflag = MAF
guardflag = MA
attr = S, NA
animtype = Light
damage = 18/((ishelper)+1)
pausetime = (9/((var(40)!=0)+1))*(ishelper=0),(9/((var(40)!=0)+1))*(ishelper=0)
sparkno = S900
guard.sparkno = S906
sparkxy = -5,-32
hitsound = S5,0
guardsound = S5,8
ground.type = Low
ground.slidetime = 10
ground.hittime = 12
ground.velocity = -4
air.velocity = -2.5,-3.5

[State 230, 3]
type = Changeanim
trigger1 = ishelper
trigger1 = time < 11+25*(parent,var(41)-3)
value = anim
elem = 1

[State 230, 4]
type = Assertspecial
trigger1 = ishelper
flag = invisible

[State 230, 5]
type = Nothitby
trigger1 = ishelper
value = SCA

[State 230, 6]
type = Screenbound
trigger1 = ishelper
movecamera = 0,0

[State 230, 7]
type = Attackmulset
triggerall = ishelper
trigger1 = enemy, movetype != H
trigger2 = parent, var(15) = 0
value = 1

[State 230, 8]
type = Attackmulset
trigger1 = ishelper
trigger1 = enemy, movetype = H
trigger1 = parent, var(15) = [1,33]
value = 0.66 - 0.02*(parent,var(15))
persistent = 0

[State 230, 9]
type = Parentvaradd
trigger1 = ishelper
trigger1 = movehit
var(15) = 1
persistent = 0

[State 230, 10]
type = Destroyself
triggerall = ishelper
trigger1 = animtime = 0
trigger2 = parent, var(40) = 0

[State 230, 11]
type = Changestate
trigger1 = animtime = 0
trigger2 = var(51) != 0
trigger2 = animelemtime(animelemno(0)+1) = 0
trigger2 = animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1) - ifelse(animelemtime(animelemno(0)+1)=0,animtime,0) > 1
trigger2 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0))-animtime)/2
value = 0
ctrl = 1

; Double Standing Light Kick
[Statedef 235]
type = S
movetype = A
physics = S
anim = 235
velset = 0,0
ctrl = 0
poweradd = 20
juggle = 4
sprpriority = 2
hitcountpersist = (enemy, movetype = H)

[State 235, 1]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 1
value = 1,random/250

[State 235, 2]
type = HitDef
trigger1 = animelem = 2
attr = S, NA
hitflag = MAF
guardflag = MA
animtype = Light
damage = 17/((ishelper)+1)
pausetime = (9/((var(40)!=0)+1))*(ishelper=0),(9/((var(40)!=0)+1))*(ishelper=0)
sparkno = S900
guard.sparkno = S906
sparkxy = 0,-67
hitsound = S5,0
guardsound = S5,8
ground.type = High
ground.slidetime = 10
ground.hittime = 12
ground.velocity = -4
air.velocity = -2.5,-3.5

[State 235, 3]
type = Changeanim
trigger1 = ishelper
trigger1 = time < 11+25*(parent,var(41)-3)
value = anim
elem = 1

[State 235, 4]
type = Assertspecial
trigger1 = ishelper
flag = invisible

[State 235, 5]
type = Nothitby
trigger1 = ishelper
value = SCA

[State 235, 6]
type = Screenbound
trigger1 = ishelper
movecamera = 0,0

[State 235, 7]
type = Attackmulset
triggerall = ishelper
trigger1 = enemy, movetype != H
trigger2 = parent, var(15) = 0
value = 1

[State 235, 8]
type = Attackmulset
trigger1 = ishelper
trigger1 = enemy, movetype = H
trigger1 = parent, var(15) = [1,33]
value = 0.66 - 0.02*(parent,var(15))
persistent = 0

[State 235, 9]
type = Parentvaradd
trigger1 = ishelper
trigger1 = movehit
var(15) = 1
persistent = 0

[State 235, 10]
type = Destroyself
triggerall = ishelper
trigger1 = animtime = 0
trigger2 = parent, var(40) = 0

[State 235, 11]
type = Changestate
trigger1 = animtime = 0
trigger2 = var(51) != 0
trigger2 = animelemtime(animelemno(0)+1) = 0
trigger2 = animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1) - ifelse(animelemtime(animelemno(0)+1)=0,animtime,0) > 1
trigger2 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0))-animtime)/2
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Stand Medium Kick
[Statedef 240]
type = S
movetype = A
physics = S
anim = 240
velset = 0,0
ctrl = 0
poweradd = 45
juggle = 8
sprpriority = 2
hitcountpersist = (enemy, movetype = H)

[State 240, 1]
type = Explod
trigger1 = var(8) = 0
trigger1 = ishelper = 0
trigger1 = time = 1
anim = 241 + (var(51)!=0)
bindtime = -1
sprpriority = 6
ownpal = 1
removeongethit = 1

[State 240, 2]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 2
value = 0,random/500

[State 240, 3]
type = HitDef
trigger1 = animelem = 2
attr = S, NA
hitflag = MAF
guardflag = MA
animtype = Medium
damage = 45/((ishelper)+1)
pausetime = (9/((var(40)!=0)+1))*(ishelper=0),(9/((var(40)!=0)+1))*(ishelper=0)
sparkno = S905
guard.sparkno = S907
sparkxy = -10,-15
hitsound = S5,4
guardsound = S5,8
ground.type = Low
ground.slidetime = 12
ground.hittime = 15
ground.velocity = -5
air.velocity = -2.2,-3.2

[State 240, 4]
type = Changeanim
trigger1 = ishelper
trigger1 = time < 11+25*(parent,var(41)-3)
value = anim
elem = 1

[State 240, 5]
type = Assertspecial
trigger1 = ishelper
flag = invisible

[State 240, 6]
type = Nothitby
trigger1 = ishelper
value = SCA

[State 240, 7]
type = Screenbound
trigger1 = ishelper
movecamera = 0,0

[State 240, 8]
type = Attackmulset
triggerall = ishelper
trigger1 = enemy, movetype != H
trigger2 = parent, var(15) = 0
value = 1

[State 240, 9]
type = Attackmulset
trigger1 = ishelper
trigger1 = enemy, movetype = H
trigger1 = parent, var(15) = [1,33]
value = 0.66 - 0.02*(parent,var(15))
persistent = 0

[State 240, 10]
type = Parentvaradd
trigger1 = ishelper
trigger1 = movehit
var(15) = 1
persistent = 0

[State 240, 11]
type = Destroyself
triggerall = ishelper
trigger1 = animtime = 0
trigger2 = parent, var(40) = 0

[State 240, 12]
type = Changestate
trigger1 = animtime = 0
trigger2 = var(51) != 0
trigger2 = animelemtime(animelemno(0)+1) = 0
trigger2 = animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1) - ifelse(animelemtime(animelemno(0)+1)=0,animtime,0) > 1
trigger2 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0))-animtime)/2
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Standing Strong Kick
[Statedef 250]
type = S
movetype = A
physics = S
anim = 250
velset = 0,0
ctrl = 0
poweradd = 70
juggle = 12
sprpriority = 2
hitcountpersist = (enemy, movetype = H)

[State 250, 1]
type = Width
trigger1 = time < 20
value = ifelse(time < 9, 5*(time+2), 50),0

[State 250, 2]
type = Explod
trigger1 = var(8) = 0
trigger1 = ishelper = 0
trigger1 = animelem = 3
anim = 251 + (var(51)!=0)
bindtime = -1
sprpriority = 6
ownpal = 1
removeongethit = 1

[State 250, 3]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 3
value = 0,4+random/500

[State 250, 4]
type = HitDef
trigger1 = animelem = 4
attr = S, NA
hitflag = MAF
guardflag = MA
animtype = Hard
damage = 70/((ishelper)+1)
pausetime = (10/((var(40)!=0)+1))*(ishelper=0),(10/((var(40)!=0)+1))*(ishelper=0)
sparkno = S904
guard.sparkno = S907
sparkxy = -10,-60
hitsound = S5,6
guardsound = S5,8
ground.type = High
ground.slidetime = 12
ground.hittime = 15
ground.velocity = -6,-4.7
air.velocity = -6,-4.7
p2stateno = 255

[State 250, 5]
type = Changeanim
trigger1 = ishelper
trigger1 = time < 11+25*(parent,var(41)-3)
value = anim
elem = 1

[State 250, 6]
type = Assertspecial
trigger1 = ishelper
flag = invisible

[State 250, 7]
type = Nothitby
trigger1 = ishelper
value = SCA

[State 250, 8]
type = Screenbound
trigger1 = ishelper
movecamera = 0,0

[State 250, 9]
type = Attackmulset
triggerall = ishelper
trigger1 = enemy, movetype != H
trigger2 = parent, var(15) = 0
value = 1

[State 250, 10]
type = Attackmulset
trigger1 = ishelper
trigger1 = enemy, movetype = H
trigger1 = parent, var(15) = [1,33]
value = 0.66 - 0.02*(parent,var(15))
persistent = 0

[State 250, 11]
type = Parentvaradd
trigger1 = ishelper
trigger1 = movehit
var(15) = 1
persistent = 0

[State 250, 12]
type = Destroyself
triggerall = ishelper
trigger1 = animtime = 0
trigger2 = parent, var(40) = 0

[State 250, 13]
type = Changestate
trigger1 = animtime = 0
trigger2 = var(51) != 0
trigger2 = animelemtime(animelemno(0)+1) = 0
trigger2 = animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1) - ifelse(animelemtime(animelemno(0)+1)=0,animtime,0) > 1
trigger2 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0))-animtime)/2
value = 0
ctrl = 1

[Statedef 255]
type = A
movetype = H
physics = N

[State 255, 1]
type = Velset
trigger1 = time = 0
x = -6
y = -4.7

[State 255, 2]
type = Velset
trigger1 = enemy(0), stateno = 250 && enemy(0), movehit
trigger1 = facing = enemy(0), facing
x = -vel x
persistent = 0

[State 255, 3]
type = Velset
trigger1 = numenemy > 1
trigger1 = enemy(1), stateno = 250 && enemy(1), movehit
trigger1 = facing = enemy(1), facing
x = -vel x
persistent = 0

[State 255, 4]
type = Changeanim2
trigger1 = time = 0
value = 255

[State 255, 5]
type = Selfstate
trigger1 = life = 0
value = 5000

[State 255, 6]
type = Posfreeze
trigger1 = time < (10/((enemynear,var(40)!=0)+1))*(enemynear,var(15)=0)

[State 255, 7]
type = Veladd
trigger1 = time >= (10/((enemynear,var(40)!=0)+1))*(enemynear,var(15)=0) + 1
y = 0.94

[State 255, 8]
type = Changestate
;trigger1 = time > 15
trigger1 = pos Y >= 15
value = 256

[Statedef 256]
type = A
movetype = H
physics = N
velset = vel x,-6

[State 256, 1]
type = Nothitby
trigger1 = anim = 5200
value = SCA

[State 256, 2]
type = Changeanim
trigger1 = time = 0
value = 5200

[State 256, 3]
type = Veladd
trigger1 = time > 0
y = 1

[State 256, 4]
type = Explod
trigger1 = time = 0
anim = F61
pos = 0,-15
postype = p1
sprpriority = -1
ownpal = 1
persistent = 0

[State 256, 5]
type = PlaySnd
trigger1 = time = 0
value = F7, 1

[State 256, 6]
type = Envshake
trigger1 = time = 0
time = 10

[State 256, 7]
type = Selfstate
trigger1 = time = 10
value = 52

;--------------------------------------------------------------------------
; Crouching Light Punch
[Statedef 400]
type = C
movetype = A
physics = C
anim = 400
velset = 0,0
ctrl = 0
poweradd = 20
juggle = 4
sprpriority = 2
hitcountpersist = (enemy, movetype = H)

[State 400, 1]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 3
value = 0,2+random/500

[State 400, 2]
type = HitDef
trigger1 = animelem = 4
attr = C, NA
hitflag = MAF
guardflag = M
animtype = Light
damage = 25/((ishelper)+1)
pausetime = (8/((var(40)!=0)+1))*(ishelper=0),(8/((var(40)!=0)+1))*(ishelper=0)
sparkno = S903
guard.sparkno = S907
sparkxy = 0,-42
hitsound = S5,3
guardsound = S5,8
ground.type = Low
ground.slidetime = 6
ground.hittime = 12
ground.velocity = -4
air.velocity = -2,-3

[State 400, 3]
type = Changeanim
trigger1 = ishelper
trigger1 = time < 11+25*(parent,var(41)-3)
value = anim
elem = 1

[State 400, 4]
type = Assertspecial
trigger1 = ishelper
flag = invisible

[State 400, 5]
type = Nothitby
trigger1 = ishelper
value = SCA

[State 400, 6]
type = Screenbound
trigger1 = ishelper
movecamera = 0,0

[State 400, 7]
type = Attackmulset
triggerall = ishelper
trigger1 = enemy, movetype != H
trigger2 = parent, var(15) = 0
value = 1

[State 400, 8]
type = Attackmulset
trigger1 = ishelper
trigger1 = enemy, movetype = H
trigger1 = parent, var(15) = [1,33]
value = 0.66 - 0.02*(parent,var(15))
persistent = 0

[State 400, 9]
type = Parentvaradd
trigger1 = ishelper
trigger1 = movehit
var(15) = 1
persistent = 0

[State 400, 10]
type = Destroyself
triggerall = ishelper
trigger1 = animtime = 0
trigger2 = parent, var(40) = 0

[State 400, 11]
type = Changestate
trigger1 = animtime = 0
trigger2 = var(51) != 0
trigger2 = animelemtime(animelemno(0)+1) = 0
trigger2 = animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1) - ifelse(animelemtime(animelemno(0)+1)=0,animtime,0) > 1
trigger2 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0))-animtime)/2
value = 11
ctrl = 1

;---------------------------------------------------------------------------
; Crouching Medium Punch
[Statedef 410]
type = C
movetype = A
physics = C
anim = 410
velset = 0,0
ctrl = 0
poweradd = 45
juggle = 8
sprpriority = 2
hitcountpersist = (enemy, movetype = H)

[State 410, 1]
type = Explod
trigger1 = var(8) = 0
trigger1 = ishelper = 0
trigger1 = animelem = 3
anim = 411 + (var(51)!=0)
bindtime = -1
sprpriority = 6
ownpal = 1
removeongethit = 1

[State 410, 2]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 3
value = 0,random/500

[State 410, 3]
type = HitDef
trigger1 = animelem = 3
attr = C, NA
hitflag = MAF
guardflag = MA
animtype = Medium
damage = 45/((ishelper)+1)
pausetime = (9/((var(40)!=0)+1))*(ishelper=0),(9/((var(40)!=0)+1))*(ishelper=0)
sparkno = S905
guard.sparkno = S907
sparkxy = -10,-45
hitsound = S5,4
guardsound = S5,8
ground.type = Low
ground.slidetime = 12
ground.hittime = 15
ground.velocity = -5
air.velocity = -2.5,-4

[State 410, 4]
type = Changeanim
trigger1 = ishelper
trigger1 = time < 11+25*(parent,var(41)-3)
value = anim
elem = 1

[State 410, 5]
type = Assertspecial
trigger1 = ishelper
flag = invisible

[State 410, 6]
type = Nothitby
trigger1 = ishelper
value = SCA

[State 410, 7]
type = Screenbound
trigger1 = ishelper
movecamera = 0,0

[State 410, 8]
type = Attackmulset
triggerall = ishelper
trigger1 = enemy, movetype != H
trigger2 = parent, var(15) = 0
value = 1

[State 410, 9]
type = Attackmulset
trigger1 = ishelper
trigger1 = enemy, movetype = H
trigger1 = parent, var(15) = [1,33]
value = 0.66 - 0.02*(parent,var(15))
persistent = 0

[State 410, 10]
type = Parentvaradd
trigger1 = ishelper
trigger1 = movehit
var(15) = 1
persistent = 0

[State 410, 11]
type = Destroyself
triggerall = ishelper
trigger1 = animtime = 0
trigger2 = parent, var(40) = 0

[State 410, 12]
type = Changestate
trigger1 = animtime = 0
trigger2 = var(51) != 0
trigger2 = animelemtime(animelemno(0)+1) = 0
trigger2 = animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1) - ifelse(animelemtime(animelemno(0)+1)=0,animtime,0) > 1
trigger2 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0))-animtime)/2
value = 11
ctrl = 1

;---------------------------------------------------------------------------
; Crouching Strong Punch
[Statedef 420]
type = C
movetype = A
physics = C
anim = 420
velset = 0,0
ctrl = 0
poweradd = 70
juggle = 12
sprpriority = 2
hitcountpersist = (enemy, movetype = H)

[State 420, 1]
type = Explod
trigger1 = var(8) = 0
trigger1 = ishelper = 0
trigger1 = animelem = 3
anim = 421 + (var(51)!=0)
bindtime = -1
sprpriority = 6
ownpal = 1
removeongethit = 1

[State 420, 2]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 3
value = 0,random/500

[State 420, 3]
type = HitDef
trigger1 = animelem = 4
attr = C, NA
hitflag = MAF
guardflag = M
animtype = Hard
damage = 65/((ishelper)+1)
pausetime = (10/((var(40)!=0)+1))*(ishelper=0),(10/((var(40)!=0)+1))*(ishelper=0)
sparkno = S904
guard.sparkno = S907
sparkxy = -10,-40
hitsound = S5,5
guardsound = S5,8
ground.type = Low
ground.slidetime = 12
ground.hittime = 15
ground.velocity = -6
air.velocity = -2.5,-4

[State 420, 4]
type = Changeanim
trigger1 = ishelper
trigger1 = time < 11+25*(parent,var(41)-3)
value = anim
elem = 1

[State 420, 5]
type = Assertspecial
trigger1 = ishelper
flag = invisible

[State 420, 6]
type = Nothitby
trigger1 = ishelper
value = SCA

[State 420, 7]
type = Screenbound
trigger1 = ishelper
movecamera = 0,0

[State 420, 8]
type = Attackmulset
triggerall = ishelper
trigger1 = enemy, movetype != H
trigger2 = parent, var(15) = 0
value = 1

[State 420, 9]
type = Attackmulset
trigger1 = ishelper
trigger1 = enemy, movetype = H
trigger1 = parent, var(15) = [1,33]
value = 0.66 - 0.02*(parent,var(15))
persistent = 0

[State 420, 10]
type = Parentvaradd
trigger1 = ishelper
trigger1 = movehit
var(15) = 1
persistent = 0

[State 420, 11]
type = Destroyself
triggerall = ishelper
trigger1 = animtime = 0
trigger2 = parent, var(40) = 0

[State 420, 12]
type = Changestate
trigger1 = animtime = 0
trigger2 = var(51) != 0
trigger2 = animelemtime(animelemno(0)+1) = 0
trigger2 = animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1) - ifelse(animelemtime(animelemno(0)+1)=0,animtime,0) > 1
trigger2 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0))-animtime)/2
value = 11
ctrl = 1

;---------------------------------------------------------------------------
; Crouching Light Kick
[Statedef 430]
type = C
movetype = A
physics = N
anim = 430
velset = 0,0
ctrl = 0
poweradd = 45
juggle = 8
sprpriority = 2
hitcountpersist = (enemy, movetype = H)

[State 430, 1]
type = Velset
trigger1 = animelem = 2
x = 6

[State 430, 2]
type = VelAdd
trigger1 = time >= 10
trigger1 = vel x > 0
x = -0.5

[State 430, 3]
type = Playerpush
trigger1 = time >= 5
value = 0
 
[State 430, 4]
type = Explod
trigger1 = ishelper = 0
trigger1 = time = [5,20]
trigger1 = timemod = 3,0
anim = 909
pos = -15,0
postype = p1
sprpriority = 6
ownpal = 1
ignorehitpause = 1

[State 430, 5]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 1
value = 1,random/250

[State 430, 6]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 1
value = 430,0

[State 430, 7]
type = HitDef
trigger1 = animelem = 3
attr = C, NA
hitflag = MAF
guardflag = L
animtype = Light
damage = 50/((ishelper)+1)
pausetime = (9/((var(40)!=0)+1))*(ishelper=0),(10/((var(40)!=0)+1))*(ishelper=0)
sparkno = S900
guard.sparkno = S906
sparkxy = -10,-8
hitsound = S5,0
guardsound = S5,8
ground.type = Trip
ground.slidetime = 15
ground.hittime = 20
ground.velocity = 0,-3
air.velocity = 0,-3
fall = 1

[State 430, 8]
type = Changeanim
trigger1 = ishelper
trigger1 = time < 11+25*(parent,var(41)-3)
value = anim
elem = 1

[State 430, 9]
type = Assertspecial
trigger1 = ishelper
flag = invisible

[State 430, 10]
type = Nothitby
trigger1 = ishelper
value = SCA

[State 430, 11]
type = Screenbound
trigger1 = ishelper
movecamera = 0,0

[State 430, 12]
type = Attackmulset
triggerall = ishelper
trigger1 = enemy, movetype != H
trigger2 = parent, var(15) = 0
value = 1

[State 430, 13]
type = Attackmulset
trigger1 = ishelper
trigger1 = enemy, movetype = H
trigger1 = parent, var(15) = [1,33]
value = 0.66 - 0.02*(parent,var(15))
persistent = 0

[State 430, 14]
type = Parentvaradd
trigger1 = ishelper
trigger1 = movehit
var(15) = 1
persistent = 0

[State 430, 15]
type = Destroyself
triggerall = ishelper
trigger1 = animtime = 0
trigger2 = parent, var(40) = 0

[State 430, 16]
type = Changestate
trigger1 = animtime = 0
trigger2 = var(51) != 0
trigger2 = animelemtime(animelemno(0)+1) = 0
trigger2 = animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1) - ifelse(animelemtime(animelemno(0)+1)=0,animtime,0) > 1
trigger2 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0))-animtime)/2
value = 11
ctrl = 1

;---------------------------------------------------------------------------
; Crouching Medium Kick
[Statedef 440]
type = C
movetype = A
physics = C
anim = 440
velset = 0,0
ctrl = 0
poweradd = 45
juggle = 8
sprpriority = 2
hitcountpersist = (enemy, movetype = H)

[State 440, 1]
type = Explod
trigger1 = var(8) = 0
trigger1 = ishelper = 0
trigger1 = time = 1
anim = 441 + (var(51)!=0)
bindtime = -1
sprpriority = 6
ownpal = 1
removeongethit = 1

[State 440, 2]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 2
value = 0,random/500

[State 440, 3]
type = HitDef
trigger1 = animelem = 2
attr = C, NA
hitflag = MAF
guardflag = L
animtype = Medium
damage = 45/((ishelper)+1)
pausetime = (9/((var(40)!=0)+1))*(ishelper=0),(9/((var(40)!=0)+1))*(ishelper=0)
sparkno = S905
guard.sparkno = S907
sparkxy = -5,-10
hitsound = S5,4
guardsound = S5,8
ground.type = Trip
ground.slidetime = 10
ground.hittime = 15
ground.velocity = -1.5,-2
air.velocity = -1.2,-3

[State 440, 4]
type = Changeanim
trigger1 = ishelper
trigger1 = time < 11+25*(parent,var(41)-3)
value = anim
elem = 1

[State 440, 5]
type = Assertspecial
trigger1 = ishelper
flag = invisible

[State 440, 6]
type = Nothitby
trigger1 = ishelper
value = SCA

[State 440, 7]
type = Screenbound
trigger1 = ishelper
movecamera = 0,0

[State 440, 8]
type = Attackmulset
triggerall = ishelper
trigger1 = enemy, movetype != H
trigger2 = parent, var(15) = 0
value = 1

[State 440, 9]
type = Attackmulset
trigger1 = ishelper
trigger1 = enemy, movetype = H
trigger1 = parent, var(15) = [1,33]
value = 0.66 - 0.02*(parent,var(15))
persistent = 0

[State 440, 10]
type = Parentvaradd
trigger1 = ishelper
trigger1 = movehit
var(15) = 1
persistent = 0

[State 440, 11]
type = Destroyself
triggerall = ishelper
trigger1 = animtime = 0
trigger2 = parent, var(40) = 0

[State 440, 12]
type = Changestate
trigger1 = animtime = 0
trigger2 = var(51) != 0
trigger2 = animelemtime(animelemno(0)+1) = 0
trigger2 = animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1) - ifelse(animelemtime(animelemno(0)+1)=0,animtime,0) > 1
trigger2 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0))-animtime)/2
value = 11
ctrl = 1

;---------------------------------------------------------------------------
; Crouching Strong Kick
[Statedef 450]
type = C
movetype = A
physics = C
anim = 450
velset = 0,0
ctrl = 0
poweradd = 70
juggle = 12
sprpriority = 2
hitcountpersist = (enemy, movetype = H)

[State 450, 1]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 3
value = 2,1

[State 450, 2]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 3
value = 450,0

[State 450, 3]
type = HitDef
trigger1 = animelem = 5
attr = C, NA
hitflag = MAF
guardflag = MA
animtype = Hard
damage = 50/((ishelper)+1)
pausetime = (10/((var(40)!=0)+1))*(ishelper=0),(10/((var(40)!=0)+1))*(ishelper=0)
sparkno = S901
guard.sparkno = S906
sparkxy = 0,-70
hitsound = S5,1
guardsound = S5,8
ground.type = High
ground.slidetime = 15
ground.hittime = 25
ground.velocity = 0,-11
air.velocity = 0,-10
guard.velocity = -6
airguard.velocity = -3,-5

[State 450, 4]
type = Changeanim
trigger1 = ishelper
trigger1 = time < 11+25*(parent,var(41)-3)
value = anim
elem = 1

[State 450, 5]
type = Assertspecial
trigger1 = ishelper
flag = invisible

[State 450, 6]
type = Nothitby
trigger1 = ishelper
value = SCA

[State 450, 7]
type = Screenbound
trigger1 = ishelper
movecamera = 0,0

[State 450, 8]
type = Attackmulset
triggerall = ishelper
trigger1 = enemy, movetype != H
trigger2 = parent, var(15) = 0
value = 1

[State 450, 9]
type = Attackmulset
trigger1 = ishelper
trigger1 = enemy, movetype = H
trigger1 = parent, var(15) = [1,33]
value = 0.66 - 0.02*(parent,var(15))
persistent = 0

[State 450, 10]
type = Parentvaradd
trigger1 = ishelper
trigger1 = movehit
var(15) = 1
persistent = 0

[State 450, 11]
type = Destroyself
triggerall = ishelper
trigger1 = animtime = 0
trigger2 = parent, var(40) = 0

[State 450, 12]
type = Changestate
trigger1 = animtime = 0
trigger2 = var(51) != 0
trigger2 = animelemtime(animelemno(0)+1) = 0
trigger2 = animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1) - ifelse(animelemtime(animelemno(0)+1)=0,animtime,0) > 1
trigger2 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0))-animtime)/2
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Jump Light Punch
[Statedef 600]
type = A
movetype = A
physics = A
anim = 600
ctrl = 0
poweradd = 20
juggle = 4
sprpriority = 2
hitcountpersist = (enemy, movetype = H)

[State 600, 1]
type = Ctrlset
trigger1 = var(9) > 0
trigger1 = animelem = 6
value = 1

[State 600, 2]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 3
value = 0,2+random/500

[State 600, 3]
type = HitDef
trigger1 = animelem = 5
attr = A, NA
hitflag = MAF
guardflag = HA
animtype = Light
damage = 25/((ishelper)+1)
pausetime = (8/((var(40)!=0)+1))*(ishelper=0),(8/((var(40)!=0)+1))*(ishelper=0)
sparkno = S905
guard.sparkno = S907
sparkxy = 0,-27
hitsound = S5,3
guardsound = S5,8
ground.type = High
ground.slidetime = 6
ground.hittime = 8
ground.velocity = -4
air.velocity = 0,-4
airguard.velocity = -1,-4

[State 600, 4]
type = Changeanim
trigger1 = ishelper
trigger1 = time < 11+25*(parent,var(41)-3)
value = anim
elem = 1

[State 600, 5]
type = Assertspecial
trigger1 = ishelper
flag = invisible

[State 600, 6]
type = Nothitby
trigger1 = ishelper
value = SCA

[State 600, 7]
type = Screenbound
trigger1 = ishelper
movecamera = 0,0

[State 600, 8]
type = Attackmulset
triggerall = ishelper
trigger1 = enemy, movetype != H
trigger2 = parent, var(15) = 0
value = 1

[State 600, 9]
type = Attackmulset
trigger1 = ishelper
trigger1 = enemy, movetype = H
trigger1 = parent, var(15) = [1,33]
value = 0.66 - 0.02*(parent,var(15))
persistent = 0

[State 600, 10]
type = Posadd
trigger1 = ishelper
trigger1 = animelem = 2
y = -parent, const(movement.yaccel)
persistent = 0

[State 600, 11]
type = Velset
trigger1 = ishelper
trigger1 = time = 0
x = parent, vel x
y = parent, vel y

[State 600, 12]
type = Statetypeset
trigger1 = ishelper
trigger1 = time = 0
physics = N

[State 600, 13]
type = Statetypeset
trigger1 = ishelper
trigger1 = time = 12+25*(parent,var(41)-3)
physics = A

[State 600, 14]
type = Posfreeze
trigger1 = ishelper
trigger1 = time < 11+25*(parent,var(41)-3)

[State 600, 15]
type = Parentvaradd
trigger1 = ishelper
trigger1 = movehit
var(15) = 1
persistent = 0

[State 600, 16]
type = Destroyself
triggerall = ishelper
trigger1 = animtime = 0
trigger2 = parent, var(40) = 0

;---------------------------------------------------------------------------
; Jump Medium Punch
[Statedef 610]
type = A
movetype = A
physics = A
anim = 610
ctrl = 0
poweradd = 45
juggle = 8
sprpriority = 2
hitcountpersist = (enemy, movetype = H)

[State 610, 1]
type = Ctrlset
trigger1 = var(9) > 0
trigger1 = animelem = 7
value = 1

[State 600, 2]
type = Explod
trigger1 = var(8) = 0
trigger1 = ishelper = 0
trigger1 = animelem = 3
ID = 611 + (var(51)!=0)
anim = 611
bindtime = -1
sprpriority = 6
ownpal = 1
removeongethit = 1

[State 610, 3]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 3
value = 0,random/500

[State 610, 4]
type = HitDef
trigger1 = animelem = 3
attr = A, NA
hitflag = MAF
guardflag = HA
animtype = Medium
damage = 45/((ishelper)+1)
pausetime = (9/((var(40)!=0)+1))*(ishelper=0),(9/((var(40)!=0)+1))*(ishelper=0)
sparkno = S905
guard.sparkno = S907
sparkxy = -10,-58
hitsound = S5,4
guardsound = S5,8
ground.type = High
ground.slidetime = 10
ground.hittime = 12
ground.velocity = -5
air.velocity = 0,-3
airguard.velocity = -2,-3

[State 610, 5]
type = Changeanim
trigger1 = ishelper
trigger1 = time < 11+25*(parent,var(41)-3)
value = anim
elem = 1

[State 610, 6]
type = Assertspecial
trigger1 = ishelper
flag = invisible

[State 610, 7]
type = Nothitby
trigger1 = ishelper
value = SCA

[State 610, 8]
type = Screenbound
trigger1 = ishelper
movecamera = 0,0

[State 610, 9]
type = Attackmulset
triggerall = ishelper
trigger1 = enemy, movetype != H
trigger2 = parent, var(15) = 0
value = 1

[State 610, 10]
type = Attackmulset
trigger1 = ishelper
trigger1 = enemy, movetype = H
trigger1 = parent, var(15) = [1,33]
value = 0.66 - 0.02*(parent,var(15))
persistent = 0

[State 610, 11]
type = Posadd
trigger1 = ishelper
trigger1 = animelem = 2
y = -parent, const(movement.yaccel)
persistent = 0

[State 610, 12]
type = Velset
trigger1 = ishelper
trigger1 = time = 0
x = parent, vel x
y = parent, vel y

[State 610, 13]
type = Statetypeset
trigger1 = ishelper
trigger1 = time = 0
physics = N

[State 610, 14]
type = Statetypeset
trigger1 = ishelper
trigger1 = time = 12+25*(parent,var(41)-3)
physics = A

[State 610, 15]
type = Posfreeze
trigger1 = ishelper
trigger1 = time < 11+25*(parent,var(41)-3)

[State 610, 16]
type = Parentvaradd
trigger1 = ishelper
trigger1 = movehit
var(15) = 1
persistent = 0

[State 610, 17]
type = Destroyself
triggerall = ishelper
trigger1 = animtime = 0
trigger2 = parent, var(40) = 0

;---------------------------------------------------------------------------
; Jump Strong Punch
[Statedef 620]
type = A
movetype = A
physics = A
anim = 620
ctrl = 0
poweradd = 70
juggle = 12
sprpriority = 2
hitcountpersist = (enemy, movetype = H)

[State 620, 1]
type = Ctrlset
trigger1 = var(9) > 0
trigger1 = animelem = 8
value = 1

[State 620, 2]
type = Explod
trigger1 = var(8) = 0
trigger1 = ishelper = 0
trigger1 = animelem = 3
ID = 621 + (var(51)!=0)
anim = 621
bindtime = -1
sprpriority = 6
ownpal = 1
removeongethit = 1

[State 620, 3]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 3
value = 0,random/500

[State 620, 4]
type = HitDef
trigger1 = animelem = 4
attr = A, NA
hitflag = MAF
guardflag = HA
animtype = Hard
damage = 65/((ishelper)+1)
pausetime = (10/((var(40)!=0)+1))*(ishelper=0),(10/((var(40)!=0)+1))*(ishelper=0)
sparkno = S904
guard.sparkno = S907
sparkxy = -10,-55
hitsound = S5,5
guardsound = S5,8
ground.type = High
ground.slidetime = 14
ground.hittime = 16
ground.velocity = -5
air.velocity = 0,-2
airguard.velocity = -3,-2

[State 620, 5]
type = Changeanim
trigger1 = ishelper
trigger1 = time < 11+25*(parent,var(41)-3)
value = anim
elem = 1

[State 620, 6]
type = Assertspecial
trigger1 = ishelper
flag = invisible

[State 620, 7]
type = Nothitby
trigger1 = ishelper
value = SCA

[State 620, 8]
type = Screenbound
trigger1 = ishelper
movecamera = 0,0

[State 620, 9]
type = Attackmulset
triggerall = ishelper
trigger1 = enemy, movetype != H
trigger2 = parent, var(15) = 0
value = 1

[State 620, 10]
type = Attackmulset
trigger1 = ishelper
trigger1 = enemy, movetype = H
trigger1 = parent, var(15) = [1,33]
value = 0.66 - 0.02*(parent,var(15))
persistent = 0

[State 620, 11]
type = Posadd
trigger1 = ishelper
trigger1 = animelem = 2
y = -parent, const(movement.yaccel)
persistent = 0

[State 620, 12]
type = Velset
trigger1 = ishelper
trigger1 = time = 0
x = parent, vel x
y = parent, vel y

[State 620, 13]
type = Statetypeset
trigger1 = ishelper
trigger1 = time = 0
physics = N

[State 620, 14]
type = Statetypeset
trigger1 = ishelper
trigger1 = time = 12+25*(parent,var(41)-3)
physics = A

[State 620, 15]
type = Posfreeze
trigger1 = ishelper
trigger1 = time < 11+25*(parent,var(41)-3)

[State 620, 16]
type = Parentvaradd
trigger1 = ishelper
trigger1 = movehit
var(15) = 1
persistent = 0

[State 620, 17]
type = Destroyself
triggerall = ishelper
trigger1 = animtime = 0
trigger2 = parent, var(40) = 0

;---------------------------------------------------------------------------
; Jump Light Kick
[Statedef 630]
type = A
movetype = A
physics = A
anim = 630
ctrl = 0
poweradd = 20
juggle = 4
sprpriority = 2
hitcountpersist = (enemy, movetype = H)

[State 630, 1]
type = Ctrlset
trigger1 = var(9) > 0
trigger1 = animelem = 7
value = 1

[State 630, 2]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 1
value = 1,random/250

[State 630, 3]
type = HitDef
trigger1 = animelem = 2
attr = A, NA
hitflag = MAF
guardflag = HA
animtype = Light
damage = 20/((ishelper)+1)
pausetime = (8/((var(40)!=0)+1))*(ishelper=0),(8/((var(40)!=0)+1))*(ishelper=0)
sparkno = S900
guard.sparkno = S906
sparkxy = 4,-24
hitsound = S5,0
guardsound = S5,8
ground.type = High
ground.slidetime = 6
ground.hittime = 8
ground.velocity = -4
air.velocity = 0,-4
airguard.velocity = -1,-4

[State 630, 4]
type = Changeanim
trigger1 = ishelper
trigger1 = time < 11+25*(parent,var(41)-3)
value = anim
elem = 1

[State 630, 5]
type = Assertspecial
trigger1 = ishelper
flag = invisible

[State 630, 6]
type = Nothitby
trigger1 = ishelper
value = SCA

[State 630, 7]
type = Screenbound
trigger1 = ishelper
movecamera = 0,0

[State 630, 8]
type = Attackmulset
triggerall = ishelper
trigger1 = enemy, movetype != H
trigger2 = parent, var(15) = 0
value = 1

[State 630, 9]
type = Attackmulset
trigger1 = ishelper
trigger1 = enemy, movetype = H
trigger1 = parent, var(15) = [1,33]
value = 0.66 - 0.02*(parent,var(15))
persistent = 0

[State 630, 10]
type = Posadd
trigger1 = ishelper
trigger1 = animelem = 2
y = -parent, const(movement.yaccel)
persistent = 0

[State 630, 11]
type = Velset
trigger1 = ishelper
trigger1 = time = 0
x = parent, vel x
y = parent, vel y

[State 630, 12]
type = Statetypeset
trigger1 = ishelper
trigger1 = time = 0
physics = N

[State 630, 13]
type = Statetypeset
trigger1 = ishelper
trigger1 = time = 12+25*(parent,var(41)-3)
physics = A

[State 630, 14]
type = Posfreeze
trigger1 = ishelper
trigger1 = time < 11+25*(parent,var(41)-3)

[State 630, 15]
type = Parentvaradd
trigger1 = ishelper
trigger1 = movehit
var(15) = 1
persistent = 0

[State 630, 16]
type = Destroyself
triggerall = ishelper
trigger1 = animtime = 0
trigger2 = parent, var(40) = 0

;---------------------------------------------------------------------------
; Jump Medium Kick
[Statedef 640]
type = A
movetype = A
physics = A
anim = 640
ctrl = 0
poweradd = 45
juggle = 8
sprpriority = 2
hitcountpersist = (enemy, movetype = H)

[State 640, 1]
type = Ctrlset
trigger1 = var(9) > 0
trigger1 = animelem = 6
value = 1

[State 640, 2]
type = Explod
trigger1 = var(8) = 0
trigger1 = ishelper = 0
trigger1 = time = 1
ID = 641 + (var(51)!=0)
anim = 641
bindtime = -1
sprpriority = 6
ownpal = 1
removeongethit = 1

[State 640, 3]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 2
value = 0,random/500

[State 640, 4]
type = HitDef
trigger1 = animelem = 2
attr = A, NA
hitflag = MAF
guardflag = HA
animtype = Medium
damage = 45/((ishelper)+1)
pausetime = (9/((var(40)!=0)+1))*(ishelper=0),(9/((var(40)!=0)+1))*(ishelper=0)
sparkno = S905
guard.sparkno = S907
sparkxy = -5,-30
hitsound = S5,4
guardsound = S5,8
ground.type = High
ground.slidetime = 10
ground.hittime = 12
ground.velocity = -5
air.velocity = 0,-1
airguard.velocity = -2,-1

[State 640, 5]
type = Changeanim
trigger1 = ishelper
trigger1 = time < 11+25*(parent,var(41)-3)
value = anim
elem = 1

[State 640, 6]
type = Assertspecial
trigger1 = ishelper
flag = invisible

[State 640, 7]
type = Nothitby
trigger1 = ishelper
value = SCA

[State 640, 8]
type = Screenbound
trigger1 = ishelper
movecamera = 0,0

[State 640, 9]
type = Attackmulset
triggerall = ishelper
trigger1 = enemy, movetype != H
trigger2 = parent, var(15) = 0
value = 1

[State 640, 10]
type = Attackmulset
trigger1 = ishelper
trigger1 = enemy, movetype = H
trigger1 = parent, var(15) = [1,33]
value = 0.66 - 0.02*(parent,var(15))
persistent = 0

[State 640, 11]
type = Posadd
trigger1 = ishelper
trigger1 = animelem = 2
y = -parent, const(movement.yaccel)
persistent = 0

[State 640, 12]
type = Velset
trigger1 = ishelper
trigger1 = time = 0
x = parent, vel x
y = parent, vel y

[State 640, 13]
type = Statetypeset
trigger1 = ishelper
trigger1 = time = 0
physics = N

[State 640, 14]
type = Statetypeset
trigger1 = ishelper
trigger1 = time = 12+25*(parent,var(41)-3)
physics = A

[State 640, 15]
type = Posfreeze
trigger1 = ishelper
trigger1 = time < 11+25*(parent,var(41)-3)

[State 640, 16]
type = Parentvaradd
trigger1 = ishelper
trigger1 = movehit
var(15) = 1
persistent = 0

[State 640, 17]
type = Destroyself
triggerall = ishelper
trigger1 = animtime = 0
trigger2 = parent, var(40) = 0

;---------------------------------------------------------------------------
; Jump Strong Kick
[Statedef 650]
type = A
movetype = A
physics = A
anim = 650
ctrl = 0
poweradd = 70
juggle = 12
sprpriority = 2
hitcountpersist = (enemy, movetype = H)

[State 650, 1]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 3
value = 0,4+random/500

[State 650, 2]
type = HitDef
trigger1 = animelem = 6
attr = A, NA
hitflag = MAF
guardflag = HA
animtype = Hard
damage = 60/((ishelper)+1)
pausetime = (10/((var(40)!=0)+1))*(ishelper=0),(10/((var(40)!=0)+1))*(ishelper=0)
sparkno = S902
guard.sparkno = S907
sparkxy = 0,-35
hitsound = S5,6
guardsound = S5,8
ground.type = High
ground.slidetime = 14
ground.hittime = 16
ground.velocity = -3,12
air.velocity = -1,12
airguard.velocity = -3,12
fall = 1

[State 650, 3]
type = Changeanim
trigger1 = ishelper
trigger1 = time < 11+25*(parent,var(41)-3)
value = anim
elem = 1

[State 650, 4]
type = Assertspecial
trigger1 = ishelper
flag = invisible

[State 650, 5]
type = Nothitby
trigger1 = ishelper
value = SCA

[State 650, 6]
type = Screenbound
trigger1 = ishelper
movecamera = 0,0

[State 650, 7]
type = Attackmulset
triggerall = ishelper
trigger1 = enemy, movetype != H
trigger2 = parent, var(15) = 0
value = 1

[State 650, 8]
type = Attackmulset
trigger1 = ishelper
trigger1 = enemy, movetype = H
trigger1 = parent, var(15) = [1,33]
value = 0.66 - 0.02*(parent,var(15))
persistent = 0

[State 650, 9]
type = Posadd
trigger1 = ishelper
trigger1 = animelem = 2
y = -parent, const(movement.yaccel)
persistent = 0

[State 650, 10]
type = Velset
trigger1 = ishelper
trigger1 = time = 0
x = parent, vel x
y = parent, vel y

[State 650, 11]
type = Statetypeset
trigger1 = ishelper
trigger1 = time = 0
physics = N

[State 650, 12]
type = Statetypeset
trigger1 = ishelper
trigger1 = time = 12+25*(parent,var(41)-3)
physics = A

[State 650, 13]
type = Posfreeze
trigger1 = ishelper
trigger1 = time < 11+25*(parent,var(41)-3)

[State 650, 14]
type = Parentvaradd
trigger1 = ishelper
trigger1 = movehit
var(15) = 1
persistent = 0

[State 650, 15]
type = Destroyself
triggerall = ishelper
trigger1 = animtime = 0
trigger2 = parent, var(40) = 0

;---------------------------------------------------------------------------
; Kung Fu Throw
[Statedef 800]
type    = S
movetype= A
physics = S
juggle  = 0
velset = 0,0
ctrl = 0
anim = 800
sprpriority = 2

[State 800, 1]
type = HitDef
Trigger1 = Time = 0
attr = S, NT
hitflag = M-
priority = 1, Miss
sparkno = -1
sprpriority = 1
p1facing = ifelse (command = "holdfwd", -1, 1)
p2facing = 1
p1stateno = 810
p2stateno = 820
guard.dist = 0
fall = 1

[State 800, 2]
type = Changestate
trigger1 = animtime = 0
trigger2 = var(51) != 0
trigger2 = animelemtime(animelemno(0)+1) = 0
trigger2 = animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1) - ifelse(animelemtime(animelemno(0)+1)=0,animtime,0) > 1
trigger2 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0))-animtime)/2
value = 0
ctrl = 1

[Statedef 810]
type    = S
movetype= A
physics = N
anim = 810
poweradd = 60

[State 810, 1]
type = Playsnd
trigger1 = animelem = 2
value = 800,0

[State 810, 2]
type = Playsnd
trigger1 = animelem = 8
value = 1,random/250

[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(2) < 0
pos = 28, 0

[State 810, Width 2-11]
type = Width
trigger1 = AnimElemTime(2) >= 0 && AnimElemTime(12) < 0
edge = 60,0

[State 810, Bind 2-4]
type = TargetBind
trigger1 = AnimElemTime(2) >= 0 && AnimElemTime(5) < 0
pos = 43, 0

[State 810, Bind 5]
type = TargetBind
trigger1 = AnimElemTime(5) >= 0 && AnimElemTime(6) < 0
pos = 32, 0

[State 810, Bind 6]
type = TargetBind
trigger1 = AnimElemTime(6) >= 0 && AnimElemTime(7) < 0
pos = 29, -60

[State 810, Bind 7]
type = TargetBind
trigger1 = AnimElemTime(7) >= 0 && AnimElemTime(8) < 0
pos = 15, -75

[State 810, Bind 8]
type = TargetBind
trigger1 = AnimElemTime(8) >= 0 && AnimElemTime(9) < 0
pos = 5, -85

[State 810, Bind 9]
type = TargetBind
trigger1 = AnimElemTime(9) >= 0 && AnimElemTime(10) < 0
pos = -12, -91

[State 810, Bind 10]
type = TargetBind
trigger1 = AnimElemTime(10) >= 0 && AnimElemTime(11) < 0
pos = -20, -90

[State 810, Bind 11]
type = TargetBind
trigger1 = AnimElem = 11
pos = -55, -50

[State 810, Hurt 11]
type = TargetLifeAdd
trigger1 = AnimElem = 11
value = -70

[State 810, Throw 11]
type = TargetState
trigger1 = AnimElem = 11
value = 821

[State 810, Turn 12]
type = Turn
trigger1 = AnimElem = 12

[State 810, Pos 15]
type = PosAdd
trigger1 = AnimElem = 15
x = -10

[State 810, State End]
type = Changestate
trigger1 = animtime = 0
trigger2 = var(51) != 0
trigger2 = animelemtime(animelemno(0)+1) = 0
trigger2 = animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1) - ifelse(animelemtime(animelemno(0)+1)=0,animtime,0) > 1
trigger2 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0))-animtime)/2
value = 0
ctrl = 1

[Statedef 820]
type    = A
movetype= H
physics = N
velset = 0,0

[State 820, 0]
type = Changeanim
trigger1 = enemynear, var(51) != 0
trigger1 = animelemtime(animelemno(0)+1) < 0
trigger1 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1))/2
value = anim
elem = animelemno(0)+1

[State 820, 1]
type = Changeanim2
Trigger1 = Time = 0
value = 820

[Statedef 821]
type    = A
movetype= H
physics = N
velset = 2.8,-7
poweradd = 40

[State 821, 0]
type = Changeanim
trigger1 = enemynear, var(51) != 0
trigger1 = animelemtime(animelemno(0)+1) < 0
trigger1 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1))/2
value = anim
elem = animelemno(0)+1

[State 821, 1]
type = VelAdd
Trigger1 = 1
y = .4

[State 821, 2]
type = Changestate
triggerall = Vel Y > 0
triggerall = Pos Y >= -20
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery"
value = 5200

[State 821, 3]
type = SelfState
triggerall = Vel Y > 0
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery"
value = 5210

[State 821, 4]
type = SelfState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 5100

;---------------------------------------------------------------------------
; Multi-Slash
[Statedef 205]
type = S
movetype = A
physics = S
anim = 205
velset = 0,0
ctrl = 0
poweradd = 80
juggle = 5
sprpriority = 2
hitcountpersist = (enemy, movetype = H)

[State 205, 1]
type = VarSet
trigger1 = animelemno(0) = 2
var(0) = 0

[State 205, 2]
type = VarSet
trigger1 = time > 0
trigger1 = command = "Tap_x"
var(0) = 1

[State 205, 3]
type = Changeanim
trigger1 = var(0) = 1
trigger1 = animtime = 0
value = anim

[State 205, 4]
type = Statetypeset
trigger1 = anim = 205
statetype = S
physics = S

[State 205, 5]
type = Statetypeset
trigger1 = anim = 405
statetype = C
physics = C

[State 205, 6]
type = Changeanim
trigger1 = anim = 205
trigger1 = command = "holddown"
value = 405
elem = animelemno(0)

[State 205, 7]
type = Changeanim
trigger1 = anim = 405
trigger1 = command != "holddown"
value = 205
elem = animelemno(0)

[State 205, 8]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = timemod = 3,1
value = 3,0

[State 205, 9]
type = HitDef
trigger1 = ishelper = 0
trigger1 = timemod = 3,1
trigger2 = ishelper
trigger2 = time >= 11 + 25*(parent,var(41)-3)
trigger2 = timemod = 3,1
attr = S, SA
hitflag = MAF
guardflag = MA
animtype = Light
damage = 20/((ishelper)+1),2/((ishelper)+1)
pausetime = (4/((var(40)!=0)+1))*(ishelper=0),(4/((var(40)!=0)+1))*(ishelper=0)
sparkno = S900
guard.sparkno = S906
sparkxy = 0,ifelse(animelemno(0)<=3,-33,ifelse(animelemno(0)=7 || animelemno(0)=8 || animelemno(0)=9,-57,-45))
hitsound = S5,3
guardsound = S5,8
ground.type = High
ground.slidetime = 15
ground.hittime = 15
ground.velocity = -5
air.velocity = -5,-3

[State 205, 10]
type = Changeanim
trigger1 = ishelper
trigger1 = time < 11+25*(parent,var(41)-3)
value = anim
elem = 1

[State 205, 11]
type = Assertspecial
trigger1 = ishelper
flag = invisible

[State 205, 12]
type = Nothitby
trigger1 = ishelper
value = SCA

[State 205, 13]
type = Screenbound
trigger1 = ishelper
movecamera = 0,0

[State 205, 14]
type = Attackmulset
triggerall = ishelper
trigger1 = enemy, movetype != H
trigger2 = parent, var(15) = 0
value = 1

[State 205, 15]
type = Attackmulset
trigger1 = ishelper
trigger1 = enemy, movetype = H
trigger1 = parent, var(15) = [1,33]
value = 0.66 - 0.02*(parent,var(15))
persistent = 0

[State 205, 16]
type = Changeanim
trigger1 = ishelper
trigger1 = animtime = 0
value = anim

[State 205, 17]
type = Varset
trigger1 = ishelper
trigger1 = parent, stateno != 205
var(0) = 1

[State 205, 18]
type = Varadd
trigger1 = ishelper
trigger1 = var(0) = 1
var(1) = 1

[State 205, 19]
type = Parentvaradd
trigger1 = ishelper
trigger1 = movehit
var(15) = 1

[State 205, 20]
type = Movehitreset
trigger1 = ishelper
trigger1 = movehit

[State 205, 21]
type = Destroyself
triggerall = ishelper
trigger1 = var(1) > 11+25*(parent,var(41)-3)
trigger2 = parent, var(40) = 0

[State 205, 22]
type = Changestate
trigger1 = animtime = 0
value = ifelse(anim=405,11,0)
ctrl = 1

;---------------------------------------------------------------------------
; Standing Bow Shot
[Statedef 300]
type = S
movetype = A
physics = S
anim = 300
velset = 0,0
ctrl = 0
poweradd = ifelse(prevstateno=301,0,70)
sprpriority = 2
hitcountpersist = (enemy, movetype = H)

[State 300, 1]
type = Statetypeset
trigger1 = anim = 300
statetype = S
physics = S

[State 300, 2]
type = Statetypeset
trigger1 = anim = 301
statetype = C
physics = C

[State 300, 3]
type = Changeanim
trigger1 = time <= 140
trigger1 = animelemno(0) = 4
trigger1 = command = "hold_x" && command = "hold_a"
value = anim
elem = 4

[State 300, 4]
type = Changeanim
trigger1 = time <= 140
trigger1 = anim = 300
trigger1 = animelemno(0) = [1,4]
trigger1 = command = "hold_x" && command = "hold_a" && command = "holddown"
value = 301
elem = animelemno(1)

[State 300, 5]
type = Changeanim
trigger1 = time <= 140
trigger1 = anim = 301
trigger1 = animelemno(0) = [1,4]
trigger1 = command = "hold_x" && command = "hold_a" && command != "holddown"
value = 300
elem = animelemno(1)

[State 300, 6]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 2
value = 300,0

[State 300, 7]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 5
value = 2,random/250

[State 300, 8]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 6
value = 300,1+random/500
volume = 100

[State 300, 9]
type = Projectile
trigger1 = anim = 300
trigger1 = animelem = 6
projID = 300+(ishelper)
projanim = 305
projhitanim = 306
velocity = 15
offset = 5,0
projshadow = -1,255,255
attr = S, NA
hitflag = MAF
guardflag = MA
animtype = Medium
air.animtype = Back
damage = 0,5
pausetime = 0,(7/((var(40)!=0)+1))*(ishelper=0)
sparkno = S307
guard.sparkno = S907
sparkxy = 60, -74
hitsound = S5,3
guardsound = S5,8
ground.type = High
ground.slidetime = 14
ground.hittime = 15
ground.velocity = -5
air.type = High
air.hittime = 15
air.velocity = -3,-1

[State 300, 10]
type = Projectile
trigger1 = anim = 301
trigger1 = animelem = 6
projID = 300+(ishelper)
projanim = 305
projhitanim = 306
velocity = 15
offset = 8,19
projshadow = -1,255,255
attr = C, NA
hitflag = MAF
guardflag = MA
animtype = Medium
air.animtype = Back
damage = 0,5
pausetime = 0,(7/((var(40)!=0)+1))*(ishelper=0)
sparkno = S307
guard.sparkno = S907
sparkxy = 60, -74
hitsound = S5,3
guardsound = S5,8
ground.type = Low
ground.slidetime = 14
ground.hittime = 15
ground.velocity = -5
air.type = High
air.hittime = 15
air.velocity = -3,-1

[State 300, 11]
type = Varset
trigger1 = ishelper
trigger1 = parent, stateno = 300
trigger1 = parent, animelem = 6
var(0) = parent,anim

[State 300, 12]
type = Varadd
trigger1 = ishelper
trigger1 = var(0) != 0
var(1) = 1

[State 300, 13]
type = Changeanim
trigger1 = ishelper
trigger1 = var(1) < 5+25*(parent,var(41)-3)
value = var(0)
elem = 4

[State 300, 14]
type = Assertspecial
trigger1 = ishelper
flag = invisible

[State 300, 15]
type = Nothitby
trigger1 = ishelper
value = SCA

[State 300, 16]
type = Screenbound
trigger1 = ishelper
movecamera = 0,0

[State 300, 17]
type = Destroyself
triggerall = ishelper
trigger1 = animtime = 0
trigger2 = parent, var(40) = 0

[State 300, 18]
type = Changestate
trigger1 = animtime = 0
trigger2 = var(51) != 0
trigger2 = animelemtime(animelemno(0)+1) = 0
trigger2 = animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1) - ifelse(animelemtime(animelemno(0)+1)=0,animtime,0) > 1
trigger2 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0))-animtime)/2
value = ifelse(anim = 301,11,0)
ctrl = 1

;---------------------------------------------------------------------------
; Boomerang
[Statedef 310]
type = S
movetype = A
physics = S
anim = 310
velset = 0,0
ctrl = 0
poweradd = 70
sprpriority = 2
hitcountpersist = (enemy, movetype = H)

[State 310, 1]
type = Varset
trigger1 = ishelper = 0
trigger1 = time <= 18
var(7) = ifelse(command="holdup",1,ifelse(command="holddown",-1,0))

[State 310, 2]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = anim = 310
trigger1 = animelem = 1
value = 310,0

[State 310, 3]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = anim = 310
trigger1 = animelem = 3
value = 310,1+random/500

[State 310, 4]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = anim = 311
value = 310,4+random/500
persistent = 0

[State 310, 5]
type = Helper
trigger1 = ishelper = 0
trigger1 = animelem = 5
name = "boomerang"
ID = 315
pos = 45,-10*abs(var(7))
postype = p1
stateno = 315
ownpal = 1
size.xscale = 0.9
size.yscale = 0.9

[State 310, 6]
type = Helper
trigger1 = ishelper
trigger1 = animelem = 5
name = "boomerang"
ID = 316
pos = 45,-10*abs(parent,var(7))
postype = p1
stateno = 315
ownpal = 1
size.xscale = 0.9
size.yscale = 0.9

[State 310, 7]
type = Changeanim
trigger1 = ishelper = 0
trigger1 = numhelper(315) > 0
trigger1 = helper(315),parentdist x > -30
value = 311
persistent = 0

[State 310, 8]
type = Changeanim
trigger1 = ishelper
trigger1 = time < 11+25*(parent,var(41)-3)
value = anim
elem = 1

[State 310, 9]
type = Assertspecial
trigger1 = ishelper
flag = invisible

[State 310, 10]
type = Nothitby
trigger1 = ishelper
value = SCA

[State 310, 11]
type = Screenbound
trigger1 = ishelper
movecamera = 0,0

[State 310, 12]
type = Varset
trigger1 = ishelper
trigger1 = time <= 18
var(7) = ifelse(parent,command="holdup",1,ifelse(parent,command="holddown",-1,0))

[State 310, 13]
type = Parentvaradd
trigger1 = ishelper
trigger1 = var(14) != 0
var(15) = var(14)
persistent = 0
ignorehitpause = 1

[State 310, 14]
type = Destroyself
triggerall = ishelper
trigger1 = var(1) != 0
trigger1 = numhelper(316) > 0
trigger1 = helper(316), parentdist x > - 30
trigger2 = animelemno(0) < 5
trigger2 = parent, var(40) = 0

[State 310, 15]
type = Changestate
triggerall = anim = 311
triggerall = ishelper = 0
trigger1 = animtime = 0
trigger2 = var(51) != 0
trigger2 = animelemtime(animelemno(0)+1) = 0
trigger2 = animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1) - ifelse(animelemtime(animelemno(0)+1)=0,animtime,0) > 1
trigger2 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0))-animtime)/2
value = 0
ctrl = 1

[Statedef 315]
type = A
movetype = A
physics = N
anim = 315
velset = 11.4,-5.7*parent,var(7)
sprpriority = 5

[State 315, 1]
type = Parentvarset
trigger1 = parent, ishelper
trigger1 = time = 0
var(1) = 1

[State 315, 2]
type = Hitoverride
trigger1 = time >= 0
attr = SCA, NA, SA, HA, NT, ST, HT, NP, SP, HP
stateno = 316
time = -1

[State 315, 3]
type = Velset
trigger1 = pos y >= 40
y = -vel y
persistent = 0

[State 315, 4]
type = Veladd
trigger1 = parent, var(7) >= 0
trigger1 = time < 25
x = -0.25
y = 0.125*parent,var(7)

[State 315, 5]
type = Veladd
trigger1 = parent, var(7) >= 0
trigger1 = time >= 25
x = -0.5
y = 0.22*parent,var(7)

[State 315, 6]
type = Veladd
trigger1 = parent, var(7) < 0
trigger1 = time < 25
x = -0.25
y = 0;ifelse(vel y >= 0,-0.05, 0.05)

[State 315, 7]
type = Veladd
trigger1 = parent, var(7) < 0
trigger1 = time >= 25
x = -0.5
y = 0.3

[State 315, 8]
type = Playsnd
trigger1 = parent, ishelper = 0
trigger1 = time = 0
value = 310,3
channel = 23
loop = 1

[State 315, 9]
type = Stopsnd
trigger1 = parent, anim = 311
channel = 23

[State 315, 10]
type = Attackmulset
trigger1 = parent, ishelper = 0
trigger1 = enemy, movetype != H
trigger2 = parent, hitcount + parent, var(14) = 0
value = 1

[State 315, 11]
type = Attackmulset
trigger1 = parent, ishelper
trigger1 = enemy, movetype != H
trigger2 = root, var(15) = 0
value = 1

[State 315, 12]
type = Attackmulset
trigger1 = parent, ishelper = 0
trigger1 = enemy, movetype = H
trigger1 = parent, hitcount + parent, var(14) = [1,33]
value = 0.66 - 0.02*(parent, hitcount + parent, var(14))

[State 315, 13]
type = Attackmulset
trigger1 = parent, ishelper
trigger1 = enemy, movetype = H
trigger1 = root, var(15) = [1,33]
value = 0.66 - 0.02*(root, var(15))

[State 315, 14]
type = HitDef
trigger1 = time <= 35
attr = S, NA
hitflag = MAF
guardflag = MA
animtype = Hard
priority = 3
damage = 60/((parent,ishelper)+1),6/((parent,ishelper)+1)
pausetime = (6/((root,var(40)!=0)+1))*(parent,ishelper=0),(6/((root,var(40)!=0)+1))*(parent,ishelper=0)
sparkno = S901
guard.sparkno = S907
sparkxy = 0,-55
hitsound = S5,2
guardsound = S5,8
ground.type = High
ground.slidetime = 18
ground.hittime = 20
ground.velocity = -8
air.velocity = -2.5,-4

[State 315, 15]
type = HitDef
trigger1 = time > 35
attr = S, NA
hitflag = MAF
guardflag = MA
animtype = Hard
priority = 3
damage = 60/((parent,ishelper)+1),6/((parent,ishelper)+1)
pausetime = (6/((root,var(40)!=0)+1))*(parent,ishelper=0),(6/((root,var(40)!=0)+1))*(parent,ishelper=0)
sparkno = S901
guard.sparkno = S907
sparkxy = 0,-55
hitsound = S5,2
guardsound = S5,8
ground.type = High
ground.slidetime = 18
ground.hittime = 20
ground.velocity = 8
air.velocity = 2.5,-4

[State 315, 16]
type = Parentvaradd
trigger1 = movehit
var(14) = 1
persistent = 0
ignorehitpause = 1

[State 315, 17]
type = Varset
trigger1 = 1
var(0) = time

[State 315, 18]
type = Changestate
trigger1 = movecontact
value = 316

[State 315, 19]
type = Changestate
trigger1 = parent, anim != [310,311]
trigger1 = -facing*pos x >= 140
value = 317

[State 315, 20]
type = Destroyself
trigger1 = parent, anim = 311
trigger2 = parent, ishelper
trigger2 = parentdist x > -30

[Statedef 316]
type = A
movetype = A
physics = N
anim = 316
velset = ifelse(vel x<=0,vel x,0),ifelse(vel y >=0 && var(0)>=45,vel y,0)
sprpriority = 5

[State 316, 1]
type = Varset
trigger1 = time = 0
fvar(0) = parentdist x

[State 316, 2]
type = Varset
trigger1 = time = 0
fvar(1) = parentdist y

[State 316, 3]
type = Veladd
trigger1 = parent, var(7) >= 0
trigger1 = time >= 0
x = -0.5
y = 0.22*parent,var(7)

[State 316, 4]
type = Veladd
trigger1 = parent, var(7) < 0
trigger1 = time >= 0
x = -0.5
y = ifelse(var(0)<45,-((fvar(1)-ifelse(var(0)>10,20,10))/fvar(0)*ifelse(var(0)>10,0.5,0.8)),0.3)

[State 316, 5]
type = Stopsnd
trigger1 = parent, anim = 311
channel = 23

[State 316, 6]
type = Changestate
trigger1 = parent, anim != [310,311]
trigger1 = -facing*pos x >= 140
value = 317

[State 316, 7]
type = Destroyself
trigger1 = parent, anim = 311
trigger2 = parent, ishelper
trigger2 = parentdist x > -30

[Statedef 317]
type = A
movetype = I
physics = N
anim = 316
velset = 0,0
sprpriority = 5

[State 317, 1]
type = Velset
trigger1 = time = 0
x = 3
y = -5

[State 317, 2]
type = Veladd
trigger1 = time > 0
trigger1 = pos y < 45
y = 0.35

[State 317, 3]
type = Posset
trigger1 = pos y > 45
y = 45

[State 317, 4]
type = Velset
trigger1 = pos y >= 45
x = 0
y = 0

[State 317, 5]
type = Changeanim
trigger1 = pos y = 45
value = 317

[State 317, 6]
type = Stopsnd
trigger1 = anim = 317
channel = 23

[State 317, 7]
type = Destroyself
trigger1 = parent, anim = 311

;---------------------------------------------------------------------------
; Bomb
[Statedef 320]
type = S
movetype = A
physics = S
anim = 320
velset = 0,0
ctrl = 0
poweradd = 70
sprpriority = 2
hitcountpersist = (enemy, movetype = H)

[State 320, 1]
type = Varset
trigger1 = time = 0
var(6) = 0

[State 320, 2]
type = Varset
trigger1 = time = 0
var(5) = ifelse(command = "holdfwd",1,ifelse(command = "holdback",-1,0))

[State 320, 3]
type = Varset
trigger1 = time = 0
trigger1 = ishelper
var(5) = parent, var(5)

[State 320, 4]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 1
value = 320,0

[State 320, 5]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 4
value = 2,random/250

[State 320, 6]
type = Helper
trigger1 = animelem = 4
name = "bombe"
ID = 325
pos = -6,-62
postype = p1
stateno = 325
ownpal = 1
persistent = 0

[State 320, 7]
type = Changeanim
trigger1 = ishelper
trigger1 = time < 11+25*(parent,var(41)-3)
value = anim
elem = 1

[State 320, 8]
type = Assertspecial
trigger1 = ishelper
flag = invisible

[State 320, 9]
type = Nothitby
trigger1 = ishelper
value = SCA

[State 320, 10]
type = Screenbound
trigger1 = ishelper
movecamera = 0,0

[State 320, 11]
type = Parentvaradd
trigger1 = ishelper
trigger1 = var(14) != 0
var(15) = var(14)
persistent = 0
ignorehitpause = 1

[State 320, 12]
type = Destroyself
triggerall = ishelper
trigger1 = animelemno(0) >= 4
trigger1 = numhelper(325) = 0
trigger2 = animelemno(0) < 4
trigger2 = parent, var(40) = 0

[State 320, 13]
type = Changestate
triggerall = ishelper = 0
trigger1 = animtime = 0
trigger2 = var(51) != 0
trigger2 = animelemtime(animelemno(0)+1) = 0
trigger2 = animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1) - ifelse(animelemtime(animelemno(0)+1)=0,animtime,0) > 1
trigger2 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0))-animtime)/2
value = 0
ctrl = 1

[Statedef 321]
type = A
movetype = H
physics = N
anim = 5030
velset = 0,0

[State 321, 1]
type = Forcefeedback
trigger1 = time = 0
time = 15
waveform = sinesquare
ampl = 140

[State 321, 2]
type = Palfx
trigger1 = time = 0
time = 70
add = 50,-80,-150
sinadd = 40,40,40,15
color = 0

[State 321, 3]
type = Velset
trigger1 = time = 10
x = -4
y = -6

[State 321, 4]
type = Velset
trigger1 = time = 10
trigger1 = enemy(0), var(6) = 1
trigger1 = facing*(enemy(0),fvar(2)-pos x)<-10
x = -vel x
persistent = 0

[State 321, 5]
type = Velset
trigger1 = time = 10
trigger1 = numenemy > 1
trigger1 = enemy(1), var(6) = 1
trigger1 = facing*(enemy(1),fvar(2)-pos x)<-10
x = -vel x
persistent = 0

[State 321, 6]
type = Velset
trigger1 = time = 10
trigger1 = numpartner > 0
trigger1 = partner, var(6) = 1
trigger1 = facing*(partner,fvar(2)-pos x)<-10
x = -vel x
persistent = 0

[State 321, 7]
type = Veladd
trigger1 = time > 10
y = 0.35

[State 321, 8]
type = Veladd
trigger1 = time = 15
trigger2 = time = 26
y = 0.35

[State 321, 9]
type = Changeanim
trigger1 = animexist(5035)
trigger1 = time = 15
value = 5035

[State 321, 10]
type = Selfstate
trigger1 = ifelse(animexist(5035),anim = 5035 && animtime = 0, anim = 5030 && animtime = 0)
value = 5050

[Statedef 325]
type = A
movetype = A
physics = N
anim = 325
velset = 6+parent,var(5), -(6+parent,var(5))
sprpriority = 5

[State 325, 1]
type = Parentvarset
trigger1 = anim = [326,327]
fvar(2) = pos x
persistent = 0

[State 325, 2]
type = Veladd
trigger1 = time > 0 && vel x > 0
x = ifelse(parent,var(5) = -1,-0.1,ifelse(parent,var(5) >= 0,-0.05,-0.05))

[State 325, 3]
type = Veladd
trigger1 = time > 0
trigger1 = pos y < 0
y = 0.6 - parent,var(5)/10.0

[State 325, 4]
type = Posset
trigger1 = pos y >= 0
trigger2 = anim = 326
y = 0

[State 325, 5]
type = Velset
trigger1 = pos y = 0
trigger2 = anim = 327
x = 0
y = 0

[State 325, 6]
type = Playsnd
trigger1 = parent, ishelper = 0
trigger1 = time = 0
value = 320,1
channel = 22
loop = 1

[State 325, 7]
type = Stopsnd
trigger1 = anim = [326,327]
channel = 22

[State 325, 8]
type = Playsnd
trigger1 = anim = [326,327]
value = 320,2
persistent = 0

[State 325, 9]
type = Attackmulset
trigger1 = parent, ishelper = 0
trigger1 = enemy, movetype != H
trigger2 = parent, hitcount + parent, var(14) = 0
value = 1

[State 325, 10]
type = Attackmulset
trigger1 = parent, ishelper
trigger1 = enemy, movetype != H
trigger2 = root, var(15) = 0
value = 1

[State 325, 11]
type = Attackmulset
trigger1 = parent, ishelper = 0
trigger1 = enemy, movetype = H
trigger1 = parent, hitcount + parent, var(14) = [1,33]
value = 0.66 - 0.02*(parent, hitcount + parent, var(14))

[State 325, 12]
type = Attackmulset
trigger1 = parent, ishelper
trigger1 = enemy, movetype = H
trigger1 = root, var(15) = [1,33]
value = 0.66 - 0.02*(root, var(15))

[State 325, 13]
type = HitDef
trigger1 = animelem = 1
attr = A, NA
hitflag = MAF
guardflag = MA
affectteam = B
animtype = Hard
damage = 70/((parent,ishelper)+1),5/((parent,ishelper)+1)
pausetime = 0,(10/((root,var(40)!=0)+1))*(parent,ishelper=0)
sparkno = -1
guard.sparkno = -1
sparkxy = 30,-20
hitsound = S5,2
guardsound = S5,8
ground.type = High
ground.slidetime = 20
ground.hittime = 25
ground.velocity = -4,-6
air.velocity = -4,-6
guard.velocity = -10
p2stateno = 321
fall = 1
fall.recover = 0
palfx.time = 72
palfx.add = 50,-80,-150
palfx.sinadd = 40,40,40,15
palfx.color = 0

[State 325, 14]
type = Parentvaradd
trigger1 = movehit
var(14) = 1
persistent = 0
ignorehitpause = 1

[State 325, 15]
type = Parentvarset
trigger1 = movehit
var(6) = 1
persistent = 0

[State 325, 16]
type = Hitoverride
trigger1 = time >= 0
attr = SCA, NA, SA, HA, NT, ST, HT, NP, SP, HP
stateno = 326
time = -1

[State 325, 17]
type = Changeanim
trigger1 = movecontact = 1
trigger2 = pos y = 0
value = ifelse(pos y = 0, 326, 327)
persistent = 0

[State 325, 18]
type = Destroyself
trigger1 = animtime = 0

[Statedef 326]
type = S
movetype = A
physics = S
anim = ifelse(pos y = 0, 326, 327)
velset = 0,0
sprpriority = 5
hitdefpersist = 1

[State 326, 1]
type = Destroyself
trigger1 = animtime = 0

;---------------------------------------------------------------------------
; Time Bomb
[Statedef 330]
type = S
movetype = A
physics = S
anim = 320
velset = 0,0
ctrl = 0
poweradd = 70
sprpriority = 2
hitcountpersist = (enemy, movetype = H)

[State 330, 1]
type = Varset
trigger1 = time = 0
var(5) = ifelse(command = "holdfwd",1,ifelse(command = "holdback",-1,0))

[State 330, 1]
type = Varset
trigger1 = time = 0
trigger1 = ishelper
var(5) = parent, var(5)

[State 330, 3]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 1
value = 320,0

[State 330, 4]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 4
value = 2,random/250

[State 330, 5]
type = Helper
trigger1 = animelem = 4
name = "bombe"
ID = 335
pos = -6,-62
postype = p1
stateno = 335
ownpal = 1

[State 330, 6]
type = Changeanim
trigger1 = ishelper
trigger1 = time < 11+25*(parent,var(41)-3)
value = anim
elem = 1

[State 330, 7]
type = Assertspecial
trigger1 = ishelper
flag = invisible

[State 330, 8]
type = Nothitby
trigger1 = ishelper
value = SCA

[State 330, 9]
type = Screenbound
trigger1 = ishelper
movecamera = 0,0

[State 330, 10]
type = Parentvaradd
trigger1 = ishelper
trigger1 = var(14) != 0
var(15) = var(14)
persistent = 0
ignorehitpause = 1

[State 330, 11]
type = Destroyself
triggerall = ishelper
trigger1 = animelemno(0) >= 4
trigger1 = numhelper(335) = 0
trigger2 = animelemno(0) < 4
trigger2 = parent, var(40) = 0

[State 330, 12]
type = Changestate
triggerall = ishelper = 0
trigger1 = animtime = 0
trigger2 = var(51) != 0
trigger2 = animelemtime(animelemno(0)+1) = 0
trigger2 = animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1) - ifelse(animelemtime(animelemno(0)+1)=0,animtime,0) > 1
trigger2 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0))-animtime)/2
value = 0
ctrl = 1

[Statedef 335]
type = A
movetype = A
physics = N
anim = 325
velset = 6+parent,var(5), -(6+parent,var(5))
sprpriority = 5

[State 335, 1]
type = Velset
trigger1 = time > 1
trigger1 = abs(pos x) > 145
trigger2 = vel x < 0.1
x = 0

[State 335, 2]
type = Veladd
trigger1 = time > 0
trigger1 = vel x >= 0.1
x = ifelse(parent,var(5) = -1,-0.1,ifelse(parent,var(5) >= 0,-0.05,-0.05))

[State 335, 3]
type = Veladd
trigger1 = time > 0
trigger1 = pos y < 0
y = 0.6 - parent,var(5)/10.0

[State 335, 4]
type = Velset
trigger1 = pos y >= 0
y = 0

[State 335, 5]
type = Posset
trigger1 = pos y > 0
y = 0

[State 335, 6]
type = Playsnd
trigger1 = parent, ishelper = 0
trigger1 = time = 0
value = 320,1
channel = 22
loop = 1

[State 335, 7]
type = Stopsnd
trigger1 = anim = [326,327]
channel = 22

[State 335, 8]
type = Playsnd
trigger1 = parent, ishelper = 0
trigger1 = anim = [326,327]
value = 320,2
persistent = 0

[State 335, 9]
type = Playsnd
trigger1 = parent, ishelper = 0
trigger1 = pos y > 0
value = 320,3

[State 335, 10]
type = Attackmulset
trigger1 = parent, ishelper = 0
trigger1 = enemy, movetype != H
trigger2 = parent, hitcount + parent, var(14) = 0
value = 1

[State 335, 11]
type = Attackmulset
trigger1 = parent, ishelper
trigger1 = enemy, movetype != H
trigger2 = root, var(15) = 0
value = 1

[State 335, 12]
type = Attackmulset
trigger1 = parent, ishelper = 0
trigger1 = enemy, movetype = H
trigger1 = parent, hitcount + parent, var(14) = [1,33]
value = 0.66 - 0.02*(parent, hitcount + parent, var(14))

[State 335, 13]
type = Attackmulset
trigger1 = parent, ishelper
trigger1 = enemy, movetype = H
trigger1 = root, var(15) = [1,33]
value = 0.66 - 0.02*(root, var(15))

[State 335, 14]
type = HitDef
trigger1 = anim = 326
attr = A, NA
hitflag = MAF
affectteam = B
animtype = Hard
damage = 70/((parent,ishelper)+1),5/((parent,ishelper)+1)
pausetime = 0,(10/((root,var(40)!=0)+1))*(parent,ishelper=0)
sparkno = -1
guard.sparkno = -1
sparkxy = 30,-20
hitsound = S5,2
guardsound = S5,8
ground.type = High
ground.slidetime = 20
ground.hittime = 25
ground.velocity = -4,-6
air.velocity = -4,-6
guard.velocity = -10
p2stateno = 321
fall = 1
fall.recover = 0
palfx.time = 72
palfx.add = 50,-80,-150
palfx.sinadd = 40,40,40,15
palfx.color = 0
persistent = 0

[State 335, 15]
type = Parentvaradd
trigger1 = movehit
var(14) = 1
persistent = 0
ignorehitpause = 1

[State 335, 16]
type = HitOverride
trigger1 = time >= 0
attr = SCA, NA, SA, HA, NT, ST, HT, NP, SP, HP
stateno = 337
time = -1

[State 335, 17]
type = Changeanim
trigger1 = anim = 325 && animtime = 0
value = ifelse(pos y = 0, 326, 327)

[State 335, 18]
type = Changestate
trigger1 = pos y >= 0
value = 336

[State 335, 19]
type = Destroyself
trigger1 = anim = [326,327]
trigger1 = animtime = 0

[Statedef 336]
type = A
movetype = A
physics = N
velset = vel x,-4.8-parent,var(5)*0.8
sprpriority = 5

[State 336, 1]
type = Velset
trigger1 = time > 1
trigger1 = abs(pos x) > 145
trigger2 = vel x <= 0
x = 0

[State 336, 2]
type = Veladd
;trigger1 = time > 0
trigger1 = vel x > 0
x = ifelse(parent,var(5)=-1,-0.15,-0.25)

[State 336, 3]
type = Veladd
trigger1 = time > 0
trigger1 = pos y < 0
y = 0.7

[State 336, 4]
type = Velset
trigger1 = time > 0
trigger1 = pos y >= 0
y = 0

[State 336, 5]
type = Posset
trigger1 = pos y > 0
y = 0

[State 336, 6]
type = Stopsnd
trigger1 = anim = [326,327]
channel = 22

[State 336, 7]
type = Playsnd
trigger1 = parent, ishelper = 0
trigger1 = anim = [326,327]
value = 320,2
persistent = 0

[State 336, 8]
type = Playsnd
trigger1 = parent, ishelper = 0
trigger1 = pos y > 0
value = 320,3

[State 336, 9]
type = Attackmulset
trigger1 = parent, ishelper = 0
trigger1 = enemy, movetype != H
trigger2 = parent, hitcount + parent, var(14) = 0
value = 1

[State 336, 10]
type = Attackmulset
trigger1 = parent, ishelper
trigger1 = enemy, movetype != H
trigger2 = root, var(15) = 0
value = 1

[State 336, 11]
type = Attackmulset
trigger1 = parent, ishelper = 0
trigger1 = enemy, movetype = H
trigger1 = parent, hitcount + parent, var(14) = [1,33]
value = 0.66 - 0.02*(parent, hitcount + parent, var(14))

[State 336, 12]
type = Attackmulset
trigger1 = parent, ishelper
trigger1 = enemy, movetype = H
trigger1 = root, var(15) = [1,33]
value = 0.66 - 0.02*(root, var(15))

[State 336, 13]
type = HitDef
trigger1 = anim = [326,327]
attr = A, NA
hitflag = MAF
affectteam = B
animtype = Hard
damage = 70/((parent,ishelper)+1),5/((parent,ishelper)+1)
pausetime = 0,(10/((root,var(40)!=0)+1))*(parent,ishelper=0)
sparkno = -1
guard.sparkno = -1
sparkxy = 30,-20
hitsound = S5,2
guardsound = S5,8
ground.type = High
ground.slidetime = 20
ground.hittime = 25
ground.velocity = -4,-6
air.velocity = -4,-6
guard.velocity = -10
p2stateno = 321
fall = 1
fall.recover = 0
palfx.time = 72
palfx.add = 50,-80,-150
palfx.sinadd = 40,40,40,15
palfx.color = 0
persistent = 0

[State 336, 14]
type = Parentvaradd
trigger1 = movehit
var(14) = 1
persistent = 0
ignorehitpause = 1

[State 336, 15]
type = HitOverride
trigger1 = time >= 0
attr = SCA, NA, SA, HA, NT, ST, HT, NP, SP, HP
stateno = 337
time = -1

[State 336, 16]
type = Changeanim
trigger1 = anim = 325 && animtime = 0
value = ifelse(pos y = 0, 326, 327)

[State 336, 179]
type = Destroyself
trigger1 = anim = [326,327]
trigger1 = animtime = 0

[Statedef 337]
type = A
movetype = A
physics = N
velset = 0,0
sprpriority = 5

[State 337, 2]
type = Velset
trigger1 = abs(pos x) > 145
x = 0

[State 337, 3]
type = Velset
trigger1 = time = 0
trigger1 = pos y != 0
x = gethitvar(xvel)*facing
y = gethitvar(yvel)

[State 337, 3]
type = Veladd
trigger1 = time > 0
trigger1 = pos y != 0
trigger1 = anim != [326,327]
y = 0.5

[State 337, 4]
type = Posset
trigger1 = pos y > 0
y = 0

[State 337, 5]
type = Playsnd
trigger1 = time > 0
trigger1 = pos y >= 0
value = 320,3
persistent = 0

[State 337, 6]
type = Changestate
trigger1 = pos y = 0
trigger1 = anim = 325
value = 338

[State 337, 7]
type = Velset
trigger1 = anim = [326,327]
x = 0
y = 0

[State 337, 8]
type = Stopsnd
trigger1 = anim = [326,327]
channel = 22

[State 337, 9]
type = Playsnd
trigger1 = parent, ishelper = 0
trigger1 = anim = [326,327]
value = 320,2
persistent = 0

[State 337, 10]
type = Attackmulset
trigger1 = parent, ishelper = 0
trigger1 = enemy, movetype != H
trigger2 = parent, hitcount + parent, var(14) = 0
value = 1

[State 337, 11]
type = Attackmulset
trigger1 = parent, ishelper
trigger1 = enemy, movetype != H
trigger2 = root, var(15) = 0
value = 1

[State 337, 12]
type = Attackmulset
trigger1 = parent, ishelper = 0
trigger1 = enemy, movetype = H
trigger1 = parent, hitcount + parent, var(14) = [1,33]
value = 0.66 - 0.02*(parent, hitcount + parent, var(14))

[State 337, 13]
type = Attackmulset
trigger1 = parent, ishelper
trigger1 = enemy, movetype = H
trigger1 = root, var(15) = [1,33]
value = 0.66 - 0.02*(root, var(15))

[State 337, 14]
type = HitDef
trigger1 = anim = [326,327]
attr = A, NA
hitflag = MAF
affectteam = B
animtype = Hard
damage = 70/((parent,ishelper)+1),5/((parent,ishelper)+1)
pausetime = 0,(10/((root,var(40)!=0)+1))*(parent,ishelper=0)
sparkno = -1
guard.sparkno = -1
sparkxy = 30,-20
hitsound = S5,2
guardsound = S5,8
ground.type = High
ground.slidetime = 20
ground.hittime = 25
ground.velocity = -4,-6
air.velocity = -4,-6
guard.velocity = -10
p2stateno = 321
fall = 1
fall.recover = 0
palfx.time = 72
palfx.add = 50,-80,-150
palfx.sinadd = 40,40,40,15
palfx.color = 0
persistent = 0

[State 337, 15]
type = Parentvaradd
trigger1 = movehit
var(14) = 1
persistent = 0
ignorehitpause = 1

[State 337, 16]
type = Changeanim
trigger1 = anim = 325
trigger1 = animtime = 0
value = ifelse(pos y = 0, 326, 327)

[State 337, 17]
type = Destroyself
trigger1 = anim = [326,327]
trigger1 = animtime = 0

[Statedef 338]
type = A
movetype = A
physics = N
velset = 0,0
sprpriority = 5

[State 338, 1]
type = Velset
trigger1 = abs(pos x) > 145
x = 0

[State 338, 2]
type = Velset
trigger1 = time = 0
;trigger1 = pos y != 0
x = gethitvar(xvel)*0.75*facing
y = gethitvar(yvel)*0.75

[State 338, 3]
type = Veladd
trigger1 = time > 0
trigger1 = pos y != 0
trigger1 = anim != [326,327]
y = 0.5

[State 338, 4]
type = Posset
trigger1 = pos y > 0
y = 0

[State 338, 5]
type = Velset
trigger1 = time > 0
trigger1 = pos y = 0
trigger2 = anim = [326,327]
x = 0
y = 0

[State 338, 6]
type = Velset
trigger1 = anim = [326,327]
x = 0
y = 0

[State 338, 7]
type = Stopsnd
trigger1 = anim = [326,327]
channel = 22

[State 338, 8]
type = Playsnd
trigger1 = parent, ishelper = 0
trigger1 = anim = [326,327]
value = 320,2
persistent = 0

[State 338, 9]
type = Playsnd
trigger1 = parent, ishelper = 0
trigger1 = time > 5
trigger1 = pos y >= 0
value = 320,3
persistent = 0

[State 338, 10]
type = Attackmulset
trigger1 = parent, ishelper = 0
trigger1 = enemy, movetype != H
trigger2 = parent, hitcount + parent, var(14) = 0
value = 1

[State 338, 11]
type = Attackmulset
trigger1 = parent, ishelper
trigger1 = enemy, movetype != H
trigger2 = root, var(15) = 0
value = 1

[State 338, 12]
type = Attackmulset
trigger1 = parent, ishelper = 0
trigger1 = enemy, movetype = H
trigger1 = parent, hitcount + parent, var(14) = [1,33]
value = 0.66 - 0.02*(parent, hitcount + parent, var(14))

[State 338, 13]
type = Attackmulset
trigger1 = parent, ishelper
trigger1 = enemy, movetype = H
trigger1 = root, var(15) = [1,33]
value = 0.66 - 0.02*(root, var(15))

[State 338, 14]
type = HitDef
trigger1 = anim = [326,327]
attr = A, NA
hitflag = MAF
affectteam = B
animtype = Hard
damage = 70/((parent,ishelper)+1),5/((parent,ishelper)+1)
pausetime = 0,(10/((root,var(40)!=0)+1))*(parent,ishelper=0)
sparkno = -1
guard.sparkno = -1
sparkxy = 30,-20
hitsound = S5,2
guardsound = S5,8
ground.type = High
ground.slidetime = 20
ground.hittime = 25
ground.velocity = -4,-6
air.velocity = -4,-6
guard.velocity = -10
p2stateno = 321
fall = 1
fall.recover = 0
palfx.time = 72
palfx.add = 50,-80,-150
palfx.sinadd = 40,40,40,15
palfx.color = 0
persistent = 0

[State 338, 15]
type = Parentvaradd
trigger1 = movehit
var(14) = 1
persistent = 0
ignorehitpause = 1

[State 338, 16]
type = Changeanim
trigger1 = anim = 325
trigger1 = animtime = 0
value = ifelse(pos y = 0, 326, 327)

[State 338, 17]
type = Destroyself
trigger1 = anim = [326,327]
trigger1 = animtime = 0

;---------------------------------------------------------------------------
; Hook Shot
[Statedef 340]
type = S
movetype = A
physics = S
anim = 340
velset = 0,0
ctrl = 0
poweradd = 70
sprpriority = 2
hitcountpersist = (enemy, movetype = H)

[State 340, 1]
type = Helper
trigger1 = animelem = 3
name = "Hook"
ID = 345
pos = 10,-71
postype = p1
stateno = 345
ownpal = 1

[State 340, 2]
type = Changestate
trigger1 = ishelper = 0
trigger1 = numhelper(345) > 0
trigger1 = helper(345), movehit
value = 341

[State 340, 3]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 3
value = 2,random/250

[State 340, 4]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 3
value = 340,0

[State 340, 5]
type = Changeanim
trigger1 = ishelper
trigger1 = time < 11+25*(parent,var(41)-3)
value = anim
elem = 1

[State 340, 6]
type = Assertspecial
trigger1 = ishelper
flag = invisible

[State 340, 7]
type = Nothitby
trigger1 = ishelper
value = SCA

[State 340, 8]
type = Screenbound
trigger1 = ishelper
movecamera = 0,0

[State 340, 9]
type = Destroyself
triggerall = ishelper
trigger1 = animtime = 0
trigger2 = parent, var(40) = 0

[State 340, 10]
type = Changestate
trigger1 = animtime = 0
trigger2 = var(51) != 0
trigger2 = animelemtime(animelemno(0)+1) = 0
trigger2 = animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1) - ifelse(animelemtime(animelemno(0)+1)=0,animtime,0) > 1
trigger2 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0))-animtime)/2
value = 0
ctrl = 1

[Statedef 341]
type = S
movetype = A
physics = S
anim = 341
velset = 0,0
ctrl = 0
sprpriority = 3

[State 341, 1]
type = Explod
trigger1 = helper(345), parentdist x < -20
trigger1 = timemod = 4,3
trigger1 = time >= 39
anim = 909
pos = -floor(helper(345),parentdist x - 30),floor(helper(345),pos y + 68)
postype = p1
facing = -1
ontop = 1
ownpal = 1

[State 341, 2]
type = Changeanim
trigger1 = time >= 39 ;&& trigger1 = helper(345), parentdist x >= -20
trigger2 = helper(345), vel x = -6.67
value = 342
persistent = 0

[State 341, 3]
type = Playsnd
trigger1 = anim = 342 && animelem = 2
value = 5000,6
persistent = 0

[State 341, 4]
type = Destroyself
trigger1 = ishelper

[State 341, 5]
type = Changestate
trigger1 = time >= 40 && helper(345), parentdist x >= -20
trigger2 = enemy(0), prevstateno = 347
trigger2 = enemy(0), stateno != 347
trigger2 = enemy(0), time = 0
trigger3 = numenemy > 1
trigger3 = enemy(1), prevstateno = 347
trigger3 = enemy(1), stateno != 347
trigger3 = enemy(1), time = 0
value = 0
ctrl = 1
ignorehitpause = 1

[Statedef 345]
type = A
movetype = A
physics = N
anim = 345
velset = 6.67,0
sprpriority = 4

[State 345, 1]
type = Attackmulset
trigger1 = parent, ishelper = 0
trigger1 = enemy, movetype != H
trigger2 = parent, hitcount + parent, var(14) = 0
value = 1

[State 345, 2]
type = Attackmulset
trigger1 = parent, ishelper
trigger1 = enemy, movetype != H
trigger2 = root, var(15) = 0
value = 1

[State 345, 3]
type = Attackmulset
trigger1 = parent, ishelper = 0
trigger1 = enemy, movetype = H
trigger1 = parent, hitcount + parent, var(14) = [1,33]
value = 0.66 - 0.02*(parent, hitcount + parent, var(14))

[State 345, 4]
type = Attackmulset
trigger1 = parent, ishelper
trigger1 = enemy, movetype = H
trigger1 = root, var(15) = [1,33]
value = 0.66 - 0.02*(root, var(15))

[State 345, 5]
type = HitDef
trigger1 = parent, stateno = 340
trigger1 = parent, ishelper = 0
attr = A, NA
hitflag = MAF
guardflag = MA
animtype = Hard
damage = 30,3
pausetime = 0,40
guard.pausetime = 0,15
sparkno = S900
guard.sparkno = S906
sparkxy = 12,0
hitsound = S340,1
guardsound = S5,8
p2stateno = 347

[State 345, 6]
type = HitDef
trigger1 = parent, stateno != 340
trigger2 = parent, ishelper
attr = A, NA
hitflag = MAF
guardflag = MA
animtype = Hard
damage = 15,2
pausetime = 0,(8/((root,var(40)!=0)+1))*(parent,ishelper=0)
sparkno = S900
guard.sparkno = S906
sparkxy = 12,0
hitsound = S340,1
guardsound = S5,8
ground.type = High
ground.slidetime = 18
ground.hittime = 20
ground.velocity = -4
air.velocity = -4, -6
p1stateno = 349

[State 345, 7]
type = null;Parentvaradd
trigger1 = movehit
var(14) = 1
persistent = 0

[State 345, 8]
type = Changestate
trigger1 = movehit
trigger1 = parent, stateno = [340,341]
value = 346

[State 345, 9]
type = Changestate
trigger1 = moveguarded
value = 349

[State 345, 10]
type = Destroyself
trigger1 = time = 80

[Statedef 346]
type = A
movetype = A
physics = N
anim = 346
velset = 0,0
sprpriority = 4

[State 346, 1]
type = Targetbind
trigger1 = anim != 344
pos = 35,72
ignorehitpause = 1

[State 346, 2]
type = Velset
trigger1 = time = 40
x = -6.67

[State 346, 3]
type = Velset
trigger1 = parentdist X > -26
x = 0

[State 346, 4]
type = Posadd
trigger1 = Vel X = 0 && parentdist X >= -25
x = parentdist X + 20

[State 346, 5]
type = Posset
trigger1 = ifelse(facing=1,pos x>110,pos x<-110)
x = ifelse(facing=1,110,-110)
ignorehitpause = 1

[State 346, 6]
type = Explod
trigger1 = time = 0
ID = 1
anim = 347
sprpriority = 3
shadow = -1,255,255
ownpal = 1

[State 346, 7]
type = Explod
trigger1 = time = 0
trigger1 = parentdist x < -20
ID = 2
anim = 347
pos = -20,0
postype = p1
sprpriority = 3
shadow = -1,255,255
ownpal = 1

[State 346, 8]
type = Explod
trigger1 = time = 0
trigger1 = parentdist x < -40
ID = 3
anim = 347
pos = -40,0
postype = p1
sprpriority = 3
shadow = -1,255,255
ownpal = 1

[State 346, 9]
type = Explod
trigger1 = time = 0
trigger1 = parentdist x < -60
ID = 4
anim = 347
pos = -60,0
postype = p1
sprpriority = 3
shadow = -1,255,255
ownpal = 1

[State 346, 10]
type = Explod
trigger1 = time = 0
trigger1 = parentdist x < -80
ID = 5
anim = 347
pos = -80,0
postype = p1
sprpriority = 3
shadow = -1,255,255
ownpal = 1

[State 346, 11]
type = Explod
trigger1 = time = 0
trigger1 = parentdist x < -100
ID = 6
anim = 347
pos = -100,0
postype = p1
sprpriority = 3
shadow = -1,255,255
ownpal = 1

[State 346, 12]
type = Explod
trigger1 = time = 0
trigger1 = parentdist x < -120
ID = 7
anim = 347
pos = -120,0
postype = p1
sprpriority = 3
shadow = -1,255,255
ownpal = 1

[State 346, 13]
type = Explod
trigger1 = time = 0
trigger1 = parentdist x < -140
ID = 8
anim = 347
pos = -140,0
postype = p1
sprpriority = 3
shadow = -1,255,255
ownpal = 1

[State 346, 14]
type = Explod
trigger1 = time = 0
trigger1 = parentdist x < -160
ID = 9
anim = 347
pos = -160,0
postype = p1
sprpriority = 3
shadow = -1,255,255
ownpal = 1

[State 346, 15]
type = Explod
trigger1 = time = 0
trigger1 = parentdist x < -180
ID = 10
anim = 347
pos = -180,0
postype = p1
sprpriority = 3
shadow = -1,255,255
ownpal = 1

[State 346, 16]
type = Explod
trigger1 = time = 0
trigger1 = parentdist x < -200
ID = 11
anim = 347
pos = -200,0
postype = p1
sprpriority = 3
shadow = -1,255,255
ownpal = 1

[State 346, 17]
type = Explod
trigger1 = time = 0
trigger1 = parentdist x < -220
ID = 12
anim = 347
pos = -220,0
postype = p1
sprpriority = 3
shadow = -1,255,255
ownpal = 1

[State 346, 18]
type = Explod
trigger1 = time = 0
trigger1 = parentdist x < -240
ID = 13
anim = 347
pos = -240,0
postype = p1
sprpriority = 3
shadow = -1,255,255
ownpal = 1

[State 346, 19]
type = Removeexplod
trigger1 = time > 40
ID = time/3 - 13

[State 346, 20]
type = Removeexplod
trigger1 = parent, stateno != [340,341]

[State 346, 21]
type = Changeanim
trigger1 = target, stateno = 348
value = 344
persistent = 0

[State 346, 22]
type = Destroyself
trigger1 = numtarget = 0
trigger2 = target, stateno = [5100,5110]
trigger3 = parent, movetype = H

[Statedef 349]
type = A
movetype = I
physics = N
velset = 0,0
sprpriority = 3

[State 349, 1]
type = Changeanim
trigger1 = time = 0
value = 349
elem = animelemno(0)*11 - 10

[State 349, 2]
type = Destroyself
trigger1 = time = 18

[Statedef 347]
type = S
movetype = H
physics = N
velset = 0,0

[State 347, 1]
type = Playerpush
trigger1 = time >= 0
value = 0

[State 347, 2]
type = Changeanim2
trigger1 = time = 0
value = 348

[State 347, 3]
type = Changestate
;trigger1 = abs(P2dist X) = 55 && time >= 40
trigger1 = vel x = 0 && time >= 40
value = 348

[Statedef 348]
type = S
movetype = H
physics = N
velset = 0,0

[State 348, 1]
type = Hitfallset
trigger1 = time = 0
value = 0

[State 348, 2]
type = Posset
trigger1 = time = 1
y = 0

[State 348, 3]
type = Changeanim
trigger1 = time = 0
value = 5300

[State 348, 4]
type = Selfstate
trigger1 = time = 75
value = ifelse(life > 0, 0, 5050)
ctrl = 1

;--------------------------------------------------------------------------
; Fire Staff
[Statedef 350]
type = S
movetype = A
physics = S
anim = 350
velset = 0,0
ctrl = 0
poweradd = 70
sprpriority = 2
hitcountpersist = (enemy, movetype = H)

[State 350, 1]
type = Parentvaradd
trigger1 = ishelper
trigger1 = var(14) = 1
var(15) = 1
persistent = 0

[State 350, 2]
type = Parentvaradd
trigger1 = ishelper
trigger1 = var(14) = 2
var(15) = 1
persistent = 0

[State 350, 3]
type = Parentvaradd
trigger1 = ishelper
trigger1 = var(14) = 3
var(15) = 1
persistent = 0

[State 350, 4]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 5
value = 350,0

[State 350, 5]
type = Explod
trigger1 = ishelper = 0
trigger1 = animelem = 5
anim = 351
bindtime = -1
sprpriority = 6
ownpal = 1
removeongethit = 1

[State 350, 6]
type = Helper
trigger1 = animelem = 8,=3
name = "Fire shoot"
ID = 355
stateno = 355
ownpal = 1

[State 350, 7]
type = Changeanim
trigger1 = ishelper
trigger1 = time < 11+25*(parent,var(41)-3)
value = anim
elem = 1

[State 350, 8]
type = Assertspecial
trigger1 = ishelper
flag = invisible

[State 350, 9]
type = Nothitby
trigger1 = ishelper
value = SCA

[State 350, 10]
type = Screenbound
trigger1 = ishelper
movecamera = 0,0

[State 350, 11]
type = Destroyself
triggerall = ishelper
trigger1 = animtime = 0
trigger2 = parent, var(40) = 0

[State 350, 12]
type = Changestate
trigger1 = animtime = 0
trigger2 = var(51) != 0
trigger2 = animelemtime(animelemno(0)+1) = 0
trigger2 = animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1) - ifelse(animelemtime(animelemno(0)+1)=0,animtime,0) > 1
trigger2 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0))-animtime)/2
value = 0
ctrl = 1

[Statedef 355]
type = S
movetype = A
physics = S
anim = 355
velset = 0,0
sprpriority = 3

[State 355, 1]
type = Bindtoparent
trigger1 = anim != 344

[State 355, 2]
type = Playsnd
trigger1 = animelem = 1
trigger2 = animelem = 12
trigger3 = animelem = 23
value = 355,0

[State 355, 3]
type = Attackmulset
trigger1 = parent, ishelper = 0
trigger1 = enemy, movetype != H
trigger2 = parent, hitcount + parent, var(14) = 0
value = 1

[State 355, 4]
type = Attackmulset
trigger1 = parent, ishelper
trigger1 = enemy, movetype != H
trigger2 = root, var(15) = 0
value = 1

[State 355, 5]
type = Attackmulset
trigger1 = parent, ishelper = 0
trigger1 = enemy, movetype = H
trigger1 = parent, hitcount + parent, var(14) = [1,33]
value = 0.66 - 0.02*(parent, hitcount + parent, var(14))

[State 355, 6]
type = Attackmulset
trigger1 = parent, ishelper
trigger1 = enemy, movetype = H
trigger1 = root, var(15) = [1,33]
value = 0.66 - 0.02*(root, var(15))

[State 355, 7]
type = HitDef
trigger1 = animelem = 1
trigger2 = animelem = 12
attr = A, NA
hitflag = MAFP
guardflag = MA
animtype = Medium
damage = 40/((parent,ishelper)+1),4/((parent,ishelper)+1)
pausetime = 0,(6/((root,var(40)!=0)+1))*(parent,ishelper=0)
sparkno = -1
guard.sparkno = -1
sparkxy = 0,0
hitsound = S5,1
guardsound = S5,8
ground.type = Low
ground.slidetime = 18
ground.hittime = 20
ground.velocity = 0,-15
air.velocity = 0,-15
guard.velocity = -4
airguard.velocity = -2, -4
p2stateno = 358
palfx.time = 75
palfx.add = 100,-20,-250
palfx.sinadd = 40,40,40,15
palfx.color = 0

[State 355, 8]
type = HitDef
trigger1 = animelem = 19
attr = A, NA
hitflag = MAFP
guardflag = MA
animtype = Medium
damage = 40/((parent,ishelper)+1),4/((parent,ishelper)+1)
pausetime = 0,(6/((root,var(40)!=0)+1))*(parent,ishelper=0)
sparkno = -1
guard.sparkno = -1
sparkxy = 0,0
hitsound = S5,1
guardsound = S5,8
ground.type = Low
ground.slidetime = 18
ground.hittime = 20
ground.velocity = 0,-15
air.velocity = 0,-15
guard.velocity = -4
airguard.velocity = -2, -4
p2stateno = 359
palfx.time = 75
palfx.add = 100,-20,-250
palfx.sinadd = 40,40,40,15
palfx.color = 0

[State 355, 9]
type = Parentvaradd
trigger1 = movehit
var(14) = 1
ignorehitpause = 1

[State 355, 10]
type = Playsnd
trigger1 = movehit
value = 355,1

[State 355, 11]
type = Helper
trigger1 = numenemy = 1
trigger1 = movehit
name = "Burn"
ID = 356
stateno = 356
ownpal = 1
persistent = 0

[State 355, 12]
type = Helper
trigger1 = numenemy > 1
trigger1 = enemy(0),stateno = 358
name = "Burn"
ID = 356
stateno = 356
ownpal = 1
persistent = 0

[State 355, 13]
type = Helper
trigger1 = numenemy > 1
trigger1 = enemy(1),stateno = 358
name = "Burn"
ID = 357
stateno = 357
ownpal = 1
persistent = 0

[State 355, 14]
type = Movehitreset
trigger1 = movehit

[State 355, 15]
type = Destroyself
trigger1 = animtime = 0
trigger2 = parent, stateno != 350

[Statedef 356]
type = S
movetype = I
physics = S
anim = 356
velset = 0,0
sprpriority = -1

[State 356, 1]
type = Posset
trigger1 = anim = 356
x = enemy(0),pos x
y = enemy(0),pos y

[State 356, 2]
type = Changeanim
trigger1 = anim = 356
trigger1 = enemy(0), stateno != [358,359] 
trigger1 = enemy(0), stateno != [5100,5101]
value = 357

[State 356, 3]
type = Destroyself
trigger1 = anim = 357
trigger1 = animtime = 0

[Statedef 357]
type = S
movetype = I
physics = S
anim = 356
velset = 0,0
sprpriority = -1

[State 357, 1]
type = Posset
trigger1 = anim = 356
x = enemy(1),pos x
y = enemy(1),pos y

[State 357, 2]
type = Changeanim
trigger1 = anim = 356
trigger1 = enemy(1), stateno != [358,359]
trigger1 = enemy(1), stateno != [5100,5101]
value = 357

[State 357, 3]
type = Destroyself
trigger1 = anim = 357
trigger1 = animtime = 0

[Statedef 358]
type = A
movetype = H
physics = N
velset = 0,-9

[State 358, 1]
type = Veladd
trigger1 = time >= 0
y = 0.45

[State 358, 2]
type = Changeanim
trigger1 = time = 0
value = 5012

[State 358, 3]
type = Changeanim
trigger1 = selfanimexist(5061)
trigger1 = anim = 5012 && animtime = 0
value = 5061

[State 358, 4]
type = Changeanim2
trigger1 = selfanimexist(5061) = 0
trigger1 = anim = 5012 && animtime = 0
value = 358

[State 358, 5]
type = Selfstate
trigger1 = pos y > 0
value = 5100

[Statedef 359]
type = A
movetype = H
physics = N
velset = 0,-9

[State 359, 1]
type = Veladd
trigger1 = time >= 0
y = 0.45

[State 359, 2]
type = Changeanim
trigger1 = time = 0
value = 5012

[State 359, 3]
type = Changeanim
trigger1 = selfanimexist(5061)
trigger1 = anim = 5012 && animtime = 0
value = 5061

[State 359, 4]
type = Changeanim2
trigger1 = selfanimexist(5061) = 0
trigger1 = anim = 5012 && animtime = 0
value = 358

[State 359, 5]
type = Selfstate
trigger1 = alive
trigger1 = time > 20
trigger1 = command = "recovery"
value = 5210

[State 359, 6]
type = Selfstate
trigger1 = pos y > 0
value = 5100

;--------------------------------------------------------------------------
; Ice Staff
[Statedef 360]
type = S
movetype = A
physics = S
anim = 360
velset = 0,0
ctrl = 0
poweradd = 70
sprpriority = 2
hitcountpersist = (enemy, movetype = H)

[State 360, 1]
type = Explod
trigger1 = ishelper = 0
trigger1 = animelem = 5
anim = 361
bindtime = -1
sprpriority = 6
ownpal = 1
removeongethit = 1

[State 360, 2]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 5
value = 350,0

[State 360, 3]
type = Helper
trigger1 = animelem = 8,=3
name = "Ice shoot"
ID = 365
pos = -20,0
postype = p1
stateno = 365
ownpal = 1

[State 360, 4]
type = Changeanim
trigger1 = ishelper
trigger1 = time < 11+25*(parent,var(41)-3)
value = anim
elem = 1

[State 360, 5]
type = Assertspecial
trigger1 = ishelper
flag = invisible

[State 360, 6]
type = Nothitby
trigger1 = ishelper
value = SCA

[State 360, 7]
type = Screenbound
trigger1 = ishelper
movecamera = 0,0

[State 360, 8]
type = Destroyself
triggerall = ishelper
trigger1 = animtime = 0
trigger2 = parent, var(40) = 0

[State 360, 9]
type = Changestate
trigger1 = animtime = 0
trigger2 = var(51) != 0
trigger2 = animelemtime(animelemno(0)+1) = 0
trigger2 = animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1) - ifelse(animelemtime(animelemno(0)+1)=0,animtime,0) > 1
trigger2 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0))-animtime)/2
value = 0
ctrl = 1

[Statedef 365]
type = S
movetype = A
physics = S
anim = 365
velset = 0,0
sprpriority = 2

[State 365, 1]
type = Bindtoparent
trigger1 = anim != 344
pos = -20,0

[State 365, 2]
type = Playsnd
trigger1 = animelem = 1
value = 365,0

[State 365, 3]
type = HitDef
trigger1 = animelem = 1
trigger1 = p2stateno != 368
attr = A, NA
hitflag = MAFP
guardflag = MA
animtype = Medium
damage = 0
pausetime = 0,8
sparkno = -1
guard.sparkno = -1
sparkxy = 12,0
hitsound = S365,1
guardsound = S5,8
p2stateno = 368

[State 365, 4]
type = Helper
trigger1 = numenemy = 1
trigger1 = movehit
name = "Ice block"
ID = 366
stateno = 366
ownpal = 1
persistent = 0

[State 365, 5]
type = Helper
trigger1 = numenemy > 1
trigger1 = enemy(0),stateno = 368
name = "Ice block"
ID = 366
stateno = 366
ownpal = 1
persistent = 0

[State 365, 6]
type = Helper
trigger1 = numenemy > 1
trigger1 = enemy(1),stateno = 368
name = "Ice block"
ID = 367
stateno = 367
ownpal = 1
persistent = 0

[State 365, 7]
type = Changeanim
trigger1 = anim = 365 && animtime = 0
value = 344

[State 365, 8]
type = Destroyself
trigger1 = anim = 344
trigger1 = numtarget = 0
trigger2 = anim = 365
trigger2 = parent, stateno != 360

[Statedef 366]
type = S
movetype = A
physics = S
anim = 366
velset = 0,0
sprpriority = 5

[State 366, 1]
type = Playsnd
trigger1 = anim = 367
value = 365,2
persistent = 0

[State 365, 2]
type = Posset
trigger1 = anim = 366
x = enemy(0),pos x
y = enemy(0),pos y

[State 366, 3]
type = Changeanim
trigger1 = enemy(0), stateno != 368
value = 367
persistent = 0

[State 366, 4]
type = Destroyself
trigger1 = anim = 367
trigger1 = animtime = 0

[Statedef 367]
type = S
movetype = A
physics = S
anim = 366
velset = 0,0
sprpriority = 5

[State 367, 1]
type = Playsnd
trigger1 = anim = 367
value = 365,2
persistent = 0

[State 367, 2]
type = Posset
trigger1 = anim = 366
x = enemy(1),pos x
y = enemy(1),pos y

[State 367, 3]
type = Changeanim
trigger1 = enemy(1), stateno != 368
value = 367
persistent = 0

[State 367, 4]
type = Destroyself
trigger1 = anim = 367
trigger1 = animtime = 0

[Statedef 368]
type = U
movetype = H
physics = N
velset = 0,0

[State 368, 1]
type = Posadd
trigger1 = time <= 30
trigger1 = timemod = 2,0
x = -1

[State 368, 2]
type = Posadd
trigger1 = time <= 30
trigger1 = timemod = 2,1
x = 1

[State 368, 3]
type = Changeanim
trigger1 = 1
value = anim
elem = animelemno(0)

[State 368, 4]
type = Palfx
trigger1 = 1
time = 1
add = 96,176,192
mul = 160,160,160
color = 0

[State 368, 5]
type = Selfstate
trigger1 = time >= 150
value = ifelse(statetype=S||statetype=C,0,5050)
ctrl = 1

;--------------------------------------------------------------------------
; High Parry
[Statedef 500]
type = S
movetype = I
physics = S
anim = 500
velset = 0,0
ctrl = 0
sprpriority = 5

[State 500, 1]
type = Nothitby
trigger1 = 1
value = SCA

[State 500, 2]
type = Palfx
trigger1 = time <= 8
trigger1 = timemod = 2,1
time = 1
add = 30,60,120
color = 0

[State 500, 3]
type = Explod
trigger1 = animelem = 2
anim = 505
pos = 15,-85
postype = p1
pausemovetime = 20
sprpriority = 6
ownpal = 1
persistent = 0

[State 500, 4]
type = Playsnd
trigger1 = time = 0
value = 500,0
volume = 200

[State 500, 5]
type = Pause
;trigger1 = var(1) = 1
trigger1 = animelem = 2
time = 12
movetime = 12

[State 500, 6]
type = Changestate
trigger1 = animtime = 0
value = 0
ctrl = 1
ignorehitpause = 1

;--------------------------------------------------------------------------
; Low Parry
[Statedef 501]
type = C
movetype = I
physics = C
anim = 501
velset = 0,0
ctrl = 0
sprpriority = 5

[State 501, 1]
type = Nothitby
trigger1 = 1
value = SCA

[State 501, 2]
type = Palfx
trigger1 = time <= 8
trigger1 = timemod = 2,1
time = 1
add = 30,60,120
color = 0

[State 501, 3]
type = Explod
trigger1 = animelem = 2
anim = 505
pos = 25,-40
postype = p1
pausemovetime = 20
sprpriority = 6
ownpal = 1
persistent = 0

[State 501, 4]
type = Playsnd
trigger1 = time = 0
value = 500,0
volume = 200

[State 501, 5]
type = Pause
trigger1 = animelem = 2
time = 12
movetime = 12

[State 501, 6]
type = Changestate
trigger1 = animtime = 0
value = 11
ctrl = 1
ignorehitpause = 1

;--------------------------------------------------------------------------
; Roll forward
[Statedef 510]
type = C
movetype = I
physics = N
anim = 510
velset = 0,0
ctrl = 0
sprpriority = 2

[State 510, 1]
type = Nothitby
trigger1 = animelem = 1
value = SCA

[State 510, 2]
type = Playerpush
trigger1 = 1
value = 0

[State 510, 3]
type = Velset
trigger1 = animelem = 1
x = 6

[State 510, 4]
type = Statetypeset
trigger1 = animelem = 7
physics = S

[State 510, 5]
type = Changestate
trigger1 = animtime = 0
trigger2 = var(51) != 0
trigger2 = animelemtime(animelemno(0)+1) = 0
trigger2 = animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1) - ifelse(animelemtime(animelemno(0)+1)=0,animtime,0) > 1
trigger2 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0))-animtime)/2
value = 11
ctrl = 1

; Roll back
[Statedef 511]
type = C
movetype = I
physics = N
anim = 511
velset = 0,0
ctrl = 0
sprpriority = 2

[State 511, 1]
type = Nothitby
trigger1 = animelem = 1
value = SCA

[State 511, 2]
type = Playerpush
trigger1 = 1
value = 0

[State 511, 3]
type = Velset
trigger1 = animelem = 1
x = -6

[State 511, 4]
type = Statetypeset
trigger1 = animelem = 7
physics = S

[State 511, 5]
type = Changestate
trigger1 = animtime = 0
trigger2 = var(51) != 0
trigger2 = animelemtime(animelemno(0)+1) = 0
trigger2 = animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1) - ifelse(animelemtime(animelemno(0)+1)=0,animtime,0) > 1
trigger2 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0))-animtime)/2
value = 11
ctrl = 1

;---------------------------------------------------------------------------
; Impalor
[Statedef 520]
type = C
movetype = A
physics = S
anim = 520
velset = 0,0
ctrl = 0
sprpriority = 2

[State 520, 1]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 6
value = 0,2+random/500

[State 520, 2]
type = HitDef
trigger1 = animelem = 9
attr = C, NA
hitflag = FD
animtype = Hard
damage = 40
pausetime = (12/((var(40)!=0)+1))*(ishelper=0),(10/((var(40)!=0)+1))*(ishelper=0)
sparkno = S900
guard.sparkno = S906
sparkxy = -10,-8
hitsound = S5,3
guardsound = S5,8

[State 520, 3]
type = Changeanim
trigger1 = ishelper
trigger1 = time < 11+25*(parent,var(41)-3)
value = anim
elem = 1

[State 520, 4]
type = Assertspecial
trigger1 = ishelper
flag = invisible

[State 520, 5]
type = Nothitby
trigger1 = ishelper
value = SCA

[State 520, 6]
type = Screenbound
trigger1 = ishelper
movecamera = 0,0

[State 520, 7]
type = Destroyself
triggerall = ishelper
trigger1 = animtime = 0
trigger2 = parent, var(40) = 0

[State 520, 8]
type = Changestate
trigger1 = animtime = 0
trigger2 = var(51) != 0
trigger2 = animelemtime(animelemno(0)+1) = 0
trigger2 = animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1) - ifelse(animelemtime(animelemno(0)+1)=0,animtime,0) > 1
trigger2 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0))-animtime)/2
value = 11
ctrl = 1

;---------------------------------------------------------------------------
; Kokiri Shot X
[Statedef 1000]
type = S
movetype = A
physics = S
anim = 1000
velset = 0,0
ctrl = 0
poweradd = 75
sprpriority = 2
hitcountpersist = (enemy, movetype = H)

[State 1000, 1]
type = Explod
trigger1 = ishelper = 0
trigger1 = time = 5
anim = 1007
sprpriority = 6
ownpal = 1

[State 1000, 2]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 3
value = 2,random/250

[State 1000, 3]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 4
value = 1000,0

[State 1000, 4]
type = Helper
trigger1 = ishelper = 0
trigger1 = animelem = 4
name = "dust"
pos = 15,0
postype = p1
stateno = 1001
ownpal = 1

[State 1000, 5]
type = Projectile
trigger1 = animelem = 4
projID = 1000+(ishelper)
projanim = 1005
projhitanim = 1006
velocity = 4
offset = 50,-64
attr = S, SP
hitflag = MAF
guardflag = MA
animtype = Hard
air.animtype = Back
damage = 0,7
pausetime = 0,(10/((var(40)!=0)+1))*(ishelper=0)
sparkno = -1
guard.sparkno = -1
hitsound = S1000,1
guardsound = S5,8
ground.type = High
ground.slidetime = 18
ground.hittime = 20
ground.velocity = -3, -5.5
air.type = High
air.hittime = 20
air.velocity = -3,-6
guard.velocity = -4
airguard.velocity = -2, -4
palfx.time = 50
palfx.add = -20,-100,-20
palfx.sinadd = -30,-30,-30,12
palfx.color = 0

[State 1000, 6]
type = Changeanim
trigger1 = ishelper
trigger1 = time < 11+25*(parent,var(41)-3)
value = anim
elem = 1

[State 1000, 7]
type = Assertspecial
trigger1 = ishelper
flag = invisible

[State 1000, 8]
type = Nothitby
trigger1 = ishelper
value = SCA

[State 1000, 9]
type = Screenbound
trigger1 = ishelper
movecamera = 0,0

[State 1000, 10]
type = Destroyself
triggerall = ishelper
trigger1 = animtime = 0
trigger2 = parent, var(40) = 0

[State 1000, 11]
type = Changestate
trigger1 = animtime = 0
trigger2 = var(51) != 0
trigger2 = animelemtime(animelemno(0)+1) = 0
trigger2 = animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1) - ifelse(animelemtime(animelemno(0)+1)=0,animtime,0) > 1
trigger2 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0))-animtime)/2
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Kokiri Shot Y
[Statedef 1010]
type = S
movetype = A
physics = S
anim = 1000
velset = 0,0
ctrl = 0
poweradd = 75
sprpriority = 2
hitcountpersist = (enemy, movetype = H)

[State 1010, 1]
type = Explod
trigger1 = ishelper = 0
trigger1 = time = 5
anim = 1007
sprpriority = 6
ownpal = 1

[State 1010, 2]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 3
value = 2,random/250

[State 1010, 3]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 4
value = 1000,0

[State 1010, 4]
type = Helper
trigger1 = ishelper = 0
trigger1 = animelem = 4
name = "dust"
pos = 15,0
postype = p1
stateno = 1001
ownpal = 1

[State 1010, 5]
type = Projectile
trigger1 = animelem = 4
projID = 1000+(ishelper)
projanim = 1005
projhitanim = 1006
velocity = 5.5
offset = 50, -64
attr = S, SP
hitflag = MAF
guardflag = MA
animtype = Hard
air.animtype = Back
damage = 0,7
pausetime = 0,(10/((var(40)!=0)+1))*(ishelper=0)
sparkno = -1
guard.sparkno = -1
hitsound = S1000,1
guardsound = S5,8
ground.type = High
ground.slidetime = 18
ground.hittime = 20
ground.velocity = -3, -5.5
air.type = High
air.hittime = 20
air.velocity = -3,-6
guard.velocity = -4
airguard.velocity = -2, -4
palfx.time = 50
palfx.add = -20,-100,-20
palfx.sinadd = -30,-30,-30,12
palfx.color = 0

[State 1010, 6]
type = Changeanim
trigger1 = ishelper
trigger1 = time < 11+25*(parent,var(41)-3)
value = anim
elem = 1

[State 1010, 7]
type = Assertspecial
trigger1 = ishelper
flag = invisible

[State 1010, 8]
type = Nothitby
trigger1 = ishelper
value = SCA

[State 1010, 9]
type = Screenbound
trigger1 = ishelper
movecamera = 0,0

[State 1010, 10]
type = Destroyself
triggerall = ishelper
trigger1 = animtime = 0
trigger2 = parent, var(40) = 0

[State 1010, 11]
type = Changestate
trigger1 = animtime = 0
trigger2 = var(51) != 0
trigger2 = animelemtime(animelemno(0)+1) = 0
trigger2 = animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1) - ifelse(animelemtime(animelemno(0)+1)=0,animtime,0) > 1
trigger2 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0))-animtime)/2
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Kokiri Shot Z
[Statedef 1020]
type = S
movetype = A
physics = S
anim = 1000
velset = 0,0
ctrl = 0
poweradd = 75
sprpriority = 2
hitcountpersist = (enemy, movetype = H)

[State 1020, 1]
type = Explod
trigger1 = ishelper = 0
trigger1 = time = 5
anim = 1007
sprpriority = 6
ownpal = 1

[State 1020, 2]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 3
value = 2,random/250

[State 1020, 3]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 4
value = 1000,0

[State 1020, 4]
type = Helper
trigger1 = ishelper = 0
trigger1 = animelem = 4
name = "dust"
pos = 15,0
postype = p1
stateno = 1001
ownpal = 1

[State 1020, 5]
type = Projectile
trigger1 = animelem = 4
projID = 1000+(ishelper)
projanim = 1005
projhitanim = 1006
velocity = 7
offset = 50, -64
attr = S, SP
hitflag = MAF
guardflag = MA
animtype = Hard
air.animtype = Back
damage = 0,7
pausetime = 0,(10/((var(40)!=0)+1))*(ishelper=0)
sparkno = -1
guard.sparkno = -1
hitsound = S1000,1
guardsound = S5,8
ground.type = High
ground.slidetime = 18
ground.hittime = 20
ground.velocity = -3, -5.5
air.type = High
air.hittime = 20
air.velocity = -3,-6
guard.velocity = -4
airguard.velocity = -2, -4
palfx.time = 50
palfx.add = -20,-100,-20
palfx.sinadd = -30,-30,-30,12
palfx.color = 0

[State 1020, 6]
type = Changeanim
trigger1 = ishelper
trigger1 = time < 11+25*(parent,var(41)-3)
value = anim
elem = 1

[State 1020, 7]
type = Assertspecial
trigger1 = ishelper
flag = invisible

[State 1020, 8]
type = Nothitby
trigger1 = ishelper
value = SCA

[State 1020, 9]
type = Screenbound
trigger1 = ishelper
movecamera = 0,0

[State 1020, 10]
type = Destroyself
triggerall = ishelper
trigger1 = animtime = 0
trigger2 = parent, var(40) = 0

[State 1020, 11]
type = Changestate
trigger1 = animtime = 0
trigger2 = var(51) != 0
trigger2 = animelemtime(animelemno(0)+1) = 0
trigger2 = animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1) - ifelse(animelemtime(animelemno(0)+1)=0,animtime,0) > 1
trigger2 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0))-animtime)/2
value = 0
ctrl = 1

[Statedef 1001]
type = A
movetype = I
physics = N
anim = 1008
velset = 4+0.15*(parent, stateno-1000),0
sprpriority = 5

[State 1001, 1]
type = Assertspecial
trigger1 = 1
flag = noshadow

[State 1001, 2]
type = Changeanim
trigger1 = parent, numprojID(1000) = 0
value = 1009
persistent = 0

[State 1001, 3]
type = Velset
trigger1 = anim = 1009
x = vel x/4
persistent = 0

[State 1001, 4]
type = Destroyself
trigger1 = time = 150
trigger2 = anim = 1009 && animtime = 0

;---------------------------------------------------------------------------
; Teleport X
[Statedef 1100]
type = S
movetype = I
physics = N
anim = 1100
velset = 0,0
ctrl = 0
poweradd = 50
sprpriority = 2
hitcountpersist = (enemy, movetype = H)

[State 1100, 1]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 3
value = 1100,0

[State 1100, 2]
type = Statetypeset
trigger1 = animelem = 2
statetype = A

[State 1100, 3]
type = AfterImage
trigger1 = var(8) = 0
trigger1 = time = 0
time = 100
length = 15
palcolor = 0
palbright = 0,0,0
palcontrast = 256,256,256
palpostbright = 70,0,90
paladd = 0,0,0
palmul = .8,.8,.8
timeGap = 1
frameGap = 3
trans = none

[State 1100, 4]
type = Playerpush
trigger1 = time >= 8
value = 0

[State 1100, 5]
type = NotHitBy
trigger1 = time >= 8
value = SCA

[State 1100, 6]
type = Veladd
trigger1 = time = [5,8]
y = -0.9

[State 1100, 7]
type = Velset
trigger1 = time = 9
y = 0

[State 1100, 8]
type = Velset
trigger1 = time = 10
x = -10.5*((var(51)!=0)+1)

[State 1100, 9]
type = Velset
trigger1 = ifelse(facing=1,pos x<=-135,pos x>=135)
x = 0

[State 1100, 10]
type = Changestate
trigger1 = vel x = 0
trigger1 = time > 20
value = 1101

[Statedef 1101]
type = A
movetype = I
physics = N
anim = 1101
ctrl = 0
sprpriority = 2
hitcountpersist = (enemy, movetype = H)

[State 1101, 1]
type = NotHitBy
trigger1 = time >= 0
value = SCA

[State 1101, 2]
type = Afterimagetime
trigger1 = time = 0
time = 7

[State 1101, 3]
type = Veladd
trigger1 = time >= 2
y = 0.9

[State 1100, 4]
type = AfterImage
trigger1 = var(40) != 0
trigger1 = time = 5
time = 330
length = 6
palcolor = 0
palbright = 0,0,0
palcontrast = 256,256,256
palpostbright = 56,0,72
timeGap = 1
frameGap = 5
trans = none

[State 1101, 5]
type = Changestate
trigger1 = pos y >= -0.1
value = 52

;---------------------------------------------------------------------------
; Teleport Y
[Statedef 1110]
type = S
movetype = I
physics = N
anim = 1100
velset = 0,0
ctrl = 0
poweradd = 50
sprpriority = 2
hitcountpersist = (enemy, movetype = H)

[State 1110, 1]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 3
value = 1100,0

[State 1110, 2]
type = Statetypeset
trigger1 = animelem = 2
statetype = A

[State 1110, 3]
type = AfterImage
trigger1 = var(8) = 0
trigger1 = time = 0
time = 100
length = 15
palcolor = 0
palbright = 0,0,0
palcontrast = 256,256,256
palpostbright = 70,0,90
paladd = 0,0,0
palmul = .8,.8,.8
timeGap = 1
frameGap = 3
trans = none

[State 1110, 4]
type = Playerpush
trigger1 = time >= 8
value = 0

[State 1110, 5]
type = NotHitBy
trigger1 = time >= 8
value = SCA

[State 1110, 6]
type = Veladd
trigger1 = time = [5,8]
y = -0.9

[State 1110, 7]
type = Velset
trigger1 = time = 9
y = 0

[State 1110, 8]
type = Velset
trigger1 = time = 10
x = 10.5*((var(51)!=0)+1)

[State 1110, 9]
type = Velset
trigger1 = P2bodydist x <= 20
x = 0

[State 1110, 10]
type = Changestate
trigger1 = vel x = 0
trigger1 = time > 20
value = 1111

[Statedef 1111]
type = A
movetype = I
physics = N
anim = 1101
ctrl = 0
sprpriority = 2
hitcountpersist = (enemy, movetype = H)

[State 1111, 1]
type = NotHitBy
trigger1 = time <= 5
value = SCA

[State 1111, 2]
type = Afterimagetime
trigger1 = time = 0
time = 7

[State 1111, 3]
type = Veladd
trigger1 = time >= 2
y = 0.9

[State 1100, 4]
type = AfterImage
trigger1 = var(40) != 0
trigger1 = time = 5
time = 330
length = 6
palcolor = 0
palbright = 0,0,0
palcontrast = 256,256,256
palpostbright = 56,0,72
timeGap = 1
frameGap = 5
trans = none

[State 1111, 5]
type = Changestate
trigger1 = pos y >= -0.1
value = 52

;---------------------------------------------------------------------------
; Teleport Z
[Statedef 1120]
type = S
movetype = I
physics = N
anim = 1100
velset = 0,0
ctrl = 0
poweradd = 50
sprpriority = 2
hitcountpersist = (enemy, movetype = H)

[State 1120, 1]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 3
value = 1100,0

[State 1120, 2]
type = Statetypeset
trigger1 = animelem = 2
statetype = A

[State 1120, 3]
type = AfterImage
trigger1 = var(8) = 0
trigger1 = time = 0
time = 100
length = 15
palcolor = 0
palbright = 0,0,0
palcontrast = 256,256,256
palpostbright = 70,0,90
paladd = 0,0,0
palmul = .8,.8,.8
timeGap = 1
frameGap = 3
trans = none

[State 1120, 4]
type = Playerpush
trigger1 = time >= 8
value = 0

[State 1120, 5]
type = Varset
trigger1 = time = 0
var(12) = facing

[State 1120, 6]
type = NotHitBy
trigger1 = time >= 8
value = SCA

[State 1120, 7]
type = Veladd
trigger1 = time = [5,8]
y = -0.9

[State 1120, 8]
type = Velset
trigger1 = time = 9
y = 0

[State 1120, 9]
type = Velset
trigger1 = time = 10
x = 10.5*((var(51)!=0)+1)

[State 1120, 9]
type = Turn
trigger1 = p2dist x <= 0

[State 1120, 10]
type = Velset
triggerall = command != "hold_c"
trigger1 = p2bodydist x > 10
trigger1 = facing = -var(12)
trigger2 = time > 10
trigger2 = abs(pos x) = 144
trigger3 = abs(enemynear, pos x) >= 144
trigger3 = p2bodydist x <= 20
x = 0

[State 1120, 11]
type = Velset
trigger1 = command = "hold_c"
trigger1 = abs(pos x) >= 144
trigger1 = time > 20
x = 0

[State 1120, 12]
type = Changestate
trigger1 = vel x = 0
trigger1 = time > 20
value = 1121

[Statedef 1121]
type = A
movetype = I
physics = N
anim = 1101
ctrl = 0
sprpriority = 2
hitcountpersist = (enemy, movetype = H)

[State 1121, 1]
type = NotHitBy
trigger1 = time >= 0
value = SCA

[State 1121, 2]
type = Afterimagetime
trigger1 = time = 0
time = 7

[State 1121, 3]
type = Veladd
trigger1 = time >= 2
y = 0.9

[State 1100, 4]
type = AfterImage
trigger1 = var(40) != 0
trigger1 = time = 5
time = 330
length = 6
palcolor = 0
palbright = 0,0,0
palcontrast = 256,256,256
palpostbright = 56,0,72
timeGap = 1
frameGap = 5
trans = none

[State 1121, 5]
type = Changestate
trigger1 = pos y >= -0.1
value = 52

;---------------------------------------------------------------------------
; Spin Attack X
[Statedef 1200]
type = S
movetype = A
physics = S
anim = 1200
velset = 0,0
ctrl = 0
poweradd = 80
juggle = 8
sprpriority = 2
hitcountpersist = (enemy, movetype = H)

[State 1200, 1]
type = Explod
trigger1 = ishelper = 0
trigger1 = animelem = 2
anim = 1201
sprpriority = -2
ownpal = 1

[State 1200, 2]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 2
value = 1200,random/500

[State 1200, 3]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 3
trigger2 = animelem = 9
value = 1200,2

[State 1200, 4]
type = Helper
trigger1 = var(8) = 0
trigger1 = ishelper = 0
trigger1 = animelem = 3
name = "spin fx"
stateno = 1202
ownpal = 1

[State 1200, 5]
type = HitDef
trigger1 = time >= 0
attr = S, NA
hitflag = MAF
guardflag = MA
animtype = Hard
priority = 5, hit
damage = 90/((ishelper)+1),9/((ishelper)+1)
pausetime = (6/((var(40)!=0)+1))*(ishelper=0),(6/((var(40)!=0)+1))*(ishelper=0)
sparkno = S904
guard.sparkno = S908
sparkxy = 0,-50
hitsound = S5,6
guardsound = S5,8
ground.type = High
ground.slidetime = 18
ground.hittime = 20
ground.velocity = ifelse(animelemno(0)%6=4,-6,6),-10
air.velocity = ifelse(animelemno(0)%6=4,-6,6),-10
guard.slidetime = 12
guard.hittime = 24
guard.ctrltime = 24
guard.velocity = -10

[State 1200, 6]
type = Changeanim
trigger1 = ishelper
trigger1 = time < 11+25*(parent,var(41)-3)
value = anim
elem = 1

[State 1200, 7]
type = Assertspecial
trigger1 = ishelper
flag = invisible

[State 1200, 8]
type = Nothitby
trigger1 = ishelper
value = SCA

[State 1200, 9]
type = Screenbound
trigger1 = ishelper
movecamera = 0,0

[State 1200, 10]
type = Attackmulset
triggerall = ishelper
trigger1 = enemy, movetype != H
trigger2 = parent, var(15) = 0
value = 1

[State 1200, 11]
type = Attackmulset
trigger1 = ishelper
trigger1 = enemy, movetype = H
trigger1 = parent, var(15) = [1,33]
value = 0.66 - 0.02*(parent,var(15))
persistent = 0

[State 1200, 12]
type = Parentvaradd
trigger1 = ishelper
trigger1 = movehit
var(15) = 1
persistent = 0

[State 1200, 13]
type = Destroyself
triggerall = ishelper
trigger1 = animtime = 0
trigger2 = parent, var(40) = 0

[State 1200, 14]
type = Changestate
trigger1 = animtime = 0
trigger2 = var(51) != 0
trigger2 = animelemtime(animelemno(0)+1) = 0
trigger2 = animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1) - ifelse(animelemtime(animelemno(0)+1)=0,animtime,0) > 1
trigger2 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0))-animtime)/2
value = 0
ctrl = 1

[Statedef 1202]
type = S
movetype = I
physics = S
anim = parent,stateno + 2
velset = 0,0
sprpriority = 3

[State 1202, 1]
type = Bindtoparent
trigger1 = 1

[State 1202, 2]
type = Changeanim
trigger1 = parent, hitpausetime != 0
value = anim
elem = animelemno(-1)

[State 1202, 3]
type = Sprpriority
trigger1 = ifelse(parent,stateno=1200,animelemno(0)%12=5,ifelse(parent,stateno=1210,animelemno(0)%10=4,animelemno(0)%8=3))
value = 1

[State 1202, 4]
type = Sprpriority
trigger1 = ifelse(parent,stateno=1200,animelemno(0)%12=11,ifelse(parent,stateno=1210,animelemno(0)%10=9,animelemno(0)%8=7))
value = 3

[State 1202, 5]
type = Changeanim
trigger1 = parent, var(51) != 0
trigger1 = animelemtime(animelemno(0)+1) < 0
trigger1 = animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1) - ifelse(animelemtime(animelemno(0)+1)=0,animtime,0) > 1
trigger1 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1))/2
value = anim
elem = animelemno(0)+1

[State 1202, 6]
type = Destroyself
trigger1 = animtime = 0
trigger2 = parent,stateno != [1200,1220]
trigger3 = parent, var(51) != 0
trigger3 = animelemtime(animelemno(0)+1) = 0
trigger3 = animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1) - ifelse(animelemtime(animelemno(0)+1)=0,animtime,0) > 1
trigger3 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0))-animtime)/2

;---------------------------------------------------------------------------
; Spin Attack Y
[Statedef 1210]
type = S
movetype = A
physics = N
anim = 1210
velset = 0,0
ctrl = 0
poweradd = 85
juggle = 8
sprpriority = 2
hitcountpersist = (enemy, movetype = H)

[State 1210, 1]
type = Velset
trigger1 = command = "holdback"
trigger1 = animelem = 2
trigger1 = vel x = 0
x = -2.5

[State 1210, 2]
type = Velset
trigger1 = command = "holdfwd"
trigger1 = animelem = 2
trigger1 = vel x = 0
x = 2.5

[State 1210, 3]
type = Statetypeset
trigger1 = animelem = 27
physics = S

[State 1210, 4]
type = Explod
trigger1 = ishelper = 0
trigger1 = animelem = 2
anim = 1201
sprpriority = -2
ownpal = 1

[State 1210, 5]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 2
value = 1200,random/500

[State 1210, 6]
type = Playsnd
triggerall = ishelper = 0
trigger1 = animelem = 3
trigger2 = animelem = 9
trigger3 = animelem = 15
trigger4 = animelem = 21
value = 1200,2

[State 1210, 7]
type = Helper
trigger1 = var(8) = 0
trigger1 = ishelper = 0
trigger1 = animelem = 3
name = "spin fx"
stateno = 1202
ownpal = 1

[State 1210, 8]
type = HitDef
trigger1 = time >= 0
attr = S, NA
hitflag = MAF
guardflag = MA
animtype = Hard
priority = 5, hit
damage = 32/((ishelper)+1),3/((ishelper)+1)
pausetime = (4/((var(40)!=0)+1))*(ishelper=0),(5/((var(40)!=0)+1))*(ishelper=0)
sparkno = S904
guard.sparkno = S908
sparkxy = 0,-50
hitsound = S5,4
guardsound = S5,8
ground.type = High
ground.slidetime = 14
ground.hittime = 14
ground.velocity = ifelse(animelemno(0)%6=4,-5,5)
air.velocity = ifelse(animelemno(0)%6=4,-3,3),-3

[State 1210, 9]
type = Changeanim
trigger1 = ishelper
trigger1 = time < 11+25*(parent,var(41)-3)
value = anim
elem = 1

[State 1210, 10]
type = Assertspecial
trigger1 = ishelper
flag = invisible

[State 1210, 11]
type = Nothitby
trigger1 = ishelper
value = SCA

[State 1210, 12]
type = Screenbound
trigger1 = ishelper
movecamera = 0,0

[State 1210, 13]
type = Attackmulset
triggerall = ishelper
trigger1 = enemy, movetype != H
trigger2 = parent, var(15) = 0
value = 1

[State 1210, 14]
type = Attackmulset
trigger1 = ishelper
trigger1 = enemy, movetype = H
trigger1 = parent, var(15) = [1,33]
value = 0.66 - 0.02*(parent,var(15))
persistent = 0

[State 1210, 15]
type = Varset
trigger1 = ishelper
trigger1 = parent, animelem = 2
fvar(0) = parent, vel x

[State 1210, 16]
type = Velset
trigger1 = ishelper
trigger1 = animelem = 2
x = fvar(0)

[State 1210, 17]
type = Parentvaradd
trigger1 = ishelper
trigger1 = movehit
var(15) = 1

[State 1210, 18]
type = Movehitreset
trigger1 = movehit

[State 1210, 19]
type = Destroyself
triggerall = ishelper
trigger1 = animtime = 0
trigger2 = parent, var(40) = 0

[State 1210, 20]
type = Changestate
trigger1 = animtime = 0
trigger2 = var(51) != 0
trigger2 = animelemtime(animelemno(0)+1) = 0
trigger2 = animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1) - ifelse(animelemtime(animelemno(0)+1)=0,animtime,0) > 1
trigger2 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0))-animtime)/2
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Spin Attack Z
[Statedef 1220]
type = S
movetype = A
physics = S
anim = 1220
velset = 0,0
ctrl = 0
poweradd = 90
juggle = 8
sprpriority = 2
hitcountpersist = (enemy, movetype = H)

[State 1220, 1]
type = Statetypeset
trigger1 = animelem = 3
statetype = A
physics = A

[State 1220, 2]
type = Velset
trigger1 = animelem = 3
x = ifelse(command = "holdfwd", 4.5,0)
y = -9.6

[State 1220, 3]
type = Veladd
trigger1 = vel x > 0
x = -0.15

[State 1220, 4]
type = Explod
trigger1 = ishelper = 0
trigger1 = anim = 1220
trigger1 = animelem = 3
anim = 1201
sprpriority = -2
ownpal = 1

[State 1220, 5]
type = Playsnd
trigger1 = ishelper = 0
trigger1 = animelem = 2
value = 1200,random/500

[State 1220, 6]
type = Playsnd
triggerall = ishelper = 0
trigger1 = animelem = 4
trigger2 = animelem = 10
trigger3 = animelem = 16
trigger4 = animelem = 22
value = 1200,2

[State 1220, 7]
type = Helper
trigger1 = var(8) = 0
trigger1 = ishelper = 0
trigger1 = animelem = 4
name = "spin fx"
stateno = 1202
ownpal = 1

[State 1220, 8]
type = HitDef
trigger1 = time >= 0
attr = S, NA
hitflag = MAF
guardflag = MA
animtype = Hard
priority = 5, hit
damage = 32/((ishelper)+1),3/((ishelper)+1)
pausetime = (4/((var(40)!=0)+1))*(ishelper=0),(4/((var(40)!=0)+1))*(ishelper=0)
sparkno = S904
guard.sparkno = S908
sparkxy = 0,-50
hitsound = S5,4
guardsound = S5,8
ground.type = High
ground.slidetime = 18
ground.hittime = 20
ground.velocity = ifelse(vel x=0,0,ifelse(animelemno(0)%6=5,-4,4)),-10
air.velocity = ifelse(vel x=0,0,ifelse(animelemno(0)%6=5,-4,4)),-6
fall = 1

[State 1220, 9]
type = Changeanim
trigger1 = ishelper
trigger1 = time < 11+25*(parent,var(41)-3)
value = anim
elem = 1

[State 1220, 10]
type = Assertspecial
trigger1 = ishelper
flag = invisible

[State 1220, 11]
type = Nothitby
trigger1 = ishelper
value = SCA

[State 1220, 12]
type = Screenbound
trigger1 = ishelper
movecamera = 0,0

[State 1220, 13]
type = Attackmulset
triggerall = ishelper
trigger1 = enemy, movetype != H
trigger2 = parent, var(15) = 0
value = 1

[State 1220, 14]
type = Attackmulset
trigger1 = ishelper
trigger1 = enemy, movetype = H
trigger1 = parent, var(15) = [1,33]
value = 0.66 - 0.02*(parent,var(15))
persistent = 0

[State 1220, 15]
type = Varset
trigger1 = ishelper
trigger1 = parent, animelem = 3
fvar(0) = parent, vel x

[State 1220, 16]
type = Velset
trigger1 = ishelper
trigger1 = animelem = 3
x = fvar(0)

[State 1220, 17]
type = Parentvaradd
trigger1 = ishelper
trigger1 = movehit
var(15) = 1

[State 1220, 18]
type = Movehitreset
trigger1 = movehit

[State 1220, 19]
type = Destroyself
triggerall = ishelper
trigger1 = animtime = 0
trigger2 = parent, movetype = H

;---------------------------------------------------------------------------
; Stone Mask
[Statedef 1400]
type = S
movetype = I
physics = S
anim = 1400
velset = 0,0
ctrl = 0
poweradd = 60
sprpriority = 2
hitcountpersist = (enemy, movetype = H)

[State 1400, 1]
type = Varset
trigger1 = animtime = -1
var(8) = 1

[State 1400, 2]
type = Playsnd
trigger1 = animelem = 11
value = 1400,0

[State 1400, 3]
type = Changestate
trigger1 = animtime = 0
trigger2 = var(51) != 0
trigger2 = animelemtime(animelemno(0)+1) = 0
trigger2 = animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1) - ifelse(animelemtime(animelemno(0)+1)=0,animtime,0) > 1
trigger2 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0))-animtime)/2
value = 0
ctrl = 1

[Statedef 1450]
type = S
movetype = I
physics = S
anim = 1450
velset = 0,0
ctrl = 0
sprpriority = 2
hitcountpersist = (enemy, movetype = H)

[State 1450, 1]
type = Varset
trigger1 = animelem = 1
var(8) = 0

[State 1450, 2]
type = Playsnd
trigger1 = animelem = 3
value = 1400,1

[State 1450, 3]
type = AfterImage
trigger1 = var(40) != 0
trigger1 = time = 0
time = power/9 - ifelse(var(41)=3,2,ifelse(var(41)=4,10,18))
length = ifelse(var(41)=3,6,ifelse(var(41)=4,14,22))
palcolor = 0
palbright = 0,0,0
palcontrast = 256,256,256
palpostbright = 56,0,72
timeGap = 1
frameGap = ifelse(var(41)=3,5,ifelse(var(41)=4,13,21))
trans = none

[State 1450, 4]
type = Helper
trigger1 = var(40) != 0
trigger1 = time = 0
name = "double"
ID = 3501
stateno = 3501
ownpal = 1

[State 1450, 5]
type = Helper
trigger1 = var(40) != 0
trigger1 = time = 1
name = "double"
ID = 3502
stateno = 3502
ownpal = 1

[State 1450, 6]
type = Changestate
trigger1 = animtime = 0
trigger2 = var(51) != 0
trigger2 = animelemtime(animelemno(0)+1) = 0
trigger2 = animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1) - ifelse(animelemtime(animelemno(0)+1)=0,animtime,0) > 1
trigger2 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0))-animtime)/2
value = 0
ctrl = 1

;--------------------------------------------------------------------------
; Mushu
[Statedef 1500]
type = S
movetype = I
physics = S
anim = 195
velset = 0,0
ctrl = 0
poweradd = 70
sprpriority = 2
hitcountpersist = (enemy, movetype = H)

[State 1500, 1]
type = Helper
trigger1 = animelem = 3
name = "Mushu"
ID = 1501
pos = 75,-450
postype = p2
stateno = 1501
ownpal = 1

[State 1500, 2]
type = Changestate
trigger1 = animtime = 0
trigger2 = var(51) != 0
trigger2 = animelemtime(animelemno(0)+1) = 0
trigger2 = animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1) - ifelse(animelemtime(animelemno(0)+1)=0,animtime,0) > 1
trigger2 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0))-animtime)/2
value = 0
ctrl = 1

[Statedef 1510]
type = S
movetype = I
physics = S
anim = 195
velset = 0,0
ctrl = 0
poweradd = 70
sprpriority = 2
hitcountpersist = (enemy, movetype = H)

[State 1510, 1]
type = Helper
trigger1 = animelem = 1
name = "Mushu"
ID = 1501
pos = 0,-450
postype = p2
stateno = 1501
ownpal = 1

[State 1510, 2]
type = Changestate
trigger1 = animtime = 0
trigger2 = var(51) != 0
trigger2 = animelemtime(animelemno(0)+1) = 0
trigger2 = animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1) - ifelse(animelemtime(animelemno(0)+1)=0,animtime,0) > 1
trigger2 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0))-animtime)/2
value = 0
ctrl = 1

[Statedef 1520]
type = S
movetype = I
physics = S
anim = 195
velset = 0,0
ctrl = 0
poweradd = 70
sprpriority = 2
hitcountpersist = (enemy, movetype = H)

[State 1520, 1]
type = Helper
trigger1 = animelem = 3
name = "Mushu"
ID = 1501
pos = -70,-450
postype = p2
stateno = 1501
ownpal = 1

[State 1520, 2]
type = Changestate
trigger1 = animtime = 0
trigger2 = var(51) != 0
trigger2 = animelemtime(animelemno(0)+1) = 0
trigger2 = animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1) - ifelse(animelemtime(animelemno(0)+1)=0,animtime,0) > 1
trigger2 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0))-animtime)/2
value = 0
ctrl = 1

[Statedef 1501]
type = A
movetype = A
physics = N
anim = 1500
velset = 0,0
sprpriority = 2

[State 1501, 1]
type = Veladd
trigger1 = pos y < 0
y = 0.4

[State 1501, 2]
type = Velset
trigger1 = pos y >= 0
y = 0

[State 1501, 3]
type = Posset
trigger1 = pos y > 0
y = 0

[State 1501, 4]
type = Changeanim
trigger1 = pos y = 0
value = 1501
persistent = 0

[State 1501, 5]
type = HitDef
trigger1 = animelem = 1
attr = S, SA
hitflag = MAFD
guardflag = MA
animtype = Hard
damage = 80/((parent,ishelper)+1),8
pausetime = (10/((root,var(40)!=0)+1))*(parent,ishelper=0),(10/((root,var(40)!=0)+1))*(parent,ishelper=0)
sparkno = S901
guard.sparkno = S907
sparkxy = 0,0
hitsound = S5,1
guardsound = S5,8
guard.dist = 10
ground.type = High
ground.slidetime = 14
ground.hittime = 16
ground.velocity = 3,15
air.velocity = 1,15
airguard.velocity = 3,15
fall = 1
persistent = 0

[State 1501, 6]
type = Changeanim
trigger1 = anim = 1501 && animtime = 0
value = 1502

[State 1501, 7]
type = Changeanim
trigger1 = anim = 1502 && animtime = 0
value = 1503

[State 1501, 8]
type = Changestate
trigger1 = anim = 1503 && animtime = 0
value = 1504

[Statedef 1504]
type = A
movetype = I
physics = N
anim = 1504
velset = 5,-3
sprpriority = 2

[State 1504, 1]
type = Destroyself
trigger1 = time = 80

;---------------------------------------------------------------------------
; Kokiri Wave
[Statedef 3000]
type = S
movetype = A
physics = S
anim = 3000
velset = 0,0
ctrl = 0
sprpriority = 3
hitcountpersist = 1

[State 3000, 1]
type = Width
trigger1 = 1
value = 20,0

[State 3000, 2]
type = Playsnd
trigger1 = animelem = 3
value = 2,1

[State 3000, 3]
type = Playsnd
trigger1 = animelem = 4
value = 3000,0
volume = 255

[State 3000, 4]
type = Superpause
trigger1 = time = 5
time = 46
movetime = 46
anim = -1
sound = S8000,0
poweradd = -3000

[State 3000, 5]
type = Pause
trigger1 = time = 51
time = 4
movetime = 4

[State 3000, 6]
type = Explod
trigger1 = time = 5
anim = 3006
bindtime = -1
removetime = 46
supermovetime = 46
sprpriority = 6
ownpal = 1

[State 3000, 7]
type = Explod
trigger1 = time = 51
anim = 3007
bindtime = -1
removetime = 4
pausemovetime = 4
sprpriority = 6
ownpal = 1

[State 3000, 8]
type = Explod
trigger1 = time = 3
anim = 3004
supermovetime = 46
sprpriority = 4
ownpal = 1

[State 3000, 9]
type = Explod
trigger1 = time = 5
anim = 3005
pos = 0,0
postype = back
supermovetime = 46
sprpriority = -5
ownpal = 1

[State 3000, 10]
type = Explod
trigger1 = time = 7
anim = 4000
pos = 9,-80
postype = p1
supermovetime = 46
sprpriority = 7
ownpal = 1

[State 3000, 11]
type = Explod
trigger1 = time = 51
anim = 3015
pos = 0,0
postype = back
bindtime = -1
removetime = 81
pausemovetime = 2
scale = 1.06,1.08
sprpriority = -5
ownpal = 1

[State 3000, 12]
type = Helper
trigger1 = animelem = 4
name = "kokiri wave"
pos = -8,-5
postype = p1
stateno = 3001
ownpal = 1

[State 3000, 13]
type = AfterImage
trigger1 = time = 0
time = 147
length = 15
palcolor = 0
palbright = 0,0,0
palcontrast = 256,256,256
palpostbright = 70,0,90
paladd = 0,0,0
palmul = .8,.8,.8
timeGap = 1
frameGap = 3
trans = none

[State 3000, 14]
type = Changestate
trigger1 = animtime = 0
value = 0
ctrl = 1

[Statedef 3001]
type = S
movetype = A
physics = S
anim = 3001
velset = 0,0
sprpriority = 7

[State 3001, 1]
type = BindtoParent
trigger1 = 1
pos = -8,-5

[State 3001, 2]
type = HitDef
trigger1 = timemod = 3,0
attr = S, HP
hitflag = MAFP
guardflag = MA
damage = 20,5
animtype = Hard
pausetime = 0,8
sparkno = S3002
guard.sparkno = S3003
sparkxy = 0,-60
hitsound = S3000,1
guardsound = S5,8
ground.type = High
ground.slidetime = 20
ground.hittime = 25
ground.velocity = -8, -7
air.velocity = -8, ifelse(time=72,-7,7)
guard.velocity = -10
fall = 1
palfx.time = 75
palfx.add = -20,-100,-20
palfx.sinadd = -30,-30,-30,12
palfx.color = 0

[State 3001, 3]
type = Destroyself
trigger1 = animtime = 0
trigger2 = parent, stateno != 3000

;---------------------------------------------------------------------------
; Biggoron Scombo
[Statedef 3100]
type = S
movetype = A
physics = N
anim = 3100
velset = 0,0
ctrl = 0
juggle = 1
sprpriority = 3
hitcountpersist = 1

[State 3100, 1]
type = Superpause
trigger1 = time = 6
time = 46
movetime = 46
anim = -1
sound = S8000,1
poweradd = -3000

[State 3100, 2]
type = Explod
trigger1 = time = 3
anim = 3004
supermovetime = 46
sprpriority = 4
ownpal = 1

[State 3100, 3]
type = Explod
trigger1 = time = 5
anim = 3005
pos = 0,0
postype = back
supermovetime = 46
sprpriority = -5
ownpal = 1

[State 3100, 4]
type = Explod
trigger1 = time = 7
anim = 4000
pos = 9,-80
postype = p1
supermovetime = 46
sprpriority = 7
ownpal = 1

[State 3100, 5]
type = Varset
trigger1 = time = 0
var(20) = 0

[State 3100, 6]
type = Velset
trigger1 = animelem = 3
x = 10

[State 3100, 7]
type = HitDef
trigger1 = animelem = 3
attr = S, HA
hitflag = MAF
guardflag = MA
animtype = Hard
damage = 50,5
pausetime = 10,8
sparkno = S901
guard.sparkno = S907
sparkxy = 10,-60
hitsound = S5,1
guardsound = S5,8
ground.type = High
ground.slidetime = 20
ground.hittime = 25
ground.velocity = 0
guard.velocity = -10
snap = 50,0
p2stateno = 3150

[State 3100, 8]
type = Changestate
trigger1 = movehit
value = 3101

[State 3100, 9]
type = Changestate
trigger1 = animtime = 0
value = 0
ctrl = 1

[Statedef 3101]
type = S
movetype = A
physics = N
anim = 3101
velset = 0,0
ctrl = 0
sprpriority = 3

[State 3101, 1]
type = Nothitby
trigger1 = 1
value = SCA

[State 3101, 2]
type = Changeanim
trigger1 = time = [6,9]
trigger2 = time = [16,19]
trigger3 = time = [26,29]
trigger4 = time = [36,39]
trigger5 = time = [46,49]
trigger6 = time = [56,59]
trigger7 = time = [66,69]
trigger8 = time = [81,84]
trigger9 = time = [93,96]
trigger10 = time = [110,113]
value = anim
elem = animelemno(0)

[State 3101, 3]
type = Explod
trigger1 = animelem = 19
anim = 221
bindtime = -1
sprpriority = 6
ownpal = 1
removeongethit = 1

[State 3101, 4]
type = Explod
trigger1 = animelem = 21, =1
anim = 241
bindtime = -1
sprpriority = 6
ownpal = 1
removeongethit = 1

[State 3101, 5]
type = Explod
trigger1 = time = 6
anim = 903
pos = 0,-43
postype = p2
bindtime = -1
sprpriority = 7
ownpal = 1
removeongethit = 1

[State 3101, 6]
type = Explod
trigger1 = time = 16
trigger2 = time = 36
trigger3 = time = 56
anim = 900
pos = -5,-32
postype = p2
bindtime = -1
sprpriority = 7
ownpal = 1
removeongethit = 1

[State 3101, 7]
type = Explod
trigger1 = time = 26
trigger2 = time = 46
trigger3 = time = 66
anim = 900
pos = 5,-68
postype = p2
bindtime = -1
sprpriority = 7
ownpal = 1
removeongethit = 1

[State 3101, 8]
type = Explod
trigger1 = time = 81
anim = 905
pos = -10,-43
postype = p2
bindtime = -1
sprpriority = 7
ownpal = 1
removeongethit = 1

[State 3101, 9]
type = Explod
trigger1 = time = 93
anim = 904
pos = -10,-15
postype = p2
bindtime = -1
sprpriority = 7
ownpal = 1
removeongethit = 1

[State 3101, 10]
type = Explod
trigger1 = time = 110
anim = 901
pos = 0,-70
postype = p2
bindtime = -1
sprpriority = 7
ownpal = 1
removeongethit = 1

[State 3101, 11]
type = Playsnd
trigger1 = time = 4
value = 0,2+random/500

[State 3101, 12]
type = Playsnd
trigger1 = time = 13
trigger2 = time = 23
trigger3 = time = 33
trigger4 = time = 43
trigger5 = time = 53
trigger6 = time = 63
value = 1,random/250

[State 3101, 13]
type = Playsnd
trigger1 = time = 78
trigger2 = time = 93
value = 0,random/500

[State 3101, 14]
type = Playsnd
trigger1 = time = 106
value = 2,1

[State 3101, 15]
type = Playsnd
trigger1 = time = 106
value = 450,0

[State 3101, 16]
type = Playsnd
trigger1 = time = 6
value = 5,3

[State 3101, 17]
type = Playsnd
trigger1 = time = 16
trigger2 = time = 26
trigger3 = time = 36
trigger4 = time = 46
trigger5 = time = 56
trigger6 = time = 66
value = 5,0

[State 3101, 18]
type = Playsnd
trigger1 = time = 81
value = 5,5

[State 3101, 19]
type = Playsnd
trigger1 = time = 93
value = 5,4

[State 3101, 20]
type = Playsnd
trigger1 = time = 110
value = 5,1

[State 3101, 21]
type = Targetlifeadd
trigger1 = time = 7
value = -15

[State 3101, 22]
type = Targetlifeadd
trigger1 = time = 17
trigger2 = time = 27
trigger3 = time = 37
trigger4 = time = 47
trigger5 = time = 57
trigger6 = time = 67
value = -5

[State 3101, 23]
type = Targetlifeadd
trigger1 = time = 82
value = -30

[State 3101, 24]
type = Targetlifeadd
trigger1 = time = 94
value = -20

[State 3101, 25]
type = Targetlifeadd
trigger1 = time = 110
value = -40

[State 3101, 26]
type = Hitadd
trigger1 = time = 6
trigger2 = time = 16
trigger3 = time = 26
trigger4 = time = 36
trigger5 = time = 46
trigger6 = time = 56
trigger7 = time = 66
trigger8 = time = 81
trigger9 = time = 93
trigger10 = time = 110
value = numtarget

[State 3101, 27]
type = Changestate
trigger1 = animtime = 0
value = 3102
ctrl = 1

[Statedef 3102]
type = A
movetype = A
physics = N
anim = 3102
velset = 0,-19
ctrl = 0
sprpriority = 3

[State 3102, 1]
type = Nothitby
trigger1 = 1
value = SCA

[State 3102, 2]
type = Veladd
trigger1 = time >= 0
y = 0.35

[State 3102, 3]
type = Playerpush
trigger1 = 1
value = 0

[State 3102, 4]
type = Velset
trigger1 = animelem = 1
x = 1

[State 3102, 5]
type = Velset
trigger1 = animelem = 11
x = 0

[State 3102, 6]
type = Veladd
trigger1 = time >= 38
y = 0.15

[State 3102, 7]
type = Explod
trigger1 = time = 38
anim = 902
pos = 0,-35
postype = p2
bindtime = -1
sprpriority = 6
ownpal = 1
removeongethit = 1

[State 3102, 8]
type = Playsnd
trigger1 = time = 0
value = 90,0

[State 3102, 9]
type = Playsnd
trigger1 = time = 30
value = 0,4+random/500

[State 3102, 10]
type = Playsnd
trigger1 = time = 38
value = 5,6

[State 3102, 11]
type = Targetbind
trigger1 = animelemno(0) = 11
pos = 25,-25
persistent = 1

[State 3102, 12]
type = Targetlifeadd
trigger1 = time = 38
value = -30

[State 3102, 13]
type = Hitadd
trigger1 = time = 38
value = numtarget

[State 3102, 14]
type = Changestate
trigger1 = pos y > 0
value = 3103

[Statedef 3103]
type = S
movetype = A
physics = N
anim = 3103
velset = 0,0
ctrl = 0
sprpriority = 3

[State 3103, 1]
type = Nothitby
trigger1 = 1
value = SCA

[State 3103, 2]
type = Posset
trigger1 = animelem = 2
y = 0

[State 3103, 3]
type = Velset
trigger1 = animelem = 2
x = -9

[State 3103, 4]
type = Statetypeset
trigger1 = animelem = 10
physics = S

[State 3103, 5]
type = Helper
trigger1 = animelem = 11
name = "net"
pos = 0,-70
postype = p1
stateno = 3105
ownpal = 1

[State 3103, 6]
type = Explod
trigger1 = animelem = 45
anim = 3110
pos = 20,200
postype = left
bindtime = -1
removetime = 84
sprpriority = 4
ownpal = 1
removeongethit = 1

[State 3103, 7]
type = Explod
trigger1 = animelem = 45
anim = target,ID + 3079
pos = 106,200
postype = left
bindtime = -1
removetime = 84
sprpriority = 4
ownpal = 1
removeongethit = 1

[State 3103, 8]
type = Explod
trigger1 = animelem = 45
anim = 3116
pos = 20,220
postype = left
bindtime = -1
removetime = 84
sprpriority = 4
ownpal = 1
removeongethit = 1

[State 3103, 9]
type = Explod
trigger1 = time = 0
anim = 908
pos = 0,0
postype = p2
sprpriority = -1
ownpal = 1
removeongethit = 1

[State 3103, 10]
type = Playsnd
trigger1 = time = 0
value = 5,10

[State 3103, 11]
type = Playsnd
trigger1 = time = 34
value = 2,random/250

[State 3103, 12]
type = Playsnd
trigger1 = time = 34
value = 330,0

[State 3103, 13]
type = Targetlifeadd
trigger1 = time = 0
value = -35

[State 3103, 14]
type = Changestate
trigger1 = animtime = 0
value = 3104

[Statedef 3104]
type = S
movetype = A
physics = N
anim = 3104
velset = 5,0
ctrl = 0
sprpriority = 3

[State 3104, 1]
type = Nothitby
trigger1 = 1
value = SCA

[State 3104, 2]
type = Helper
trigger1 = animelem = 7
name = "B1"
ID = 3111
pos = 20,220-floor(screenpos y)
postype = left
stateno = 3111
ownpal = 1

[State 3104, 3]
type = Helper
trigger1 = animelem = 7
name = "B2"
ID = 3112
pos = 38,220-floor(screenpos y)
postype = left
stateno = 3112
ownpal = 1

[State 3104, 4]
type = Helper
trigger1 = animelem = 7
name = "B3"
ID = 3113
pos = 56,220-floor(screenpos y)
postype = left
stateno = 3113
ownpal = 1

[State 3104, 5]
type = Helper
trigger1 = animelem = 7
name = "B4"
ID = 3114
pos = 74,220-floor(screenpos y)
postype = left
stateno = 3114
ownpal = 1

[State 3104, 6]
type = Helper
trigger1 = animelem = 7
name = "B5"
ID = 3115
pos = 92,220-floor(screenpos y)
postype = left
stateno = 3115
ownpal = 1

[State 3104, 7]
type = Helper
trigger1 = animelem = 7
name = "B6"
ID = 3116
pos = 110,220-floor(screenpos y)
postype = left
stateno = 3116
ownpal = 1

[State 3104, 8]
type = Helper
trigger1 = animelem = 7
name = "B7"
ID = 3117
pos = 128,220-floor(screenpos y)
postype = left
stateno = 3117
ownpal = 1

[State 3104, 9]
type = Helper
trigger1 = animelem = 7
name = "B8"
ID = 3118
pos = 146,220-floor(screenpos y)
postype = left
stateno = 3118
ownpal = 1

[State 3104, 10]
type = Posfreeze
trigger1 = time = [18,17+floor(3.2*tickspersecond)]
trigger1 = var(20) != 8
value = 1

[State 3104, 11]
type = Changeanim
trigger1 = time = [18,17+floor(3.2*tickspersecond)]
trigger1 = var(20) != 8
value = anim
elem = animelemno(0)

[State 3104, 12]
type = Explod
trigger1 = animelem = 7
ID = 3117
anim = 3117
pos = 20,200
postype = left
bindtime = -1
removetime = floor(3.2*tickspersecond)
sprpriority = 4
ownpal = 1
removeongethit = 1
persistent = 0

[State 3104, 13]
type = Explod
trigger1 = animelem = 7
ID = 3118
anim = 3118
pos = 96,200
postype = left
bindtime = -1
removetime = floor(3.2*tickspersecond)
sprpriority = 4
ownpal = 1
removeongethit = 1
persistent = 0

[State 3104, 14]
type = Removeexplod
trigger1 = var(20) = 8
ID = 3117

[State 3104, 15]
type = Removeexplod
trigger1 = var(20) = 8
ID = 3118

[State 3104, 16]
type = Playsnd
trigger1 = animelem = 12
trigger2 = animelem = 21
value = 0,4+random/500

[State 3104, 17]
type = Velset
trigger1 = animelem = 12
y = -7

[State 3104, 18]
type = Statetypeset
trigger1 = animelem = 12
statetype = A
physics = A

[State 3104, 19]
type = HitDef
trigger1 = animelem = 13
attr = S, HA
hitflag = MAF
guardflag = MA
animtype = Hard
damage = 400, 80
pausetime = 10,10
sparkno = S904
guard.sparkno = S907
sparkxy = -10,-43
hitsound = S5,7
guardsound = S5,8
ground.type = High
ground.slidetime = 12
ground.hittime = 15
ground.velocity = -5,-8
air.velocity = -4,-7
fall = 1
fall.recover = 0

[State 3104, 20]
type = HitDef
trigger1 = animelem = 22
attr = S, HA
hitflag = MAF
guardflag = MA
animtype = Hard
damage = 600, 120
pausetime = 10,10
sparkno = S905
guard.sparkno = S907
sparkxy = -10,-63
hitsound = S5,7
guardsound = S5,8
ground.type = High
ground.slidetime = 12
ground.hittime = 15
ground.velocity = -4,12
air.velocity = -4,12
fall = 1
fall.recover = 0

[Statedef 3105]
type = S
movetype = A
physics = N
anim = 375
velset = 7,0.5
sprpriority = 3

[State 3105, 1]
type = HitDef
trigger1 = animelem = 3
attr = S, NA
hitflag = MAF
guardflag = MA
animtype = Medium
damage = 0
pausetime = 1, 1
sparkno = -1
guard.sparkno = -1
sparkxy = 0,0
hitsound = -1
guardsound = -1
ground.type = High
ground.slidetime = 6
ground.hittime = 12
ground.velocity = 0
air.velocity = 0
p1stateno = 3106
p2stateno = 3153

[State 3105, 2]
type = Destroyself
trigger1 = time = 150

[Statedef 3106]
type = S
movetype = I
physics = N
anim = 376
velset = 0,0
sprpriority = 3

[State 3106, 1]
type = Bindtotarget
trigger1 = anim = 376
trigger1 = target, stateno = 3153
pos = 25,-65

[State 3106, 2]
type = Playsnd
trigger1 = time = 0
value = 330,1

[State 3106, 3]
type = Playsnd
trigger1 = parent, var(20) = 8
trigger1 = numtarget = 0
trigger1 = animelem = 2
value = 90,0

[State 3106, 4]
type = Changeanim
trigger1 = time = [158,157+floor(3.2*tickspersecond)]
trigger1 = parent, var(20) != 8
value = anim
elem = animelemno(0)

[State 3106, 5]
type = Changeanim
trigger1 = time = 217+floor(3.2*tickspersecond)
trigger2 = parent, var(20) = 8
trigger3 = target, stateno != 3153
value = 377
persistent = 0

[State 3106, 6]
type = Destroyself
trigger1 = anim = 377 && animtime = 0

[Statedef 3111]
type = S
movetype = I
physics = N
anim = 3120+2*(random/100)
velset = 0,0
sprpriority = 7

[State 3111, 1]
type = Assertspecial
trigger1 = 1
flag = noshadow

[State 3111, 2]
type = Playsnd
trigger1 = anim%2 = 1
trigger1 = animelemtime(1) = 1
value = 3110,0

[State 3111, 3]
type = Varset
trigger1 = anim%2 = 0
var(0) = 0

[State 3111, 4]
type = Parentvarset
triggerall = parent, var(20) = 0
trigger1 = anim = 3120 && (enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c")
trigger2 = anim = 3122 && (enemy, command = "up" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c")
trigger3 = anim = 3124 && enemy, facing = 1
trigger3 = enemy, command = "up" || enemy, command = "down" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c"
trigger4 = anim = 3124 && enemy, facing = -1
trigger4 = enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c"
trigger5 = anim = 3126 && enemy, facing = 1
trigger5 = enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c"
trigger6 = anim = 3126 && enemy, facing = -1
trigger6 = enemy, command = "up" || enemy, command = "down" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c"
trigger7 = anim = 3128 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c")
trigger8 = anim = 3130 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c")
trigger9 = anim = 3132 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c")
trigger10 = anim = 3134 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "b" || enemy, command = "c")
trigger11 = anim = 3136 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "c")
trigger12 = anim = 3138 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b")
var(20) = -1

[State 3111, 5]
type = Changeanim
trigger1 = parent, var(20) = -1
trigger1 = anim%2 = 1
value = anim - 1

[State 3111, 6]
type = Parentvarset
triggerall = parent, var(20) = -1
trigger1 = anim = 3120 && enemy, command = "up"
trigger2 = anim = 3122 && enemy, command = "down"
trigger3 = anim = 3124 && ifelse(enemy,facing=1,enemy, command = "back",enemy, command = "forward")
trigger4 = anim = 3126 && ifelse(enemy,facing=1,enemy, command = "forward",enemy, command = "back")
trigger5 = anim = 3128 && enemy, command = "x"
trigger6 = anim = 3130 && enemy, command = "y"
trigger7 = anim = 3132 && enemy, command = "z"
trigger8 = anim = 3134 && enemy, command = "a"
trigger9 = anim = 3136 && enemy, command = "b"
trigger10 = anim = 3138 && enemy, command = "c"
var(20) = 0

[State 3111, 7]
type = Changeanim
triggerall = parent, var(20) <= 0
trigger1 = anim = 3120 && enemy, command = "up"
trigger2 = anim = 3122 && enemy, command = "down"
trigger3 = anim = 3124 && ifelse(enemy,facing=1,enemy, command = "back",enemy, command = "forward")
trigger4 = anim = 3126 && ifelse(enemy,facing=1,enemy, command = "forward",enemy, command = "back")
trigger5 = anim = 3128 && enemy, command = "x"
trigger6 = anim = 3130 && enemy, command = "y"
trigger7 = anim = 3132 && enemy, command = "z"
trigger8 = anim = 3134 && enemy, command = "a"
trigger9 = anim = 3136 && enemy, command = "b"
trigger10 = anim = 3138 && enemy, command = "c"
value = anim + 1

[State 3111, 8]
type = Varadd
trigger1 = anim%2 = 1
var(0) = 1

[State 3111, 9]
type = Parentvarset
trigger1 = var(0) = 2
var(20) = 1

[State 3111, 10]
type = Destroyself
trigger1 = time = floor(3.2*tickspersecond)
trigger2 = parent, movetype = H
trigger3 = parent, var(20) = 8

[Statedef 3112]
type = S
movetype = I
physics = N
anim = 3120+2*(random/100)
velset = 0,0
sprpriority = 7

[State 3112, 1]
type = Assertspecial
trigger1 = 1
flag = noshadow

[State 3112, 2]
type = Playsnd
trigger1 = anim%2 = 1
trigger1 = animelemtime(1) = 1
value = 3110,0

[State 3112, 3]
type = Changeanim
triggerall = parent, var(20) = 1
trigger1 = anim = 3120 && enemy, command = "up"
trigger2 = anim = 3122 && enemy, command = "down"
trigger3 = anim = 3124 && ifelse(enemy,facing=1,enemy, command = "back",enemy, command = "forward")
trigger4 = anim = 3126 && ifelse(enemy,facing=1,enemy, command = "forward",enemy, command = "back")
trigger5 = anim = 3128 && enemy, command = "x"
trigger6 = anim = 3130 && enemy, command = "y"
trigger7 = anim = 3132 && enemy, command = "z"
trigger8 = anim = 3134 && enemy, command = "a"
trigger9 = anim = 3136 && enemy, command = "b"
trigger10 = anim = 3138 && enemy, command = "c"
value = anim + 1

[State 3112, 4]
type = Varadd
trigger1 = anim%2 = 1
var(0) = 1

[State 3112, 5]
type = Parentvarset
trigger1 = var(0) = 2
var(20) = 2

[State 3112, 6]
type = Varset
trigger1 = anim%2 = 0
var(0) = 0

[State 3112, 7]
type = Parentvarset
triggerall = parent, var(20) = 1
trigger1 = anim = 3120 && (enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c")
trigger2 = anim = 3122 && (enemy, command = "up" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c")
trigger3 = anim = 3124 && enemy, facing = 1
trigger3 = enemy, command = "up" || enemy, command = "down" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c"
trigger4 = anim = 3124 && enemy, facing = -1
trigger4 = enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c"
trigger5 = anim = 3126 && enemy, facing = 1
trigger5 = enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c"
trigger6 = anim = 3126 && enemy, facing = -1
trigger6 = enemy, command = "up" || enemy, command = "down" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c"
trigger7 = anim = 3128 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c")
trigger8 = anim = 3130 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c")
trigger9 = anim = 3132 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c")
trigger10 = anim = 3134 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "b" || enemy, command = "c")
trigger11 = anim = 3136 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "c")
trigger12 = anim = 3138 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b")
var(20) = -1

[State 3112, 8]
type = Changeanim
trigger1 = parent, var(20) = -1
trigger1 = anim%2 = 1
value = anim - 1

[State 3112, 9]
type = Destroyself
trigger1 = time = floor(3.2*tickspersecond)
trigger2 = parent, movetype = H
trigger3 = parent, var(20) = 8

[Statedef 3113]
type = S
movetype = I
physics = N
anim = 3120+2*(random/100)
velset = 0,0
sprpriority = 7

[State 3113, 1]
type = Assertspecial
trigger1 = 1
flag = noshadow

[State 3113, 2]
type = Playsnd
trigger1 = anim%2 = 1
trigger1 = animelemtime(1) = 1
value = 3110,0

[State 3113, 3]
type = Changeanim
triggerall = parent, var(20) = 2
trigger1 = anim = 3120 && enemy, command = "up"
trigger2 = anim = 3122 && enemy, command = "down"
trigger3 = anim = 3124 && ifelse(enemy,facing=1,enemy, command = "back",enemy, command = "forward")
trigger4 = anim = 3126 && ifelse(enemy,facing=1,enemy, command = "forward",enemy, command = "back")
trigger5 = anim = 3128 && enemy, command = "x"
trigger6 = anim = 3130 && enemy, command = "y"
trigger7 = anim = 3132 && enemy, command = "z"
trigger8 = anim = 3134 && enemy, command = "a"
trigger9 = anim = 3136 && enemy, command = "b"
trigger10 = anim = 3138 && enemy, command = "c"
value = anim + 1

[State 3113, 4]
type = Varadd
trigger1 = anim%2 = 1
var(0) = 1

[State 3113, 5]
type = Parentvarset
trigger1 = var(0) = 2
var(20) = 3

[State 3113, 6]
type = Varset
trigger1 = anim%2 = 0
var(0) = 0

[State 3113, 7]
type = Parentvarset
triggerall = parent, var(20) = 2
trigger1 = anim = 3120 && (enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c")
trigger2 = anim = 3122 && (enemy, command = "up" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c")
trigger3 = anim = 3124 && enemy, facing = 1
trigger3 = enemy, command = "up" || enemy, command = "down" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c"
trigger4 = anim = 3124 && enemy, facing = -1
trigger4 = enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c"
trigger5 = anim = 3126 && enemy, facing = 1
trigger5 = enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c"
trigger6 = anim = 3126 && enemy, facing = -1
trigger6 = enemy, command = "up" || enemy, command = "down" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c"
trigger7 = anim = 3128 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c")
trigger8 = anim = 3130 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c")
trigger9 = anim = 3132 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c")
trigger10 = anim = 3134 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "b" || enemy, command = "c")
trigger11 = anim = 3136 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "c")
trigger12 = anim = 3138 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b")
var(20) = -1

[State 3113, 8]
type = Changeanim
trigger1 = parent, var(20) = -1
trigger1 = anim%2 = 1
value = anim - 1

[State 3113, 9]
type = Destroyself
trigger1 = time = floor(3.2*tickspersecond)
trigger2 = parent, movetype = H
trigger3 = parent, var(20) = 8

[Statedef 3114]
type = S
movetype = I
physics = N
anim = 3120+2*(random/100)
velset = 0,0
sprpriority = 7

[State 3114, 1]
type = Assertspecial
trigger1 = 1
flag = noshadow

[State 3114, ]
type = Playsnd
trigger1 = anim%2 = 1
trigger1 = animelemtime(1) = 1
value = 3110,0

[State 3114, 3]
type = Changeanim
triggerall = parent, var(20) = 3
trigger1 = anim = 3120 && enemy, command = "up"
trigger2 = anim = 3122 && enemy, command = "down"
trigger3 = anim = 3124 && ifelse(enemy,facing=1,enemy, command = "back",enemy, command = "forward")
trigger4 = anim = 3126 && ifelse(enemy,facing=1,enemy, command = "forward",enemy, command = "back")
trigger5 = anim = 3128 && enemy, command = "x"
trigger6 = anim = 3130 && enemy, command = "y"
trigger7 = anim = 3132 && enemy, command = "z"
trigger8 = anim = 3134 && enemy, command = "a"
trigger9 = anim = 3136 && enemy, command = "b"
trigger10 = anim = 3138 && enemy, command = "c"
value = anim + 1

[State 3114, 4]
type = Varadd
trigger1 = anim%2 = 1
var(0) = 1

[State 3114, 5]
type = Parentvarset
trigger1 = var(0) = 2
var(20) = 4

[State 3114, 6]
type = Varset
trigger1 = anim%2 = 0
var(0) = 0

[State 3114, 7]
type = Parentvarset
triggerall = parent, var(20) = 3
trigger1 = anim = 3120 && (enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c")
trigger2 = anim = 3122 && (enemy, command = "up" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c")
trigger3 = anim = 3124 && enemy, facing = 1
trigger3 = enemy, command = "up" || enemy, command = "down" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c"
trigger4 = anim = 3124 && enemy, facing = -1
trigger4 = enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c"
trigger5 = anim = 3126 && enemy, facing = 1
trigger5 = enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c"
trigger6 = anim = 3126 && enemy, facing = -1
trigger6 = enemy, command = "up" || enemy, command = "down" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c"
trigger7 = anim = 3128 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c")
trigger8 = anim = 3130 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c")
trigger9 = anim = 3132 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c")
trigger10 = anim = 3134 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "b" || enemy, command = "c")
trigger11 = anim = 3136 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "c")
trigger12 = anim = 3138 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b")
var(20) = -1

[State 3114, 8]
type = Changeanim
trigger1 = parent, var(20) = -1
trigger1 = anim%2 = 1
value = anim - 1

[State 3114, 9]
type = Destroyself
trigger1 = time = floor(3.2*tickspersecond)
trigger2 = parent, movetype = H
trigger3 = parent, var(20) = 8

[Statedef 3115]
type = S
movetype = I
physics = N
anim = 3120+2*(random/100)
velset = 0,0
sprpriority = 7

[State 3115, 1]
type = Assertspecial
trigger1 = 1
flag = noshadow

[State 3115, 2]
type = Playsnd
trigger1 = anim%2 = 1
trigger1 = animelemtime(1) = 1
value = 3110,0

[State 3115, 3]
type = Changeanim
triggerall = parent, var(20) = 4
trigger1 = anim = 3120 && enemy, command = "up"
trigger2 = anim = 3122 && enemy, command = "down"
trigger3 = anim = 3124 && ifelse(enemy,facing=1,enemy, command = "back",enemy, command = "forward")
trigger4 = anim = 3126 && ifelse(enemy,facing=1,enemy, command = "forward",enemy, command = "back")
trigger5 = anim = 3128 && enemy, command = "x"
trigger6 = anim = 3130 && enemy, command = "y"
trigger7 = anim = 3132 && enemy, command = "z"
trigger8 = anim = 3134 && enemy, command = "a"
trigger9 = anim = 3136 && enemy, command = "b"
trigger10 = anim = 3138 && enemy, command = "c"
value = anim + 1

[State 3115, 4]
type = Varadd
trigger1 = anim%2 = 1
var(0) = 1

[State 3115, 5]
type = Parentvarset
trigger1 = var(0) = 2
var(20) = 5

[State 3115, 6]
type = Varset
trigger1 = anim%2 = 0
var(0) = 0

[State 3115, 7]
type = Parentvarset
triggerall = parent, var(20) = 4
trigger1 = anim = 3120 && (enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c")
trigger2 = anim = 3122 && (enemy, command = "up" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c")
trigger3 = anim = 3124 && enemy, facing = 1
trigger3 = enemy, command = "up" || enemy, command = "down" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c"
trigger4 = anim = 3124 && enemy, facing = -1
trigger4 = enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c"
trigger5 = anim = 3126 && enemy, facing = 1
trigger5 = enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c"
trigger6 = anim = 3126 && enemy, facing = -1
trigger6 = enemy, command = "up" || enemy, command = "down" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c"
trigger7 = anim = 3128 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c")
trigger8 = anim = 3130 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c")
trigger9 = anim = 3132 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c")
trigger10 = anim = 3134 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "b" || enemy, command = "c")
trigger11 = anim = 3136 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "c")
trigger12 = anim = 3138 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b")
var(20) = -1

[State 3115, 8]
type = Changeanim
trigger1 = parent, var(20) = -1
trigger1 = anim%2 = 1
value = anim - 1

[State 3115, 9]
type = Destroyself
trigger1 = time = floor(3.2*tickspersecond)
trigger2 = parent, movetype = H
trigger3 = parent, var(20) = 8

[Statedef 3116]
type = S
movetype = I
physics = N
anim = 3120+2*(random/100)
velset = 0,0
sprpriority = 7

[State 3116, 1]
type = Assertspecial
trigger1 = 1
flag = noshadow

[State 3116, 2]
type = Playsnd
trigger1 = anim%2 = 1
trigger1 = animelemtime(1) = 1
value = 3110,0

[State 3116, 3]
type = Changeanim
triggerall = parent, var(20) = 5
trigger1 = anim = 3120 && enemy, command = "up"
trigger2 = anim = 3122 && enemy, command = "down"
trigger3 = anim = 3124 && ifelse(enemy,facing=1,enemy, command = "back",enemy, command = "forward")
trigger4 = anim = 3126 && ifelse(enemy,facing=1,enemy, command = "forward",enemy, command = "back")
trigger5 = anim = 3128 && enemy, command = "x"
trigger6 = anim = 3130 && enemy, command = "y"
trigger7 = anim = 3132 && enemy, command = "z"
trigger8 = anim = 3134 && enemy, command = "a"
trigger9 = anim = 3136 && enemy, command = "b"
trigger10 = anim = 3138 && enemy, command = "c"
value = anim + 1

[State 3116, 4]
type = Varadd
trigger1 = anim%2 = 1
var(0) = 1

[State 3116, 5]
type = Parentvarset
trigger1 = var(0) = 2
var(20) = 6

[State 3116, 6]
type = Varset
trigger1 = anim%2 = 0
var(0) = 0

[State 3116, 7]
type = Parentvarset
triggerall = parent, var(20) = 5
trigger1 = anim = 3120 && (enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c")
trigger2 = anim = 3122 && (enemy, command = "up" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c")
trigger3 = anim = 3124 && enemy, facing = 1
trigger3 = enemy, command = "up" || enemy, command = "down" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c"
trigger4 = anim = 3124 && enemy, facing = -1
trigger4 = enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c"
trigger5 = anim = 3126 && enemy, facing = 1
trigger5 = enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c"
trigger6 = anim = 3126 && enemy, facing = -1
trigger6 = enemy, command = "up" || enemy, command = "down" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c"
trigger7 = anim = 3128 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c")
trigger8 = anim = 3130 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c")
trigger9 = anim = 3132 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c")
trigger10 = anim = 3134 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "b" || enemy, command = "c")
trigger11 = anim = 3136 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "c")
trigger12 = anim = 3138 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b")
var(20) = -1

[State 3116, 8]
type = Changeanim
trigger1 = parent, var(20) = -1
trigger1 = anim%2 = 1
value = anim - 1

[State 3116, 9]
type = Destroyself
trigger1 = time = floor(3.2*tickspersecond)
trigger2 = parent, movetype = H
trigger3 = parent, var(20) = 8

[Statedef 3117]
type = S
movetype = I
physics = N
anim = 3120+2*(random/100)
velset = 0,0
sprpriority = 7

[State 3117, 1]
type = Assertspecial
trigger1 = 1
flag = noshadow

[State 3117, 2]
type = Playsnd
trigger1 = anim%2 = 1
trigger1 = animelemtime(1) = 1
value = 3110,0

[State 3117, 3]
type = Changeanim
triggerall = parent, var(20) = 6
trigger1 = anim = 3120 && enemy, command = "up"
trigger2 = anim = 3122 && enemy, command = "down"
trigger3 = anim = 3124 && ifelse(enemy,facing=1,enemy, command = "back",enemy, command = "forward")
trigger4 = anim = 3126 && ifelse(enemy,facing=1,enemy, command = "forward",enemy, command = "back")
trigger5 = anim = 3128 && enemy, command = "x"
trigger6 = anim = 3130 && enemy, command = "y"
trigger7 = anim = 3132 && enemy, command = "z"
trigger8 = anim = 3134 && enemy, command = "a"
trigger9 = anim = 3136 && enemy, command = "b"
trigger10 = anim = 3138 && enemy, command = "c"
value = anim + 1

[State 3117, 4]
type = Varadd
trigger1 = anim%2 = 1
var(0) = 1

[State 3117, 5]
type = Parentvarset
trigger1 = var(0) = 2
var(20) = 7

[State 3117, 6]
type = Varset
trigger1 = anim%2 = 0
var(0) = 0

[State 3117, 7]
type = Parentvarset
triggerall = parent, var(20) = 6
trigger1 = anim = 3120 && (enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c")
trigger2 = anim = 3122 && (enemy, command = "up" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c")
trigger3 = anim = 3124 && enemy, facing = 1
trigger3 = enemy, command = "up" || enemy, command = "down" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c"
trigger4 = anim = 3124 && enemy, facing = -1
trigger4 = enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c"
trigger5 = anim = 3126 && enemy, facing = 1
trigger5 = enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c"
trigger6 = anim = 3126 && enemy, facing = -1
trigger6 = enemy, command = "up" || enemy, command = "down" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c"
trigger7 = anim = 3128 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c")
trigger8 = anim = 3130 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c")
trigger9 = anim = 3132 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c")
trigger10 = anim = 3134 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "b" || enemy, command = "c")
trigger11 = anim = 3136 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "c")
trigger12 = anim = 3138 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b")
var(20) = -1

[State 3117, 8]
type = Changeanim
trigger1 = parent, var(20) = -1
trigger1 = anim%2 = 1
value = anim - 1

[State 3117, 9]
type = Destroyself
trigger1 = time = floor(3.2*tickspersecond)
trigger2 = parent, movetype = H
trigger3 = parent, var(20) = 8

[Statedef 3118]
type = S
movetype = I
physics = N
anim = 3120+2*(random/100)
velset = 0,0
sprpriority = 7

[State 3118, 1]
type = Assertspecial
trigger1 = 1
flag = noshadow

[State 3118, 2]
type = Playsnd
trigger1 = anim%2 = 1
trigger1 = animelemtime(1) = 1
value = 3110,0

[State 3118, 3]
type = Changeanim
triggerall = parent, var(20) = 7
trigger1 = anim = 3120 && enemy, command = "up"
trigger2 = anim = 3122 && enemy, command = "down"
trigger3 = anim = 3124 && ifelse(enemy,facing=1,enemy, command = "back",enemy, command = "forward")
trigger4 = anim = 3126 && ifelse(enemy,facing=1,enemy, command = "forward",enemy, command = "back")
trigger5 = anim = 3128 && enemy, command = "x"
trigger6 = anim = 3130 && enemy, command = "y"
trigger7 = anim = 3132 && enemy, command = "z"
trigger8 = anim = 3134 && enemy, command = "a"
trigger9 = anim = 3136 && enemy, command = "b"
trigger10 = anim = 3138 && enemy, command = "c"
value = anim + 1

[State 3118, 4]
type = Varadd
trigger1 = anim%2 = 1
var(0) = 1

[State 3118, 5]
type = Parentvarset
trigger1 = var(0) = 2
var(20) = 8

[State 3118, 6]
type = Varset
trigger1 = anim%2 = 0
var(0) = 0

[State 3118, 7]
type = Parentvarset
triggerall = parent, var(20) = 7
trigger1 = anim = 3120 && (enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c")
trigger2 = anim = 3122 && (enemy, command = "up" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c")
trigger3 = anim = 3124 && enemy, facing = 1
trigger3 = enemy, command = "up" || enemy, command = "down" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c"
trigger4 = anim = 3124 && enemy, facing = -1
trigger4 = enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c"
trigger5 = anim = 3126 && enemy, facing = 1
trigger5 = enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c"
trigger6 = anim = 3126 && enemy, facing = -1
trigger6 = enemy, command = "up" || enemy, command = "down" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c"
trigger7 = anim = 3128 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c")
trigger8 = anim = 3130 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c")
trigger9 = anim = 3132 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "a" || enemy, command = "b" || enemy, command = "c")
trigger10 = anim = 3134 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "b" || enemy, command = "c")
trigger11 = anim = 3136 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "c")
trigger12 = anim = 3138 && (enemy, command = "up" || enemy, command = "down" || enemy, command = "back" || enemy, command = "forward" || enemy, command = "x" || enemy, command = "y" || enemy, command = "z" || enemy, command = "a" || enemy, command = "b")
var(20) = -1

[State 3118, 8]
type = Changeanim
trigger1 = parent, var(20) = -1
trigger1 = anim%2 = 1
value = anim - 1

[State 3118, 9]
type = Destroyself
trigger1 = time = floor(3.2*tickspersecond)
trigger2 = parent, movetype = H
trigger3 = parent, var(20) = 8

[Statedef 3150]
type = A
movetype = H
physics = S
velset = 0,0

[State 3150, 1]
type = Nothitby
trigger1 = 1
value = SCA

[State 3150, 2]
type = Velset
trigger1 = time = 6
x = -2

[State 3150, 3]
type = Posset
trigger1 = time = 0
y = 0

[State 3150, 4]
type = Posadd
triggerall = timemod = 2,0
trigger1 = time = [0,3]
trigger2 = time = [16,19]
trigger3 = time = [26,29]
trigger4 = time = [36,39]
trigger5 = time = [46,49]
trigger6 = time = [56,59]
trigger7 = time = [66,69]
trigger8 = time = [76,79]
trigger9 = time = [91,94]
trigger10 = time = [103,106]
x = -1

[State 3150, 5]
type = Posadd
triggerall = timemod = 2,1
trigger1 = time = [0,3]
trigger2 = time = [16,19]
trigger3 = time = [26,29]
trigger4 = time = [36,39]
trigger5 = time = [46,49]
trigger6 = time = [56,59]
trigger7 = time = [66,69]
trigger8 = time = [76,79]
trigger9 = time = [91,94]
trigger10 = time = [103,106]
x = 1

[State 3150, 6]
type = Changeanim
trigger1 = time = [0,3]
trigger2 = time = [91,94]
value = 5002

[State 3150, 7]
type = Changeanim
trigger1 = time = [0,3]
trigger2 = time = [91,94]
value = 5002

[State 3150, 8]
type = Changeanim
trigger1 = time = [16,19]
trigger2 = time = [36,39]
trigger3 = time = [56,59]
trigger4 = time = [76,79]
value = 5000

[State 3150, 9]
type = Changeanim
trigger1 = time = [26,29]
trigger2 = time = [46,49]
trigger3 = time = [66,69]
value = 5010

[State 3150, 10]
type = Changeanim
trigger1 = time = [103,106]
value = 5011

[State 3150, 11]
type = Changeanim
trigger1 = anim = 5000 && animtime = 0
value = 5005

[State 3150, 12]
type = Changeanim
trigger1 = anim = 5001 && animtime = 0
value = 5006

[State 3150, 13]
type = Changeanim
trigger1 = anim = 5002 && animtime = 0
value = 5007

[State 3150, 14]
type = Changestate
trigger1 = time = 119
value = 3151

[Statedef 3151]
type = A
movetype = H
physics = N
velset = 0,0

[State 3151, 1]
type = Changeanim2
trigger1 = time = 0
value = 3151

[State 3151, 2]
type = Posadd
trigger1 = timemod = 2,0
trigger1 = time <= 12
x = 1

[State 3151, 3]
type = Posadd
trigger1 = timemod = 2,1
trigger1 = time <= 12
x = -1

[State 3151, 4]
type = Velset
trigger1 = time = 12
y = -19

[State 3151, 5]
type = Veladd
trigger1 = time >= 12
y = 0.35

[State 3151, 6]
type = Veladd
trigger1 = time >= 46
y = 0.15

[State 3151, 7]
type = Changestate
trigger1 = enemynear, stateno != [3100,3102]
;trigger1 = time > 25
;trigger1 = pos y >= 0
value = 3152

[Statedef 3152]
type = A
movetype = H
physics = N
anim = 5100
velset = 0,0

[State 3152, 1]
type = Posset
trigger1 = time = 0
y = 0

[State 3152, 2]
type = Changeanim
trigger1 = time = 10
value = 5160

[State 3152, 3]
type = Velset
trigger1 = anim = 5160
x = -3
y = -10.5
persistent = 0

[State 3152, 4]
type = Veladd
trigger1 = anim = 5160
y = 0.35

[State 3152, 5]
type = Selfstate
trigger1 = pos y > 0
value = 5110

[Statedef 3153]
type = S
movetype = H
physics = N
velset = 0,0

[State 3153, 1]
type = Changeanim2
trigger1 = time = 0
value = 3153

[State 3153, 2]
type = Changeanim2
trigger1 = time = [160,159+floor(3.2*tickspersecond)]
value = anim
elem = animelemno(0)

[State 3153, 3]
type = Posset
trigger1 = time = 0
y = 0

[State 3153, 4]
type = Changestate
trigger1 = enemy, var(20) = 8
value = 3154

[State 3153, 5]
type = Selfstate
trigger1 = time = 217+floor(3.2*tickspersecond)
value = 0
ctrl = 1

[Statedef 3154]
type = S
physics = S
anim = 40
ctrl = 0
sprpriority = 1
hitcountpersist = (enemy, movetype = H)

[State 3154, 1]
type = Changeanim
trigger1 = anim = 40 && animtime = 0
value = 41

[State 3154, 2]
type = Velset
trigger1 = anim = 41
y = -15
persistent = 0

[State 3154, 3]
type = Selfstate
trigger1 = anim = 41
value = 50
ctrl = 1

;---------------------------------------------------------------------------
; Time Song
[Statedef 3400]
type = S
movetype = I
physics = S
anim = 3400
velset = 0,0
ctrl = 0
sprpriority = 3

[State 3400, 1]
type = Varset
trigger1 = time = 27+9*tickspersecond
var(51) = power

[State 3400, 2]
type = Explod
trigger1 = animelem = 10
anim = 919
pos = 25,10
postype = left
bindtime = -1
removetime = 9*tickspersecond
supermovetime = 9*tickspersecond
sprpriority = -3
ownpal = 1

[State 3400, 3]
type = Superpause
trigger1 = animelem = 10
time = 9*tickspersecond
movetime = 9*tickspersecond
anim = -1
sound = S3400,0

[State 3400, 4]
type = Changestate
trigger1 = time = 27+9*tickspersecond
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Illusion Dance (1)
[Statedef 3500]
type = S
movetype = I
physics = S
anim = 3500
velset = 0,0
ctrl = 0
sprpriority = 3
hitcountpersist = (enemy, movetype = H)

[State 3500, 1]
type = Varset
trigger1 = 1
var(41) = 3

[State 3500, 2]
type = Varset
trigger1 = time = 28
var(40) = power

[State 3500, 3]
type = Superpause
trigger1 = time = 4
time = 25
movetime = 25
anim = -1
sound = S8000,2

[State 3500, 4]
type = Explod
trigger1 = time = 5
anim = 3510
bindtime = -1
supermovetime = 25
sprpriority = 2
ownpal = 1

[State 3500, 5]
type = Explod
trigger1 = time = 5
anim = 3511
pos = -12, -125
postype = p1
bindtime = -1
supermovetime = 25
sprpriority = 4
ownpal = 1

[State 3500, 6]
type = AfterImage
trigger1 = time = 29
time = power/9 - 2
length = 6
palcolor = 0
palbright = 0,0,0
palcontrast = 256,256,256
palpostbright = 56,0,72
timeGap = 1
frameGap = 5
trans = none

[State 3500, 7]
type = Helper
trigger1 = time = 0
name = "double"
ID = 3501
stateno = 3501
ownpal = 1

[State 3500, 8]
type = Helper
trigger1 = time = 1
name = "double"
ID = 3502
stateno = 3502
ownpal = 1

[State 3500, 9]
type = Changestate
trigger1 = time = 30
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Illusion Dance (2)
[Statedef 3510]
type = S
movetype = I
physics = S
anim = 3500
velset = 0,0
ctrl = 0
sprpriority = 3
hitcountpersist = (enemy, movetype = H)

[State 3510, 1]
type = Varset
trigger1 = 1
var(41) = 4

[State 3510, 2]
type = Varset
trigger1 = time = 28
var(40) = power

[State 3510, 3]
type = Superpause
trigger1 = time = 4
time = 25
movetime = 25
anim = -1
sound = S8000,2

[State 3510, 4]
type = Explod
trigger1 = time = 5
anim = 3510
bindtime = -1
supermovetime = 25
sprpriority = 2
ownpal = 1

[State 3510, 5]
type = Explod
trigger1 = time = 5
anim = 3511
pos = -12, -125
postype = p1
bindtime = -1
supermovetime = 25
sprpriority = 4
ownpal = 1

[State 3510, 6]
type = AfterImage
trigger1 = time = 29
time = power/9 - 10
length = 14
palcolor = 0
palbright = 0,0,0
palcontrast = 256,256,256
palpostbright = 56,0,72
timeGap = 1
frameGap = 13
trans = none

[State 3510, 7]
type = Helper
trigger1 = time = 0
name = "double"
ID = 3501
stateno = 3501
ownpal = 1

[State 3510, 8]
type = Helper
trigger1 = time = 1
name = "double"
ID = 3502
stateno = 3502
ownpal = 1

[State 3510, 9]
type = Changestate
trigger1 = time = 30
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Illusion Dance (3)
[Statedef 3520]
type = S
movetype = I
physics = S
anim = 3500
velset = 0,0
ctrl = 0
sprpriority = 3
hitcountpersist = (enemy, movetype = H)

[State 3520, 1]
type = Varset
trigger1 = 1
var(41) = 5

[State 3520, 2]
type = Varset
trigger1 = time = 28
var(40) = power

[State 3520, 3]
type = Superpause
trigger1 = time = 4
time = 25
movetime = 25
anim = -1
sound = S8000,2

[State 3520, 4]
type = Explod
trigger1 = time = 5
anim = 3510
bindtime = -1
supermovetime = 25
sprpriority = 2
ownpal = 1

[State 3520, 5]
type = Explod
trigger1 = time = 5
anim = 3511
pos = -12, -125
postype = p1
bindtime = -1
supermovetime = 25
sprpriority = 4
ownpal = 1

[State 3520, 6]
type = AfterImage
trigger1 = time = 29
time = power/9 - 18
length = 22
palcolor = 0
palbright = 0,0,0
palcontrast = 256,256,256
palpostbright = 56,0,72
timeGap = 1
frameGap = 21
trans = none

[State 3520, 7]
type = Helper
trigger1 = time = 0
name = "double"
ID = 3501
stateno = 3501
ownpal = 1

[State 3520, 8]
type = Helper
trigger1 = time = 1
name = "double"
ID = 3502
stateno = 3502
ownpal = 1

[State 3520, 9]
type = Changestate
trigger1 = time = 30
value = 0
ctrl = 1

[Statedef 3501]
type = S
movetype = I
physics = N
anim = parent,anim
velset = 0,0
sprpriority = -98

[State 3501, 1]
type = Assertspecial
trigger1 = time > 0
flag = invisible

[State 3501, 2]
type = Nothitby
trigger1 = 1
value = SCA

[State 3501, 3]
type = Changeanim
trigger1 = parent, anim != anim
trigger2 = parent, animelemno(0) != animelemno(0)
value = parent, anim
elem = parent, animelemno(0)

[State 3501, 4]
type = AfterImage
trigger1 = time = 0
time = 999999
length = ifelse(parent,var(41)=3,10,ifelse(parent,var(41)=4,26,42))
palcolor = 0
palbright = 0,0,0
palcontrast = 256,256,256
palpostbright = 56,0,72
timeGap = 1
frameGap = ifelse(parent,var(41)=3,9,ifelse(parent,var(41)=4,25,41))
trans = none

[State 3501, 5]
type = Bindtoparent
trigger1 = 1
facing = 1

[State 3501, 6]
type = Destroyself
trigger1 = parent, var(40) = 0
trigger1 = parent, stateno != [3500,3520]
trigger2 = parent, var(8) = 1

[Statedef 3502]
type = S
movetype = I
physics = N
anim = parent,anim
velset = 0,0
sprpriority = -99

[State 3502, 1]
type = Assertspecial
trigger1 = time > 0
flag = invisible

[State 3502, 2]
type = Nothitby
trigger1 = 1
value = SCA

[State 3502, 3]
type = Changeanim
;triggerall = parent, time > 3
trigger1 = parent, anim != anim
trigger2 = parent, animelemno(0) != animelemno(0)
value = parent, anim
elem = parent, animelemno(0)

[State 3502, 4]
type = AfterImage
trigger1 = time = 0
time = 999999
length = ifelse(parent,var(41)=3,13,ifelse(parent,var(41)=4,38,32))
palcolor = 256
palbright = 10,10,10
palcontrast = 110,183,256
palpostbright = 0,0,0
timeGap = ifelse(parent,var(41)=5,2,1)
frameGap = ifelse(parent,var(41)=3,12,ifelse(parent,var(41)=4,37,31))
trans = none

[State 3502, 5]
type = Bindtoparent
trigger1 = 1
facing = 1

[State 3502, 6]
type = Destroyself
trigger1 = parent, var(40) = 0
trigger1 = parent, stateno != [3500,3520]
trigger2 = parent, var(8) = 1

;---------------------------------------------------------------------------
; HIT_BOUNCE (hit ground)
[Statedef 5100]
type    = L
movetype= H
physics = N

[State 5100, 0]
type = Playsnd
trigger1 = time = 0
value = 5100,random/333

[State 5100, 1]
type = VelSet
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) = 0
trigger1 = vel x > 1
x = 1

[State 5100, EnvShake]
type = FallEnvShake
trigger1 = Time = 0

[State 5100, Var] ;Save fall velocity
type = VarSet
trigger1 = Time = 0
;trigger1 = GetHitVar(fall.yvel) = 0
sysvar(1) = floor(vel y)

[State 5100, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = (anim != [5051,5059]) && (anim != [5061,5069])
trigger2 = !SelfAnimExist(5100 + (anim % 10))
value = 5100

[State 5100, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
trigger1 = time = 0
trigger1 = (anim = [5051,5059]) || (anim = [5061,5069])
trigger1 = SelfAnimExist(5100 + (anim % 10))
value = 5100 + (anim % 10)

[State 5100, 4]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5100, 5]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5100, 6] ;Reduce speed
type = VelMul
trigger1 = Time = 0
x = 0.75

[State 5100, 7]
type = ChangeState
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) = 0
value = 5110 ;HIT_LIEDOWN

[State 5100, 8]
type = GameMakeAnim
trigger1 = Time = 1
;value = 61
;pos = 0, 0
;under = 1
value = 60 + (sysvar(1) > 5) + (sysvar(1) > 14)
pos = 0, 0
under = sysvar(1) <= 10

[State 5100, 9]
type = HitFallDamage
trigger1 = Time = 3

[State 5100, 10]
type = PlaySnd
trigger1 = Time = 1
;value = F7, 0 ;Hit ground
value = F7, (sysvar(1) > 5) + (sysvar(1) > 14)

[State 5100, 11]
type = PosFreeze
trigger1 = 1

[State 5100, 12]
type = ChangeState
trigger1 = AnimTime = 0
value = 5101

[State 5100, 13]
type = ForceFeedback
trigger1 = Time = 0
waveform = sinesquare
ampl = 128,-3,-.2,.005
time = 20

;---------------------------------------------------------------------------
; HIT_BOUNCE (bounce into air)
[Statedef 5101]
type    = L
movetype= H
physics = N

[State 5101, 1] ;Coming hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim != [5101,5109]
trigger2 = !SelfAnimExist(5160 + (anim % 10))
value = 5160

[State 5101, 2] ;Coming hit ground anim (for hit up)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim = [5101,5109]
trigger1 = SelfAnimExist(5160 + (anim % 10))
value = 5160 + (anim % 10)

[State 5101, 3]
type = HitFallVel
trigger1 = Time = 0

[State 5101, 4]
type = PosSet
trigger1 = Time = 0
y = 20

[State 5101, 5] ;Acceleration
type = VelAdd
trigger1 = 1
y = .4

[State 5101, 6] ;Hit ground
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 12
type = ChangeState
value = 5110

;---------------------------------------------------------------------------
; HIT_LIEDOWN
[Statedef 5110]
type    = L
movetype= H
physics = N

[State 5110, EnvShake]
type = FallEnvShake
trigger1 = Time = 0

[State 5110, 1] ;For hit up/up-diag type (from state 5081)
type = ChangeAnim
persistent = 0
trigger1 = SelfAnimExist(5110 + (anim % 10))
trigger1 = anim = [5081,5089]
value = 5110 + (anim % 10)

[State 5110, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
triggerall = anim != [5110,5119] ;Not already changed anim
trigger1 = anim != [5161,5169]
trigger2 = !SelfAnimExist(5170 + (anim % 10))
value = ifelse(anim=5070,5071,5170)

[State 5110, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
triggerall = time = 0
triggerall = anim != [5110,5119] ;Not already changed anim
trigger1 = anim = [5161,5169]
trigger1 = SelfAnimExist(5170 + (anim % 10))
value = 5170 + (anim % 10)

[State 5110, 4]
type = HitFallDamage
trigger1 = Time = 0

[State 5110, 5]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5110, Var] ;Get fall velocity
type = VarSet
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) != 0
sysvar(1) = floor(vel y)

[State 5110, 6]
type = PlaySnd
trigger1 = Time = 0
trigger1 = !SysVar(0)
;value = F7, 0 ;Hit ground
value = F7, (sysvar(1) > 5) + (sysvar(1) > 14)

[State 5110, 7]
type = GameMakeAnim
trigger1 = Time = 0
trigger1 = !SysVar(0)
value = 60 + (sysvar(1) > 5) + (sysvar(1) > 14)
pos = 0, 0
under = sysvar(1) <= 10

[State 5110, 8]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5110, 9] ;For hit up type
type = ChangeAnim
persistent = 0
triggerall = anim = [5171,5179]
triggerall = SelfAnimExist(5110 + (anim % 10))
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground anim
value = 5110 + (anim % 10)

[State 5110, 10] ;For normal
type = ChangeAnim
persistent = 0
triggerall = Anim != [5111,5119]
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground frame
value = ifelse(anim=5071,5072,5110)

[State 5110, 11] ;If just died
type = ChangeState
triggerall = !alive
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground frame
trigger3 = Anim = [5110,5119]
trigger4 = anim = 5072
value = 5150

[State 5110, 12]
type = VarSet
trigger1 = SysVar(0)
trigger1 = Time = 0
sysvar(0) = 0

[State 5110, 13] ;Friction
type = VelMul
trigger1 = 1
x = 0.85

[State 5110, 14]
type = ForceFeedback
trigger1 = alive
trigger1 = Time = 0
time = 8
ampl = 240
waveform = sine

[State 5110, 15]
type = ForceFeedback
trigger1 = !alive
trigger1 = Time = 0
ampl = 200, 7, -.467
time = 30
waveform = sine

;---------------------------------------------------------------------------
; HIT_GETUP
[Statedef 5120]
type    = L
movetype= I
physics = N

[State 5120, 1a] ;Get up anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim != [5111,5119]
trigger2 = !SelfAnimExist(5120 + (anim % 10))
value = ifelse(anim=5072,5073,5120)

[State 5120, 1b] ;Get up anim (for hit up/diag-up)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim = [5111,5119]
trigger1 = SelfAnimExist(5120 + (anim % 10))
value = 5120 + (anim % 10)

[State 5120, 2]
type = VelSet
trigger1 = Time = 0
x = 0

[State 5120, 3]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

[State 5120, 4]
type = HitFallSet
trigger1 = AnimTime = 0
value = 1

[State 5120, 5] ;Can't be thrown right after getting up
type = NotHitBy
trigger1 = AnimTime = 0
value = , NT,ST,HT
time = 12

[State 5120, 6] ;Can't be hit right after getting up (short time)
type = NotHitBy
trigger1 = AnimTime = 0
value2 = SCA
time = 3

[State 5120, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; HIT_LIEDEAD
[Statedef 5150]
type    = L
movetype= H
physics = N
sprpriority = -3

[State 5150, 1] ;Normal anim
type = ChangeAnim
triggerall = Time = 0
triggerall = SelfAnimExist(5140)
triggerall = anim != 5072
trigger1 = (anim != [5111,5119]) && (anim != [5171,5179])
trigger2 = !SelfAnimExist(5140 + (anim % 10))
value = 5140

[State 5150, 3] ;Hit up type anim
type = ChangeAnim
trigger1 = Time = 0
trigger1 = (anim = [5111,5119]) || (anim = [5171,5179])
trigger1 = SelfAnimExist(5140 + (anim % 10))
value = 5140 + (anim % 10)

[State 5150, 4] ;Match over anim
type = ChangeAnim
persistent = 0
;trigger1 = Time = 0
trigger1 = MatchOver = 1
trigger1 = Anim = [5140,5149]
trigger1 = SelfAnimExist(anim+10)
value = anim+10

[State 5150, 5] ;Switch to 5110 if liedead anim does not exist
type = ChangeAnim
trigger1 = Time = 0
trigger1 = Anim != [5140,5159]
trigger1 = Anim != [5110,5119]
trigger1 = anim != 5072
value = 5110

[State 5150, 6] ;Friction
type = VelMul
trigger1 = 1
x = 0.85

[State 5150, 7] ;Friction
type = VelSet
trigger1 = Vel x < .05
persistent = 0
x = 0

[State 5150, 8]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

[Statedef 5300]
type = A
movetype = H
physics = N
anim = 5051
velset = 0,0

[State 5300, 1]
type = Nothitby
trigger1 = 1
value = SCA

[State 5300, 2]
type = Varset
trigger1 = 1
var(3) = 0

[State 5300, 3]
type = Velset
trigger1 = time = 0
x = -2
y = -10

[State 5300, 4]
type = Veladd
trigger1 = time > 0
y = 0.35

[State 5300, 5]
type = Changeanim
trigger1 = time = 25
value = 5061

[State 5300, 6]
type = Changestate
trigger1 = pos y > 0
value = 5301

[Statedef 5301]
type = L
movetype = H
physics = N
anim = 5170
velset = 0,0

[State 5301, 1]
type = Posset
trigger1 = time = 0
y = 0

[State 5301, 2]
type = Explod
trigger1 = time = 0
anim = F61
sprpriority = -1
ownpal = 1
persistent = 0

[State 5301, 3]
type = Playsnd
trigger1 = time = 0
value = 5100, random/333

[State 5301, 4]
type = Changeanim
trigger1 = anim = 5170 && animtime = 0
value = 5110

[State 5301, 5]
type = Changeanim
trigger1 = time = 40
value = 5120

[State 5301, 6]
type = Changestate
trigger1 = anim = 5120 && animtime = 0
value = 5302

[Statedef 5302]
type = S
movetype = H
physics = N
anim = 5300
velset = 0,0

[State 5302, 1]
type = Explod
trigger1 = time = 0
anim = 5301
pos = 0,-90
postype = p1
bindtime = -1
removetime = 180
sprpriority = 6
ownpal = 1
removeongethit = 1

[State 5302, 2]
type = Playsnd
trigger1 = time = 0
value = 5300,0

[State 5302, 3]
type = Changestate
trigger1 = time = 180
value = 0
ctrl = 1

;---------------------------------------------------------------------------
[Statedef -2]

[State -2, 1]
type = DisplayToClipboard
trigger1 = 1
text = "Vitesse(%f,%f),Position(%f,%f),Distx(%f)"
params = Vel X, Vel Y, Pos X, Pos Y, abs(enemy,pos x-pos x)-(p2dist x-p2bodydist x)
ignorehitpause = 1

[State -2, 2]
type = Explod
trigger1 = anim = [5,6]
trigger1 = numexplod(7) = 0
ID = 7
anim = 7
pos = -59,55+13*(anim=6)
postype = p1
bindtime = -1
sprpriority = 6
ownpal = 1

[State -2, 3]
type = Explod
trigger1 = anim = [5,6]
trigger1 = numexplod(8) = 0
ID = 8
anim = 7
pos = -104,55+13*(anim=6)
postype = p1
bindtime = -1
sprpriority = 6
ownpal = 1

[State -2, 4]
type = Stopsnd
trigger1 = stateno != 100
channel = 24

[State -2, 5]
type = Playsnd
trigger1 = alive && stateno = [5000,5999]
trigger1 = random < 666 && time = 0
trigger1 = movetype = H && gethitvar(animtype) = 0
trigger1 = ifelse(gethitvar(hitshaketime)>0,hitshakeover=0,hitshakeover=1)
value = 5000,random/500

[State -2, 6]
type = Playsnd
trigger1 = alive && stateno = [5000,5999]
trigger1 = random < 666 && time = 0
trigger1 = movetype = H && gethitvar(animtype) = 1
trigger1 = ifelse(gethitvar(hitshaketime)>0,hitshakeover=0,hitshakeover=1)
value = 5000,2+random/500

[State -2, 7]
type = Playsnd
trigger1 = alive && stateno = [5000,5999]
trigger1 = random < 666 && time = 0
trigger1 = movetype = H && gethitvar(animtype) >= 2
trigger1 = ifelse(gethitvar(hitshaketime)>0,hitshakeover=0,hitshakeover=1)
value = 5000,4+random/500

[State -2, 8]
type = Varadd
trigger1 = var(9) > 0
trigger1 = time > (stateno = 91)
var(9) = 1

[State -2, 9]
type = Varset
trigger1 = statetype = S || stateno >= 5000 || stateno = 45
var(9) = 0

[State -2, 10]
type = Varset
trigger1 = var(9) = 0
var(10) = 0

[State -2, 11]
type = Varadd
trigger1 = var(9)%6 = 3
trigger1 = var(9) >= 15
trigger2 = var(9) = 24
var(10) = 8

[State -2, 12]
type = Explod
trigger1 = var(9) = 2
anim = 95
pos = 0,45
postype = p1
sprpriority = 5
ownpal = 1

[State -2, 13]
type = Explod
trigger1 = var(9)%3 = 0
trigger1 = var(9) = [18,36]
anim = 96+((random-1)/333)
pos = ifelse(var(9)%2=0,Var(10),-Var(10)),0
postype = p1
sprpriority = 5
ownpal = 1

[State -2, 14]
type = Explod
trigger1 = var(9)%4 = 1
trigger1 = var(9) = [5,30]
anim = 99
pos = (random/10)-40,0
postype = p1
sprpriority = 4
ownpal = 1

[State -2, 15]
type = Veladd
trigger1 = var(9) > 3
trigger1 = command = "holdfwd"
trigger1 = vel x < 4.79
x = 0.24

[State -2, 16]
type = Veladd
trigger1 = var(9) > 3
trigger1 = command = "holdback"
trigger1 = vel x > -1.19
x = -0.06

[State -2, 17]
type = RemoveExplod
trigger1 = statetype != A
ID = 611

[State -2, 18]
type = RemoveExplod
trigger1 = statetype != A
ID = 621

[State -2, 19]
type = RemoveExplod
trigger1 = statetype != A
ID = 641

[State -2, 20]
type = Explod
trigger1 = screenpos y <= 30
trigger1 = var(9) >= 0
anim = 912
pos = floor(pos x) + 160, 25
postype = left
facing = facing
bindtime = -1
ontop = 1
ownpal = 1

[State -2, 21]
type = Explod
trigger1 = screenpos y <= 30
trigger1 = var(9) >= 0
anim = ID+883
pos = floor(pos x) + 160 - 16*facing, 8
postype = left
bindtime = -1
ontop = 1
ownpal = 1

[State -2, 22]
type = Explod
trigger1 = screenpos y < 300
trigger1 = enemy(0), screenpos y >= 320
anim = 914
pos = floor(enemy(0),pos x) + 160, 215
postype = left
facing = enemy(0),facing
bindtime = -1
ontop = 1
ownpal = 1

[State -2, 23]
type = Explod
trigger1 = screenpos y < 300
trigger1 = enemy(0), screenpos y >= 320
anim = enemy(0),ID+883
pos = floor(enemy(0),pos x) + 160 - 16*enemy(0),facing, 199
postype = left
bindtime = -1
ontop = 1
ownpal = 1

[State -2, 24]
type = Explod
trigger1 = screenpos y < 300
trigger1 = numenemy > 1
trigger1 = enemy(1), screenpos y >= 320
anim = 914
pos = floor(enemy(1),pos x) + 160, 215
postype = left
facing = enemy(1),facing
bindtime = -1
ontop = 1
ownpal = 1

[State -2, 25]
type = Explod
trigger1 = screenpos y < 300
trigger1 = numenemy > 1
trigger1 = enemy(1), screenpos y >= 320
anim = enemy(1), ID + 883
pos = floor(enemy(1),pos x) + 160 - 16*enemy(1),facing, 199
postype = left
bindtime = -1
ontop = 1
ownpal = 1

[State -2, 26]
type = Explod
trigger1 = screenpos y < 300
trigger1 = numpartner > 0
trigger1 = partner, screenpos y >= 320
anim = 913
pos = floor(partner,pos x) + 160, 215
postype = left
facing = partner,facing
bindtime = -1
ontop = 1
ownpal = 1

[State -2, 27]
type = Explod
trigger1 = screenpos y < 300
trigger1 = numpartner > 0
trigger1 = partner, screenpos y >= 320
anim = partner, ID + 883
pos = floor(partner,pos x) + 160 - 16*partner,facing, 199
postype = left
bindtime = -1
ontop = 1
ownpal = 1

[State -2, 28]
type = Varadd
trigger1 = command = "holdfwd2"
var(4) = 1

[State -2, 29]
type = Varadd
trigger1 = command = "holddown2"
var(4) = -1

[State -2, 30]
type = Varset
trigger1 = var(4) > 0
trigger1 = command != "holdfwd2"
var(4) = 0

[State -2, 31]
type = Varset
triggerall = var(4) < 0
trigger1 = command != "holddown2" && command != "holdfwd"
var(4) = 0

[State -2, 32]
type = Varset
trigger1 = var(4) > 0
trigger1 = anim != [150,152]
var(1) = 1

[State -2, 33]
type = Varset
trigger1 = var(4) < 0
trigger1 = anim != [150,152]
var(2) = 1

[State -2, 34]
type = Varset
triggerall = stateno != 150
trigger1 = var(4) = 0 || var(4) >= 6
trigger2 = command != "holdfwd2"
var(1) = 0

[State -2, 35]
type = Varset
triggerall = stateno != 152
trigger1 = var(4) = 0 || var(4) <= -6
trigger2 = command != "holddown2"
var(2) = 0

[State -2, 36]
type = Varset
trigger1 = movetype = H
var(8) = 0

[State -2, 37]
type = Assertspecial
trigger1 = var(8) = 1
flag = invisible

[State -2, 38]
type = Afterimagetime
trigger1 = stateno = [5000,5999]
trigger2 = var(40) = 0 && stateno != [1100,1199]
trigger3 = var(8) = 1
time = 0
ignorehitpause = 1

[State -2, 39]
type = Varadd
trigger1 = var(40) > 0
var(40) = -9
ignorehitpause = 1

[State -2, 40]
type = Poweradd
trigger1 = var(40) != 0
trigger1 = stateno !=  [120,159]
trigger1 = stateno !=  [500,501]
trigger1 = movetype = H
value = -1500
persistent = 0

[State -2, 41]
type = Varset
trigger1 = var(40) < 0
trigger2 = stateno != [120,159]
trigger2 = stateno != [500,501]
trigger2 = movetype = H
var(40) = 0
ignorehitpause = 1

[State -2, 42]
type = Varset
trigger1 = var(40) = 0
var(41) = 0

[State -2, 43]
type = Powerset
trigger1 = var(40) != 0
value = var(40)
ignorehitpause = 1

[State -2, 44]
type = Helper
triggerall = var(40) != 0
triggerall = time = 1
triggerall = stateno != [500,511]
trigger1 = stateno = [200,650]
trigger2 = stateno = [1000,1020]
trigger3 = stateno = [1200,1220]
helpertype = player
name = "double"
ID = 3500+var(41)
stateno = stateno
ownpal = 1

[State -2, 45]
type = Varadd
trigger1 = var(51) != 0
var(51) = -9
ignorehitpause = 1

[State -2, 46]
type = Varset
trigger1 = var(51) < 0
var(51) = 0
ignorehitpause = 1

[State -2, 47]
type = Powerset
trigger1 = var(51) != 0
value = var(51)
ignorehitpause = 1

[State -2, 48]
type = Targetlifeadd
trigger1 = projhit300 = 1
value = ifelse(enemy,movetype=H && hitcount+var(14)>0,-floor(50*(0.66 - 0.02*(hitcount+var(14)))),-50)
persistent = 0

[State -2, 49]
type = Targetlifeadd
trigger1 = projhit301 = 1
value = ifelse(enemy,movetype=H && var(15)>0,-floor(25*(0.66 - 0.02*var(15))),-25)
persistent = 0

[State -2, 50]
type = Targetlifeadd
trigger1 = projhit1000 = 1
value = ifelse(enemy,movetype=H && hitcount+var(14)>0,-floor(70*(0.66 - 0.02*(hitcount+var(14)))),-70)
persistent = 0

[State -2, 51]
type = Targetlifeadd
trigger1 = projhit1001 = 1
value = ifelse(enemy,movetype=H && var(15)>0,-floor(35*(0.66 - 0.02*var(15))),-35)
persistent = 0

[State -2, 52]
type = Targetstate
trigger1 = numtarget > 0
trigger1 = target, gethitvar(damage) = 0
trigger1 = target, life = 0
trigger1 = target, anim = 5006
value = 5050

[State -2, 53]
type = Varadd
trigger1 = projhit300 = 1
trigger2 = projhit1000 = 1
var(14) = 1

[State -2, 54]
type = Varadd
trigger1 = projhit301 = 1
trigger2 = projhit1001 = 1
var(15) = 1

[State -2, 55]
type = Varset
trigger1 = enemy, movetype != H
trigger1 = var(14) != 0
var(14) = 0
ignorehitpause = 1

[State -2, 56]
type = Varset
trigger1 = enemy, movetype != H
trigger1 = var(15) != 0
var(15) = 0
ignorehitpause = 1

[State -2, 57]
type = Hitadd
trigger1 = enemy, movetype != H
value = -hitcount

[State -2, 58]
type = Attackmulset
trigger1 = enemy, movetype != H
trigger2 = hitcount + var(14) = 0
value = 1

[State -2, 59]
type = Attackmulset
trigger1 = enemy, movetype = H
trigger1 = hitcount+var(14) = [1,33]
value = 0.66 - 0.02*(hitcount+var(14))
persistent = 0

[Statedef -3]

[State -3, 1]
type = Changeanim
trigger1 = var(51) != 0
trigger1 = stateno != [5000,5999]
trigger1 = stateno != [350,369]
trigger1 = animelemtime(animelemno(0)+1) < 0
trigger1 = animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1) - ifelse(animelemtime(animelemno(0)+1)=0,animtime,0) > 1
trigger1 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1))/2
value = anim
elem = animelemno(0)+1

[State -3, 2]
type = Changeanim
trigger1 = var(51) != 0
trigger1 = anim = 0 || anim = 11 || anim = 20 || anim = 21 || anim = 41 || anim = 42 || anim = 43 || anim = 100 || anim = 105
trigger1 = animelemtime(animelemno(0)+1) = 0
trigger1 = animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1) - ifelse(animelemtime(animelemno(0)+1)=0,animtime,0) > 1
trigger1 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0))-animtime)/2
value = anim
elem = animelemno(-animtime)

[State -3, 3]
type = Changeanim
trigger1 = var(51) != 0
trigger1 = anim = [5,6]
trigger1 = animelemtime(animelemno(0)+1) = 0
trigger1 = animelemtime(animelemno(0)) - animelemtime(animelemno(0)+1) - ifelse(animelemtime(animelemno(0)+1)=0,animtime,0) > 1
trigger1 = animelemtime(animelemno(0)) >= (animelemtime(animelemno(0))-animtime)/2
value = ifelse(anim=6,11,0)

[State -3, 4]
type = Posadd
trigger1 = var(51) != 0
trigger1 = stateno != [5000,5999]
trigger1 = stateno != [1100,1199]
x = vel x
y = vel y + ifelse(statetype=A,const(movement.yaccel)*2*var(50),0)

[State -3, 5]
type = Varadd
trigger1 = var(51) != 0
trigger1 = statetype = A
var(50) = 1

[State -3, 6]
type = Varset
trigger1 = var(51) != 0
trigger1 = statetype != A || stateno = 45
var(50) = 0

[State -3, 7]
type = Changestate
trigger1 = ctrl
trigger1 = statetype != A
trigger1 = numhelper(315) = 1
trigger1 = helper(315), anim = 317
trigger1 = helper(315),parentdist x = [-10,10]
value = 310

[State -3, 8]
type = Varadd
trigger1 = gethitvar(hitshaketime) > 0
var(3) = 10

[State -3, 9]
type = Varadd
trigger1 = movetype != H
trigger1 = var(3) > 0
var(3) = -1

[State -3, 10]
type = Changestate
trigger1 = var(3) >= 1000
trigger1 = alive
value = 5300
persistent = 0
