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

[Size]
xscale = 1           ;Horizontal scaling factor.
yscale = 1           ;Vertical scaling factor.
ground.back = 14    ;Player width (back, ground)
ground.front = 14    ;Player width (front, ground)
air.back = 10        ;Player width (back, air)
air.front = 10       ;Player width (front, air)
height = 60          ;Height of player (for opponent to jump over)
attack.dist = 160    ;Default attack distance
proj.attack.dist = 90 ;Default attack distance for projectiles
proj.doscale = 0     ;Set to 1 to scale projectiles too
head.pos = 0, -54   ;Approximate position of head
mid.pos = -1, -28    ;Approximate position of midsection
shadowoffset = 0     ;Number of pixels to vertically offset the shadow
draw.offset = 0,0    ;Player drawing offset in pixels (x, y)

[Velocity]
walk.fwd  = 3.0     ;Walk forward
walk.back = -3.0     ;Walk backward
run.fwd  = 8.0, 0    ;Run forward (x, y)
run.back = -6.5,-3.8 ;Hop backward (x, y)
jump.neu = 0,-10.0    ;Neutral jumping velocity (x, y)
jump.back = -3.0    ;Jump back Speed (x, y)
jump.fwd = 3.0       ;Jump forward Speed (x, y)
runjump.back = -2.55,-8.1 ;Running jump speeds (opt)
runjump.fwd = 6,-7      ;.
airjump.neu = 0,-8.1      ;.
airjump.back = -2.55      ;Air jump speeds (opt)
airjump.fwd = 2.5         ;.

[Movement]
airjump.num = 0      ;Number of air jumps allowed (opt)
airjump.height = 35  ;Minimum distance from ground before you can air jump (opt)
yaccel = .44         ;Vertical acceleration
stand.friction = .85  ;Friction coefficient when standing
crouch.friction = .82 ;Friction coefficient when crouching

;---------------------------------------------------------------------------
; Variable usage:
; This is a record of the variables that KFM uses. Keeping a record of your
; variable usage helps you avoid careless mistakes later.
; var(1)  - Used in kfm.cmd for combo condition (updated every tick)
; var(2)  - Used in Kung Fu Throw (state 800) to remember if fwd was being
;           held (remembered from state 800 through state 810).


; Stand
[Statedef 0]
type = S
physics = S
sprpriority = 0

[State 1120, Blink]
type = PalFX
trigger1 = Time = 0
time = 0

[State 0, 1]
type = ChangeAnim
trigger1 = Anim != [0,5]
trigger2 = Anim = 5 && AnimTime = 0 ;Turn anim over
trigger3 = Anim = [1,2]
trigger3 = !animtime
trigger4 = anim = 4
trigger4 = !animtime
value = 0

[State 0, 1]
type = ChangeAnim
trigger1 = Anim = 0
trigger1 = !animtime
value = random%3

[State 0, 1]
type = changeanim
triggerall = anim != 3 && anim != 5
trigger1 = enemynear,pos y <= -35
trigger2 = enemynear,const(size.head.pos.y) <= -120
trigger2 = enemynear,anim != [10,12]
trigger2 = enemynear,statetype != L
value = 3

[State 0, 1]
type = changeanim
triggerall = anim = 3
trigger1 = enemynear,pos y > -35
trigger1 = enemynear,const(size.head.pos.y) > -120
trigger2 = enemynear,anim = [10,12]
trigger2 = enemynear,const(size.head.pos.y) <= -120
trigger3 = enemynear,statetype = L
trigger3 = enemynear,const(size.head.pos.y) <= -120
value = 4

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

[State 0, 3] ;Stop moving if low velocity or 4 ticks pass
type = VelSet
trigger1 = abs(vel x) < Const(movement.stand.friction.threshold)
trigger2 = Time = 4
x = 0

[State 0, 4] ;Are you dead?
type = ChangeState
trigger1 = !alive
value = 5050
ctrl = 0

; Jump Start
[Statedef 40]
type    = S
physics = S
anim = 40
ctrl = 0
sprpriority = 1

[State 40, 1]
type = VarSet
trigger1 = Time = 0
trigger2 = var(59)
trigger2 = p2bodydist x = [-10,10]
sysvar(1) = 0

[State 40, 2]
type = VarSet
trigger1 = command = "holdforward"
trigger2 = var(59)
trigger2 = p2bodydist x > 10
sysvar(1) = 1

[State 40, 3]
type = VarSet
trigger1 = command = "holdbackward"
trigger2 = var(59)
trigger2 = p2bodydist x < -10
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

; Jump Up
[Statedef 50]
type    = A
physics = A

[state 1000]
type = playsnd
trigger1 = time = 0
value = S50,0
volumescale = 125

[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 > Const720p(-8)
trigger1 = SelfAnimExist(anim + 3)
trigger1 = anim >= 41 && anim <= 43
persistent = 0
value = Anim + 3

;Run
[Statedef 100]
type    = S
physics = S
anim = 100
sprpriority = 1
ctrl = 0

[state 1000]
type = playsnd
trigger1 = time = 0
value = S100,1
volumescale = 125

[state 1000]
type = playsnd
trigger1 = animelem = 3
trigger2 = animelem = 7
value = S100,0
volumescale = 125

[state 1000]
type = gameMakeAnim
trigger1 = time = 0
pos = 0,0
value = 120
ignorehitpause = 1

[State 100, 1b]
type = VelSet
trigger1 = time > 3
x = const(velocity.run.fwd.x)

[State 100, 2] ;Prevent run from canceling into walk
type = AssertSpecial
trigger1 = 1
flag = NoWalk

[State 100, 3] ;Prevent from turning
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State 100, Jump]
type = changestate
triggerall = time > 4
trigger1 = command = "holdup"
trigger1 = !var(59)
value = 40

[State 100, 4]
type = ChangeState
triggerall = time > 3
trigger1 = command != "holdforward"
trigger1 = !var(59)
trigger2 = p2bodydist X <= 24 || p2movetype = A
trigger2 = var(59)
value = 101

; Roll Back
[Statedef 105]
type    = S
physics = S
anim = 105
sprpriority = 1
ctrl = 0

[state 1000]
type = gameMakeAnim
trigger1 = time = 0
pos = 0,0
value = 120
ignorehitpause = 1

[state 1000]
type = nothitby
trigger1 = time = 0
time = 12
value = SCA
ignorehitpause = 1

[State 200, 2]
type = PlaySnd
trigger1 = animelem = 2
value = 100,0
volumescale = 125

[State 200, 2]
type = PlaySnd
trigger1 = animelem = 2
value = 200,2
volumescale = 125

[State 100, 1b]
type = VelSet
trigger1 = time > 1 && time < 21
x = const(velocity.run.back.x)

[State 0, VelSet]
type = VelSet
trigger1 = time >= 20
x = 0
y = 0

[State 100, 2] ;Prevent run from canceling into walk
type = AssertSpecial
trigger1 = 1
flag = NoWalk

[State 100, 3] ;Prevent from turning
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State 0, ChangeState]
type = ChangeState
trigger1 = command = "holddown"
trigger1 = !animtime
value = 11
ctrl = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = command != "holddown"
trigger1 = !animtime
value = 0
ctrl = 1

;Skidding
[Statedef 101]
type = S
movetype = I
physics = S
anim = 101
ctrl = 0
sprpriority = 1

[state 1000]
type = gameMakeAnim
trigger1 = time = 0
trigger2 = time = 2
trigger3 = time = 4
trigger4 = time = 6
pos = 0,0
value = 120
ignorehitpause = 1

[state 101,0]
type = playsnd
trigger1 = time = 0
value = S101,0
volumescale = 125

[state 1000]
type = veladd
trigger1 = time = 0
x = 1.7

[State 200, 1]
type = NULL
trigger1 = animelem = 2
trigger2 = animelem = 4
attr = S, NA
damage = 15,0
getpower = 36,36
givepower = 36,36
animtype = Light
guardflag = M
hitflag = MAF
pausetime = 3, 3
sparkNo = 0
guard.sparkNo = 40
sparkXY = -10,-35
hitsound = 5,1
guardsound = 6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -2.5,0
air.velocity = -1.5,-1.5
air.type = low
air.hittime = 15
yaccel = 0.5
ID = 101

[State 0, CtrlSet]
type = CtrlSet
trigger1 = time >= 5
value = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = !animtime
value = 0
ctrl = 1

; GUARD (start)
[Statedef 120]
type = U    ;Leave state type unchanged
physics = U ;Leave physics unchanged

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

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

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

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

[State 120, Hi to Lo]
type = StateTypeSet
triggerall = statetype = S
trigger1 = !AILevel
trigger1 = command = "holddown"
trigger2 = AILevel
trigger2 = (abs(P2Dist X)>120) || (P2MoveType=H) || (P2StateType=C)
trigger2 = P2StateType!=A
trigger2 = AIlevel = 3 && random <= 32 || AIlevel = 4 && random <= 64 || AIlevel = 5 && random <= 72 || AIlevel = 6 && random <= 94 || AIlevel = 7 && random <=250 || AIlevel = 8 && random <= 999
statetype = C
physics = C

[State 120, Lo to Hi]
type = StateTypeSet
triggerall = statetype = C
trigger1 = !AILevel
trigger1 = command != "holddown"
trigger2 = AILevel
trigger2 = p2statetype = A
trigger2 = abs(P2BodyDist X)<50
trigger2 = AIlevel = 3 && random <= 32 || AIlevel = 4 && random <= 64 || AIlevel = 5 && random <= 72 || AIlevel = 6 && random <= 94 || AIlevel = 7 && random <=250 || AIlevel = 8 && random <= 999
statetype = S
physics = S

[State 120, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 130 + (statetype = C) + (statetype = A)*2

[State 120, Stop Guarding]
type = ChangeState
trigger1 = command != "holdbackward"
trigger1 = !AILevel
trigger2 = !inguarddist
value = 140

;---------------------------------------------------------------------------
; Stand guard (guarding)
[Statedef 130]
type    = S
physics = S

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

[State 130, Hi to Lo]
type = ChangeState
trigger1 = command = "holddown"
trigger1 = !AILevel
trigger2 = AILevel
trigger2 = (abs(P2Dist X)>120) || (P2MoveType=H) || (P2StateType=C)
trigger2 = P2StateType!=A
trigger2 = AIlevel = 3 && random <= 32 || AIlevel = 4 && random <= 64 || AIlevel = 5 && random <= 72 || AIlevel = 6 && random <= 94 || AIlevel = 7 && random <=250 || AIlevel = 8 && random <= 999
value = 131

[State 130, Stop Guarding]
type = ChangeState
trigger1 = !AILevel
trigger1 = command != "holdbackward"
trigger2 = !inguarddist
value = 140

;---------------------------------------------------------------------------
; Crouch guard (guarding)
[Statedef 131]
type    = C
physics = C

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

[State 131, Lo to Hi]
type = ChangeState
trigger1 = command != "holddown"
trigger1 = !AILevel
trigger2 = AILevel
trigger2 = p2statetype = A
trigger2 = abs(P2BodyDist X)<50
trigger2 = AIlevel = 3 && random <= 32 || AIlevel = 4 && random <= 64 || AIlevel = 5 && random <= 72 || AIlevel = 6 && random <= 94 || AIlevel = 7 && random <=250 || AIlevel = 8 && random <= 999
value = 130

[State 131, Stop Guarding]
type = ChangeState
trigger1 = !AILevel
trigger1 = command != "holdbackward"
trigger2 = !inguarddist
value = 140

;---------------------------------------------------------------------------
; 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 = "holdbackward" || (var(59)>0)
trigger1 = inguarddist
value = 130

[State 132, 7]
type = ChangeState
trigger1 = sysvar(0)
value = 52

[State 132, Stop Guarding]
type = ChangeState
trigger1 = !AILevel
trigger1 = command != "holdbackward"
trigger2 = !inguarddist
value = 140


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

[State 150, 1]
type = ChangeAnim
trigger1 = 1
value = 150

[State 150, 2]
type = ChangeState
trigger1 = HitShakeOver
value = 151 + 2*(StateType=C)

[State 120, Hi to Lo]
type = StateTypeSet
triggerall = statetype = S
trigger1 = !AILevel
trigger1 = command = "holddown"
trigger2 = AILevel
trigger2 = (abs(P2Dist X)>120) || (P2MoveType=H) || (P2StateType=C)
trigger2 = P2StateType!=A
trigger2 = AIlevel = 3 && random <= 32 || AIlevel = 4 && random <= 64 || AIlevel = 5 && random <= 72 || AIlevel = 6 && random <= 94 || AIlevel = 7 && random <=250 || AIlevel = 8 && random <= 999
statetype = C
physics = C

[State 120, Lo to Hi]
type = StateTypeSet
triggerall = statetype = C
trigger1 = !AILevel
trigger1 = command != "holddown"
trigger2 = AILevel
trigger2 = p2statetype = A
trigger2 = abs(P2BodyDist X)<50
trigger2 = AIlevel = 3 && random <= 32 || AIlevel = 4 && random <= 64 || AIlevel = 5 && random <= 72 || AIlevel = 6 && random <= 94 || AIlevel = 7 && random <=250 || AIlevel = 8 && random <= 999
statetype = S
physics = S

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

;---------------------------------------------------------------------------
; Stand guard hit (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 = HitOver
x = 0

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

[State 120, Hi to Lo]
type = StateTypeSet
triggerall = statetype = S
trigger1 = !AILevel
trigger1 = command = "holddown"
trigger2 = AILevel
trigger2 = (abs(P2Dist X)>120) || (P2MoveType=H) || (P2StateType=C)
trigger2 = P2StateType!=A
trigger2 = AIlevel = 3 && random <= 32 || AIlevel = 4 && random <= 64 || AIlevel = 5 && random <= 72 || AIlevel = 6 && random <= 94 || AIlevel = 7 && random <=250 || AIlevel = 8 && random <= 999
statetype = C
physics = C

[State 120, Lo to Hi]
type = StateTypeSet
triggerall = statetype = C
trigger1 = !AILevel
trigger1 = command != "holddown"
trigger2 = AILevel
trigger2 = p2statetype = A
trigger2 = abs(P2BodyDist X)<50
trigger2 = AIlevel = 3 && random <= 32 || AIlevel = 4 && random <= 64 || AIlevel = 5 && random <= 72 || AIlevel = 6 && random <= 94 || AIlevel = 7 && random <=250 || AIlevel = 8 && random <= 999
statetype = S
physics = S

[State 151, 4]
type = ChangeState
trigger1 = HitOver
value = 130
ctrl = !AILevel

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

[State 152, 1]
type = ChangeAnim
trigger1 = 1
value = 151

[State 152, 3]
type = ChangeState
trigger1 = HitShakeOver
value = 151 + 2*(StateType=C)

[State 120, Hi to Lo]
type = StateTypeSet
triggerall = statetype = S
trigger1 = !AILevel
trigger1 = command = "holddown"
trigger2 = AILevel
trigger2 = (abs(P2Dist X)>120) || (P2MoveType=H) || (P2StateType=C)
trigger2 = P2StateType!=A
trigger2 = AIlevel = 3 && random <= 32 || AIlevel = 4 && random <= 64 || AIlevel = 5 && random <= 72 || AIlevel = 6 && random <= 94 || AIlevel = 7 && random <=250 || AIlevel = 8 && random <= 999
statetype = C
physics = C

[State 120, Lo to Hi]
type = StateTypeSet
triggerall = statetype = C
trigger1 = !AILevel
trigger1 = command != "holddown"
trigger2 = AILevel
trigger2 = p2statetype = A
trigger2 = abs(P2BodyDist X)<50
trigger2 = AIlevel = 3 && random <= 32 || AIlevel = 4 && random <= 64 || AIlevel = 5 && random <= 72 || AIlevel = 6 && random <= 94 || AIlevel = 7 && random <=250 || AIlevel = 8 && random <= 999
statetype = S
physics = S

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

;---------------------------------------------------------------------------
; Crouch guard hit (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 = HitOver
x = 0

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

[State 120, Hi to Lo]
type = StateTypeSet
triggerall = statetype = S
trigger1 = !AILevel
trigger1 = command = "holddown"
trigger2 = AILevel
trigger2 = (abs(P2Dist X)>120) || (P2MoveType=H) || (P2StateType=C)
trigger2 = P2StateType!=A
trigger2 = AIlevel = 3 && random <= 32 || AIlevel = 4 && random <= 64 || AIlevel = 5 && random <= 72 || AIlevel = 6 && random <= 94 || AIlevel = 7 && random <=250 || AIlevel = 8 && random <= 999
statetype = C
physics = C

[State 120, Lo to Hi]
type = StateTypeSet
triggerall = statetype = C
trigger1 = !AILevel
trigger1 = command != "holddown"
trigger2 = AILevel
trigger2 = p2statetype = A
trigger2 = abs(P2BodyDist X)<50
trigger2 = AIlevel = 3 && random <= 32 || AIlevel = 4 && random <= 64 || AIlevel = 5 && random <= 72 || AIlevel = 6 && random <= 94 || AIlevel = 7 && random <=250 || AIlevel = 8 && random <= 999
statetype = S
physics = S

[State 153, 4]
type = ChangeState
trigger1 = HitOver
value = 131
ctrl = !AILevel

;---------------------------------------------------------------------------
; Air guard hit (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

;---------------------------------------------------------------------------
; Air guard hit (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 151, 3]
type = CtrlSet
trigger1 = Time = GetHitVar(ctrltime)
trigger1 = !AILevel
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, 6]
type = ChangeState
trigger1 = sysvar(0)
trigger1 = command = "holdbackward" || var(59)>0
trigger1 = inguarddist
value = 130

[State 155, 7]
type = ChangeState
trigger1 = sysvar(0)
value = 52

;Counter! Biach.
[Statedef 160]
type    = S
movetype= A
physics = S
juggle  = 0
poweradd= -1000
ctrl = 0
velset = 0,0
anim = 230
sprpriority = 2

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 1
ignorehitpause = 1 

[State 0, PalFX]
type = PalFX
trigger1 = time = 0
time = 2
add = 256,256,256
mul = 256,256,256
invertall = 0
color = 256
ignorehitpause = 1

[State 210, 1]
type = PlaySnd
trigger1 = animelem = 3
value = 0, 0
volumescale = 125

[State 200, 2]
type = playsnd
trigger1 = animelem = 3
value = S200,0 +random%3
volumescale = 125

[state 1000]
type = varadd
trigger1 = movehit
var(20) = 1
ignorehitpause = 1

[State 200, 1]
type = HitDef
trigger1 = time = 0 && var(20) <= 1
attr = S, NA
damage = 106, 0
getpower = 72,36
givepower = 36,36
animtype = Hard
guardflag = M
hitflag = MAF
priority = 4, hit
pausetime = 10, 10
sparkNo = 2
guard.sparkNo = 40
sparkXY = -10,-40
hitsound = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 30
ground.hittime  = 18
ground.velocity = -5.0,-7
air.type = low
air.velocity = -5.0,-7
air.hittime = 25
fall = 1
air.fall = 1
fall.recover = 1
yaccel = 0.8
ID = 230

[state 1000]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1 

;Counter!
[Statedef 161]
type    = S
movetype= A
physics = S
juggle  = 0
poweradd= -1000
ctrl = 0
velset = 0,0
anim = 252
sprpriority = 2

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 1
ignorehitpause = 1 

[State 0, PalFX]
type = PalFX
trigger1 = time = 0
time = 2
add = 256,256,256
mul = 256,256,256
invertall = 0
color = 256
ignorehitpause = 1

[State 1120, Blink]
type = PalFX
trigger1 = Time = 0
time = 0
add = 84,84,84
sinadd = 92,92,92,5

[state 1000]
type = removeexplod
trigger1 = 1
ID = 69
ignorehitpause = 1

[state 1000]
type = velset
trigger1 = 1
x = 15

[State 210, 1]
type = PlaySnd
trigger1 = !time
value = S1, 2
volumescale = 125

[State 700, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 0

[state 1000]
type = varadd
trigger1 = movehit
var(20) = 1
ignorehitpause = 1

[State 200, 1]
type = HitDef
trigger1 = time = 0 && var(20) <= 1
attr = S, SA
damage = 106, 0
getpower = 0,0
givepower = 36,36
animtype = hard
guardflag = M
hitflag = MA-
pausetime = 7, 7
sparkNo = 2
guard.sparkNo = 40
sparkXY = -10,-45
hitsound = 5,2
guardsound = 6,0
ground.type = low
ground.slidetime = 15
ground.hittime  = 17
ground.velocity = -18,-8
guard.velocity = -6
airguard.velocity = -6,-4
air.type = low
air.velocity = -18,-8
air.hittime = 25
Air.fall = 1
fall = 1
fall.recover = 0
yaccel = 0.5
ID = 251
p2stateno = 255
p2facing = 1  
envshake.time = 4

[state 1000]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1 

;---------------------------------------------------------------------------
; Lose by Time Over
; CNS difficulty: basic
; CNS レベル: 基本
[Statedef 170]
type = S
ctrl = 0
anim = 170
velset = 0,0

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

;---------------------------------------------------------------------------
; Win state decider
; CNS difficulty: basic
; CNS レベル: 基本
[Statedef 180]
type = S

[State 180, 1]
type = ChangeState
trigger1 = Time = 0
value = 181

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

[state 1000]
type = playsnd
trigger1 = !time
trigger1 = life < 800
value = S180,0+random%3
volumescale = 125

[state 1000]
type = playsnd
trigger1 = !time
trigger1 = life >= 800
value = S180,3
volumescale = 125

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

;---------------------------------------------------------------------------
;Intro decider
[Statedef 190]
type = S
ctrl = 0
velset = 0,0

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = intro

[State 0, ChangeState]
type = changestate
trigger1 = p2name = "FP2 Carol Tea"
value = 192
ctrl = 0

[State 0, ChangeState]
type = changestate
trigger1 = p2name = "FP2 Sash Lilac"
value = 192
ctrl = 0

[State 0, ChangeState]
type = ChangeState
trigger1 = time = 0
value = 191
ctrl = 0

; Introduction - Whenever you're ready
[Statedef 191]
type = S
ctrl = 0
anim = 190
velset = 0,0

[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro

[state 1000]
type = playsnd
trigger1 = time = 0
value = S190,0
volumescale = 130

[State 191, 3] ;Change to stand state when done
type = ChangeState
trigger1 = animtime = 0
value = 0

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

[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 191, 3] ;Change to stand state when done
type = ChangeState
trigger1 = animtime = 0
value = 0
;---------------------------------------------------------------------------
;Weak Whip
[Statedef 200]
type    = S                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                      ;Move-type: A-attack, I-idle, H-gethit
physics = S                      ;Physics: S-stand, C-crouch, A-air
juggle  = 0                      ;Number of air juggle points move takes
;Commonly-used controllers:
velset = 0,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 200                       ;Change animation (Def: no change)
poweradd = 0                    ;Power to add (Def: 0)
sprpriority = 2                  ;Set p1's sprite layering priority to 2 (in front)

[State 200, 1]
type = HitDef
trigger1 = time = 0
attr = S, NA
damage = ceil(ifElse(fvar(11) * 16 < 7, 7, fvar(11) * 16)), 0
getpower = 72,36
givepower = 36,36
animtype = Light
guardflag = M
hitflag = MAF
pausetime = 6, 6
sparkNo = 0
guard.sparkNo = 40
sparkXY = -10,-35
hitsound = 5,0
guardsound = 6,0
ground.type = High
ground.slidetime = 10
ground.hittime  = 13
ground.velocity = -2.3
;Attack.dist
air.type = low
air.velocity = -2.3,-2
air.hittime = 15
yaccel = 0.5
ID = 200

[State 0, ChangeState]
type = changestate
triggerall = movecontact
trigger1 = command = "x"
trigger1 = command != "holddown"
trigger2 = var(59)
trigger2 = random<var(50)*2.0
value = 210
ctrl = 0

[State 200, 2]
type = playsnd
trigger1 = animelem = 2
value = S200,0 +random%3
volumescale = 125

[State 200, 1]
type = PlaySnd
trigger1 = animelem = 2
value = 0, 1
volumescale = 125

[State 200, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1


;---------------------------------------------------------------------------
;Medium Whip
[Statedef 210]
type    = S
movetype= A
physics = S
juggle  = 0
poweradd= 0
ctrl = 0
velset = 0,0
anim = 210
sprpriority = 2

[State 210, 1]
type = PlaySnd
trigger1 = animelem = 2
value = 0, 0
volumescale = 125

[State 200, 2]
type = playsnd
trigger1 = animelem = 2
value = S200,0 +random%3
volumescale = 125

[State 200, 1]
type = HitDef
trigger1 = time = 0
attr = S, NA
damage = ceil(ifElse(fvar(11) * 32 < 7, 7, fvar(11) * 32)), 0
getpower = 72,36
givepower = 36,36
animtype = Medium
guardflag = M
hitflag = MAF
pausetime = 6, 6
sparkNo = 1
guard.sparkNo = 40
sparkXY = -10,-45
hitsound = 5,1
guardsound = 6,0
ground.type = High
ground.slidetime = 15
ground.hittime  = 17
ground.velocity = -2.5
air.type = low
air.velocity = -2.5,-2
air.hittime = 25
Air.fall = 0
fall.recover = 0
yaccel = 0.5
ID = 210

[State 0, ChangeState]
type = changestate
triggerall = movecontact
trigger1 = command = "x"
trigger1 = command != "holddown"
trigger2 = var(59)
trigger2 = random<var(50)*2.0
value = 230
ctrl = 0

[State 0, ChangeState]
type = changestate
triggerall = movecontact
trigger1 = command = "x"
trigger1 = command = "holddown"
trigger2 = var(59)
trigger2 = random<var(50)*2.0
value = 230
ctrl = 0

[State 210, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;Strong Whip
[Statedef 230]
type    = S
movetype= A
physics = S
juggle  = 0
poweradd= 0
ctrl = 0
velset = 0,0
anim = 230
sprpriority = 2

[State 210, 1]
type = PlaySnd
trigger1 = animelem = 3
value = 0, 0
volumescale = 125

[State 200, 2]
type = playsnd
trigger1 = animelem = 3
value = S200,0 +random%3
volumescale = 125

[State 200, 1]
type = HitDef
trigger1 = time = 0
attr = S, NA
damage = ceil(ifElse(fvar(11) * 47 < 7, 7, fvar(11) * 47)), 0
getpower = 72,36
givepower = 36,36
animtype = Hard
guardflag = M
hitflag = MAF
priority = 4, hit
pausetime = 10, 10
sparkNo = 1
guard.sparkNo = 40
sparkXY = -10,-40
hitsound = 5,1
guardsound = 6,0
ground.type = High
ground.slidetime = 30
ground.hittime  = 18
ground.velocity = -5.0,0
air.type = low
air.velocity = -5.0,-2
air.hittime = 25
yaccel = 0.5
ID = 230

[State 0, ChangeState]
type = changestate
triggerall = movecontact
trigger1 = random<var(50)*2.0
value = 1000
ctrl = 0

[State 0, ChangeState]
type = changestate
triggerall = movecontact
trigger1 = random<var(50)*2.0
value = 1015
ctrl = 0

[State 210, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;Dodge
[Statedef 250]
type    = S
movetype= I
physics = S
juggle  = 0
velset = 0,0
ctrl = 0
anim = 250
sprpriority = -1

[State 1120, Blink]
type = PalFX
trigger1 = anim = 250
trigger1 = Time = 0
time = 22
add = 84,84,84
sinadd = 92,92,92,5

[State 700, Voice]
type = Playsnd
trigger1 = time = 2
value = S2,0
volumescale = 125
channel = 0

[state 1000]
type = explod
trigger1 = !time
anim = 251
ontop = 0
pos = 0,0
postype = p1
removetime = 12
bindtime = -1
removeongethit = 1
ownpal = 1
sprpriority = -1
scale = 1.00,1.00
ID = 69

[State 700, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 0

[State 700, HitBy]
type = HitBy
trigger1 = 1
value = SCA,AT
time = 1

[State 0, ChangeState]
type = changestate
triggerall = power >= 500
triggerall = time >= 10
trigger1 = command = "b"
trigger2 = var(59)
trigger2 = random<var(50)*2.0
trigger2 = p2bodydist x >= 50
value = 251
ctrl = 0

[State 700, Attack]
type = ChangeState
trigger1 = animtime = 0
value = 0
ctrl = 1

;Woosh!
[Statedef 251]
type    = S
movetype= A
physics = S
juggle  = 0
poweradd= -500
ctrl = 0
velset = 0,0
anim = 252
sprpriority = 2

[state 1000]
type = removeexplod
trigger1 = 1
ID = 69
ignorehitpause = 1

[State 1120, Blink]
type = PalFX
trigger1 = Time = 0
time = 0
add = 84,84,84
sinadd = 92,92,92,5

[state 1000]
type = velset
trigger1 = 1
x = 15

[State 210, 1]
type = PlaySnd
trigger1 = !time
value = S1, 2
volumescale = 125

[State 700, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 0

[state 1000]
type = varadd
trigger1 = movehit
var(20) = 1
ignorehitpause = 1

[State 200, 1]
type = HitDef
trigger1 = time = 0 && var(20) <= 1
attr = S, SA
damage = 105, 0
getpower = 0,0
givepower = 36,36
animtype = hard
guardflag = MAF
hitflag = MA-
pausetime = 4, 4
sparkNo = 2
guard.sparkNo = 40
sparkXY = -10,-45
hitsound = 5,2
guardsound = 6,0
ground.type = low
ground.slidetime = 15
ground.hittime  = 17
ground.velocity = -18,-8
guard.velocity = -6
airguard.velocity = -6,-4
air.type = high
air.velocity = -18,-8
air.hittime = 25
Air.fall = 0
fall.recover = 0
yaccel = 0.5
ID = 251
p2stateno = 255
p2facing = 1  
envshake.time = 4

[state 1000]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1 

;Forward Dodge
[StateDef 260]
type = S
physics = N
moveType = I
anim = 260
ctrl = 0
velSet = 0,0
sprPriority = -1

[State 710, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 0

[State 710, HitBy]
type = HitBy
trigger1 = AnimElemTime(9)<0
value = SCA,AT
time = 1

[State 710, Start Roll]
type = VelSet
trigger1 = AnimElem = 1
x = 5.0

[State 710, Start Roll]
type = VelSet
trigger1 = AnimElem = 8
x = 1.5

;[State 710, End Roll]
;type = VelSet
;trigger1 = AnimElem = 9
;x = 0

[State 1120, Blink]
type = PalFX
trigger1 = anim = 260
trigger1 = Time = 0
time = 22
add = 84,84,84
sinadd = 92,92,92,5

[State 700, Voice]
type = Playsnd
trigger1 = time = 2
value = S2,0
volumescale = 125
channel = 0

[state 1000]
type = explod
trigger1 = !time
anim = 251
ontop = 0
pos = 0,0
postype = p1
bindtime = -1
removetime = 12
removeongethit = 1
ownpal = 1
sprpriority = -1
scale = 1.00,1.00
ID = 69

[State 0, ChangeState]
type = changestate
triggerall = power >= 500
triggerall = time >= 10
trigger1 = command = "b"
trigger2 = var(59)
trigger2 = random<var(50)*2.0
value = 251
ctrl = 0

[State 710, End]
type = ChangeState
trigger1 = animtime = 0
value = 0
ctrl = 1    

;Backward Dodge
[StateDef 261]
type = S
physics = N
moveType = I
anim = 261
ctrl = 0
velSet = 0,0
sprPriority = -1

[State 710, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 0

[State 710, HitBy]
type = HitBy
trigger1 = AnimElemTime(9)<0
value = SCA,AT
time = 1

[State 710, Start Roll]
type = VelSet
trigger1 = AnimElem = 1
x = -5.0

[State 710, Start Roll]
type = VelSet
trigger1 = AnimElem = 8
x = -1.5

;[State 710, End Roll]
;type = VelSet
;trigger1 = AnimElem = 9
;x = 0

[State 1120, Blink]
type = PalFX
trigger1 = anim = 261
trigger1 = Time = 0
time = 22
add = 84,84,84
sinadd = 92,92,92,5

[State 700, Voice]
type = Playsnd
trigger1 = time = 2
value = S2,0
volumescale = 125
channel = 0

[state 1000]
type = explod
trigger1 = !time
anim = 251
ontop = 0
pos = 0,0
postype = p1
bindtime = -1
removetime = 12
removeongethit = 1
ownpal = 1
sprpriority = -1
scale = 1.00,1.00
ID = 69

[State 0, ChangeState]
type = changestate
triggerall = power >= 500
triggerall = time >= 10
trigger1 = command = "b"
trigger2 = var(59)
trigger2 = random<var(50)*2.0
value = 251
ctrl = 0

[State 710, End]
type = ChangeState
trigger1 = animtime = 0
value = 0
ctrl = 1    

[Statedef 262]
type    = A
movetype= A
physics = N
juggle  = 0
ctrl = 0
anim = 635
sprpriority = 2
poweradd = 0
velset = 8,0

[state 1000]
type = veladd
trigger1 = 1
y = .42

[State 1100, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 1014
ctrl = 0

;Boom!
[Statedef 255]
type    = A
movetype= H
physics = N
velset = 0,0

[State 1025, Anim] ;Custom animation
type = ChangeAnim2
trigger1 = 1
value = 255

[State 1025, State]
type = ChangeState
trigger1 = HitShakeOver = 1
value = 256

;------------------
; Hit by Fast Kung Fu Palm - flying through the air
; (a custom gethit state)
[Statedef 256]
type    = A
movetype= H
physics = N

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

[State 1026, Gravity]
type = VelAdd
trigger1 = 1
y = .45

[State 1026, No scroll]
type = ScreenBound
triggerall = Pos y < -15
trigger1 = BackEdgeBodyDist < 65
trigger2 = FrontEdgeBodyDist < 65
value = 1
movecamera = 0,1

[State 1026, Hit wall]
type = ChangeState
triggerall = Pos y < -15
trigger1 = BackEdgeBodyDist <= 20
trigger2 = FrontEdgeBodyDist <= 20
value = 257

[State 1026, Hit ground]
type = SelfState
trigger1 = (Vel y > 0) && (Pos y >= 0)
value = 5100

;------------------
; Hit by Fast Kung Fu Palm - hit wall
; (a custom gethit state)
[Statedef 257]
type    = A
movetype= H
physics = N

[State 1027, Turn]
type = Turn
trigger1 = (Time = 0) && (FrontEdgeBodyDist <= 30)

[State 1027, Pos]
type = PosAdd
trigger1 = Time = 0
x = 15 - BackEdgeBodyDist

[State 1027, Stop moving]
type = PosFreeze
trigger1 = 1
x = 1
y = 1

[State 1027, No scroll]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 0,1

[State 1027, Spark]
type = Explod
trigger1 = Time = 0
anim = F72
pos = 0, floor (screenpos y) - 50
postype = back
sprpriority = 3

[State 1027, Anim]
type = ChangeAnim2
trigger1 = Time = 0
value = 256

[State 1027, Sound]
type = PlaySnd
trigger1 = Time = 0
value = F7,2
volumescale = 125

[State 1027, State]
type = ChangeState
trigger1 = AnimTime = 0
value = 258

;------------------
; Hit by Fast Kung Fu Palm - bounce off wall
; (a custom gethit state)
[Statedef 258]
type    = A
movetype= H
physics = N

[State 1028, 1]
type = NotHitBy
trigger1 = 1
value = , NA, NP

[State 1028, Vel Y]
type = VelSet
trigger1 = Time = 0
y = -5

[State 1028, Vel X]
type = VelSet
trigger1 = Time = 0
x = 0.4

[State 1028, Turn]
type = Turn
trigger1 = (Time = 0) && (BackEdgeDist < 30)

[State 1028, Gravity]
type = VelAdd
trigger1 = 1
y = .35

[State 1028, Anim 5050] ;Self falling animation
type = ChangeAnim
trigger1 = Time = 0
trigger1 = !SelfAnimExist(5052)
value = 5050

[State 1028, Anim 5052] ;Self falling animation (diagup type)
type = ChangeAnim
trigger1 = Time = 0
trigger1 = SelfAnimExist(5052)
value = 5052

[State 1028, Anim 5060] ;Coming down - normal
type = ChangeAnim
trigger1 = Vel Y > -2
trigger1 = Anim = 5050
trigger1 = SelfAnimExist(5060)
persistent = 0
value = 5060

[State 1028, Anim 5062] ;Coming down - diagup type
type = ChangeAnim
trigger1 = Vel Y > -2
trigger1 = Anim = 5052
trigger1 = SelfAnimExist(5062)
persistent = 0
value = 5062

[State 1028, Hit ground]
type = SelfState
trigger1 = (Vel y > 0) && (Pos y >= 0)
value = 5100

;Crouch Weak Whip
[Statedef 400]
type    = C
movetype= A
physics = C
juggle  = 0
poweradd= 0
ctrl = 0
anim = 400
sprpriority = 2

[State 400, 1]
type = PlaySnd
trigger1 = animelem = 3
value = 0, 1
volumescale = 125

[State 200, 2]
type = playsnd
trigger1 = animelem = 3
value = S200,0 +random%3
volumescale = 125

[state 1000]
type = varadd
trigger1 = movehit
trigger1 = numtarget(400)
trigger1 = target(400),time = 0
var(20) = 1
ignorehitpause = 1

[State 200, 1]
type = HitDef
trigger1 = time = 0 && var(20)<=1
attr = C, NA
damage = ceil(ifElse(fvar(11) * 16 < 7, 7, fvar(11) * 16)), 0
getpower = 72,36
givepower = 36,36
animtype = Light
guardflag = L
hitflag = MAFD
pausetime = 6, 6
sparkNo = 0
guard.sparkNo = 40
sparkXY = -15,-40
hitsound = 5,0
guardsound = 6,0
ground.type = low
ground.slidetime = 10
ground.hittime  = 13
ground.velocity = -2.3
air.type = low
air.velocity = -2.3,-4
air.hittime = 15
down.velocity = -1,-5
down.hittime = 20
yaccel = 0.42
ID = 400

[State 0, ChangeState]
type = changestate
triggerall = movecontact
trigger1 = command = "x"
trigger1 = command != "holddown"
trigger2 = var(59)
trigger2 = random<var(50)*2.0
value = 210
ctrl = 0

[State 0, ChangeState]
type = changestate
triggerall = movecontact
trigger1 = command = "x"
trigger1 = command = "holddown"
trigger2 = var(59)
trigger2 = random<var(50)*2.0
value = 210
ctrl = 0

[State 400, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1

;Air Weak Whip
[Statedef 600]
type    = A
movetype= A
physics = A
juggle  = 0
poweradd= 0
ctrl = 0
anim = 600
sprpriority = 2

[State 600, 1]
type = PlaySnd
trigger1 = anim = 600
trigger1 = animelem = 2
value = 0, 1
volumescale = 125

[State 200, 2]
type = playsnd
trigger1 = anim = 600
trigger1 = animelem = 2
value = S200,0 +random%3
volumescale = 125

[State 200, 1]
type = HitDef
trigger1 = anim = 600
trigger1 = time = 0
attr = A, NA
damage = ceil(ifElse(fvar(11) * 16 < 7, 7, fvar(11) * 16)), 0
getpower = 72,36
givepower = 36,36
animtype = light
guardflag = HA
hitflag = MAF
pausetime = 6, 6
sparkNo = 0
guard.sparkNo = 40
sparkXY = -15,-45
hitsound = 5,0
guardsound = 6,0
ground.type = High
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -2
air.type = low
air.velocity = -1.5,-2
air.hittime = 25
fall = 0
fall.recover = 0
;yaccel = 0.8
ID = 600

[state 1000]
type = changeanim
trigger1 = anim = 600
trigger1 = animtime = 0
value = 635

[State 0, ChangeState]
type = changestate
triggerall = movecontact
trigger1 = command = "x"
trigger2 = var(59)
trigger2 = random<var(50)*2.0
value = 610
ctrl = 0

;Air Medium Whip
[Statedef 610]
type    = A
movetype= A
physics = A
juggle  = 0
poweradd= 11
ctrl = 0
anim = 610
sprpriority = 2
velset = 2,-2

[State 600, 1]
type = PlaySnd
trigger1 = anim = 610
trigger1 = animelem = 3
value = 0, 0
volumescale = 125

[State 200, 2]
type = playsnd
trigger1 = anim = 610
trigger1 = animelem = 3
value = S200,0 +random%3
volumescale = 125

[State 200, 1]
type = HitDef
trigger1 = anim = 610
trigger1 = time = 0
attr = A, NA
damage = ceil(ifElse(fvar(11) * 32 < 7, 7, fvar(11) * 32)), 0
getpower = 72,36
givepower = 36,36
animtype = medium
guardflag = HA
hitflag = MAF
pausetime = 6, 6
sparkNo = 1
guard.sparkNo = 40
sparkXY = -15,-40
hitsound = 5,1
guardsound = 6,0
ground.type = High
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -3
air.type = low
air.velocity = -3.0,-2
air.hittime = 25
fall = 0
fall.recover = 0
;yaccel = 0.8
ID = 610

[state 1000]
type = changeanim
trigger1 = anim = 610
trigger1 = animtime = 0
value = 635

[State 0, ChangeState]
type = changestate
triggerall = movecontact
trigger1 = random<var(50)*2.0
value = 1010
ctrl = 0

[State 0, ChangeState]
type = changestate
triggerall = movecontact
trigger1 = command = "x"
trigger2 = var(59)
trigger2 = random<var(50)*2.0
value = 630
ctrl = 0

;Air Strong Whip
[Statedef 630]
type    = A
movetype= A
physics = A
juggle  = 0
poweradd= 11
ctrl = 0
anim = 630
sprpriority = 2
velset = 2,-2

[State 600, 1]
type = PlaySnd
trigger1 = anim = 630
trigger1 = animelem = 3
value = 0, 0
volumescale = 125

[State 200, 2]
type = playsnd
trigger1 = anim = 630
trigger1 = animelem = 3
value = S200,0 +random%3
volumescale = 125

[State 200, 1]
type = HitDef
trigger1 = anim = 630
trigger1 = time = 0
attr = A, NA
damage = ceil(ifElse(fvar(11) * 47 < 7, 7, fvar(11) * 47)), 0
getpower = 72,36
givepower = 36,36
animtype = hard
guardflag = HA
hitflag = MAF
pausetime = 10, 10
sparkNo = 2
guard.sparkNo = 40
sparkXY = -15,-40
hitsound = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -5,-6
air.type = low
air.velocity = -1.5,15
air.hittime = 25
fall = 1
fall.recover = 0
fall.damage = 15
;yaccel = 0.8
ID = 630
envshake.time = 10

[state 1000]
type = changeanim
trigger1 = anim = 630
trigger1 = animtime = 0
value = 635

;Air Strong Whip
[Statedef 631]
type    = A
movetype= A
physics = N
juggle  = 0
poweradd= 11
ctrl = 0
anim = 630
sprpriority = 2
velset = 2,-2

[state 1000]
type = veladd
trigger1 = 1
y = .42

[State 600, 1]
type = PlaySnd
trigger1 = anim = 630
trigger1 = animelem = 3
value = 0, 0
volumescale = 125

[State 200, 2]
type = playsnd
trigger1 = anim = 630
trigger1 = animelem = 3
value = S200,0 +random%3
volumescale = 125

[State 200, 1]
type = HitDef
trigger1 = anim = 630
trigger1 = time = 0
attr = A, NA
damage = ceil(ifElse(fvar(11) * 47 < 7, 7, fvar(11) * 47)), 0
getpower = 72,36
givepower = 36,36
animtype = hard
guardflag = HA
hitflag = MAF
pausetime = 10, 10
sparkNo = 2
guard.sparkNo = 40
sparkXY = -15,-40
hitsound = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -5,-4
air.type = low
air.velocity = -1.5,15
air.hittime = 25
fall = 1
fall.recover = 0
fall.damage = 15
;yaccel = 0.8
ID = 630
envshake.time = 10

[state 1000]
type = changeanim
trigger1 = anim = 630
trigger1 = animtime = 0
value = 635

[State 1100, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 1012
ctrl = 0

;Air Dodge
[Statedef 650]
type    = A
movetype= I
physics = N
juggle  = 0
ctrl = 0
anim = 650
sprpriority = -1

[State 1120, Blink]
type = PalFX
trigger1 = anim = 650
trigger1 = Time = 0
time = 22
add = 84,84,84
sinadd = 92,92,92,5

[State 700, Voice]
type = Playsnd
trigger1 = time = 2
value = S2,0
volumescale = 125
channel = 0

[state 1000]
type = veladd
trigger1 = 1
y = .42

[state 1000]
type = explod
trigger1 = !time
anim = 251
ontop = 0
pos = 0,0
postype = p1
removetime = 12
bindtime = -1
removeongethit = 1
ownpal = 1
sprpriority = -1
scale = 1.00,1.00
ID = 69

[State 700, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 0

[State 700, HitBy]
type = HitBy
trigger1 = 1
value = SCA,AT
time = 1

[State 0, ChangeState]
type = changestate
triggerall = power >= 500
triggerall = time >= 10
trigger1 = command = "b"
trigger2 = var(59)
trigger2 = random<var(50)*2.0
value = 651
ctrl = 0

[State 700, Attack]
type = Changestate
trigger1 = animtime = 0
value = 1016
ctrl = 0

[State 1100, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 1014
ctrl = 0

;Air Woosh!
[Statedef 651]
type    = A
movetype= A
physics = A
juggle  = 4
poweradd= -500
ctrl = 0
velset = 0,0
anim = 252
sprpriority = 2

[state 1000]
type = removeexplod
trigger1 = 1
ID = 69
ignorehitpause = 1

[State 1120, Blink]
type = PalFX
trigger1 = Time = 0
time = 0
add = 84,84,84
sinadd = 92,92,92,5

[state 1000]
type = velset
trigger1 = 1
x = 15
y = 0

[State 210, 1]
type = PlaySnd
trigger1 = !time
value = S1, 2
volumescale = 125

[State 700, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 0

[state 1000]
type = varadd
trigger1 = movehit
var(20) = 1
ignorehitpause = 1

[State 200, 1]
type = HitDef
trigger1 = time = 0 && var(20) <= 1
attr = S, SA
damage = 106, 0
getpower = 0,0
givepower = 36,36
animtype = hard
guardflag = MAF
hitflag = MA-
pausetime = 4, 4
sparkNo = 2
guard.sparkNo = 40
sparkXY = -10,-45
hitsound = 5,2
guardsound = 6,0
ground.type = low
ground.slidetime = 15
ground.hittime  = 17
ground.velocity = -18,-8
guard.velocity = -6
airguard.velocity = -6,-4
air.type = low
air.velocity = -18,-8
air.hittime = 25
Air.fall = 0
fall.recover = 0
yaccel = 0.5
ID = 251
p2stateno = 255
p2facing = 1  
envshake.time = 4

[state 1000]
type = changestate
trigger1 = animtime = 0
value = 262
ctrl = 0

[State 1100, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 1014
ctrl = 0

;Throw attack - Ech
[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          ;Attributes: Standing, Normal Throw
hitflag = M-          ;Affect only ground people who are not being hit
priority = 1, Miss    ;Throw has low priority, must be miss or dodge type.
sparkno = -1          ;No spark
p1sprpriority = 1     ;Draw p1's sprite in front of p2
                      ;p2's sprite priority is set to 0 by default
p1facing = 1
p2facing = 1          ;Force p2 to face KFM
p1stateno = 810       ;On success, KFM changes to state 810
p2stateno = 820       ;If hit, p2 changes to state 820 in KFM's cns
guard.dist = 0        ;This prevents p2 from going into a guard state if close
fall = 1              ;Force p2 into falling down
ID = 820
guardflag = 

[state 1000]
type = stateTypeSet
trigger1 = animelemtime(3) >= 0
movetype = I

[State 0, PalFX]
type = PalFX
trigger1 = time = 0
time = 2
add = 256,256,256
mul = 256,256,256
invertall = 0
color = 256
ignorehitpause = 1

[State 800, 2]
type = ChangeState
Trigger1 = AnimTime = 0
value = 0
ctrl = 1

;Throw attack - Ech
[Statedef 801]
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          ;Attributes: Standing, Normal Throw
hitflag = M-          ;Affect only ground people who are not being hit
priority = 1, Miss    ;Throw has low priority, must be miss or dodge type.
sparkno = -1          ;No spark
p1sprpriority = 1     ;Draw p1's sprite in front of p2
                      ;p2's sprite priority is set to 0 by default
p1facing = 1
p2facing = 1          ;Force p2 to face KFM
p1stateno = 815       ;On success, KFM changes to state 810
p2stateno = 830       ;If hit, p2 changes to state 820 in KFM's cns
guard.dist = 0        ;This prevents p2 from going into a guard state if close
fall = 1              ;Force p2 into falling down
ID = 820
guardflag = 

[state 1000]
type = stateTypeSet
trigger1 = animelemtime(3) >= 0
movetype = I

[State 0, PalFX]
type = PalFX
trigger1 = time = 0
time = 2
add = 256,256,256
mul = 256,256,256
invertall = 0
color = 256
ignorehitpause = 1

[State 800, 2]
type = ChangeState
Trigger1 = AnimTime = 0
value = 0
ctrl = 1

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

[state 1000]
type = varadd
trigger1 = time = 0
var(20) = 1
ignorehitpause = 1

[State 0, Turn]
type = null;Turn
trigger1 = command = "holdbackward"
trigger1 = time = 0

[State 0, TargetState]
type = null;TargetState
trigger1 = command = "holdbackward"
trigger1 = time = 0
value = 822
ID = 820

[State 0, Width]
type = Width
trigger1 = 1
edge = 40,0

[State 810, Grab Sound]
type = PlaySnd
trigger1 = time = 0
value = S8, 0
volumescale = 200

[State 810, Throw Sound]
type = PlaySnd
trigger1 = Animelem = 3
value = 0, 1
volumescale = 125

[State 810, Hit Sound]
type = PlaySnd
trigger1 = AnimElem = 4
value = F5,2

[State 200, 2]
type = PlaySnd
trigger1 = Animelem = 3
value = S200,0+random%3
Volumescale = 125

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

[State 0, Explod]
type = Explod
trigger1 = animelem = 4
anim = F2
ID = 8052
pos = 50,-35
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
ontop = 1

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

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

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

[State 0, VarSet]
type = VarSet
trigger1 = 1
var(4) = 1

[State 810, State End]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

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

[state 1000]
type = varadd
trigger1 = time = 0
var(20) = 1
ignorehitpause = 1

[State 0, Turn]
type = Turn
trigger1 = time = 0

[State 0, Width]
type = Width
trigger1 = 1
edge = 40,0

[State 810, Grab Sound]
type = PlaySnd
trigger1 = time = 0
value = S8, 0
volumescale = 200

[State 810, Throw Sound]
type = PlaySnd
trigger1 = Animelem = 3
value = 0, 1
volumescale = 125

[State 810, Hit Sound]
type = PlaySnd
trigger1 = AnimElem = 4
value = F5,2

[State 200, 2]
type = PlaySnd
trigger1 = Animelem = 3
value = S200,0+random%3
Volumescale = 125

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

[State 0, Explod]
type = Explod
trigger1 = animelem = 4
anim = F2
ID = 8052
pos = 50,-35
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
ontop = 1

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

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

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

[State 0, VarSet]
type = VarSet
trigger1 = 1
var(4) = 1

[State 810, State End]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;Thrown by Kung Fu Throw
; (a custom gethit state)
; Description: This is the state that the opponent changes to after being
;     hit by KFM's throw HitDef. The important thing here is to use a
;     ChangeAnim2 controller. The difference between ChangeAnim2 and
;     ChangeAnim is that ChangeAnim2 changes the player's animation to
;     an action in the AIR file of the attacker (in this case, kfm.air),
;     whereas ChangeAnim always changes the player to an action in his
;     own AIR file. Look at Action 820 in kfm.air for some extra
;     comments.
[Statedef 820]
type    = A
movetype= H
physics = N
velset = 0,0

[State 1120, Blink]
type = PalFX
trigger1 = Time = 0
time = 0

[State 1120, Blink]
type = PalFX
trigger1 = Time = 0
time = 0

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

;---------------------------------------------------------------------------
;Thrown by Kung Fu Throw - thrown into the air
; (a custom gethit state)
; Description: This state has the opponent flying through the air and
;     falling down onto the ground. The SelfState controller sets the
;     opponent back using to his own state file when he his the ground.
;     Controllers 821,2 and 821,3 allow the opponent to recover by
;     hitting his recovery command when he is falling.
[Statedef 821]
type    = A
movetype= H
physics = N
velset = -4,-8

[State 1120, Blink]
type = PalFX
trigger1 = Time = 0
time = 0

[State 1120, Blink]
type = PalFX
trigger1 = Time = 0
time = 0

[State 821, 1] ;Gravity
type = VelAdd
Trigger1 = 1
y = .6

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

;---------------------------------------------------------------------------
;Thrown by Kung Fu Throw
; (a custom gethit state)
; Description: This is the state that the opponent changes to after being
;     hit by KFM's throw HitDef. The important thing here is to use a
;     ChangeAnim2 controller. The difference between ChangeAnim2 and
;     ChangeAnim is that ChangeAnim2 changes the player's animation to
;     an action in the AIR file of the attacker (in this case, kfm.air),
;     whereas ChangeAnim always changes the player to an action in his
;     own AIR file. Look at Action 820 in kfm.air for some extra
;     comments.
[Statedef 822]
type    = A
movetype= H
physics = N
velset = 0,0

[State 1120, Blink]
type = PalFX
trigger1 = Time = 0
time = 0

[State 1120, Blink]
type = PalFX
trigger1 = Time = 0
time = 0

[State 0, Turn]
type = Turn
trigger1 = time = 0

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

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

[State 1120, Blink]
type = PalFX
trigger1 = Time = 0
time = 0

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

[Statedef 831]
type    = A
movetype= H
physics = N
velset = 4,-8

[State 0, Turn]
type = Turn
trigger1 = time = 0

[State 1120, Blink]
type = PalFX
trigger1 = Time = 0
time = 0

[State 1120, Blink]
type = PalFX
trigger1 = Time = 0
time = 0

[State 821, 1] ;Gravity
type = VelAdd
Trigger1 = 1
y = .6

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

;Rising slash part 1
[Statedef 1000]
type    = S
movetype= A
physics = S
juggle  = 0
poweradd= 0
ctrl = 0
velset = 0,0
anim = 1000
sprpriority = 2

[state 1000]
type = velset
triggerall = prevstateno = [200,600]
trigger1 = time = 0
x = 6

[state 1000]
type = velset
triggerall = !prevstateno = [200,600]
trigger1 = time = 0
x = 3

[state 1000]
type = playsnd
trigger1 = animelem = 2
value = 1000,0+random%3
volumescale = 125

[state 1000]
type = playsnd
trigger1 = animelem = 2
value = 0,2
volumescale = 125

[state 1000]
type = nothitby
trigger1 = 1
value = SCA
time = 1
ignorehitpause = 1

[state 1000]
type = changestate
trigger1 = animelem = 3
value = 1001
ctrl = 0

;Rising slash part 2
[Statedef 1001]
type    = A
movetype= A
physics = N
juggle  = 0
ctrl = 0
poweradd = 72
velset = 1.2,-9.5
sprpriority = 2

[state 1000]
type= veladd
trigger1 = 1
y = .42

[State 200, 1]
type = HitDef
trigger1 = anim = 1000
trigger1 = animelem = 3
attr = A, SA
damage = ceil(ifElse(fvar(11) * 35 < 7, 7, fvar(11) * 35)), 1
animtype = diagup
getpower = 36,18
givepower = 18,18
guardflag = M
hitflag = MAF
pausetime = 5, 5
sparkNo = 1
guard.sparkNo = 40
sparkXY = -20,-55
hitsound = 5,1
guardsound = 6,0
ground.type = low
ground.slidetime = 20
ground.hittime  = 25
ground.velocity = -1,-4.0
air.type = low
air.velocity = -1,-4.0
air.hittime = 25
Air.fall = 1
fall.recover = 0
fall = 1
yaccel = 0.5
ID = 1001

[State 200, 1]
type = HitDef
trigger1 = anim = 1000
trigger1 = animelem = 4
attr = A, SA
damage = ceil(ifElse(fvar(11) * 35 < 7, 7, fvar(11) * 35)), 5
animtype = diagup
getpower = 36,18
givepower = 18,18
guardflag = M
hitflag = MAF
pausetime = 5, 5
sparkNo = 1
guard.sparkNo = 40
sparkXY = -20,-55
hitsound = 5,1
guardsound = 6,0
ground.type = High
ground.slidetime = 20
ground.hittime  = 25
ground.velocity = -1,-11.0
air.type = high
air.velocity = -1,-12.0
air.hittime = 25
Air.fall = 1
fall.recover = 0
fall = 1
yaccel = 0.60
ID = 1001

[state 1000]
type = changeanim
trigger1 = anim = 1000
trigger1 = animtime = 0
value = 635

[State 0, ChangeState]
type = null
triggerall = !var(59)
triggerall = movecontact
trigger1 = command = "QCB_x"
value = 1069
ctrl = 0

[State 0, ChangeState]
type = changestate
triggerall = time >= 12 && movecontact
trigger1 = command = "x"
trigger2 = var(59)
trigger2 = random<var(50)*2.0
value = 631
ctrl = 0

[State 1100, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 1012
ctrl = 0

;Air Rising Slash
[Statedef 1002]
type    = A
movetype= A
physics = N
juggle  = 0
ctrl = 0
poweradd = 72
anim = 1001
velset = 1.0,-8.5
sprpriority = 2

[state 1000]
type = playsnd
trigger1 = animelem = 1
value = 1000,0+random%3
volumescale = 125

[state 1000]
type = playsnd
trigger1 = animelem = 1
value = 0,2
volumescale = 125

[state 1000]
type= veladd
trigger1 = 1
y = .42

[State 200, 1]
type = HitDef
trigger1 = anim = 1001
trigger1 = animelem = 2
attr = A, SA
damage = ceil(ifElse(fvar(11) * 30 < 7, 7, fvar(11) * 30)), 5
animtype = diagup
getpower = 36,18
givepower = 18,18
guardflag = M
hitflag = MAF
pausetime = 5, 5
sparkNo = 1
guard.sparkNo = 40
sparkXY = -20,-55
hitsound = 5,1
guardsound = 6,0
ground.type = low
ground.slidetime = 20
ground.hittime  = 25
ground.velocity = -1,-4.0
air.type = low
air.velocity = -1,-4.0
air.hittime = 25
Air.fall = 1
fall.recover = 0
fall = 1
yaccel = 0.5
ID = 1001

[State 200, 1]
type = HitDef
trigger1 = anim = 1001
trigger1 = animelem = 3
attr = A, SA
damage = ceil(ifElse(fvar(11) * 30 < 7, 7, fvar(11) * 30)), 5
animtype = diagup
getpower = 36,18
givepower = 18,18
guardflag = MAF
hitflag = MAF
pausetime = 5, 5
sparkNo = 1
guard.sparkNo = 40
sparkXY = -20,-55
hitsound = 5,1
guardsound = 6,0
ground.type = High
ground.slidetime = 20
ground.hittime  = 25
ground.velocity = -1,-11.0
air.type = high
air.velocity = -1,-12.0
air.hittime = 25
Air.fall = 1
fall.recover = 0
fall = 1
yaccel = 0.5
ID = 1001

[state 1000]
type = changeanim
trigger1 = anim = 1001
trigger1 = animtime = 0
value = 635

[State 0, ChangeState]
type = changestate
triggerall = time >= 12 && movecontact
trigger1 = command = "x"
trigger2 = var(59)
trigger2 = random<var(50)*2.0
value = 630
ctrl = 0

[State 1100, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 1012
ctrl = 0

;---------------------------------------------------------------------------
;Dive kick part 1
[Statedef 1010]
type    = A
movetype= A
physics = N
juggle  = 0
ctrl = 0
poweradd = 72
anim = 1010
sprpriority = 2

[State 3050, hitvar]
type=varset
trigger1 = time = 0
var(14)=0

[state 1000]
type = velset
trigger1 = 1
y = -2.00

[state 1000]
type = playsnd
trigger1 = animelem = 1
value = S1,0
volumescale = 125

[state 1000]
type = playsnd
trigger1 = animtime = 0
value = S1,1
volumescale = 125

[state 1000]
type = playsnd
trigger1 = animtime = 0
value = 1000,0+random%3
volumescale = 125

[state 1000]
type = changestate
trigger1 = animtime = 0
value = 1011
ctrl = 0

;Dive kick part 2
[Statedef 1011]
type    = A
movetype= A
physics = N
juggle  = 0
ctrl = 0
poweradd = 0
anim = 1011
velset = 3,5
sprpriority = 2

[State 3050, hitvar]
type=varset
trigger1 = anim!=1011
var(14)=0

[State 3050, hitvar]
type=varadd
trigger1=anim=1011&&(movehit=1||moveguarded=1||movereversed=1)
var(14)=1

[state 1000]
type = veladd
trigger1 = 1
y = 0.9

[State 1000, 5] ;Opponent near
type = hitdef
trigger1=anim=1011 && animelemtime(15)>=0
trigger1= timemod = 2,0 && var(14)<3
attr = A, SA
animtype  = Hard;core
damage    = ceil(ifElse(fvar(11) * 30 < 7, 7, fvar(11) * 30)), 3
guardflag = HA
hitflag = MAF
getpower = 72,36
givepower = 36,36
pausetime = 4,4
sparkNo = 1
guard.sparkNo = 40
sparkXY = -8,-10
hitsound = 5,1
guardsound = 6,0
ground.type = high
air.type = low
ground.slidetime = 17
ground.hittime  = 17
ground.velocity = -2.5,0
air.velocity = -2,-1.5
fall = 0
air.fall = 1
fall.recovertime = 20
ID = 650

[state 1000]
type = changestate
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 1012
ctrl = 1

; Jump Land from dive kick
[Statedef 1012]
type    = S
physics = S
ctrl = 0
anim = 1012

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

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

[State 52, 4]
type = VelSet
trigger1 = abs(vel x) < Const(movement.stand.friction.threshold)
x = 0

[State 52, Landing Dust Explod]
type = NULL
trigger1 = !Time
anim = 8102
sprPriority = -3
posType = P1
scale = 0.5,0.5
pauseMoveTime = -1
superMoveTime = -1
ownPal = 1

[State 0, ChangeState]
type = changestate
triggerall = time > 2
trigger1 = command = "x"
trigger1 = command = "holddown"
trigger2 = var(59)
trigger2 = random<var(50)*2.0
value = 400
ctrl = 0

[State 52, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

; Jump Land from dive kick
[Statedef 1014]
type    = S
physics = S
ctrl = 0
anim = 1014

[state 1000]
type = nothitby
trigger1 = time = 0
time = 0
value = SCA
ignorehitpause = 1

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

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

[State 52, 4]
type = VelSet
trigger1 = abs(vel x) < Const(movement.stand.friction.threshold)
x = 0

[State 52, Landing Dust Explod]
type = NULL
trigger1 = !Time
anim = 8102
sprPriority = -3
posType = P1
scale = 0.5,0.5
pauseMoveTime = -1
superMoveTime = -1
ownPal = 1

[State 52, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;Dragon cyclone
[Statedef 1015]
type    = S
movetype= A
physics = S
juggle  = 0
ctrl = 0
poweradd = 72
velset = 3,0
anim = 1015
sprpriority = 2

[State 1100, 5]
type = ChangeState
trigger1 = animtime = 0
value = 1420
ctrl = 0

;Dragon cyclone
[Statedef 1420]
type    = A
movetype= A
physics = N
juggle  = 0
ctrl = 0
poweradd = 72
anim = 1050
velset = 6,-3.5
sprpriority = 2

[state 100x,atc efe];?????????
type = Explod
trigger1 = time  = 0
anim =1150
ID = 100
postype = p1
pos = 0,-40
sprpriority = 5
ontop = 1
bindtime = 1
removetime = -2
ownpal=1
persistent  =0
scale = 1.0,1.0

[state 100x,atc efe];????????? ?
type = Explod
trigger1 = numexplod(101) <= 2
trigger1 = 1
anim =1150
ID = 101
postype = p1
pos = 30,-40
random = 40,20
sprpriority = 5
ontop = 1
bindtime = 1
removetime = 12
ownpal=1
scale = 1.0 + (random % 3 * 0.1), 1.0 + (random % 3 * 0.1)
accel  = -0.2 - (random % 4 * 0.1),0

[state 100x,atc efe];????????? ?
type = Explod
trigger1 = numexplod(101) <= 2
trigger1 = 1
anim =1150
ID = 101
postype = p1
pos = -20,-40
random = 40,20
sprpriority = 5
ontop = 1
bindtime = 1
removetime = 12
ownpal=1
scale = 1 + (random % 3 * 0.1), 1 + (random % 3 * 0.1)
accel  = -0.2 - (random % 4 * 0.1),0

[state 1000]
type = veladd
trigger1 = 1
y = .22

[state 1000]
type = playsnd
trigger1 = animelem = 1
value = S1,3
volumescale = 125

[state 1000]
type = playsnd
trigger1 = animelem = 1
value = S1020,0
volumescale = 125

[State 200, 1]
type = HitDef
trigger1 = animelem = 2
trigger2 = animelem = 6
attr = A, SA
damage = ceil(ifElse(fvar(11) * 25 < 7, 7, fvar(11) * 25)), 1
animtype = medium
guardflag = MA
hitflag = MAF
getpower = 20,5
givepower = 5,5
pausetime = 6,6
sparkNo = 1
guard.sparkNo = 40
sparkXY = -1,-40
hitsound = 5,1
guardsound = 6,0
ground.type = High
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -6,-3.2
guard.velocity = -8
guard.ctrltime = 10
airguard.ctrltime = 3
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = -10
air.type = low
air.velocity = -6.1,-2.8
air.hittime = 25
airguard.velocity = -5,-2.0
Air.fall = 1
fall.recover = 0
fall = 1
yaccel = 0.5
ID = 1020

[State 200, 1]
type = hitdef
trigger1 = animelem = 4
trigger2 = animelem = 8
attr = A, SA
damage = ceil(ifElse(fvar(11) * 25 < 7, 7, fvar(11) * 25)), 1
animtype = medium
guardflag = MA
hitflag = MAF
pausetime = 6, 6
getpower = 20,5
givepower = 5,5
sparkNo = 0
guard.sparkNo = 40
sparkXY = 10,-40
hitsound = 5,1
guardsound = 6,0
guard.ctrltime = 10
ground.type = High
ground.slidetime = 20
ground.hittime  = 35
ground.velocity = -6,-2.0
guard.velocity = -10
airguard.velocity = -5,-1.0
guard.cornerpush.veloff = -5
air.type = low
air.velocity = -4.0,-2.5
air.hittime = 25
Air.fall = 1
fall.recover = 0
fall = 1
yaccel = 0.5
ID = 1020

[State 0, Hair]
type = null
trigger1 = time = 0
name = "Hair"
ID = 1421
stateno = 1421
pos = 0,0
postype = p1 
facing = 1
keyctrl = 0
ownpal = 0

[state 1000]
type = explod
trigger1 = time = 0
removetime = -1
anim = 1051
postype = p1
pos = 0,0
scale = 1.00,1.00
removeongethit = 1
ignorehitpause = 0
bindtime = -1
ID = 1051
ownpal = 0

[state 1000]
type = removeexplod
trigger1 = anim != 1050
trigger2 = Vel Y > 0 && Pos Y >= 0
trigger3 = anim = [120,123]
trigger4 = anim = [130,133]
trigger5 = anim = [140,143]
trigger6 = anim = [150,153]
trigger7 = anim = 47
trigger8 = anim = [5000,5999]
trigger9 = stateno = [5000,5999]
ID = 1051

[State 0, ChangeState]
type = null
triggerall = time >= 15 && movecontact
trigger1 = command = "x"
trigger2 = var(59)
trigger2 = random<var(50)*2.0
value = 630
ctrl = 0

[State 1100, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 1014
ctrl = 0

[Statedef 1421]
type    = A
movetype= I
physics = N
ctrl = 0
sprpriority = 0
anim = 1051

[State 0, BindToRoot]
type = BindToRoot
trigger1 = 1 
time = 1
pos = 0,0
ignorehitpause = 1

[State 1522,Angle]
type = Angleadd
trigger1 = 1
value = 30

[State 1522,Angle]
type = AngleDraw
trigger1 = 1

[State 1522,Vel]
type = VelSet
trigger1 = time < 1
y = -15.5

[State 1522,Vel]
type = VelAdd
trigger1 = time < 1
y = 3.5

[State 1522,Pos]
type = PosFreeze
trigger1 = time > 1
x = 1
y = -120

[state 1000]
type = destroyself
trigger1 = root, stateno != 1420

;Dragon boost - State over
[Statedef 1016]
type    = A
movetype= A
physics = N
juggle  = 0
ctrl = 0
anim = 635
sprpriority = 2
poweradd = 0

[state 1000]
type = veladd
trigger1 = 1
y = .42

[State 1100, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 1014
ctrl = 0

;Air Dragon cyclone (different version)
[Statedef 1069]
type    = A
movetype= A
physics = N
juggle  = 0
ctrl = 0
poweradd = 72
;velset = 5.1,-4
anim = 1050
sprpriority = 2

[state 100x,atc efe];?????????
type = Explod
trigger1 = time  = 0
anim =1150
ID = 100
postype = p1
pos = 0,-40
sprpriority = 5
ontop = 1
bindtime = 1
removetime = -2
ownpal=1
persistent  =0
scale = 1.0,1.0

[state 100x,atc efe];????????? ?
type = Explod
trigger1 = numexplod(101) <= 2
trigger1 = 1
anim =1150
ID = 101
postype = p1
pos = 30,-40
random = 40,20
sprpriority = 5
ontop = 1
bindtime = 1
removetime = 12
ownpal=1
scale = 1.0 + (random % 3 * 0.1), 1.0 + (random % 3 * 0.1)
accel  = -0.2 - (random % 4 * 0.1),0

[state 100x,atc efe];????????? ?
type = Explod
trigger1 = numexplod(101) <= 2
trigger1 = 1
anim =1150
ID = 101
postype = p1
pos = -20,-40
random = 40,20
sprpriority = 5
ontop = 1
bindtime = 1
removetime = 12
ownpal=1
scale = 1 + (random % 3 * 0.1), 1 + (random % 3 * 0.1)
accel  = -0.2 - (random % 4 * 0.1),0

[state 1000]
type = velset
triggerall = prevstateno = 1001
trigger1 = time = 0 
y = -3.50
x = 3.5

[state 1000]
type = velset
triggerall = prevstateno != 1001
trigger1 = time = 0
y = -3.80

[state 1000]
type = veladd
trigger1 = 1
y = .22

[state 1000]
type = playsnd
trigger1 = animelem = 1
value = S1,3
volumescale = 125

[state 1000]
type = playsnd
trigger1 = animelem = 1
value = S1020,0
volumescale = 125

[State 200, 1]
type = hitdef
trigger1 = animelem = 2
trigger2 = animelem = 6 
attr = A, SA
damage = ceil(ifElse(fvar(11) * 15 < 7, 7, fvar(11) * 15)), 1
animtype = medium
guardflag = MA
hitflag = MAF
getpower = 20,5
givepower = 5,5
pausetime = 6,6
sparkNo = 1
guard.sparkNo = 40
sparkXY = -1,-40
hitsound = 5,1
guardsound = 6,0
ground.type = High
ground.slidetime = 20
ground.hittime  = 35
ground.velocity = -4,-2.0
guard.velocity = -8
guard.cornerpush.veloff = -10
airguard.cornerpush.veloff = -10
air.type = low
air.velocity = -4.0,-2.9
airguard.velocity = -4,-1
air.hittime = 25
Air.fall = 1
fall.recover = 0
fall = 1
yaccel = 0.5
;ID = 1060

[State 200, 1]
type = HitDef
trigger1 = animelem = 4 ;&& movehit = 0
trigger2 = animelem = 8 ;&& movehit = 0
attr = A, SA
damage = ceil(ifElse(fvar(11) * 15 < 7, 7, fvar(11) * 15)), 1
animtype = medium
guardflag = MA
hitflag = MAF
getpower = 20,5
givepower = 5,5
pausetime = 6,6
sparkNo = 1
guard.sparkNo = 40
sparkXY = 10,-40
hitsound = 5,1
guardsound = 6,0
ground.type = High
ground.slidetime = 20
ground.hittime  = 35
ground.velocity = -4,-2.0
air.type = low
air.velocity = -4.0,-2.9
air.hittime = 25
Air.fall = 1
fall.recover = 0
fall = 1
yaccel = 0.5
;ID = 1060

[state 1000]
type = explod
trigger1 = time = 0
removetime = -1
anim = 1051
postype = p1
pos = 0,0
scale = 1.0,1.0
removeongethit = 1
ignorehitpause = 0
bindtime = -1
ID = 1588
ownpal = 0

[state 1000]
type = removeexplod
trigger1 = anim != 1050
trigger2 = Vel Y > 0 && Pos Y >= 0
trigger3 = anim = [120,123]
trigger4 = anim = [130,133]
trigger5 = anim = [140,143]
trigger6 = anim = [150,153]
trigger7 = anim = 47
trigger8 = anim = [5000,5999]
trigger9 = stateno = [5000,5999]
ID = 1588

[State 0, Hair]
type = null
trigger1 = time = 0
name = "DCHair"
ID = 1026
stateno = 1026
pos = 0,0
postype = p1
facing = 1
keyctrl = 0
ownpal = 0
ignorehitpause = 0

[State 1100, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 1014
ctrl = 0

;Dragon boost
[Statedef 1020]
type    = A
movetype= A
physics = N
juggle  = 0
ctrl = 0
velset = 0,0
sprpriority = 2
poweradd = -500
anim = 1100

[State 3050, hitvar]
type=varset
trigger1 = time = 0
;trigger2= anim = 1015 && animtime = 0
;trigger2 = anim = 1015 && hitcount <= 5
;trigger2 = anim =1015 && animelemtime(15)<0
var(14)=0

[State 1120, Blink]
type = PalFX
trigger1 = anim = 1100
trigger1 = Time = 0
time = 30
add = 84,84,84
sinadd = 92,92,92,5

[state 100x,atc efe];?????????
type = explod
trigger1 = time  = 0
anim =1150
ID = 100
postype = p1
pos = 0,-32
sprpriority = 5
ontop = 1
bindtime = 1
removetime = -2
ownpal=1
persistent  =0
scale = 1.0,1.0

[state 100x,atc efe];????????? ?
type = explod
trigger1 = numexplod(101) <= 3
trigger1 = 1
anim =1150
ID = 101
postype = p1
pos = 0,-32
random = 35,35
sprpriority = 5
ontop = 1
bindtime = 1
removetime = 12
ownpal=1
scale = 1 + (random % 3 * 0.1), 1 + (random % 3 * 0.1)
;accel  = -0.2 - (random % 4 * 0.1),0

[state 1000]
type = nothitby
trigger1 = 1
value = SCA
ignorehitpause = 1

[state 1000]
type = velset
trigger1 = 1
x = 0
y = 0

[state 1000]
type = playsnd
trigger1 = animelem = 1
value = S3,0
volumescale = 125

[state 1000]
type = playsnd
trigger1 = animelem = 16
value = S3,1
volumescale = 125

[state 1000]
type = changestate
trigger1 = animelem = 16
value = 1021
ctrl = 0

;Dragon boost - Horizontal
[Statedef 1021]
type    = A
movetype= A
physics = N
juggle  = 4
ctrl = 0
velset = 0,0
sprpriority = 2
poweradd = 0

[state 100x,atc efe];?????????
type = explod
trigger1 = time  = 0
anim =1130
ID = 100
postype = p1
pos = -20,-35
sprpriority = 5
ontop = 1
bindtime = 1
removetime = -2
ownpal=1
persistent  =0
scale = 1.0,1.0

[state 100x,atc efe];????????? ?
type = explod
trigger1 = numexplod(101) <= 3
trigger1 = 1
anim =1130
ID = 101
postype = p1
pos = -20,-35
random = 40,30
sprpriority = 5
ontop = 1
bindtime = 1
removetime = 12
ownpal=1
scale = 1 + (random % 3 * 0.1), 1 + (random % 3 * 0.1)
accel  = -0.8 - (random % 4 * 0.1),0

[State 0, Hair]
type = Helper
trigger1 = time = 0
helpertype = normal
name = "Boost"
ID = 10200
stateno = 10200
pos = 0,0
postype = p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1

[state 1000]
type = nothitby
trigger1 = 1
value = SCA
ignorehitpause = 1

[state 1000]
type = width
trigger1 = 1
value = 0,0

[State 3000, Super C]
type = AfterImageTime
trigger1 = AnimElemTime(2) >= 1 && Time < 60
time = 2

[state 1000]
type = playerpush
trigger1 = 1
value = 0

[state 1000]
type = velset
trigger1 = 1
y = 0
x = 12

[State 3050, hitvar]
type=varset
trigger1 = anim!=1100
;trigger2= anim = 1015 && animtime = 0
;trigger2 = anim = 1015 && hitcount <= 5
;trigger2 = anim =1015 && animelemtime(15)<0
var(14)=0

[State 3050, hitvar]
type=varadd
trigger1=anim=1100&&(movehit=1||moveguarded=1||movereversed=1)
var(14)=1

[State 3050, hit]
type=hitdef
trigger1=anim=1100 && animelemtime(16)>=0
trigger1= timemod = 2,0 && var(14)<5
;trigger1 = hitcount <= 4
attr = A, SA
damage = ceil(ifElse(fvar(11) * 25 < 7, 7, fvar(11) * 25)), 2
animtype = heavy;fucking metal
guardflag = M
hitflag = MAF
getpower = 0,0
givepower = 36,18
;givepower = 5,5
pausetime = 3, 0
sparkNo = 1
guard.sparkNo = 40
sparkXY = -10,-35
hitsound = 5,1
guardsound = 6,0
ground.type = low
guard.velocity = -5
airguard.velocity = 0,-1
ground.slidetime = 20
ground.hittime  = 25
ground.velocity = -2.5,-1.0
air.type = low
air.velocity = -2.5,-1.0
air.cornerpush.veloff = 0
ground.cornerpush.veloff = 0
air.hittime = 25
Air.fall = 1
fall.recover = 0
fall = 1
ID = 1021

[State 1100, 5]
type = ChangeState
triggerall = !var(59)
trigger1 = command = "a"
trigger1 = movecontact
trigger2 = FrontEdgeBodyDist <= 0
value = 1030
ctrl = 0

[State 1100, 5]
type = ChangeState
triggerall = var(59)
trigger1 = movehit = 5
trigger1 = movecontact
trigger2 = FrontEdgeBodyDist <= 0
value = 1030
ctrl = 0

[state 1000]
type = changestate
trigger1 = time = 40
value = 1022
ctrl = 0

;Dragon boost - State over
[Statedef 1022]
type    = A
movetype= A
physics = N
juggle  = 0
ctrl = 0
anim = 635
sprpriority = 2
poweradd = 0

[state 1000]
type = veladd
trigger1 = 1
y = .42

[State 1100, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 1012
ctrl = 1

;Dragon boost - First state for vertical DB
[Statedef 1023]
type    = A
movetype= A
physics = N
juggle  = 0
ctrl = 0
velset = 0,0
sprpriority = 2
poweradd = -500
anim = 1101

[State 3050, hitvar]
type=varset
trigger1 = time = 0
;trigger2= anim = 1015 && animtime = 0
;trigger2 = anim = 1015 && hitcount <= 5
;trigger2 = anim =1015 && animelemtime(15)<0
var(14)=0

[State 1120, Blink]
type = PalFX
trigger1 = anim = 1101
trigger1 = Time = 0
time = 30
add = 84,84,84
sinadd = 92,92,92,5

[state 100x,atc efe];?????????
type = explod
trigger1 = time  = 0
anim =1150
ID = 100
postype = p1
pos = 0,-32
sprpriority = 5
ontop = 1
bindtime = 1
removetime = -2
ownpal=1
persistent  =0
scale = 1.0,1.0

[state 100x,atc efe];????????? ?
type = explod
trigger1 = numexplod(101) <= 3
trigger1 = 1
anim =1150
ID = 101
postype = p1
pos = 0,-32
random = 35,35
sprpriority = 5
ontop = 1
bindtime = 1
removetime = 12
ownpal=1
scale = 1 + (random % 3 * 0.1), 1 + (random % 3 * 0.1)
;accel  = -0.2 - (random % 4 * 0.1),0

[state 1000]
type = nothitby
trigger1 = 1
value = SCA
ignorehitpause = 1

[state 1000]
type = velset
trigger1 = 1
x = 0
y = 0

[state 1000]
type = playsnd
trigger1 = animelem = 1
value = S3,0
volumescale = 125

[state 1000]
type = playsnd
trigger1 = animelem = 16
value = S3,1
volumescale = 125

[state 1000]
type = changestate
trigger1 = animelem = 16
value = 1024
ctrl = 0

;Dragon boost - Vertical
[Statedef 1024]
type    = A
movetype= A
physics = N
juggle  = 0
ctrl = 0
velset = 0,0
sprpriority = 2
poweradd = 0

[state 1000]
type = width
trigger1 = 1
value = 0,0

[state 1000]
type = nothitby
trigger1 = 1
value = SCA
ignorehitpause = 1

[state 100x,atc efe];?????????
type = explod
trigger1 = time  = 0
anim =1131
ID = 100
postype = p1
pos = -8,-44
sprpriority = 5
ontop = 1
bindtime = 1
removetime = -2
ownpal=1
persistent  =0
scale = 1.0,1.0

[state 100x,atc efe];????????? ?
type = explod
trigger1 = numexplod(101) <= 3
trigger1 = 1
anim =1131
ID = 101
postype = p1
pos = -8,-44
random = 40,30
sprpriority = 5
ontop = 1
bindtime = 1
removetime = 12
ownpal=1
scale = 1 + (random % 3 * 0.1), 1 + (random % 3 * 0.1)
accel  = -0.8 - (random % 4 * 0.1),0.8 - (random % 4 * 0.1)

[State 0, Hair]
type = Helper
trigger1 = time = 0
helpertype = normal
name = "Boost"
ID = 10201
stateno = 10201
pos = 0,0
postype = p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1

[State 0, Hair]
type = Helper
trigger1 = !numhelper(1028)
name = "Hair"
ID = 1028
stateno = 1028
pos = 0,0
postype = p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0

[state 1000]
type = angledraw
trigger1 = 1
value = 40
ignorehitpause = 1

[state 1000]
type = playerpush
trigger1 = 1
value = 0

[state 1000]
type = velset
trigger1 = 1
y = -10
x = 8

[State 3050, hitvar]
type=varset
trigger1 = anim!=1101
;trigger2= anim = 1015 && animtime = 0
;trigger2 = anim = 1015 && hitcount <= 5
;trigger2 = anim =1015 && animelemtime(15)<0
var(14)=0

[State 3050, hitvar]
type=varadd
trigger1=anim=1101&&(movehit=1||moveguarded=1||movereversed=1)
var(14)=1

[State 3050, hit]
type=hitdef
trigger1=anim=1101 && animelemtime(16)>=0
trigger1= timemod = 2,0 && var(14)<5
;trigger1 = hitcount <= 4
attr = A, SA
damage = ceil(ifElse(fvar(11) * 25 < 7, 7, fvar(11) * 25)), 2
animtype = heavy;fucking metal
guardflag = M
hitflag = MAF
getpower = 0,0
givepower = 36,18
;givepower = 5,5
pausetime = 3, 0
sparkNo = 1
guard.sparkNo = 40
sparkXY = -10,-45
hitsound = 5,1
guardsound = 6,0
ground.type = low
guard.velocity = -5
airguard.velocity = 0,-1
ground.slidetime = 20
ground.hittime  = 25
ground.velocity = -2.5,-5.0
air.type = low
air.velocity = -2.5,-5.0
air.cornerpush.veloff = 0
ground.cornerpush.veloff = 0
air.hittime = 25
Air.fall = 1
fall.recover = 0
fall = 1
ID = 1021

[State 1100, 5]
type = ChangeState
triggerall = !var(59)
trigger1 = command = "a"
trigger1 = movecontact
trigger2 = FrontEdgeBodyDist <= 0
value = 1030
ctrl = 0

[State 1100, 5]
type = ChangeState
triggerall = var(59)
trigger1 = movehit = 5
trigger1 = movecontact
trigger2 = FrontEdgeBodyDist <= 0
value = 1030
ctrl = 0

[state 1000]
type = changestate
trigger1 = time = 30
value = 1022
ctrl = 0

;Dragon boost - State over (ver 2)
[Statedef 1025]
type    = A
movetype= A
physics = N
juggle  = 0
ctrl = 0
anim = 635
sprpriority = 2
poweradd = 0

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 1,0
ignorehitpause = 1

[state 1000]
type = veladd
trigger1 = 1
y = .42

[State 1100, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 52
ctrl = 1

;Hair for vertical DB
[Statedef 1028]
type    = S
movetype= I
physics = N
ctrl = 0
sprpriority = 0
poweradd = 0

[State 0, BindToRoot]
type = BindToRoot
trigger1 = 1 
time = 1
pos = 0,0
ignorehitpause = 1

[state 1000]
type = angledraw
triggerall = root,anim = 1101
trigger1 = 1
value = 40
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = root,anim != 1101
value = 19999
ignorehitpause = 1

[State 0, Turn]
type = turn
trigger1 = facing = -1
trigger1 = root,facing = 1
trigger2 = facing = 1
trigger2 = root,facing = -1
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 10016
trigger1 = root,anim = 1101
trigger1 = root,animelem = 16
value = 10016
ignorehitpause = 1

;Hair for vertical DB
[Statedef 1029]
type    = S
movetype= I
physics = N
ctrl = 0
sprpriority = 0
poweradd = 0

[State 0, BindToRoot]
type = BindToRoot
trigger1 = 1 
time = 1
pos = 0,0
ignorehitpause = 1

[state 1000]
type = angledraw
triggerall = root,anim = 1102
trigger1 = 1
value = -40
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = root,anim != 1102
value = 19999
ignorehitpause = 1

[State 0, Turn]
type = turn
trigger1 = facing = -1
trigger1 = root,facing = 1
trigger2 = facing = 1
trigger2 = root,facing = -1
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 10016
trigger1 = root,anim = 1102
trigger1 = root,animelem = 16
value = 10016
ignorehitpause = 1

;Boost Explosion
[Statedef 1030]
type    = A
movetype= A
physics = N
;juggle  = 1
poweradd= 0
ctrl = 0
anim = 1110
sprpriority = 2

[state 1000]
type = varadd
trigger1 = time = 0
var(20) = 1
ignorehitpause = 1

[State 1120, Blink]
type = PalFX
trigger1 = anim = 1110
trigger1 = Time = 0
time = 10
add = 84,84,84
sinadd = 92,92,92,5

[state 1000]
type = playsnd
trigger1 = time = 0
value = S3,2
volumescale = 125

[state 1000]
type = veladd
trigger1 = 1
y = .42

[state 1000]
type = velset
trigger1 = time = 0
x = -3.0
y = -8

[State 3300, Bosst Explosion]
type = Helper
trigger1 = time = 0
helperType = Normal
stateNo = 13305
ID = 13305
name = "Boost Explosion"
posType = P1
pos = 0,-40
size.xScale = 1.0
size.yScale = 1.0
ownPal = 1

[State 0, Hair]
type = Helper
trigger1 = time = 0
name = "Woosh"
helpertype = Normal
ID = 7000
stateno = 7001
pos = 0,-40
postype = p1
facing = 1
keyctrl = 0
ownpal = 1

[State 0, Hair]
type = Helper
trigger1 = time = 0
name = "Woosh"
helpertype = Normal
ID = 7000
stateno = 7002
pos = 0,-40
postype = p1
facing = 1
keyctrl = 0
ownpal = 1

[State 0, Hair]
type = Helper
trigger1 = time = 0
name = "Woosh"
helpertype = Normal
ID = 7000
stateno = 7003
pos = 0,-40
postype = p1
facing = 1
keyctrl = 0
ownpal = 1

[State 0, Hair]
type = Helper
trigger1 = time = 0
name = "Woosh"
helpertype = Normal
ID = 7000
stateno = 7004
pos = 0,-40
postype = p1
facing = 1
keyctrl = 0
ownpal = 1

[state 1000]
type = changeanim
trigger1 = anim = 1110
trigger1 = animtime = 0
value = 635

[State 1100, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 1014
ctrl = 1

;Boost hah
[Statedef 1031]
type    = A
movetype= A
physics = N
;juggle  = 1
poweradd= 0
ctrl = 0
anim = 1110
sprpriority = 2

[state 1000]
type = veladd
trigger1 = 1
y = .42

[state 1000]
type = velset
trigger1 = time = 0
x = -2.0
y = -4

[state 1000]
type = changeanim
trigger1 = anim = 1110
trigger1 = animtime = 0
value = 635

[State 1100, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 1014
ctrl = 0

;Dragon boost
[Statedef 1050]
type    = A
movetype= A
physics = N
juggle  = 0
ctrl = 0
velset = 0,0
sprpriority = 2
poweradd = -500
anim = 1102

[State 3050, hitvar]
type=varset
trigger1 = time = 0
;trigger2= anim = 1015 && animtime = 0
;trigger2 = anim = 1015 && hitcount <= 5
;trigger2 = anim =1015 && animelemtime(15)<0
var(14)=0

[State 1120, Blink]
type = PalFX
trigger1 = anim = 1102
trigger1 = Time = 0
time = 30
add = 84,84,84
sinadd = 92,92,92,5

[state 100x,atc efe];?????????
type = explod
trigger1 = time  = 0
anim =1150
ID = 100
postype = p1
pos = 0,-32
sprpriority = 5
ontop = 1
bindtime = 1
removetime = -2
ownpal=1
persistent  =0
scale = 1.0,1.0

[state 100x,atc efe];????????? ?
type = explod
trigger1 = numexplod(101) <= 3
trigger1 = 1
anim =1150
ID = 101
postype = p1
pos = 0,-32
random = 35,35
sprpriority = 5
ontop = 1
bindtime = 1
removetime = 12
ownpal=1
scale = 1 + (random % 3 * 0.1), 1 + (random % 3 * 0.1)
;accel  = -0.2 - (random % 4 * 0.1),0

[state 1000]
type = nothitby
trigger1 = 1
value = SCA
ignorehitpause = 1

[state 1000]
type = velset
trigger1 = 1
x = 0
y = 0

[state 1000]
type = playsnd
trigger1 = animelem = 1
value = S3,0
volumescale = 125

[state 1000]
type = playsnd
trigger1 = animelem = 16
value = S3,1
volumescale = 125

[state 1000]
type = changestate
trigger1 = animelem = 16
value = 1051
ctrl = 0

;Dragon boost - Downward DB
[Statedef 1051]
type    = A
movetype= A
physics = N
juggle  = 0
ctrl = 0
velset = 0,0
sprpriority = 2

[state 1000]
type = nothitby
trigger1 = 1
value = SCA
ignorehitpause = 1

[state 1000]
type = width
trigger1 = 1
value = 0,0

[state 100x,atc efe];?????????
type = explod
trigger1 = time  = 0
anim =1132
ID = 100
postype = p1
pos = 35,-10
sprpriority = 5
ontop = 1
bindtime = 1
removetime = -2
ownpal=1
persistent  =0
scale = 1.0,1.0

[state 100x,atc efe];????????? ?
type = explod
trigger1 = numexplod(101) <= 3
trigger1 = 1
anim =1132
ID = 101
postype = p1
pos = 35,-10
random = 40,30
sprpriority = 5
ontop = 1
bindtime = 1
removetime = 12
ownpal=1
scale = 1 + (random % 3 * 0.1), 1 + (random % 3 * 0.1)
accel  = -0.8 - (random % 4 * 0.1),-1.2 - (random % 4 * 0.1)

[State 0, Hair]
type = Helper
trigger1 = time = 0
helpertype = normal
name = "Boost"
ID = 10202
stateno = 10202
pos = 0,0
postype = p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1

[State 0, Hair]
type = Helper
trigger1 = !numhelper(1029)
name = "Hair"
ID = 1029
stateno = 1029
pos = 0,0
postype = p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0

[state 1000]
type = angledraw
trigger1 = 1
value = -40
ignorehitpause = 1

[state 1000]
type = playerpush
trigger1 = 1
value = 0

[state 1000]
type = velset
trigger1 = 1
y = 10
x = 8

[State 3050, hitvar]
type=varset
trigger1 = anim!=1102
;trigger2= anim = 1015 && animtime = 0
;trigger2 = anim = 1015 && hitcount <= 5
;trigger2 = anim =1015 && animelemtime(15)<0
var(14)=0

[State 3050, hitvar]
type=varadd
trigger1=anim=1102&&(movehit=1||moveguarded=1||movereversed=1)
var(14)=1

[State 3050, hit]
type=hitdef
trigger1=anim=1102 && animelemtime(16)>=0
trigger1= timemod = 2,0 && var(14)<5
;trigger1 = hitcount <= 4
attr = A, SA
damage = ceil(ifElse(fvar(11) * 25 < 7, 7, fvar(11) * 25)), 2
animtype = heavy;fucking metal
guardflag = M
hitflag = MAF
getpower = 0,0
givepower = 36,18
;givepower = 5,5
pausetime = 3, 0
sparkNo = 1
guard.sparkNo = 40
sparkXY = -10,-20
hitsound = 5,1
guardsound = 6,0
ground.type = low
guard.velocity = -5
airguard.velocity = 0,-1
ground.slidetime = 20
ground.hittime  = 25
ground.velocity = -2.0,-1
air.type = low
air.velocity = -2.5,-1
air.cornerpush.veloff = 0
ground.cornerpush.veloff = 0
air.hittime = 25
Air.fall = 1
fall.recover = 0
fall = 1
ID = 1021

[State 1100, 5]
type = ChangeState
triggerall = !var(59)
trigger1 = command = "a"
trigger1 = movecontact
trigger2 = FrontEdgeBodyDist <= 0
trigger3 = Vel Y > 0 && Pos Y >= 0
value = 1030
ctrl = 0

[State 1100, 5]
type = ChangeState
triggerall = var(59)
trigger1 = movehit = 5
trigger2 = Vel Y > 0 && Pos Y >= 0
value = 1030
ctrl = 0

[State 1100, 5]
type = ChangeState
triggerall = power <= 250
triggerall = var(59)
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 52
ctrl = 1

[State 1100, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 52
ctrl = 1

;Boost Helper - Cycle 1
[Statedef 10200]
type    = A
movetype= A
physics = N
juggle  = 0
ctrl = 0
velset = 0,0
sprpriority = 9999
poweradd = 0
anim = 1120

[state 1000]
type = bindtoroot
trigger1 = 1
pos = 12,-11
ignorehitpause = 1

[State 3005, scale]
type = angledraw
trigger1 = 1
scale = 0.80, 0.70
ignorehitpause = 1

[State 3005, trans]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256,256
ignorehitpause = 1

[state 1000]
type = destroyself
trigger1 = root, stateno != 1021

;Boost Helper - Vertical DB
[Statedef 10201]
type    = A
movetype= A
physics = N
juggle  = 0
ctrl = 0
velset = 0,0
sprpriority = 9999
poweradd = 0
anim = 1120

[state 1000]
type = bindtoroot
trigger1 = 1
pos = 3,-18
ignorehitpause = 1

[State 3005, scale]
type = angledraw
trigger1 = 1
value = 40
scale = 0.80, 0.70
ignorehitpause = 1

[State 3005, trans]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256,256
ignorehitpause = 1

[state 1000]
type = destroyself
trigger1 = root, stateno != 1024

;Boost Helper - Downward DB
[Statedef 10202]
type    = A
movetype= A
physics = N
juggle  = 0
ctrl = 0
velset = 0,0
sprpriority = 9999
poweradd = 0
anim = 1120

[state 1000]
type = bindtoroot
trigger1 = 1
pos = 16,-2
ignorehitpause = 1

[State 3005, scale]
type = angledraw
trigger1 = 1
value = -40
scale = 0.80, 0.70
ignorehitpause = 1

[State 3005, trans]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256,256
ignorehitpause = 1

[state 1000]
type = destroyself
trigger1 = root, stateno != 1051

;LvL 1 Super Rising Slash (I'm ripping myself off lol)
[Statedef 3000]
type    = S
movetype= A
physics = S
juggle  = 0
velset = 0,0
anim = 3000
ctrl = 0
poweradd = 0
sprpriority = 2

[state 1000]
type = null
trigger1 = 1
flag = nobardisplay
ignorehitpause = 1

[State 3000, Super A]
type = SuperPause
trigger1 = AnimElem = 1
pos = 0, 0
anim = -1
sound = -1
time = 16
movetime = 16
poweradd = -1000
p2defmul = 1
darken = 0

[state 1000]
type = explod
trigger1 = time = 0
anim = F100
pos = -1,-35
ontop = 1
postype = p1
bindtime = -1
removeongethit = 1
ignorehitpause = 1
supermovetime = 16
pausemovetime = 16

[state 1000]
type = nothitby
trigger1 = time <= 25
value = SCA
time = 1
ignorehitpause = 1

[State 1120, Blink]
type = PalFX
trigger1 = Time = 0
time = 16
add = 84,84,84
sinadd = 92,92,92,4

[state 1000]
type = playsnd
trigger1 = time = 0
value = S3000,0
volumescale = 125

[state 1000]
type = playsnd
trigger1 = animelem = 4
value = 1000,0
volumescale = 125

[state 1000]
type = playsnd
trigger1 = animelem = 4
value = 0,2
volumescale = 125

[state 1000]
type = velset
trigger1 = animelem = 3
x = 10

[State 200, 1]
type = HitDef
triggerall = anim = 3000
trigger1 = animelem = 4
trigger2 = animelem = 5
attr = A, HA
damage = 30, 2
animtype = medium
getpower = 0,0
givepower = 18,18
guardflag = M
hitflag = MAF
pausetime = 4, 4
sparkNo = 1
guard.sparkNo = 40
sparkXY = -20,-55
hitsound = 5,1
guardsound = 6,0
ground.type = low
ground.slidetime = 20
ground.hittime  = 25
ground.velocity = -4,0
air.type = low
air.velocity = -1.5,-4.5
air.hittime = 25
Air.fall = 1
fall.recover = 0
fall = 0
yaccel = 0.5
ID = 3000

[state 1000]
type = changestate
trigger1 = animelem = 12
value = 3001
ctrl = 0

;Part 2
[Statedef 3001]
type    = A
movetype= A
physics = N
juggle  = 0
ctrl = 0
poweradd = 0
velset = 2.0,-10.5
sprpriority = 2

[state 1000]
type = playsnd
trigger1 = time = 0
value = 1000,1
volumescale = 125

[state 1000]
type = playsnd
trigger1 = time = 0
value = 0,1
volumescale = 125

[state 1000]
type = veladd
trigger1 = 1
y = .42

[State 200, 1]
type = HitDef
trigger1 = anim = 3000
trigger1 = animelem = 13
trigger2 = animelem = 14
attr = A, HA
damage = 30, 2
animtype = diagup
getpower = 0,0
givepower = 18,18
guardflag = M
hitflag = MAF
pausetime = 4, 4
sparkNo = 1
guard.sparkNo = 40
sparkXY = -20,-55
hitsound = 5,1
guardsound = 6,0
ground.type = low
ground.slidetime = 20
ground.hittime  = 25
ground.velocity = -1,-7.8
air.type = low
air.velocity = -1,-8.9
air.hittime = 25
Air.fall = 1
fall.recover = 0
fall = 1
yaccel = 0.5
ID = 3001

[state 1000]
type = changeState
triggerall = movehit
trigger1 = animtime = 0
value = 3002
ctrl = 0

[state 1000]
type = changeState
triggerall = moveguarded
trigger1 = animtime = 0
value = 1022
ctrl = 0

[state 1000]
type = changeState
trigger1 = animtime = 0
value = 1022
ctrl = 0

[State 1100, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 52
ctrl = 1

;Part 3
[Statedef 3002]
type    = A
movetype= A
physics = N
juggle  = 0
ctrl = 0
poweradd = 0
anim = 3002
velset = 1.5,-2
sprpriority = 2

[state 1000]
type = veladd
trigger1 = 1
y = .42

[state 1000]
type = playsnd
trigger1 = animelem = 4
value = 0,1
volumescale = 125

[state 1000]
type = playsnd
trigger1 = animelem = 4
value = 1000,2
volumescale = 125

[State 200, 1]
type = HitDef
trigger1 = animelem = 5
trigger2 = animelem = 6
attr = A, HA
damage = 20, 0
getpower = 0,0
givepower = 36,36
animtype = medium
guardflag = HA
hitflag = MAF
pausetime = 3, 3
sparkNo = 1
guard.sparkNo = 40
sparkXY = -15,-40
hitsound = 5,1
guardsound = 6,0
ground.type = High
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -3
air.type = low
air.velocity = -3.0,-2
air.hittime = 25
fall = 0
fall.recover = 0
;yaccel = 0.8
ID = 3000
envshake.time = 5

[State 200, 1]
type = HitDef
trigger1 = animelem = 7
attr = A, HA
damage = 25, 0
getpower = 0,0
givepower = 36,36
animtype = hard
guardflag = HA
hitflag = MAF
pausetime = 12, 12
sparkNo = 2
guard.sparkNo = 40
sparkXY = -15,-40
hitsound = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -5,-4
air.type = low
air.velocity = -1.5,15
air.hittime = 25
fall = 1
fall.recover = 0
fall.damage = 20
;yaccel = 0.8
ID = 3000
envshake.time = 12

[state 1000]
type = changestate
trigger1 = animtime = 0
value = 1022
ctrl = 0

[State 1100, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 1014
ctrl = 0

;LvL 1 Super Dragon Cyclone
[Statedef 3005]
type    = A
movetype= A
physics = N
juggle  = 0
velset = 0,0
anim = 3005
ctrl = 0
sprpriority = 2

[state 1000]
type = null
trigger1 = 1
flag = nobardisplay
ignorehitpause = 1

[State 1120, Blink]
type = PalFX
trigger1 = Time = 0
time = 16
add = 84,84,84
sinadd = 92,92,92,4

[State 3000, Super A]
type = SuperPause
trigger1 = AnimElem = 1
pos = 0, 0
anim = -1
sound = -1
time = 16
movetime = 16
poweradd = -1000
p2defmul = 1
darken = 0

[state 1000]
type = explod
trigger1 = time = 0
anim = F100
pos = -1,-35
ontop = 1
postype = p1
bindtime = -1
removeongethit = 1
ignorehitpause = 1
supermovetime = 16
pausemovetime = 16

[state 1000]
type = nothitby
trigger1 = time = 0
value = SCA
time = 16
ignorehitpause = 1

[state 1000]
type = playsnd
trigger1 = time = 0
value = S3000,0
volumescale = 125

[state 1000]
type = changestate
trigger1 = time = 16
value = 3006
ctrl = 0

[Statedef 3006]
type    = A
movetype= A
physics = N
juggle  = 0
ctrl = 0
velset = 0,-5.0
sprpriority = 2

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 1,0
ignorehitpause = 1

[state 1000]
type = null
trigger1 = 1
flag = nobardisplay
ignorehitpause = 1

[state 1000]
type = explod
trigger1 = time = 0
removetime = -1
anim = 1051
postype = p1
pos = 0,0
scale = 1.0,1.0
removeongethit = 1
ignorehitpause = 0
bindtime = -1
ID = 1569
ownpal = 0

[State 1120, Blink]
type = PalFX
trigger1 = 1
time = 1
add = 48,48,48
sinadd = 64,64,64,4

[state 1000]
type = nothitby
trigger1 = 1
value = SCA
time = 1
ignorehitpause = 1

[state 1000]
type = changestate
trigger1 = time = 2
value = 3007
ctrl = 0

[Statedef 3007]
type    = A
movetype= A
physics = N
juggle  = 0
ctrl = 0
velset = 0,0
sprpriority = 2

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 1,0
ignorehitpause = 1

[state 1000]
type = nothitby
trigger1 = time <= 4
value = SCA
time = 1
ignorehitpause = 1

[state 100x,atc efe];?????????
type = Explod
trigger1 = time  = 0
anim =1150
ID = 100
postype = p1
pos = 0,-40
sprpriority = 5
ontop = 1
bindtime = 1
removetime = -2
ownpal=1
persistent  =0
scale = 1.0,1.0

[state 100x,atc efe];????????? ?
type = Explod
trigger1 = numexplod(101) <= 3
trigger1 = 1
anim =1150
ID = 101
postype = p1
pos = 20,-40
random = 40,20
sprpriority = 5
ontop = 1
bindtime = 1
removetime = 12
ownpal=1
scale = 1.0 + (random % 3 * 0.1), 1.0 + (random % 3 * 0.1)
accel  = 0.2 + (random % 4 * 0.1),0

[state 100x,atc efe];????????? ?
type = Explod
trigger1 = numexplod(101) <= 3
trigger1 = 1
anim =1150
ID = 101
postype = p1
pos = -20,-40
random = 40,20
sprpriority = 5
ontop = 1
bindtime = 1
removetime = 12
ownpal=1
scale = 1 + (random % 3 * 0.1), 1 + (random % 3 * 0.1)
accel  = -0.2 - (random % 4 * 0.1),0

[State 3200, pullhelper]
type = helper
trigger1 = (anim = 3005) && !numhelper(3206)
helpertype = normal
stateno = 3206
ID = 3206
name = "Vaccum"
postype = p2
pos = enemynear, const(size.ground.back) -25, -ceil(enemy, pos y)
persistent = 0
size.ground.back = 5
size.ground.front = 5
size.height = 240

[state 1000]
type = null
trigger1 = 1
flag = nobardisplay
ignorehitpause = 1

[state 1000]
type = playsnd
trigger1 = time = 0
value = S1,3
volumescale = 125

[state 1000]
type = playsnd
trigger1 = time = 0
value = S1,4
volumescale = 125

[state 1000]
type = playsnd
trigger1 = time = 0
value = S1020,0
volumescale = 125

[State 850, 0]
type = Width
trigger1 = AnimElem = 3, >= 0
edge = 30,30

[state 1000]
type = playerpush
trigger1 = 1
value = 0

[state 1000]
type = velset
trigger1 = 1
y = 0
x = 0

[State 3200, Dust]
type = explod
trigger1 = (anim = 3005) && !numexplod(3210)
anim = 3006
ID = 3210
sprpriority = -3
postype = p1
bindtime = -1
pos = 0, -ceil(pos y)
removetime = -1
ownpal = 1
removeongethit = 1
scale = 0.80, 0.80

[State 3200, Dust]
type = modifyexplod
trigger1 = numexplod(3210)
ID = 3210
postype = p1
pos = 0, -ceil(pos y)

[State 1028]
type = HitDef
trigger1 = AnimElem = 4 || AnimElem = 9 || AnimElem = 14 || animelem = 19 || animelem = 24
persistent = 1
attr = A, HA
getpower = 0
animtype = Light
damage = 18, 2
pausetime = 2,2
guardflag = M
hitflag = MAF
sparkNo = 1
guard.sparkNo = 40
sparkXY = -1,-35
hitsound = 5,1
guardsound = 6,0
ground.type = high
ground.slidetime = 12
ground.hittime = 12
guard.velocity = -12
airguard.velocity = -12,-2
air.type = low
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
guard.cornerpush.veloff = -10
airguard.cornerpush.veloff = -10
ground.velocity = 14,0
air.velocity = 14,-1.0
;yaccel = 0
maxdist = 4
fall.recover = 0

[State 1028]
type = HitDef
trigger1 = AnimElem = 6 || AnimElem = 11 || AnimElem = 16 || animelem = 21
persistent = 1
attr = A, HA
getpower = 0
animtype = Light
damage = 18, 2
pausetime = 2,2
guardflag = M
hitflag = MAF
sparkNo = 1
guard.sparkNo = 40
sparkXY = -1,-35
hitsound = 5,1
guardsound = 6,0
ground.type = high
ground.slidetime = 12
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
guard.cornerpush.veloff = -10
airguard.cornerpush.veloff = -10
air.type = low
ground.hittime = 12
guard.velocity = -12
airguard.velocity = 12,-1
ground.velocity = -14,0
air.velocity = -14,-1.0
maxdist = -4
;yaccel = 0
fall.recover = 0

[State 1028]
type = HitDef
trigger1 = animelem = 26
attr = A, HA
animtype = Heavy
getpower = 0
damage = ceil(ifElse(fvar(11) * 15 < 7, 7, fvar(11) * 15)), 2
pausetime = 2,2
guardflag = MA
hitflag = MAF
sparkNo = 1
guard.sparkNo = 40
sparkXY = -1,-35
hitsound = 5,1
guardsound = 6,0
ground.type = high
ground.slidetime = 2
ground.hittime  = 4
ground.velocity = -8,-5
guard.velocity = -12
airguard.velocity = -12,-5
air.velocity = -8,-5
air.type = low
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
guard.cornerpush.veloff = -10
airguard.cornerpush.veloff = -10
fall = 1
air.fall = 1
fall.recover = 0

[state 1000]
type = changestate
trigger1 = animtime = 0
value = 3008
ctrl = 0

;Dragon boost - State over
[Statedef 3008]
type    = A
movetype= A
physics = N
juggle  = 0
ctrl = 0
anim = 635
sprpriority = 2
poweradd = 0

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 1,0
ignorehitpause = 1

[state 1000]
type = veladd
trigger1 = 1
y = .42

[State 1100, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 1012
ctrl = 1

;LvL 2 Dragon Rage
[Statedef 3015]
type    = S
movetype= A
physics = S
juggle  = 0
velset = 0,0
anim = 3300
ctrl = 0
poweradd = 0
sprpriority = 2

[State 3000, Super A]
type = SuperPause
trigger1 = AnimElem = 1
pos = 0, 0
anim = -1
sound = -1
time = 21
movetime = 21
poweradd = -2000
p2defmul = 1
darken = 0

[state 1000]
type = explod
trigger1 = time = 0
anim = F101
pos = -15,-43
ontop = 1
postype = p1
bindtime = -1
removeongethit = 1
ignorehitpause = 1
supermovetime = 21
pausemovetime = 21

[state 1000]
type = nothitby
trigger1 = time = 0
value = SCA
time = 25
ignorehitpause = 1

[State 1120, Blink]
type = PalFX
trigger1 = Time = 0
time = 21
add = 84,84,84
sinadd = 92,92,92,4

[state 1000]
type = playsnd
trigger1 = time = 0
value = S3000,0
volumescale = 125

[state 1000]
type = velset
trigger1 = animelemtime(2) > 0 && animelemtime(42) < 0
x = 2.5

[state 1000]
type = playsnd
trigger1 = animelem = 3
trigger2 = animelem = 15
trigger3 = animelem = 27
value = 0,0
volumescale = 125

[state 1000]
type = playsnd
trigger1 = animelem = 9
trigger2 = animelem = 21
trigger3 = animelem = 33
value = 0,1
volumescale = 125

[state 1000]
type = playsnd
trigger1 = animelem = 3
trigger2 = animelem = 15
trigger3 = animelem = 27
value = S200,0
volumescale = 125

[state 1000]
type = playsnd
trigger1 = animelem = 9
trigger2 = animelem = 21
trigger3 = animelem = 33
value = S200,1
volumescale = 125

[state 1000]
type = playsnd
trigger1 = animelem = 39
value = 0,1
volumescale = 125

[state 1000]
type = playsnd
trigger1 = animelem = 39
value = S200,2
volumescale = 125

[State 200, 1]
type = HitDef
trigger1 = animelem = 4
trigger2 = animelem = 10
trigger3 = animelem = 16
trigger4 = animelem = 22
trigger5 = animelem = 28
trigger6 = animelem = 34
attr = A, HA
damage = 30, 2
animtype = medium
getpower = 0,0
givepower = 18,18
guardflag = M
hitflag = MAF
pausetime = 4, 4
sparkNo = 2
guard.sparkNo = 40
sparkXY = -20,-40
hitsound = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 20
ground.hittime  = 25
guard.ctrltime = 3
ground.velocity = -5.5,0
guard.velocity = -6.5
guard.cornerpush.veloff = -10
ground.cornerpush.veloff = -6
airguard.velocity = -4,-2.0
air.type = low
air.velocity = -2.0,-2.2
air.hittime = 25
Air.fall = 1
fall.recover = 0
fall = 0
yaccel = 0.3
ID = 3000

[State 200, 1]
type = HitDef
trigger1 = animelem = 40
attr = A, HA
damage = 50, 2
animtype = medium
getpower = 0,0
givepower = 18,18
guardflag = M
hitflag = MAF
pausetime = 5, 12
guard.pausetime = 12,12
sparkNo = 2
guard.sparkNo = 40
sparkXY = -20,-40
hitsound = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 20
ground.hittime  = 25
ground.velocity = -5.6,0
guard.velocity = -12.5
guard.cornerpush.veloff = -10
ground.cornerpush.veloff = -6
airguard.velocity = -4,-2.0
air.type = low
air.velocity = -2.0,-2.2
air.hittime = 25
Air.fall = 1
fall.recover = 0
fall = 0
yaccel = 0.3
ID = 3000

[state 1000]
type = changestate
trigger1 = animelemtime(44) > 0
trigger1 = movehit
value = 3016
ctrl = 0

[state 1000]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1

;Part 2
[Statedef 3016]
type    = S
movetype= A
physics = S
juggle  = 0
ctrl = 0
poweradd = 0
anim = 3301
velset = 3,0
sprpriority = 2

[state 1000]
type = changestate
trigger1 = animelem = 2
value = 3017
ctrl = 0

;Part 3
[Statedef 3017]
type    = A
movetype= A
physics = N
juggle  = 0
ctrl = 0
poweradd = 0
velset = 1.5,-10.5
sprpriority = 2

[state 1000]
type = playsnd
triggerall = anim = 3301
trigger1 = time = 0
value = 1000,1
volumescale = 125

[state 1000]
type = playsnd
triggerall = anim = 3301
trigger1 = time = 0
value = 0,1
volumescale = 125

[state 1000]
type = veladd
trigger1 = 1
y = .42

[State 200, 1]
type = HitDef
triggerall = anim = 3301
trigger1 = animelem = 3
trigger2 = animelem = 4
attr = A, HA
damage = 25, 2
animtype = diagup
getpower = 0,0
givepower = 18,18
guardflag = M
hitflag = MAF
pausetime = 5, 5
sparkNo = 2
guard.sparkNo = 40
sparkXY = -15,-55
hitsound = 5,2
guardsound = 6,0
ground.type = low
ground.slidetime = 20
ground.hittime  = 25
ground.velocity = -1.5,-8.7
air.type = low
air.velocity = -1.5,-8.9
air.hittime = 25
Air.fall = 1
fall.recover = 0
fall = 1
yaccel = 0.5
ID = 3001

[state 1000]
type = changestate
trigger1 = anim = 3301
trigger1 = animtime = 0
value = 1022
ctrl = 0

[state 1000]
type = changeState
triggerall = movecontact
trigger1 = animelemtime(9) > 0
value = 3002
ctrl = 0

[State 1100, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 52
ctrl = 1

;LvL 3 Dragon crusher (Rip off of M.Bison's hyper move "Psycho crusher")
[Statedef 3020]
type    = A
movetype= A
physics = N
juggle  = 4
velset = 0,0
anim = 3500
ctrl = 0
sprpriority = 2

[State 3050, hitvar]
type=varset
trigger1 = time = 0
var(14)=0

[state 100x,atc efe];?????????
type = explod
trigger1 = animelemtime(2) >= 0
anim =1150
ID = 100
postype = p1
pos = 0,-30
sprpriority = 5
ontop = 1
bindtime = 1
removetime = -2
ownpal=1
persistent  =0
scale = 1.0,1.0
accel  = 0,0.8 - (random % 4 * 0.1)
pausemovetime = 20
supermovetime = 20

[state 100x,atc efe];????????? ?
type = explod
trigger1 = numexplod(101) <= 3
trigger1 = animelemtime(2) >= 0
anim =1150
ID = 101
postype = p1
pos = 0,-30
random = 45,40
sprpriority = 5
ontop = 1
bindtime = 1
removetime = 12
ownpal=1
scale = 1 + (random % 3 * 0.1), 1 + (random % 3 * 0.1)
accel  = 0,0.8 - (random % 4 * 0.1)
pausemovetime = 20
supermovetime = 20

[state 1000]
type = nothitby
trigger1 = 1
value = SCA
ignorehitpause = 1

[State 1120, Blink]
type = PalFX
trigger1 = Time = 0
time = 20
add = 84,84,84
sinadd = 92,92,92,4

[State 1120, Blink]
type = PalFX
trigger1 = animelem = 2
time = 24
add = 84,84,84
sinadd = 92,92,92,4

[state 1000]
type = velset
trigger1 = animelemtime(1) >= 0
y = 0

[state 1000]
type = velset
trigger1 = animelemtime(2) >= 0
y = -0.6

[state 1000]
type = velset
trigger1 = animelemtime(6) >= 0
y = -11.0

[State 3000, Super A]
type = SuperPause
trigger1 = AnimElem = 1
pos = 0, 0
anim = -1
sound = -1
time = 45
movetime = 45
poweradd = -3000
p2defmul = 1
darken = 0

[state 1000]
type = explod
trigger1 = time = 0
anim = F102
pos = -1,-35
ontop = 1
postype = p1
bindtime = -1
removeongethit = 1
ignorehitpause = 1
supermovetime = 100
pausemovetime = 100

[State 6034, HyperBG]
type=helper
trigger1 = time = 0
helpertype=normal
stateno=6031
ID=6031
name="HyperBG"
postype=Back
supermovetime=99999
pausemovetime=99999
ownpal=1
ignorehitpause=1
size.xscale=.6
size.yscale=.6

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 1,0
ignorehitpause = 1

[state 1000]
type = nothitby
trigger1 = time = 0
value = SCA
time = 16
ignorehitpause = 1

[state 1000]
type = playsnd
trigger1 = time = 0
value = S3000,0
volumescale = 125

[state 1000]
type = playsnd
trigger1 = animelem = 2
value = S4000,0
volumescale = 125

[state 1000]
type = changestate
trigger1 = time = 50
value = 3021
ctrl = 0
;---------------------------------------------------------------------------

;BLAST!
[Statedef 3021]
type    = A
movetype= A
physics = N
juggle  = 4
anim = 3501
ctrl = 0
sprpriority = 2

[state 1000]
type = removeExplod
trigger1 = time = 0
ID = 100

[state 1000]
type = removeExplod
trigger1 = time = 0
ID = 101

[State 4002, pos]
type = posset
triggerall = facing = 1
trigger1 = time = 0
x = -240
y =-50

[state 100x,atc efe];?????????
type = explod
trigger1 = time  = 0
anim =1130
ID = 100
postype = p1
pos = -20,-35
sprpriority = 5
ontop = 1
bindtime = 1
removetime = -2
ownpal=1
persistent  =0
scale = 1.0,1.0

[state 100x,atc efe];????????? ?
type = explod
trigger1 = numexplod(101) <= 3
trigger1 = 1
anim =1130
ID = 101
postype = p1
pos = -20,-35
random = 40,30
sprpriority = 5
ontop = 1
bindtime = 1
removetime = 12
ownpal=1
scale = 1 + (random % 3 * 0.1), 1 + (random % 3 * 0.1)
accel  = -1.8 - (random % 4 * 0.1),0

[State 0, Hair]
type = Helper
trigger1 = time = 0
helpertype = normal
name = "Boost"
ID = 30200
stateno = 30200
pos = 0,0
postype = p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1

[State 0, Hair]
type = null
trigger1 = timemod = 3,0
helpertype = normal
name = "fireball"
ID = 30210
stateno = 30210
pos = 15,-20
postype = p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1

[State 0, Hair]
type = null
trigger1 = timemod = 3,0
helpertype = normal
name = "fireball"
ID = 30211
stateno = 30211
pos = 15,-20
postype = p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1

[State 4002, pos]
type = posset
triggerall = facing = -1
trigger1 = time = 0
x = 240
y =-50

[state 1000]
type = screenbound
trigger1 = 1
value = 0

[state 1000]
type = playsnd
trigger1 = time = 0
value = S4000,1
volumescale = 125

[state 1000]
type = playsnd
trigger1 = time = 0
value = S4000,2
volumescale = 125

[state 1000]
type = nothitby
trigger1 = 1
value = SCA
ignorehitpause = 1

[state 1000]
type = playerPush
trigger1 = 1
value = 0

[State 3050, hitvar]
type=varadd
trigger1=anim=3501&&(movehit=1||moveguarded=1||movereversed=1)
var(14)=1

[State 3050, hit]
type=hitdef
trigger1=anim=3501 && animelemtime(1)>=0
trigger1= timemod = 2,0 && var(14)<10
attr = A, HA
damage = 45, 4
animtype = heavy;fucking metal
guardflag = MAF
hitflag = MAF
getpower = 0
pausetime = 4, 4
sparkNo = 3
guard.sparkNo = 40
sparkXY = -10,-35
hitsound = 5,3
guardsound = 6,0
ground.type = low
guard.velocity = -5
airguard.velocity = 0,-1
ground.slidetime = 20
ground.hittime  = 25
ground.velocity = -6.0,-1.5
air.type = low
air.velocity = -6.0,-1.5
air.cornerpush.veloff = 0
ground.cornerpush.veloff = 0
air.hittime = 25
Air.fall = 1
fall.recover = 0
fall = 1
envshake.time = 16
envshake.freq = 60
envshake.ampl = 8

[state 1000]
type = velset
trigger1 = 1
x = 15
y = 0

[state 1000]
type = changestate
trigger1 = frontedgedist < -550 || Time > 200
;trigger1 = abs(Pos x) > floor(gamewidth/2 + 550) ;(Gamewidth/2) + 550
value = 3023

;State over
[Statedef 3023]
type    = A
movetype= A
physics = N
juggle  = 4
anim = 635
ctrl = 0
sprpriority = 2

[state 1000]
type = screenbound
trigger1 = 1
value = 0

[State 4002, pos]
type = posset
trigger1 = time = 0
x = ifelse (pos x > 0, - ((gamewidth/2)+30), ((gamewidth/2) + 30)) 
y =-80

[state 1000]
type = veladd
trigger1 = 1
y = .42

[state 1000]
type = velset
trigger1 = time = 0
x = 3.5

[state 1000]
type = changestate
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 1014
ctrl = 0

;Boost Helper - Cycle 1
[Statedef 30200]
type    = A
movetype= A
physics = N
juggle  = 4
ctrl = 0
velset = 0,0
sprpriority = 9999
poweradd = 0
anim = 1120

[state 1000]
type = bindtoroot
trigger1 = 1
pos = 8,7
ignorehitpause = 1

[State 3005, scale]
type = angledraw
trigger1 = 1
scale = 1.00, 1.00
ignorehitpause = 1

[State 3005, trans]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256,256
ignorehitpause = 1

[state 1000]
type = destroyself
trigger1 = root, stateno != 3021

;Fireball #1
[Statedef 30210]
type    = A
movetype= A
physics = N
anim = 3502
ctrl = 0
sprpriority = 5

[state 1000]
type = velset
trigger1 = time >= 0
x = 0
y = -8*(sin(0.50*time))

[state 1000]
type = destroyself
trigger1 = root, stateno != 3021
trigger2 = time >= 20

;Fireball #2
[Statedef 30211]
type    = A
movetype= A
physics = N
anim = 3502
ctrl = 0
sprpriority = 5

[state 1000]
type = velset
trigger1 = time >= 0
x = 0
y = 8*(sin(0.50*time))

[state 1000]
type = destroyself
trigger1 = root, stateno != 3021
trigger2 = time >= 20

;Hair Helper
[Statedef 6000]
type    = S
movetype= I
physics = N
ctrl = 0
sprpriority = 0

[State 0, BindToRoot]
type = BindToRoot
trigger1 = 1 
time = 1
pos = 0,0
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = root,anim != 0 
trigger1 = root,anim != 1
;trigger1 = root,anim != 2
trigger1 = root,anim != 3
trigger1 = root,anim != 4
trigger1 = root,anim != 5
;trigger1 = root,anim != 6
;trigger1 = root,anim != 10
;trigger1 = root,anim != 11
;trigger1 = root,anim != 12
trigger1 = root,anim != 20
trigger1 = root,anim != 21
trigger1 = root,anim != 41
trigger1 = root,anim != 42
trigger1 = root,anim != 43
trigger1 = root,anim != 44
trigger1 = root,anim != 45
trigger1 = root,anim != 46
;trigger1 = root,anim != 100
trigger1 = root,anim != 101
;trigger1 = root,anim != 105
trigger1 = root,anim != 110
trigger1 = root,anim != 111
trigger1 = root,anim != 115
trigger1 = root,anim != 116
trigger1 = root,anim != 170
trigger1 = root,anim != 190
;trigger1 = root,anim != 191 && root,anim != 194 && root,anim != [1910,1911]
trigger1 = root,anim != 195 && root,anim != [1950,1951]
trigger1 = root,anim != 240
trigger1 = root,anim != 241
trigger1 = root,anim != 635 
trigger1 = root,anim != 1100
trigger1 = root,anim != 1011
trigger1 = root,anim != 1016
trigger1 = root,anim != 3001
trigger1 = root,anim != 3010
trigger1 = root,anim != 3300 
trigger1 = root,anim != 3011
trigger1 = root,anim != 3310
trigger1 = root,anim != 3311
trigger1 = root,anim != 3312
trigger1 = root,anim != 1920
trigger1 = root,anim != 5040
trigger1 = root,anim != 5200
trigger1 = root,anim != 5210
trigger1 = root,anim != 5300 && root,anim != 5500
trigger3 = root,anim = 3011
trigger3 = root,time > 40
;trigger5 = root,anim = 105
;trigger5 = root,time > 2 && root,time <= 20
value = 19999
ignorehitpause = 1

[State 0, Turn]
type = Turn
trigger1 = facing = -1
trigger1 = root,facing = 1
trigger2 = facing = 1
trigger2 = root,facing = -1
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 9991
trigger1 = root,anim = 0
trigger2 = root,anim = 1
trigger3 = root,anim = 3
trigger4 = root,anim = 4
trigger5 = root,anim = 195
trigger6 = root,anim = 170
value = 9991
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 9996
trigger1 = root,anim = 20
value = 9996
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 9997
trigger1 = root,anim = 21
value = 9997
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 9998
trigger1 = root,anim = 41
value = 9998
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 9998
trigger1 = root,anim = 42
value = 9998
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 10000
trigger1 = root,anim = 43
value = 10000
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 10003
trigger1 = root,anim = 635
value = 10003
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 9999
trigger1 = root,anim = 44
value = 9999
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 9999
trigger1 = root,anim = 45
value = 9999
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 10001
trigger1 = root,anim = 46
value = 10001
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 10015
trigger1 = root,anim = 1100
value = 10015
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 10005
trigger1 = root,anim = 101
value = 10005
ignorehitpause = 1

[State 1000, ChangeAnim]
type = ChangeAnim
triggerall = anim != 9991
trigger1 = root,anim = 190
value = 9991
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 9991
trigger1 = root,anim = 175
value = 9991
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 10006
trigger1 = root,anim = 5
value = 10006
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 10008
trigger1 = root,anim = 1011
value = 10008
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 10009
trigger1 = root,anim = 1016
value = 10009
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 10012
trigger1 = root,anim = 5040
value = 10012
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 10012
trigger1 = root,anim = 5200
value = 10012
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 10014
trigger1 = root,anim = 5210
value = 10014
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 9991
trigger1 = root,anim = 5500
value = 9991
ignorehitpause = 1


;---------------------------------------------------------------------------
; Override common states (use same number to override) :
;---------------------------------------------------------------------------
[statedef -2]

[State 0, Hair]
type = Helper
trigger1 = !numhelper(6000)
name = "Hair"
ID = 6000
stateno = 6000
pos = 0,0
postype = p1   ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0

[State -2, 2a]
type = Playsnd
triggerall = alive
triggerall = Random < 500
trigger1 = stateno = 5120
trigger1 = time = 1
value = 5120, 0+random%2
channel = 0
Volumescale = 150

[State -2, 2a]
type = PlaySnd
triggerall = alive
triggerall = Random < 500
trigger1 = (stateno = 5000) || (stateno = 5010) || (stateno = 5020) || (stateno = 5070) || (stateno = 45000)
trigger1 = time = 0
trigger2 = (stateno != 5000) && (stateno != 5010) && (stateno != 5020) && (stateno != 5070) && (stateno != 45000)
trigger2 = stateno != [120,160]
trigger2 = gethitvar(damage)
value = 5000, 0+random%3
channel = 0
Volumescale = 125

[State -2]
Type=VarSet
Trigger1=Roundstate<2
Trigger2=P2Stateno=[120,160]
Trigger3=enemynear,ctrl
Trigger4=P2StateType!=A
Trigger4=P2MoveType!=H && enemynear,stateno != 3122
trigger5 = enemynear,name = "Duck Hunt"
var(0)=0
ignorehitpause=1

[State -2]
Type=VarSet
triggerall = stateno != 410 && stateno != 412 && stateno != 630 && stateno != 632
triggerall = movetype != A
Trigger1=Roundstate<2
Trigger2=P2Stateno=[120,160]
Trigger3=enemynear,ctrl
Trigger4=P2StateType!=A
Trigger4=P2MoveType!=H && enemynear,stateno != 3122
trigger5 = enemynear,name = "Duck Hunt"
var(1)=0
ignorehitpause=1

[State -2]
Type=VarSet
Trigger1=Roundstate<2
Trigger2=P2Stateno=[120,160]
Trigger3=enemynear,ctrl
Trigger4=P2StateType!=A
Trigger4=P2MoveType!=H && enemynear,stateno != 3122
trigger5 = enemynear,name = "Duck Hunt"
var(2)=0
ignorehitpause=1

[State -2]
Type=VarSet
Trigger1=Roundstate<2
Trigger2=P2Stateno=[120,160]
Trigger3=enemynear,ctrl
Trigger4=P2StateType!=A
Trigger4=P2MoveType!=H && enemynear,stateno != 3122
trigger5 = enemynear,name = "Duck Hunt"
var(3)=0
ignorehitpause=1

[State -2]
Type=VarSet
Trigger1=Roundstate<2
Trigger2=P2Stateno=[120,160]
Trigger3=enemynear,ctrl
Trigger4=P2StateType!=A
Trigger4=P2MoveType!=H && enemynear,stateno != 3122
trigger5 = enemynear,name = "Duck Hunt"
var(4)=0
ignorehitpause=1

[state -2]
type = varset
triggerall = p2stateno = 5080
trigger1 = movehit
trigger1 = p2statetype = L && p2movetype = H
trigger1 = time = 0
trigger1 = p2stateno = [800,850]
var(20) = 0
ignorehitpause = 1

[state -2]
type = varset
trigger1 = !p2movetype = H
var(20) = 0
ignorehitpause = 1

[State -2, Hit Detection]
type = VarSet
trigger1 = MoveContact = 1 && var(30) < 0
var(30) = HitPauseTime
ignoreHitPause = 1

[State -2, Hit Detection]
type = VarSet
trigger1 = 1
var(30) = -1

[State -2, Hit Detection]
type = VarRangeSet
trigger1 = MoveType = I
trigger2 = MoveType = H && Time
first = 30
last = 36
value = -1
ignoreHitPause = 1

[State -2, Hit Count]
type = VarAdd
trigger1 = MoveHit = 1
trigger1 = !(HitDefAttr = SCA, AT)
var(13) = 1

[State -2, Hit Count Reset]
type = VarSet
trigger1 = NumEnemy && var(13)
trigger1 = (EnemyNear, MoveType != H) && (EnemyNear, StateNo != 5300)
var(13) = 0
ignoreHitPause = 1

[State -2, Juggle Count]
type = VarAdd
trigger1 = MoveHit = 1
trigger1 = !(HitDefAttr = SCA,AT)
var(15) = 1

[State -2, Juggle Reset Single]
type = VarSet
triggerAll = NumEnemy = 1 && var(15)
trigger1 = (Enemy, StateType != A) && (Enemy, StateNo != [5100,5109]) && (Enemy, Time >= 1)
trigger2 = (Enemy, MoveType != H) || (Enemy, StateNo = [120,155]) || (Enemy, Ctrl)
var(15) = 0
ignoreHitPause = 1

[State -2, Juggle Reset Simul]
type = VarSet
triggerAll = NumEnemy >= 2 && var(15)
trigger1 = (EnemyNear(0), StateType != A) && (EnemyNear(0), Time >= 1)
trigger2 = (EnemyNear(0), MoveType != H) || (EnemyNear(0), StateNo = [120,155]) || (EnemyNear(0), Ctrl)
trigger3 = (EnemyNear(1), StateType != A) && (EnemyNear(0), Time >= 1)
trigger4 = (EnemyNear(1), MoveType != H) || (EnemyNear(0), StateNo = [120,155]) || (EnemyNear(0), Ctrl)
var(15) = 0
ignoreHitPause = 1

[State -2, Free Juggling]
type = VarSet
trigger1 = RoundState != 2
var(15) = 0
ignoreHitPause = 1

[State -2, Juggle Flag]
type = VarSet
trigger1 = NumEnemy && !var(16)
trigger1 = (EnemyNear, StateNo = 5040) && !(EnemyNear, Ctrl)
var(16) = 1
ignorehitpause = 1

[State -2, Juggle Flag Reset Single]
type = VarSet
triggerAll = NumEnemy = 1 && var(16)
trigger1 = (Enemy, MoveType != H) && (Enemy, StateNo != 5040)
trigger2 = !(Enemy, HitShakeOver) || (Enemy, StateType = L) || (Enemy, Ctrl)
var(16) = 0
ignoreHitPause = 1

[State -2, Juggle Flag Reset Simul]
type = VarSet
triggerAll = NumEnemy >= 2 && var(16)
trigger1 = (EnemyNear(0), MoveType != H) && (EnemyNear(0), StateNo != 5040)
trigger2 = !(EnemyNear(0), HitShakeOver) || (EnemyNear(0), StateType = L) || (EnemyNear(0), Ctrl)
trigger3 = (EnemyNear(1), MoveType != H) && (EnemyNear(1), StateNo != 5040)
trigger4 = !(EnemyNear(1), HitShakeOver) || (EnemyNear(1), StateType = L) || (EnemyNear(1), Ctrl)
var(16) = 0
ignoreHitPause = 1

[State -2, Counter Flag] 
type = VarSet
trigger1 = NumEnemy
fvar(8) = (EnemyNear, MoveType = A)
ignoreHitPause = 1
 
;Damage Dampener Variable (by POTS)
[State -2, Hit Count] 
type = VarAdd 
trigger1 = !IsHelper
trigger1 = MoveHit = 1 
trigger1 = !HitPauseTime 
trigger1 = !(HitDefAttr = SCA, AT) 
fvar(13) = 1 
 
[State -2, Hit Count Reset] 
type = VarSet 
trigger1 = NumEnemy && fvar(13) 
trigger1 = (EnemyNear, MoveType != H) && (EnemyNear, StateNo != 5300) 
fvar(13) = 0 
ignoreHitPause = 1

[State -2, Dampener] 
type = VarSet 
trigger1 = 1 
fvar(10) = ifElse(fvar(13) < 3, 24, ifElse(fvar(13) >= 23, 1, 24 - fvar(13))) / 24.0 
ignoreHitPause = 1 
 
[State -2, Dampener Limit] 
type = VarSet 
trigger1 = fvar(10) < 0 
fvar(10) = 0 
ignoreHitPause = 1 
 
[State -2, Root Dampener] 
type = VarSet 
trigger1 = 1 
fvar(11) = fvar(10) * ifElse(fvar(8), 1.2, 1) 
ignoreHitPause = 1

[State -1, AI ON]  ; Turn the AI on when
Type = VarSet
TriggerAll = Var(59) < 1 ; it is not on yet and
TriggerAll = RoundState=2 ; the fight has started and is not over yet and
Trigger1 = AILevel>0 ; the computer is playing the character
v = 59
value= 1 ; value of 1 will mean the AI is on
Ignorehitpause=1

[State -1, AI OFF] ; Turn the AI off when
Type=VarSet
Triggerall=var(59)>0  ; it is on and
Trigger1=RoundState!=2  ; the round is not started yet or is already over or
Trigger2=AILevel=0  ; the computer is not in control
v=59
value=0 ; value of 0 will mean the AI is off. values other than 0 and 1 are not used in this example, we have only one AI mode, the normal one.
Ignorehitpause=1

[State -1, AI go easeh on meh!]
Type=VarSet
Trigger1=1
var(50)=(AILevel=1)*6+(AILevel=2)*12+(AILevel=3)*32+(AILevel=4)*64+(AILevel=5)*90+(AILevel=6)*128+(AILevel=7)*200+(AILevel=8)*300

[State -2, Debug]
type = displaytoclipboard
trigger1 = 1
text = "AI = %d OTG points = %i"
params = AIlevel, var(20)
ignorehitpause = 1

[Statedef -3]

[State -3, Pause]
type = Helper
triggerall = teamside = 1
triggerall = (!AILevel) && !(NumHelper(8000)) && (RoundState = 2)
trigger1 = command = "start" && (!HitPauseTime || HitPauseTime = 1) && !NumHelper(6002)
helpertype = normal 
name = "Pause Menu"
ID = 8000
stateno = 8000
pos = 0,0
postype = left
facing = 1
keyctrl = 1
ownpal = 1
pausemovetime = 9999
ignorehitpause = 1

;DRM
[State -3, DRM Check]
type = null
triggerall = !numhelper(10000)
trigger1 = !time
helpertype = normal 
name = "Copy Protection"
ID = 10000
stateno = 10000
pos = 0,0
postype = left
facing = 1
keyctrl = 1
ownpal = 1
pausemovetime = 9999
ignorehitpause = 1

[state -3]
type = removeexplod
trigger1 = time = 1 && anim != 1050
ID = 1051
ignorehitpause = 1

[state -3]
type = removeexplod
trigger1 = time = 1 && stateno != 1420
ID = 1051
ignorehitpause = 1

[state -3]
type = removeexplod
trigger1 = time = 1 && anim != 1050
ID = 1588
ignorehitpause = 1

[State 3200, Dust]
type = removeexplod
trigger1 = anim != 3005 && numexplod(3210)
ID = 3210

[state -3]
type = removeexplod
trigger1 = time = 1 && anim != 3005
ID = 1569
ignorehitpause = 1

[State -3, Level 1 Super AfterImage]
type = AfterImage
trigger1 = StateNo = 3000 && Time = 16
trigger2 = StateNo = 3005 && Time = 16
time = 2
timegap = 1
framegap = 4
length = 16
palbright = 200, 200, 250
palcontrast = 0, 100,150
palcolor = 0
trans = add

[State -3, Level 2 Super AfterImage]
type = Afterimage
trigger1 = StateNo = 3015 && Time = 21
time = 2
timegap = 1
framegap = 4
length = 16
palbright = 250, 150, 200
palcontrast = 250, 100,0
palcolor = 0
trans = add

[State -3, AfterImage Persist]
type = AfterImageTime
;trigger1 = StateNo = 50 || (StateNo = [600,699])
;trigger1 = (var(3) = 2 || var(3) = 3) && vel y < -1
;trigger2 = var(20)
;trigger3 = StateNo = [700,715]
trigger1 = StateNo = [3000,3020]
time = 2
ignorehitpause = 1

[State -3, AfterImage Off]
type = AfterImageTime
triggerAll = Time <= 1
trigger1 = StateNo = 3000 || StateNo = 3001 || Stateno = 3005 || Stateno = 3006 || stateno = 3007 || stateno = 3015 || stateno = 3016
;trigger2 = StateNo = 3300
time = 0
ignorehitpause = 1


;This controller plays a sound everytime KFM lands from a jump, or
;from his back-dash.
[State -3, Landing Sound]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 52 ;Jump land
trigger2 = stateno = 106 ;Run-back land
trigger3 = stateno = 1012
trigger4 = stateno = 1014
value = 40, 0
volumescale = 125
