[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 = 18    ;Player width (back, ground)
ground.front = 18    ;Player width (front, ground)
air.back = 14        ;Player width (back, air)
air.front = 14       ;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 = -2, -59   ;Approximate position of head
mid.pos = 0, -29    ;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.2     ;Walk forward
walk.back = -3.2    ;Walk backward
run.fwd  = 6.2, 0    ;Run forward (x, y)
run.back = -4.5,-4 ;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 = -3.5,-7 ;Running jump speeds (opt)
runjump.fwd = 5,-6.5      ;.
airjump.neu = 0,-8.5      ;.
airjump.back = -3.0     ;Air jump speeds (opt)
airjump.fwd = 3.0         ;.

[Movement]
airjump.num = 1      ;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 0, 1]
type = ChangeAnim
trigger1 = Anim != [0,5]
trigger2 = Anim = 5 && AnimTime = 0 ;Turn anim over
trigger3 = Anim = [1,2]
trigger3 = !animtime
trigger4 = anim = 3
trigger4 = !animtime
value = 0

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

[State 0, 1]
type = changeanim
triggerall = anim != 2 && 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 = 2

[State 0, 1]
type = changeanim
triggerall = anim = 2
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 = 3

[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

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

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

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

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

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

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

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

[State 45, 7]
type = ChangeState
trigger1 = Time = 2
value = 69
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

; Jump Up
[Statedef 69]
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, 48, ifelse((vel x)>0, 48, 48))

[State 50, 3]
type = ChangeAnim
trigger1 = Vel y > Const720p(-8)
trigger1 = SelfAnimExist(anim + 3)
trigger1 = anim >= 41 && anim <= 48
persistent = 0
value = Anim + 3

[state 1000]
type = explod
trigger1 = time = 0
anim = 10500
postype = p1
pos = 0,0
bindtime = 1
scale = 1.20,0.30
ontop = 1
removeongethit = 1
ignorehitpause = 1

;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 = 5
trigger2 = animelem = 10
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

;Skidding
;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 = 2.0

[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

;Jump Back
[Statedef 105]
type    = A
physics = A
movetype = I
ctrl = 0
anim = 105
sprpriority = 1

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

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

[State 200, 1]
type = PlaySnd
trigger1 = !time
value = S50, 0
volumescale = 125

[State 7100, Dust]
type = explod
trigger1 = !time
anim = F120
ID = 120
sprpriority = 3
postype = p1
pos = 0, ceil(pos y)
scale = 1, 1
pausemovetime = -1
supermovetime = -1

[State 700, Attack]
type = Changeanim
trigger1 = anim = 105
trigger1 = animtime = 0
value = 635

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

[State 105, 3]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 106

;---------------------------------------------------------------------------
; Jump Back (Landing)
[Statedef 106]
type    = S
physics = S
ctrl = 0
anim = 47

[State 200, 1]
type = PlaySnd
trigger1 = time = 0
value = 40, 0
volumescale = 125

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

[State 52, 煙]
type = explod
trigger1 = time = 0
anim = 69
pos = 0, 0
postype = p1
sprpriority = 2
ownpal = 1

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

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

[State 106, 4]
type = ChangeState
trigger1 = animtime = 0
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

;FREEZE!
[Statedef 160]
type    = S
movetype= A
physics = S
juggle  = 0
poweradd= -1000
ctrl = 0
velset = 0,0
anim = 1601
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 0, VarAdd]
type = VarAdd
trigger1 = movehit
trigger1 = numtarget(160)
trigger1 = target(160),time = 0
var(2) = 6
ignorehitpause = 1

[state 1000]
type = velset
trigger1 = animelem = 4
x = 4.5

[state 1000]
type = envshake
trigger1 = animelem = 6
time = 10
ampl = 5

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

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

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

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

[State 200, 1]
type = HitDef
trigger1 = time = 0 && var(20) <= 1
trigger1 = time = 0 && var(20) <= 1
attr = S, SA
damage = 90, 2
animtype = heavy
getpower = 0,0
givepower = 18,18
guardflag = M
hitflag = MAF
pausetime = 15, 15
sparkNo = 2
guard.sparkNo = 40
sparkXY = -15,-35
hitsound = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -4,-5
guard.hittime = 20
air.type = high
air.velocity = -4,-5
air.hittime = 25
Air.fall = 1
fall.recover = 0
fall = 1
yaccel = 0.42
ID = 160

[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
volumescale = 125

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = time <= 150
flag = roundnotover
ignorehitpause = 1

[state 1000]
type = playsnd
trigger1 = !time
trigger1 = life >= 800
value = S180,1
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 Neera Li"
value = 193
ctrl = 0

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

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

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

[State 191, 1] ;Freeze animation until PreIntro is over
type = ChangeAnim
triggerall = time < 300
trigger1 = p2stateno = [190,199]
value = 191

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

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

; Introduction - Mirror
[Statedef 193]
type = S
ctrl = 0
anim = 192
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 Staff
[Statedef 200]
type    = S                      
movetype= A                      
physics = S                      
juggle  = 0                    
velset = 0,0                     
ctrl = 0                         
anim = 200                    
poweradd = 0                    
sprpriority = 2

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

[State 200, 1]
type = HitDef
trigger1 = time = 0
attr = S, NA
damage = ceil(ifElse(fvar(11) * 20 < 7, 7, fvar(11) * 20)), 0
getpower = 72,36
givepower = 36,36
animtype = Light
guardflag = M
hitflag = MAF
pausetime = 6, 6
sparkNo = 0
guard.sparkNo = 40
sparkXY = -10,-38
hitsound = 5,0
guardsound = 6,0
ground.type = High
ground.slidetime = 18
ground.hittime  = 18
ground.velocity = -4.5
guard.velocity = -4.5
guard.ctrltime = 3
air.type = low
air.velocity = -2.5,-4.0
air.hittime = 18
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 = 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 200, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
;Pew, die and 3.14.
[Statedef 201]
type    = S                      
movetype= A                      
physics = S                      
juggle  = 0                    
velset = 0,0                     
ctrl = 0                         
anim = 201                   
poweradd = 0                    
sprpriority = 2

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

[State 2500, 0]
type = Helper
trigger1 = AnimElem = 1
helpertype = normal
name = "Kyoob"
id = 205
facing = 1
pos = 15,-38
postype = p1
stateno = 205
keyctrl = 0
ownpal = 1
size.xscale = 1
size.yscale = 1

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

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

;Pew, die and 3.14.
[Statedef 202]
type    = S                      
movetype= A                      
physics = S                      
juggle  = 0                    
velset = 0,0                     
ctrl = 0                         
anim = 201                   
poweradd = 0                    
sprpriority = 2

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

[State 2500, 0]
type = Helper
trigger1 = AnimElem = 1
helpertype = normal
name = "Kyoob"
id = 205
facing = 1
pos = 15,-38
postype = p1
stateno = 205
keyctrl = 0
ownpal = 1
size.xscale = 1
size.yscale = 1

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

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

;Pew, die and 3.14.
[Statedef 203]
type    = S                      
movetype= A                      
physics = S                      
juggle  = 0                    
velset = 0,0                     
ctrl = 0                         
anim = 201                   
poweradd = 0                    
sprpriority = 2

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

[State 2500, 0]
type = Helper
trigger1 = AnimElem = 1
helpertype = normal
name = "Kyoob"
id = 205
facing = 1
pos = 15,-38
postype = p1
stateno = 205
keyctrl = 0
ownpal = 1
size.xscale = 1
size.yscale = 1

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

;Kyoob Projectile Part 1
[Statedef 205]
type = A
movetype = A
physics = N
ctrl = 0
velset = 0,0
sprpriority = 1
anim = 202
poweradd = 0

[state 1000]
type = assertspecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

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

[State 1210, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA, NA, SA, HA, NT, ST, HT
time = 1

[State 1210, HitBy]
type = HitBy
trigger1 = 1
value = SCA, NP, SP, HP
time = 1

[State 1210, HitOverride]
type = HitOverride
trigger1 = Time <= 0
time = -1
attr = SCA, NP, SP, HP
slot = 0
stateno = 206

[State 1000, 5] ;Opponent near
type = hitdef
trigger1 = time = 0
attr = S, NP
animtype  = light
damage    = 30, 0
priority  = 5
getpower = 72,36
givepower = 36,36
guardflag = MAF
pausetime = 0,0
sparkno = 0
sparkxy = 0,0
guard.sparkno = 40
hitsound   = 5,0
guardsound = 6,0
ground.type = high
ground.slidetime = 15
ground.hittime  = 15
air.hittime = 10
ground.velocity = -4.0,0
air.velocity = -4.5,-1.5
air.hittime = 30
fall = 0
air.fall = 1
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
fall.recover = 0

[state 1000]
type = changestate
trigger1 = movecontact
trigger2 = time > 12
value = 206

[State 1210, Destroy]
type = changestate
trigger1 = BackEdgeBodyDist <= -100
trigger2 = FrontEdgeBodyDist <= -100
value = 206
ctrl = 0

;Kyoob Projectile - Disappear
[Statedef 206]
type = A
movetype = I
physics = N
ctrl = 0
velset = 0,0
sprpriority = 5
anim = 10500
poweradd = 0

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

[state 1000]
type = assertspecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 1008, End]
type = destroyself
trigger1 = animtime = 0

;Weak Staff
[Statedef 210]
type    = S                      
movetype= A                      
physics = S                      
juggle  = 0                    
velset = 0,0                     
ctrl = 0                         
anim = 200                    
poweradd = 0                    
sprpriority = 2

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

[State 200, 1]
type = HitDef
trigger1 = time = 0
attr = S, NA
damage = ceil(ifElse(fvar(11) * 20 < 7, 7, fvar(11) * 20)), 0
getpower = 72,36
givepower = 36,36
animtype = Light
guardflag = M
hitflag = MAF
pausetime = 6, 6
sparkNo = 0
guard.sparkNo = 40
sparkXY = -10,-38
hitsound = 5,0
guardsound = 6,0
ground.type = High
ground.slidetime = 18
ground.hittime  = 18
ground.velocity = -4.5
ground.cornerpush.veloff = -10
air.cornerpush.veloff = -10
guard.velocity = -4.5
guard.ctrltime = 3
air.type = low
air.velocity = -2.5,-4.0
air.hittime = 18
yaccel = 0.5
ID = 210

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

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

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

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

[state 1000]
type = velset
trigger1 = animelem = 5
x = 3.8

[State 210, 1]
type = PlaySnd
trigger1 = time = 10
value = 0, 1
volumescale = 125

[State 200, 2]
type = playsnd
trigger1 = time = 10
value = S200,0 +random%2
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 = 8, 8
sparkNo = 1
guard.sparkNo = 40
sparkXY = -10,-40
hitsound = 5,1
guardsound = 6,0
ground.type = High
ground.slidetime = 30
ground.hittime  = 22
ground.velocity = -8.0,0
guard.velocity = -8
guard.ctrltime = 3
ground.cornerpush.veloff = -15
air.cornerpush.veloff = -15
air.type = low
air.velocity = -4.0,-2.0
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 = 1700
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
channel = 0
volumescale = 125

[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 700, Attack]
type = ChangeState
trigger1 = animtime = 0
value = 0
ctrl = 1

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

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

[State 1026, Velocity]
type = VelSet
trigger1 = Time = 0
x = -20
y = -5

[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 - flying through the air
; (a custom gethit state)
[Statedef 256]
type    = A
movetype= H
physics = N

[State 1026, Velocity]
type = VelSet
trigger1 = Time = 0
x = -20
y = -5

[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,3
volumescale = 125

[state 1000]
type = envshake
trigger1 = time = 0
time = 10

[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 = 1.0

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

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

[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

;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(7)<0
value = SCA,AT
time = 1

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

[State 710, Start Roll]
type = VelSet
trigger1 = AnimElem = 5
x = 2.0

;[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
channel = 0
volumescale = 125

[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 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(7)<0
value = SCA,AT
time = 1

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

[State 710, Start Roll]
type = VelSet
trigger1 = AnimElem = 5
x = -2.0

;[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
channel = 0
volumescale = 125

[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 710, End]
type = ChangeState
trigger1 = animtime = 0
value = 0
ctrl = 1     

;Weak Staff
[Statedef 400]
type    = C                      
movetype= A                      
physics = C                      
juggle  = 0                     
velset = 0,0                     
ctrl = 0                         
anim = 400                   
poweradd = 0                    
sprpriority = 2

[State 200, 1]
type = PlaySnd
trigger1 = animelem = 3
value = 0, 0                
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) * 20 < 7, 7, fvar(11) * 20)), 0
getpower = 72,36
givepower = 36,36
animtype = Light
guardflag = L
hitflag = MAFD
pausetime = 6, 6
sparkNo = 0
guard.sparkNo = 40
sparkXY = -15,-25
hitsound = 5,0
guardsound = 6,0
ground.type = low
ground.slidetime = 20
ground.hittime  = 18
ground.velocity = -4.5
air.type = low
air.velocity = -2.5,-3
air.hittime = 18
down.velocity = -1,-6.0
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 = 200
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 = 200
ctrl = 0

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

;Pew, die and 3.14.
[Statedef 401]
type    = C                      
movetype= A                      
physics = C                      
juggle  = 0                    
velset = 0,0                     
ctrl = 0                         
anim = 401                   
poweradd = 0                    
sprpriority = 2

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

[State 2500, 0]
type = Helper
trigger1 = AnimElem = 1
helpertype = normal
name = "Kyoob"
id = 205
facing = 1
pos = 20,-22
postype = p1
stateno = 205
keyctrl = 0
ownpal = 1
size.xscale = 1
size.yscale = 1

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

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

;Pew, die and 3.14.
[Statedef 402]
type    = C                      
movetype= A                      
physics = C                      
juggle  = 0                    
velset = 0,0                     
ctrl = 0                         
anim = 401                   
poweradd = 0                    
sprpriority = 2

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

[State 2500, 0]
type = Helper
trigger1 = AnimElem = 1
helpertype = normal
name = "Kyoob"
id = 205
facing = 1
pos = 20,-22
postype = p1
stateno = 205
keyctrl = 0
ownpal = 1
size.xscale = 1
size.yscale = 1

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

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

;Pew, die and 3.14.
[Statedef 403]
type    = C                      
movetype= A                      
physics = C                      
juggle  = 0                    
velset = 0,0                     
ctrl = 0                         
anim = 401                   
poweradd = 0                    
sprpriority = 2

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

[State 2500, 0]
type = Helper
trigger1 = AnimElem = 1
helpertype = normal
name = "Kyoob"
id = 205
facing = 1
pos = 20,-22
postype = p1
stateno = 205
keyctrl = 0
ownpal = 1
size.xscale = 1
size.yscale = 1

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

;Weak Staff
[Statedef 410]
type    = C                      
movetype= A                      
physics = C                      
juggle  = 0                     
velset = 0,0                     
ctrl = 0                         
anim = 400                   
poweradd = 0                    
sprpriority = 2

[State 200, 1]
type = PlaySnd
trigger1 = animelem = 3
value = 0, 0                
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) * 20 < 7, 7, fvar(11) * 20)), 0
getpower = 72,36
givepower = 36,36
animtype = Light
guardflag = L
hitflag = MAFD
pausetime = 6, 6
sparkNo = 0
guard.sparkNo = 40
sparkXY = -15,-25
hitsound = 5,0
guardsound = 6,0
ground.type = low
ground.slidetime = 20
ground.hittime  = 18
ground.velocity = -4.5
air.type = low
air.velocity = -2.5,-3
air.hittime = 18
down.velocity = -1,-6.5
down.hittime = 20
yaccel = 0.42
ID = 400

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

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

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

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

[State 200, 1]
type = HitDef
trigger1 = anim = 600
trigger1 = time = 0
attr = A, NA
damage = ceil(ifElse(fvar(11) * 20 < 7, 7, fvar(11) * 20)), 0
getpower = 72,36
givepower = 36,36
animtype = light
guardflag = HA
hitflag = MAF
pausetime = 6, 6
sparkNo = 0
guard.sparkNo = 40
sparkXY = -10,-45
hitsound = 5,0
guardsound = 6,0
ground.type = High
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -3.5
air.type = low
air.velocity = -2.0,-3
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

;Woah
[Statedef 601]
type    = A
movetype= A
physics = A
juggle  = 0
poweradd= 0
ctrl = 0
anim = 601
sprpriority = 2

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

[State 2500, 0]
type = Helper
trigger1 = AnimElem = 1
helpertype = normal
name = "Kyoob"
id = 205
facing = 1
pos = 15,-43
postype = p1
stateno = 605
keyctrl = 0
ownpal = 1
size.xscale = 1
size.yscale = 1

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

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

;Woah
[Statedef 602]
type    = A
movetype= A
physics = A
juggle  = 0
poweradd= 0
ctrl = 0
anim = 601
sprpriority = 2

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

[State 2500, 0]
type = Helper
trigger1 = AnimElem = 1
helpertype = normal
name = "Kyoob"
id = 205
facing = 1
pos = 15,-42
postype = p1
stateno = 605
keyctrl = 0
ownpal = 1
size.xscale = 1
size.yscale = 1

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

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

;Woah
[Statedef 603]
type    = A
movetype= A
physics = A
juggle  = 0
poweradd= 0
ctrl = 0
anim = 601
sprpriority = 2

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

[State 2500, 0]
type = Helper
trigger1 = AnimElem = 1
helpertype = normal
name = "Kyoob"
id = 205
facing = 1
pos = 15,-42
postype = p1
stateno = 605
keyctrl = 0
ownpal = 1
size.xscale = 1
size.yscale = 1

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

;Kyoob Projectile Part 1
[Statedef 605]
type = A
movetype = A
physics = N
ctrl = 0
velset = 0,0
sprpriority = 1
anim = 202
poweradd = 0

[state 1000]
type = assertspecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[state 1000]
type = bindtoroot
trigger1 = time = 0
time = 1
pos = 15,-43
ignorehitpause = 1

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

[State 1210, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA, NA, SA, HA, NT, ST, HT
time = 1

[State 1210, HitBy]
type = HitBy
trigger1 = 1
value = SCA, NP, SP, HP
time = 1

[State 1210, HitOverride]
type = HitOverride
trigger1 = Time <= 0
time = -1
attr = SCA, NP, SP, HP
slot = 0
stateno = 206

[State 1000, 5] ;Opponent near
type = hitdef
trigger1 = time = 0
attr = S, NP
animtype  = light
damage    = 30, 0
priority  = 5
getpower = 72,36
givepower = 36,36
guardflag = MAF
pausetime = 0,0
sparkno = 0
sparkxy = 0,0
guard.sparkno = 40
hitsound   = 5,0
guardsound = 6,0
ground.type = low
ground.slidetime = 15
ground.hittime  = 15
air.hittime = 10
ground.velocity = -4.0,0
air.velocity = -3.0,-1.5
fall = 0
air.fall = 0
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
fall.recover = 0

[state 1000]
type = changestate
trigger1 = movecontact
trigger2 = time > 12
value = 206

[State 1210, Destroy]
type = changestate
trigger1 = BackEdgeBodyDist <= -100
trigger2 = FrontEdgeBodyDist <= -100
value = 206
ctrl = 0

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

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

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

[State 0, ChangeState]
type = changestate
triggerall = time >= 9
trigger1 = command = "hold_a"
trigger2 = var(59)
trigger2 = random<var(50)*2.0
value = 601
ctrl = 0

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

;Falling State
[Statedef 635]
type    = A
movetype= A
physics = N
juggle  = 1
poweradd= 0
ctrl = 0
anim = 635
sprpriority = 2

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

[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 1000]
type = veladd
trigger1 = 1
y = .42

[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 1100, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 1012
ctrl = 0

[State 700, Attack]
type = Changestate
triggerall = anim = 650
trigger1 = animtime = 0
value = 635
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, Throw Sound]
type = PlaySnd
trigger1 = Animelem = 2
value = 0, 2
volumescale = 125

[State 810, Hit Sound]
type = PlaySnd
trigger1 = AnimElem = 1
value = S9,0
volumescale = 200

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

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

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

[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, Throw Sound]
type = PlaySnd
trigger1 = Animelem = 2
value = 0, 2
volumescale = 125

[State 810, Hit Sound]
type = PlaySnd
trigger1 = AnimElem = 1
value = S9,0
volumescale = 200

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

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

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

[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 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 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 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
;---------------------------------------------------------------------------
;Ice Crasher
[Statedef 1000]
type    = A
movetype= A
physics = N
juggle  = 0
poweradd= 0
ctrl = 0
velset = 1,-0.5
anim = 1000
sprpriority = 2

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

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

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

;Ice Crasher
[Statedef 1004]
type    = A
movetype= A
physics = N
juggle  = 0
poweradd= 0
ctrl = 0
anim = 1000
sprpriority = 2

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

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

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

;Ice Crasher part 2
[Statedef 1001]
type    = A
movetype= A
physics = N
juggle  = 0
poweradd= 0
ctrl = 0
sprpriority = 2

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

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

[state 1000]
type = veladd
trigger1 = 1
x = 3.40

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

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

[State 200, 1]
type = HitDef
trigger1=anim=1000 && animelemtime(4)>=0
trigger1= timemod = 2,0 && var(14)<2
attr = A, SA
damage = ceil(ifElse(fvar(11) * 45 < 10, 10, fvar(11) * 45)), 2
animtype = hard
getpower = 36,18
givepower = 18,18
guardflag = MA
hitflag = MAF
pausetime = 8, 8
sparkNo = 1
guard.sparkNo = 40
sparkXY = -20,-48
hitsound = 5,1
guardsound = 6,0
ground.type = low
ground.slidetime = 20
ground.hittime  = 25
ground.velocity = -6,-3.0
ground.cornerpush.veloff = -5
guard.velocity = -10
airguard.velocity = -6,-4 
air.cornerpush.veloff = -5
guard.cornerpush.veloff = -6
air.type = low
air.velocity = -6,-3.0
air.hittime = 25
Air.fall = 1
yaccel = 0.6
fall.recover = 0
fall = 1
ID = 1001

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

[Statedef 1002]
type    = A
movetype= A
physics = N
juggle  = 0
poweradd= 0
ctrl = 0
sprpriority = 2

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

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

; Landing after ice crasher
[Statedef 1003]
type    = S
physics = S
ctrl = 0
anim = 1001

[state 1000]
type = gameMakeAnim
trigger1 = time = 0
pos = 0,0
value = 120
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, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

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

[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, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;Dead State
[Statedef 1018]
type = A
movetype= I
physics = N
ctrl = 0
;velset = 0,0
sprpriority = 5
movehitpersist = 1

[State 1014, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1
persistent = 1

[State 1014, Muteki]
type = NotHitBy
trigger1 = 1
value = SCA

[State 1014, End]
type = ChangeState
trigger1 = !AnimTime
value = 1019

[State 1014, End]
type = DestroySelf
trigger1 = Root,MoveType=H

;Wait
[StateDef 1019]
type = A
physics = N
moveType = I
anim = 19999
ctrl = 0
velSet = 0,0

[State 1015, AfterImageTime]
type = AfterImageTime
trigger1 = 1 
time = 0
ignorehitpause = 1 

[State 1015, DestroySelf]
type = DestroySelf
trigger1 = !NumTarget
trigger2 = NumTarget
trigger2 = Target, Time <= 1 && !(Target, HitShakeOver)

;FREEZE!
[Statedef 1500]
type    = S
movetype= A
physics = S
juggle  = 0
poweradd= 0
ctrl = 0
velset = 0,0
anim = 1500
sprpriority = 2

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

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

[State 0, ChangeState]
type = ChangeState
triggerall = numhelper(7050) = 1
trigger1 = helper(7050), stateno = 70522
value = 1500
ctrl = 0

[State 2500, 0]
type = Helper
trigger1 = AnimElem = 3
helpertype = normal
name = "Freeze material"
id = 7050
facing = 1
pos = 25,-39
postype = p1
stateno = 7051
keyctrl = 0
ownpal = 1
size.xscale = 1
size.yscale = 1

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

;FREEZE! (Air)
[Statedef 1501]
type    = A
movetype= A
physics = N
juggle  = 0
poweradd= 0
ctrl = 0
velset = 0,0
anim = 1501
sprpriority = 2

[state 1000]
type = velset
trigger1 = time = 0
x = -3
y = -5

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

[state 1000]
type = playsnd
triggerall = anim = 1501
trigger1 = animelem = 3
value = S1,0
volumescale = 125

[state 1000]
type = playsnd
triggerall = anim = 1501
trigger1 = animelem = 3
value = S1000,0
volumescale = 125

[State 0, ChangeState]
type = ChangeState
triggerall = numhelper(7050) = 1
trigger1 = helper(7050), stateno = 70522
value = 1501
ctrl = 0

[State 2500, 0]
type = Helper
triggerall = anim = 1501
trigger1 = AnimElem = 3
helpertype = normal
name = "Freeze material"
id = 7050
facing = 1
pos = 25,-45
postype = p1
stateno = 7051
keyctrl = 0
ownpal = 1
size.xscale = 1
size.yscale = 1

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

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

;Ice Spike
[Statedef 1600]
type    = S
movetype= A
physics = S
juggle  = 0
poweradd= 0
ctrl = 0
velset = 0,0
anim = 1600
sprpriority = 2

[state 1000]
type = velset
trigger1 = animelem = 4
x = 6.0

[state 1000]
type = envshake
trigger1 = animelem = 6
time = 10
ampl = 5

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

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

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

[State 200, 1]
type = HitDef
trigger1 = time = 0
attr = S, SA
damage = ceil(ifElse(fvar(11) * 90 < 15, 15, fvar(11) * 90)), 1
animtype = heavy
getpower = 36,18
givepower = 18,18
guardflag = MA
hitflag = MAF
pausetime = 15, 15
sparkNo = 2
guard.sparkNo = 40
sparkXY = -15,-35
hitsound = 5,2
guardsound = 6,0
ground.type = low
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -4,-5
guard.hittime = 20
guard.velocity = -12
airguard.velocity = -7,-3
ground.cornerpush.veloff = -12
air.cornerpush.veloff = -12
guard.cornerpush.veloff = -12
air.type = low
air.velocity = -4,-5
air.hittime = 25
Air.fall = 1
fall.recover = 0
fall = 1
yaccel = 0.42
ID = 1600

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

;Upper Slash
[Statedef 1700]
type    = S
movetype= A
physics = S
juggle  = 0
poweradd= 0
ctrl = 0
velset = 0,0
anim = 1700
sprpriority = 2

[state 1000]
type = velset
triggerall = prevstateno = [200,400]
trigger1 = animelem = 2
x = 17

[state 1000]
type = velset
triggerall = prevstateno != [200,400]
trigger1 = animelem = 2
x = 12

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

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

[State 200, 1]
type = HitDef
trigger1 = time = 0
trigger2 = animelem = 5
trigger3 = animelem = 6
attr = A, SA
damage = ceil(ifElse(fvar(11) * 30 < 15, 15, fvar(11) * 30)), 1
animtype = diagup
getpower = 36,18
givepower = 18,18
guardflag = M
hitflag = MAF
pausetime = 5, 5
sparkNo = 1
guard.sparkNo = 40
sparkXY = -5,-70
hitsound = 5,1
guardsound = 6,0
ground.type = low
ground.slidetime = 20
ground.hittime  = 25
ground.velocity = -2.2,-3.5
ground.cornerpush.veloff = -3
guard.velocity = -8
guard.ctrltime = 3
airguard.velocity = -8,-4 
air.type = low
air.velocity = -2.2,-4.5
air.hittime = 25
Air.fall = 1
fall.recover = 0
fall = 1
yaccel = 0.5
ID = 1001

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

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

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

;Upper Slash (Air) (not in use)
[Statedef 1701]
type    = A
movetype= A
physics = N
juggle  = 0
poweradd= 0
ctrl = 0
anim = 1700
sprpriority = 2

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

[state 1000]
type = velset
trigger1 = time = 0
y = -5

[state 1000]
type = playsnd
triggerall = anim = 1700
trigger1 = animelem = 3
value = S2,3
volumescale = 125

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

[State 200, 1]
type = HitDef
triggerall = anim = 1700
trigger1 = time = 0
trigger2 = animelem = 5
trigger3 = animelem = 6
attr = A, SA
damage = 25,5;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 = -5,-70
hitsound = 5,1
guardsound = 6,0
ground.type = High
ground.slidetime = 20
ground.hittime  = 25
ground.velocity = -1,-3.5
air.type = high
air.velocity = -1,-4.5
air.hittime = 25
Air.fall = 1
fall.recover = 0
fall = 1
yaccel = 0.7
ID = 1001

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

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

;LvL 1 Ice storm
[Statedef 3000]
type    = S
movetype= A
physics = S
juggle  = 0
velset = 0,0
anim = 3000
ctrl = 0
poweradd = 0
sprpriority = 5

[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 = velset
trigger1 = prevstateno = [200,249]
trigger1 = animelem = 3
x = 10

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

[state 1000]
type = nothitby
trigger1 = time = 0
value = SCA
time = 20
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 = 5
value = S3001,0
volumescale = 125

[State 2500, 0]
type = Helper
triggerall = animelemtime(4) > 0
trigger1 = timemod = 4,0
helpertype = normal
name = "Woosh"
id = 3001
facing = 1
pos = 0,-20
postype = p1
stateno = 3001
keyctrl = 0
ownpal = 1
size.xscale = 1
size.yscale = 1

[State 2500, 0]
type = Helper
trigger1 = time = 0
helpertype = normal
name = "Hol up"
id = 3005
facing = 1
pos = 0,0
postype = p1
stateno = 3005
keyctrl = 0
ownpal = 1
size.xscale = 1
size.yscale = 1
persistent = 1

[state 1000]
type = changestate
trigger1 = animelem = 32
value = 3069
ctrl = 0

;Nice
[Statedef 3069]
type    = S
movetype= I
physics = S
juggle  = 0
velset = 0,0
ctrl = 0
poweradd = 0
sprpriority = 5

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

; Helper Thingy
[Statedef 3001]
type = A
movetype = A
physics = N
ctrl = 0
velset = 0,0
sprpriority = 2
poweradd = 0

[State 3305, ChangeAnim]
type = ChangeAnim
trigger1 = Anim != 3001
value = 3001

[State 3305, Counter Flag]
type = VarSet
trigger1 = NumEnemy
trigger1 = MoveContact != 1
var(9) = (EnemyNear, MoveType = A)

[State 3305, Damage Dampener]
type = VarSet
trigger1 = 1
fvar(11) = (Root, fvar(10)) * ifElse(var(9), 1.2, 1)

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

[State 1000, 5] ;Opponent near
type = hitdef
trigger1 = time = 0
trigger1 = Time = 8 && PrevStateNo = 3002 || (Time = 0 && !var(14))
attr = S, HP
animtype  = hard
damage    = 15, 1
priority  = 5
getpower = 0,0
givepower = 36,36
guardflag = MA
pauseTime = 0, 3
guard.pauseTime = 0, 10
sparkno = 2
sparkxy = -5,-35
guard.sparkno = 40
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 20
ground.hittime  = 30
guard.dist = 2
air.hittime = 30
ground.velocity = 0,-5.5
guard.velocity = -0.5
guard.ctrltime = 8
airguard.velocity = -0.3,-3.5
air.velocity = 0,-5.5
fall = 1
air.fall = 0
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
fall.recover = 0
yaccel = .50

[State 3305, Miss]
type = HitDef
trigger1 = (Root, var(16))
attr = S, HP
hitFlag =
sparkXY = -10,0
guard.dist = 2

[State 3305, End]
type = ChangeState
trigger1 = MoveContact
value = 3002
ignoreHitPause = 1

[State 3305, End]
type = ChangeState
trigger1 = Animtime = 0
value = 3003
ignoreHitPause = 1

;Hit Pause
[StateDef 3002]
type = A
physics = N
moveType = A
ctrl = 0
sprPriority = 2
moveHitPersist = 1
hitCountPersist = 1

[State 3306, PosFreeze]
type = PosFreeze
trigger1 = 1
value = 1

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

[State 3306, VelSet]
type = VelSet
trigger1 = MoveContact = 1 && NumTarget
x = 0

[State 3306, Parent Hit Count]
type = ParentVarAdd
trigger1 = !Time
trigger1 = MoveContact && NumTarget
var(13) = 1

[State 3306, Self Hit Count]
type = VarAdd
trigger1 = !Time
trigger1 = MoveContact && NumTarget
var(13) = 1

[State 3306, Juggle Points]
type = ParentVarAdd
trigger1 = !Time
trigger1 = MoveContact && NumTarget
var(15) = 1

[State 3306, ProjContact]
type = VarSet
trigger1 = MoveContact && NumTarget
var(18) = 1

[State 3306, ProjContact]
type = ParentVarSet
triggerAll = MoveContact && NumTarget
trigger1 = 1
var(18) = 1

[State 3306, End]
type = ChangeState
trigger1 = Time >= 0
value = 3001

;Disappear
[StateDef 3003]
type = A
physics = N
moveType = A
anim = 19999
ctrl = 0
velSet = 0,0
sprPriority = 2
moveHitPersist = 1

[State 3007, End]
type = ChangeState
trigger1 = !AnimTime
value = 1008

;Controller
[Statedef 3005]
type    = S
movetype= I
physics = S
poweradd= 0
ctrl = 0
velset = 0,0
anim = 19999

[state 1000]
type = changestate
trigger1 = root, stateno != 3000
value = 3006
ctrl = 0

;Controller End
[Statedef 3006]
type    = S
movetype= I
physics = S
poweradd= 0
ctrl = 0
velset = 0,0
anim = 19999

[State 1008, End]
type = DestroySelf
trigger1 = p2movetype != H

;Triple Spike
[Statedef 3010]
type    = S
movetype= A
physics = S
juggle  = 0
velset = 0,0
anim = 3010
ctrl = 0
poweradd = 0
sprpriority = 2

[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 = -14,-40
ontop = 1
postype = p1
bindtime = -1
removeongethit = 1
ignorehitpause = 1
supermovetime = 16
pausemovetime = 16

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

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

[state 1000]
type = envshake
trigger1 = animelem = 5
time = 10
ampl = 5

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

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

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

[State 3050, Projectile]
type = Helper
trigger1 = AnimElemTime(5) = 1
helperType = Normal
stateNo = 3015
ID = 3015
name = "MAX Ice Pillar"
posType = P1
pos = 0,0
size.xScale = 1
size.yScale = 1
keyctrl = 1
ownpal = 1
facing = 1
persistent = 0
ignorehitpause = 1

[State 3050, Projectile]
type = Helper
trigger1 = AnimElemTime(7) = 1
helperType = Normal
stateNo = 3015
ID = 3015
name = "MAX Ice Pillar"
posType = P1
pos = 25,0
size.xScale = 1
size.yScale = 1
keyctrl = 1
ownpal = 1
facing = 1
persistent = 0
ignorehitpause = 1

[State 3050, Projectile]
type = Helper
trigger1 = AnimElemTime(9) = 1
helperType = Normal
stateNo = 3015
ID = 3015
name = "MAX Ice Pillar"
posType = P1
pos = 50,0
size.xScale = 1
size.yScale = 1
keyctrl = 1
ownpal = 1
facing = 1
persistent = 0
ignorehitpause = 1

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

;Energy Blast (Helper)
[StateDef 3015]
type = S
physics = N
moveType = A
ctrl = 0
anim = 3015
poweradd = 0
sprPriority = 5

[state 1000]
type = assertspecial
trigger1 = 1
flag = noshadow;thehedgehog
ignorehitpause = 1

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

[State 3055, Anim]
type = changeanim
trigger1 = !time && !prevstateno
value = 3015

[State 1035, VarAdd]
type = VarAdd
trigger1 = !Time
var(2) = 1

[State 1035, Counter Flag]
type = VarSet
trigger1 = NumEnemy
trigger1 = moveContact != 1
var(9) = (EnemyNear, MoveType = A)

[State 1035, Dampener]
type = VarSet
trigger1 = 1
fvar(11) = (Root, fvar(10)) * ifElse(var(9), 1.2, 1)

[State 1035, Miss]
type = HitDef
trigger1 = 1
attr = S,SP
hitFlag =
sparkXY = -10,0

[State 1035, Hit 1]
type = HitDef
trigger1 = time = 0
attr = S, SP
hitFlag = MAF
guardFlag = MAF
damage = 50, 1
getpower = 0,0
givePower = 10, 10
pauseTime = 5,5
guard.pauseTime = 1,1
animType = Hard
air.animType = Back
fall.animType = Back
ground.type = High
ground.hitTime = 18
ground.slideTime = 18
guard.hitTime = 18
air.hitTime = 30
ground.velocity = -4.5, -3
ground.cornerPush.velOff = 0
guard.velocity = -4.5
guard.cornerPush.velOff = 0
air.velocity = -4.5, -3
air.cornerPush.velOff = 0
airGuard.velocity = -5, 0
airGuard.cornerPush.velOff = 0
fall = 1
air.fall = 1
fall.recover = 0
hitSound = 5,2
guardSound = 6,0
sparkNo = 2
guard.SparkNo = 40
sparkXY = -15, -35
sprpriority = 5

[State 1006, HitCount]
type = ParentVarAdd
trigger1 = !Time
trigger1 = MoveContact && NumTarget
var(13) = 1
persistent = 0

[State 1006, Juggle Points]
type = ParentVarAdd
trigger1 = !Time
trigger1 = MoveContact && NumTarget
var(15) = 1
persistent = 0

[State 1006, ProjContact]
type = VarSet
trigger1 = MoveContact && NumTarget
var(18) = 1
persistent = 0

[State 1006, ProjContact]
type = ParentVarSet
trigger1 = MoveContact && NumTarget
trigger1 = Root, StateNo = 3010
var(18) = 1
persistent = 0

[State 1035, ChangeState]
type = ChangeState
trigger1 = MoveReversed
value = 1018
ignoreHitPause = 1

[State 1035, ChangeState]
type = ChangeState
trigger1 = animtime = 0
value = 1018
ignoreHitPause = 1

[State 1035, End]
type = DestroySelf
trigger1 = root, movetype = H 

;Icy death
[Statedef 3050]
type = S
movetype = A
physics = S
juggle = 0
ctrl = 0
anim = 3050
velset = 0,0
poweradd = 0

[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 = 35,-17
ontop = 1
postype = p1
bindtime = -1
removeongethit = 1
ignorehitpause = 1
supermovetime = 21
pausemovetime = 21

[state 1000]
type = nothitby
trigger1 = time = 0
value = SCA
time = 30
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 = playsnd
trigger1 = time = 27
value = S200,0 +random%2
volumescale = 125

[state 1000]
type = playsnd
trigger1 = time = 27
value = S2,4
volumescale = 125

[state 1000]
type = velset
triggerall = prevstateno = [200,499]
trigger1 = time = 27
x = 15

[state 1000]
type = velset
trigger1 = time = 27
x = 12

[state 1000]
type = velset
trigger1 = moveguarded
x = -12

[state 1000]
type = velset
trigger1 = movecontact
x = 0

[State 2900, 1]
type = Hitdef
trigger1 = AnimElem = 5
attr = S, HA
damage = 100, 10
animtype = Heavy
guardflag = M
hitflag = MAF
pausetime = 15, 15
sparkno = 2
guard.sparkno = 40 
getpower = 0
sparkxy = -10, -80
hitsound = 5,2
guardsound = 6,0
ground.type = Low
ground.slidetime = 15
ground.hittime  = 20
ground.velocity = .8,-20
guard.velocity = -10
ground.cornerpush.veloff = -5
guard.cornerpush.veloff = -10
air.cornerpush.veloff = -5
airguard.velocity = -5,-5
air.type = Low
fall.animtype = Heavy
air.velocity = .8,-20
fall.envshake.time = 10
fall.envshake.freq = 100
fall.envshake.ampl = -10
fall.envshake.phase = 10
p2stateno = 3060
air.hittime = 20
fall.recover = 0
snap = 50,-50
air.fall = 1
yaccel = 1
fall = 1
kill = 0
envshake.time = 15

[State 2900, State]
type = ChangeState
triggerall = MoveHit
trigger1 = Anim = 3050
trigger1 = animtime = 0
value = 3051

[State 2900, State]
type = ChangeState
triggerall = movehit = 0
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;ugh
[Statedef 3051]
type = S
movetype = A
physics = S
juggle = 0
ctrl = 0
anim = 3055
velset = 0,0
poweradd = 0

[state 1000]
type = changeanim
triggerall = anim = 3055
trigger1 = animtime = 0
value = 3056

[state 1000]
type = playsnd
triggerall = anim = 3056
trigger1 = animelem = 2
value = S2,4
volumescale = 125
channel = 5
persistent = 1

[State 2900, 2]
type = HitDef
triggerall = Time > 14
trigger1 = Anim = 3056
trigger1 = AnimElem = 2
attr = S, HA
damage = 20, 10
animtype = DiagUp
hitflag = MAF+
priority = 3, Hit
pausetime = 0, 5
sparkno = 1
getpower = 0
sparkxy = 0, -100
hitsound = 5,1
ground.type = High
ground.slidetime = 15
ground.hittime  = 20
ground.velocity = -10,0
airguard.velocity = -5,-5
air.type = Low
air.velocity = -1.8,-2
air.hittime = 20
p2stateno = 3061
fall.recover = 0
yaccel = 0.80
snap = 10,-75
air.fall = 1
kill = 0

[State 2900, State]
type = ChangeState
trigger1 = time > 70
value = 3052
ctrl = 0

;stab
[Statedef 3052]
type = S
movetype = A
physics = S
juggle = 0
ctrl = 0
anim = 3058
velset = 0,0
poweradd = 0

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

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

[state 1000]
type = envshake
trigger1 = animelem = 10
time = 10
ampl = 5

[State 200, 1]
type = HitDef
trigger1 = time = 0
attr = S, SA
damage = 50, 2
animtype = heavy
getpower = 0,0
givepower = 18,18
guardflag = M
hitflag = MAFD
pausetime = 15, 15
sparkNo = 2
guard.sparkNo = 40
sparkXY = -20,-30
hitsound = 5,2
guardsound = 6,0
ground.type = low
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -4,-5
guard.hittime = 20
air.type = low
air.velocity = -4,-5
air.hittime = 25
Air.fall = 1
fall.recover = 0
fall = 1
yaccel = 0.42
ID = 1600
kill = 1

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

; Hit up into the air
[Statedef 3060]
type = A
movetype = H
physics = N
ctrl = 0
velset = 0,0

[State 2905, 0]
type = NotHitBy
trigger1 = 1
value = SCA, NA, SA, AT, AP
time = 1

[State 2905, 0]
type = HitBy
trigger1 = 1
value = SCA, HA
time = 1

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

[State 2905, 2]
type = ChangeAnim2
trigger1 = Time < 10
value = 3060

[State 2905, HitVelSet]
type = HitVelSet
trigger1 = Time = 10
x = 1
y = 1

[State 2905, 3]
type = VelAdd
trigger1 = Time >= 10
trigger1 = Vel Y < 20
y = 1

[State 2905, State]
type = ChangeState
trigger1 = Time > 10
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 20
value = 5100

; Multi Hit
[Statedef 3061]
type = A
movetype = H
physics = N
ctrl = 0
velset = 0,0

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

[State 2907, 2]
type = ChangeAnim2
trigger1 = Time <= 0
value = 3061

[State 2907, HitVelSet]
type = HitVelSet
trigger1 = Time = 5
x = 1
y = 1

[State 2907, 3]
type = VelAdd
trigger1 = Time > 5
y = .4

[State 2907, 4]
type = SelfState
trigger1 = Time > 10
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 20
value = 5100 ;Hit ground

;Wait
[StateDef 1008]
type = A
physics = N
moveType = I
anim = 19999
ctrl = 0
velSet = 0,0

[State 1008, End]
type = DestroySelf
trigger1 = !NumTarget
trigger2 = NumTarget
trigger2 = Target, Time <= 1 && !(Target,HitShakeOver)

;IceSHotMove
[StateDef 7051]
type = A
movetype= A
physics = N
juggle  = 0
ctrl = 0
anim = 1550
poweradd = 0
sprpriority = 3

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

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

[State 1000, Varset]
type = parentvarset
trigger1 = numtarget(69) && movehit = 1
var(4) = target,ID
ignorehitpause = 1
persistent = 0

[State 0, ParentVarSet]
type = ParentVarSet
trigger1 = movehit
v = 51    ;fv =
value = 1
;ignorehitpause =
;persistent =

[State 0, ChangeState]
type = ChangeState
trigger1 = moveguarded
value = 705222
ctrl = 0
;anim =
;ignorehitpause =
;persistent =

[State 0, ParentVarSet]
type = ParentVarSet
trigger1 = movehit = 1
v = 18    ;fv =
value = 1
;ignorehitpause =
;persistent =

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

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = ,NA,SA,HA,NT,NP,ST,HT
;value2 = S,NA
time = 1
;ignorehitpause =
;persistent =

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,SP,HP        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
slot = 0
stateno = 7056
time = 1
forceair = 0
;ignorehitpause =
;persistent =

[State 0, VelSet]
type = VelSet
trigger1 = time = 0
x = 8.5
;ignorehitpause =
;persistent =

[State 7051, 1]
type = HitDef
triggerall = p2stateno = [7053,7055]
triggerall = p2statetype = S || p2statetype = L
trigger1 = time = 0
attr = A, SP
damage = 10
animtype = heavy
guardflag = MA
hitflag = MA
priority = 3, Hit
pausetime = 0, 0
sparkno = -1
sparkxy = 0,0
guard.sparkno = -1
hitsound = s1, 1
guardsound = 6, 0
ground.type = High
ground.slidetime = 5
ground.hittime  = 18
ground.velocity = -4
guard.ctrltime = 20
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = 0,0
air.hittime = 18
p2stateno = 7060
p1stateno = 70522
palfx.time = 0
ID = 69

[State 7051, 1]
type = HitDef
triggerall = p2stateno = [7053,7055]
triggerall = p2statetype = C
trigger1 = time = 0
attr = A, SP
damage = 10
animtype = heavy
guardflag = MA
hitflag = MA
priority = 3, Hit
pausetime = 0, 0
sparkno = -1
sparkxy = 0,0
guard.sparkno = -1
hitsound = s1, 1
guardsound = 6, 0
ground.type = High
ground.slidetime = 5
ground.hittime  = 18
ground.velocity = -4
guard.ctrltime = 20
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = 0,0
air.hittime = 18
p2stateno = 7061
p1stateno = 70522
palfx.time = 0
ID = 69

[State 7051, 1]
type = HitDef
triggerall = p2stateno = [7053,7055]
triggerall = p2statetype = A
trigger1 = time = 0
attr = A, SP
damage = 10
animtype = back
guardflag = MA
hitflag = MA
priority = 3, Hit
pausetime = 0, 0
sparkno = -1
guard.sparkno = -1
sparkxy = -70, -68
hitsound = s1, 1
guardsound = 6, 0
ground.type = High
ground.slidetime = 5
ground.hittime  = 18
ground.velocity = -4
guard.ctrltime = 20
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -4,-3
air.hittime = 18
p2stateno = 7062
p1stateno = 70522
palfx.time = 0
ID = 69

[State 7051, 1]
type = HitDef
triggerall = p2stateno = [7153,7155]
triggerall = p2statetype = S || p2statetype = L
trigger1 = time = 0
attr = A, SP
damage = 10
animtype = heavy
guardflag = MA
hitflag = MA
priority = 3, Hit
pausetime = 0, 0
sparkno = -1
sparkxy = 0,0
guard.sparkno = -1
hitsound = s1, 1
guardsound = 6, 0
ground.type = High
ground.slidetime = 5
ground.hittime  = 18
ground.velocity = -4
guard.ctrltime = 20
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = 0,0
air.hittime = 18
p2stateno = 7060
p1stateno = 70522
palfx.time = 0
ID = 69

[State 7051, 1]
type = HitDef
triggerall = p2stateno = [7153,7155]
triggerall = p2statetype = C
trigger1 = time = 0
attr = A, SP
damage = 10
animtype = heavy
guardflag = MA
hitflag = MA
priority = 3, Hit
pausetime = 0, 0
sparkno = -1
sparkxy = 0,0
guard.sparkno = -1
hitsound = s1, 1
guardsound = 6, 0
ground.type = High
ground.slidetime = 5
ground.hittime  = 18
ground.velocity = -4
guard.ctrltime = 20
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = 0,0
air.hittime = 18
p2stateno = 7061
p1stateno = 70522
palfx.time = 0
ID = 69

[State 7051, 1]
type = HitDef
triggerall = p2stateno = [7153,7155]
triggerall = p2statetype = A
trigger1 = time = 0
attr = A, SP
damage = 10
animtype = back
guardflag = MA
hitflag = MA
priority = 3, Hit
pausetime = 0, 0
sparkno = -1
guard.sparkno = -1
sparkxy = -70, -68
hitsound = s1, 1
guardsound = 6, 0
ground.type = High
ground.slidetime = 5
ground.hittime  = 18
ground.velocity = -4
guard.ctrltime = 20
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -4,-3
air.hittime = 18
p2stateno = 7062
p1stateno = 70522
palfx.time = 0
ID = 69

[State 7051, 1]
type = HitDef
triggerall = p2stateno != [7053,7055]
triggerall = p2statetype = A
trigger1 = time = 0
attr = A, SP
damage = 10
animtype = back
guardflag = MA
hitflag = MA
priority = 3, Hit
pausetime = 0, 0
sparkno = -1
guard.sparkno = -1
sparkxy = -70, -68
hitsound = s1, 1
guardsound = 6, 0
ground.type = High
ground.slidetime = 5
ground.hittime  = 18
ground.velocity = 0
guard.ctrltime = 20
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = 0,0
air.hittime = 18
p2stateno = 7055
p1stateno = 7052
palfx.time = 94
palfx.add = 0,160,250
palfx.mul = 220,164,250
palfx.sinadd = 85,55,110,0
ID = 69

[State 7051, 1]
type = HitDef
triggerall = p2stateno != [7053,7055]
triggerall = p2statetype = S || p2statetype = L
trigger1 = time = 0
attr = A, SP
damage = 10
animtype = heavy
guardflag = MA
hitflag = MA
priority = 3, Hit
pausetime = 0, 0
sparkno = -1
sparkxy = 0,0
guard.sparkno = -1
hitsound = s1, 1
guardsound = 6, 0
ground.type = High
ground.slidetime = 5
ground.hittime  = 18
ground.velocity = 0
guard.ctrltime = 20
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = 0,0
air.hittime = 18
p2stateno = 7053
p1stateno = 7052
ID = 69

[State 7051, 1]
type = HitDef
triggerall = p2stateno != [7053,7055]
triggerall = p2statetype = C
trigger1 = time = 0
attr = A, SP
damage = 10
animtype = heavy
guardflag = MA
hitflag = MA
priority = 3, Hit
pausetime = 0, 0
sparkno = -1
sparkxy = 0,0
guard.sparkno = -1
hitsound = s1, 1
guardsound = 6, 0
ground.type = High
ground.slidetime = 5
ground.hittime  = 18
ground.velocity = 0
guard.ctrltime = 20
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = 0,0
air.hittime = 18
p2stateno = 7054
p1stateno = 7052
ID = 69

[State 7051, destroyself]
type = destroyself
trigger1 = BackEdgeBodyDist <= -100
trigger2 = FrontEdgeBodyDist <= -100

;------------------------
;IceSHotMove
[StateDef 70511]
type = A
movetype= A
physics = N
juggle  = 0
ctrl = 0
anim = 1550
poweradd = 0
sprpriority = 3

[State 0, ChangeState]
type = ChangeState
trigger1 = moveguarded
value = 705222
ctrl = 0
;anim =
;ignorehitpause =
;persistent =

[State 0, ParentVarSet]
type = ParentVarSet
trigger1 = movehit
v = 51    ;fv =
value = 1
;ignorehitpause =
;persistent =

[State 0, ParentVarSet]
type = ParentVarSet
trigger1 = movehit = 1
v = 18    ;fv =
value = 1
;ignorehitpause =
;persistent =

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

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = ,NA,SA,HA,NT,NP,ST,HT
;value2 = S,NA
time = 1
;ignorehitpause =
;persistent =

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,SP,HP        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
slot = 0
stateno = 7056
time = 1
forceair = 0
;ignorehitpause =
;persistent =

[State 0, VelSet]
type = VelSet
trigger1 = time = 0
x = 8
;ignorehitpause =
;persistent =

[State 7051, 1]
type = HitDef
triggerall = p2stateno = [7053,7055]
triggerall = p2statetype = S || p2statetype = L
trigger1 = AnimElem = 1
attr = A, ST
damage = 10
animtype = heavy
guardflag = MA
hitflag = MA
priority = 3, Hit
pausetime = 0, 0
sparkno = -1
sparkxy = 0,0
guard.sparkno = -1
hitsound = s1, 1
guardsound = 6, 0
ground.type = High
ground.slidetime = 5
ground.hittime  = 18
ground.velocity = -4
guard.ctrltime = 20
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = 0,0
air.hittime = 18
p2stateno = 7060
p1stateno = 70522
envshake.time = 5
envshake.ampl = 3
palfx.time = 0

[State 7051, 1]
type = HitDef
triggerall = p2stateno = [7053,7055]
triggerall = p2statetype = C
trigger1 = AnimElem = 1
attr = A, ST
damage = 10
animtype = heavy
guardflag = MA
hitflag = MA
priority = 3, Hit
pausetime = 0, 0
sparkno = -1
sparkxy = 0,0
guard.sparkno = -1
hitsound = s1, 1
guardsound = 6, 0
ground.type = High
ground.slidetime = 5
ground.hittime  = 18
ground.velocity = -4
guard.ctrltime = 20
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = 0,0
air.hittime = 18
p2stateno = 7061
p1stateno = 70522
envshake.time = 5
envshake.ampl = 3
palfx.time = 0

[State 7051, 1]
type = HitDef
triggerall = p2stateno = [7053,7055]
triggerall = p2statetype = A
trigger1 = AnimElem = 1
attr = A, ST
damage = 10
animtype = back
guardflag = MA
hitflag = MA
priority = 3, Hit
pausetime = 0, 0
sparkno = 7052
sparkxy = -70, -68
hitsound = s1, 1
guardsound = 6, 0
ground.type = High
ground.slidetime = 5
ground.hittime  = 18
ground.velocity = -4
guard.ctrltime = 20
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -4,-3
air.hittime = 18
p2stateno = 7062
p1stateno = 70522
envshake.time = 5
envshake.ampl = 3
palfx.time = 0

[State 7051, 1]
type = HitDef
triggerall = p2stateno = [7153,7155]
triggerall = p2statetype = S || p2statetype = L
trigger1 = AnimElem = 1
attr = A, ST
damage = 10
animtype = heavy
guardflag = MA
hitflag = MA
priority = 3, Hit
pausetime = 0, 0
sparkno = -1
sparkxy = 0,0
guard.sparkno = -1
hitsound = s1, 1
guardsound = 6, 0
ground.type = High
ground.slidetime = 5
ground.hittime  = 18
ground.velocity = -4
guard.ctrltime = 20
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = 0,0
air.hittime = 18
p2stateno = 7060
p1stateno = 70522
envshake.time = 5
envshake.ampl = 3
palfx.time = 0

[State 7051, 1]
type = HitDef
triggerall = p2stateno = [7153,7155]
triggerall = p2statetype = C
trigger1 = AnimElem = 1
attr = A, ST
damage = 10
animtype = heavy
guardflag = MA
hitflag = MA
priority = 3, Hit
pausetime = 0, 0
sparkno = -1
sparkxy = 0,0
guard.sparkno = -1
hitsound = s1, 1
guardsound = 6, 0
ground.type = High
ground.slidetime = 5
ground.hittime  = 18
ground.velocity = -4
guard.ctrltime = 20
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = 0,0
air.hittime = 18
p2stateno = 7061
p1stateno = 70522
envshake.time = 5
envshake.ampl = 3
palfx.time = 0

[State 7051, 1]
type = HitDef
triggerall = p2stateno = [7153,7155]
triggerall = p2statetype = A
trigger1 = AnimElem = 1
attr = A, ST
damage = 10
animtype = back
guardflag = MA
hitflag = MA
priority = 3, Hit
pausetime = 0, 0
sparkno = 7052
sparkxy = -70, -68
hitsound = s1, 1
guardsound = 6, 0
ground.type = High
ground.slidetime = 5
ground.hittime  = 18
ground.velocity = -4
guard.ctrltime = 20
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -4,-3
air.hittime = 18
p2stateno = 7062
p1stateno = 70522
envshake.time = 5
envshake.ampl = 3
palfx.time = 0

[State 7051, 1]
type = HitDef
triggerall = p2stateno != [7053,7055]
triggerall = p2statetype = A
trigger1 = AnimElem = 1
attr = A, ST
damage = 10
animtype = back
guardflag = MA
hitflag = MA
priority = 3, Hit
pausetime = 0, 0
sparkno = 7052
sparkxy = -70, -68
hitsound = s1, 1
guardsound = 6, 0
ground.type = High
ground.slidetime = 5
ground.hittime  = 18
ground.velocity = 0
guard.ctrltime = 20
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = 0,0
air.hittime = 18
p2stateno = 7055
p1stateno = 7052
envshake.time = 5
envshake.ampl = 3
palfx.time = 94
palfx.add = 0,160,250
palfx.mul = 220,164,250
palfx.sinadd = 85,55,110,0

[State 7051, 1]
type = HitDef
triggerall = p2stateno != [7053,7055]
triggerall = p2statetype = S || p2statetype = L
trigger1 = AnimElem = 1
attr = A, ST
damage = 10
animtype = heavy
guardflag = MA
hitflag = MA
priority = 3, Hit
pausetime = 0, 0
sparkno = -1
sparkxy = 0,0
guard.sparkno = -1
hitsound = s1, 1
guardsound = 6, 0
ground.type = High
ground.slidetime = 5
ground.hittime  = 18
ground.velocity = 0
guard.ctrltime = 20
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = 0,0
air.hittime = 18
p2stateno = 7053
p1stateno = 7052
envshake.time = 5
envshake.ampl = 3

[State 7051, 1]
type = HitDef
triggerall = p2stateno != [7053,7055]
triggerall = p2statetype = C
trigger1 = AnimElem = 1
attr = A, ST
damage = 10
animtype = heavy
guardflag = MA
hitflag = MA
priority = 3, Hit
pausetime = 0, 0
sparkno = -1
sparkxy = 0,0
guard.sparkno = -1
hitsound = s1, 1
guardsound = 6, 0
ground.type = High
ground.slidetime = 5
ground.hittime  = 18
ground.velocity = 0
guard.ctrltime = 20
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = 0,0
air.hittime = 18
p2stateno = 7054
p1stateno = 7052
envshake.time = 5
envshake.ampl = 3

[State 7051, destroyself]
type = destroyself
trigger1 = time = 100

;------------------------
;IceSHotMove
[StateDef 70510]
type = A
movetype= A
physics = N
juggle  = 0
ctrl = 0
anim = 1550
poweradd = 0
sprpriority = 3

[State 0, ChangeState]
type = ChangeState
trigger1 = moveguarded
value = 705222
ctrl = 0
;anim =
;ignorehitpause =
;persistent =

[State 0, ParentVarSet]
type = ParentVarSet
trigger1 = movehit = 1
v = 18    ;fv =
value = 1
;ignorehitpause =
;persistent =

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

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = ,NA,SA,HA,NT,NP,ST,HT
;value2 = S,NA
time = 1
;ignorehitpause =
;persistent =

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA,SP,HP        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
slot = 0
stateno = 7056
time = 1
forceair = 0
;ignorehitpause =
;persistent =

[State 0, VelSet]
type = VelSet
trigger1 = time = 0
x = 8
;ignorehitpause =
;persistent =

[State 7051, 1]
type = HitDef
trigger1 = AnimElem = 1
attr = A, SP
damage = 10,5
animtype = heavy
guardflag = MA
hitflag = MA
priority = 3, Hit
pausetime = 0, 0
sparkno = 7052
sparkxy = -10, -68
hitsound = s1, 1
guardsound = 6, 0
ground.type = High
ground.slidetime = 5
ground.hittime  = 18
ground.velocity = -4
guard.ctrltime = 20
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = 0,0
air.hittime = 18
envshake.time = 5
envshake.ampl = 3
palfx.time = 0

[State 0, ChangeState]
type = ChangeState
trigger1 = movehit = 1
value = 705222
ctrl = 0
;anim =
;ignorehitpause =
;persistent =


[State 7051, destroyself]
type = destroyself
trigger1 = time = 100


;Iceshotend
[StateDef 7052]
type = S
movetype= I
physics = N
juggle  = 1
velset = 0,0
ctrl = 0
anim = 1551
poweradd = 0
sprpriority = 8

[State 0, BindToTarget]
type = BindToTarget
trigger1 = time = 0
time = 1
ID = -1
pos = -24,-39

[state 100x,atc efe];?????????
type = Explod
trigger1 = time  = 0
anim =2000
ID = 100
postype = p2
pos = 0,-30
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) <= 8
trigger1 = 1
anim =2000
ID = 101
postype = p2
pos = 0,-30
random = 90,90
sprpriority = 5
ontop = 1
bindtime = 1
removetime = 20
ownpal=1
scale = 1.0 + (random % 3 * 0.1), 1 + (random % 3 * 0.1)
;accel  = -0.2 - (random % 4 * 0.1),0

[State 1200, Helper]
type = Helper
trigger1 = !time
helpertype = normal
name = "AAAAAAAAAAAAAAAAA"
id = 7500
pos = 0, 0
postype = P2
stateno = 7500
keyctrl = 0
persistent = 1

[State 7052, end]
type = destroyself
trigger1 = AnimTime = 0

;-----------------------
;Iceshotend3
[StateDef 705222]
type = S
movetype= I
physics = N
juggle  = 1
velset = 0,0
ctrl = 0
anim = 1550
poweradd = 0
sprpriority = 3

[state 1000]
type = gamemakeanim
trigger1 = time = 0
value = 40
pos = 10,0
ignorehitpause = 1

[state 1000]
type = velset
trigger1 = 1
y = -5
x = -8.5

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

[State 7051, destroyself]
type = destroyself
trigger1 = BackEdgeBodyDist <= -100
trigger2 = FrontEdgeBodyDist <= -100
;-----------------------
;Iceshotend2
[StateDef 70522]
type = S
movetype= I
physics = N
juggle  = 1
velset = 0,0
ctrl = 0
anim = 1551
poweradd = 0
sprpriority = 3

[State 0, BindToTarget]
type = BindToTarget
trigger1 = time = 0
time = 1
ID = -1
pos = -24,-39
;ignorehitpause =
;persistent =

[State 7052, end]
type = destroyself
trigger1 = AnimTime = 0

;CustomeIceState
[StateDef 7053]
type = S
movetype= H
physics = N
juggle  = 1
velset = 0,0
ctrl = 0
poweradd = 20
sprpriority = 2

[State 0, ChangeState]
type = ChangeState
triggerall = pos y < 0
trigger1 = time = 0
value = 7055
ctrl = 0
;anim =
;ignorehitpause =
;persistent =


;Generated by Fighter Factory PalFX Editor
[State 0, PalFXWiz]
type = PalFX
trigger1 = 1
time = 1
add = 0,160,250
mul = 220,164,250
sinadd = 85,55,110,0
invertall = 0
color = 0
;ignorehitpause = 0
;persistent = 1



[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = time = 0
value = 7053
;elem = 1
;ignorehitpause =
;persistent =

[State 7053, end]
type = SelfState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;----------------------
;CustomeIceState
[StateDef 7054]
type = S
movetype= H
physics = N
juggle  = 1
velset = 0,0
ctrl = 0
poweradd = 20
sprpriority = 2

[State 0, ChangeState]
type = ChangeState
triggerall = pos y < 0
trigger1 = time = 0
value = 7055
ctrl = 0
;anim =
;ignorehitpause =
;persistent =

;Generated by Fighter Factory PalFX Editor
[State 0, PalFXWiz]
type = PalFX
trigger1 = 1
time = 1
add = 0,160,250
mul = 220,164,250
sinadd = 85,55,110,0
invertall = 0
color = 0
;ignorehitpause = 0
;persistent = 1



[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = time = 0
value = 7054
;elem = 1
;ignorehitpause =
;persistent =


[State 0, Explod]
type = Explod
trigger1 = time = 0
anim = 705222
ID = 7052
pos = 20,-68
postype = p1  ;p2,front,back,left,right
facing = -1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
supermove
pausemove
scale = 0.5,0.5
sprpriority = 3
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
;ignorehitpause =
;persistent =


[State 7053, end]
type = SelfState
trigger1 = AnimTime = 0
value = 11
ctrl = 1

;----------------------
;CustomeIceState
[StateDef 7055]
type = A
movetype = H
physics = N
juggle  = 1
velset = 0,0
ctrl = 0
poweradd = 20
sprpriority = 2

;Generated by Fighter Factory PalFX Editor
[State 0, PalFXWiz]
type = PalFX
trigger1 = 1
time = 1
add = 0,160,250
mul = 220,164,250
sinadd = 85,55,110,0
invertall = 0
color = 0
;ignorehitpause = 0
;persistent = 1



[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = time = 0
value = 70544
;elem = 1
;ignorehitpause =
;persistent =


[State 0, Explod]
type = Explod
trigger1 = time = 0
anim = 705222
ID = 7052
pos = 20,-68
postype = p1  ;p2,front,back,left,right
facing = -1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
supermove
pausemove
scale = 0.5,0.5
sprpriority = 3
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
;ignorehitpause =
;persistent =


[State 7053, end]
type = SelfState
trigger1 = AnimTime = 0
value = 5040
ctrl = 1

;Iceshotend - Override
[StateDef 7056]
type = S
movetype= I
physics = N
juggle  = 1
velset = 0,0
ctrl = 0
anim = 1551
poweradd = 0
sprpriority = 8

[State 7052, end]
type = destroyself
trigger1 = AnimTime = 0
;----------------------
;CustomeIceState
[StateDef 7060]
type = S
movetype= H
physics = N
juggle  = 1
velset = 0,0
ctrl = 0
poweradd = 50
sprpriority = 2

[State 0, ChangeState]
type = ChangeState
triggerall = pos y < 0
trigger1 = time = 0
value = 7062
ctrl = 0
;anim =
;ignorehitpause =
;persistent =

;Generated by Fighter Factory PalFX Editor
[State 0, PalFXWiz]
type = PalFX
trigger1 = time = 0
time = 1
add = 0,160,250
mul = 220,164,250
sinadd = 85,55,110,0
invertall = 0
color = 0
;ignorehitpause = 0
;persistent = 1



[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = time = 0
value = 7053
;elem = 1
;ignorehitpause =
;persistent =

[State 0, Explod]
type = Explod
trigger1 = time = 0
anim = 705222
ID = 7052
pos = 20,-68
postype = p1  ;p2,front,back,left,right
facing = -1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
supermove
pausemove
scale = 0.5,0.5
sprpriority = 3
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
;ignorehitpause =
;persistent =

[State 7053, end]
type = SelfState
trigger1 = time = 1
value = 0
ctrl = 1

;----------------------
;CustomeIceState
[StateDef 7061]
type = S
movetype= H
physics = N
juggle  = 1
velset = 0,0
ctrl = 0
poweradd = 50
sprpriority = 2

;Generated by Fighter Factory PalFX Editor
[State 0, PalFXWiz]
type = PalFX
trigger1 = time = 0
time = 1
add = 0,160,250
mul = 220,164,250
sinadd = 85,55,110,0
invertall = 0
color = 0
;ignorehitpause = 0
;persistent = 1

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = time = 0
value = 7054
;elem = 1
;ignorehitpause =
;persistent =


[State 0, Explod]
type = Explod
trigger1 = time = 0
anim = 705222
ID = 7052
pos = 20,-68
postype = p1  ;p2,front,back,left,right
facing = -1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
supermove
pausemove
scale = 0.5,0.5
sprpriority = 3
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
;ignorehitpause =
;persistent =


[State 7053, end]
type = SelfState
trigger1 = time = 1
value = 11
ctrl = 1

;----------------------
;CustomeIceState
[StateDef 7062]
type = S
movetype= H
physics = N
juggle  = 1
velset = 0,0
ctrl = 0
poweradd = 50
sprpriority = 2

;Generated by Fighter Factory PalFX Editor
[State 0, PalFXWiz]
type = PalFX
trigger1 = time = 0
time = 1
add = 0,160,250
mul = 220,164,250
sinadd = 85,55,110,0
invertall = 0
color = 0
;ignorehitpause = 0
;persistent = 1

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = time = 0
value = 70544
;elem = 1
;ignorehitpause =
;persistent =


[State 0, Explod]
type = Explod
trigger1 = time = 0
anim = 705222
ID = 7052
pos = 20,-68
postype = p1  ;p2,front,back,left,right
facing = -1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
supermove
pausemove
scale = 0.5,0.5
sprpriority = 3
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
;ignorehitpause =
;persistent =


[State 7053, end]
type = SelfState
trigger1 = time = 1
value = 5040
ctrl = 1

;Ice Cube
[StateDef 7500]
type = S
movetype= I
physics = S
velset = 0,0
ctrl = 0
anim = 19999
sprpriority = 3

[state 1000]
type = explod
trigger1 = !time
anim = 1552
postype = p2
bindtime = -1
ID = 78
removetime = -1
removeongethit = 1
ignorehitpause = 1
ontop = 0
sprpriority = 3

[state 1000]
type = removeExplod
trigger1 = p2stateno != [7053,7055]
ID = 78
ignorehitpause = 1

[state 1000]
type = playsnd
trigger1 = p2stateno != [7053,7055]
value = S1,2
volumescale = 125

[state 1000]
type = envshake
trigger1 = p2stateno != [7053,7055]
time = 5
ampl = 2

;Ice Debris
[State 1200, Helper]
type = Helper
trigger1 = p2stateno != [7053,7055]
helpertype = normal
name = "Crack"
id = 7501
pos = 0, -20
postype = P2
stateno = 7501
keyctrl = 0
persistent = 1

[State 1200, Helper]
type = Helper
trigger1 = p2stateno != [7053,7055]
helpertype = normal
name = "Crack"
id = 7502
pos = 0, -20
postype = P2
stateno = 7502
keyctrl = 0
persistent = 1

[State 1200, Helper]
type = Helper
trigger1 = p2stateno != [7053,7055]
helpertype = normal
name = "Crack"
id = 7503
pos = 0, -20
postype = P2
stateno = 7503
keyctrl = 0
persistent = 1

[State 1200, Helper]
type = Helper
trigger1 = p2stateno != [7053,7055]
helpertype = normal
name = "Crack"
id = 7504
pos = 0, -20
postype = P2
stateno = 7504
keyctrl = 0
persistent = 1

[State 1200, Helper]
type = Helper
trigger1 = p2stateno != [7053,7055]
helpertype = normal
name = "Crack"
id = 7505
pos = 0, -20
postype = P2
stateno = 7505
keyctrl = 0
persistent = 1
;---------

[state 1000]
type = destroyself
trigger1 = p2stateno != [7053,7055]

;Ice Debris
[StateDef 7501]
type = A
movetype= I
physics = N
ctrl = 0
anim = 1553
sprpriority = 3

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

[state 1000]
type = velset
trigger1 = time = 0
y = -7
x = -3

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

;Ice Debris
[StateDef 7502]
type = A
movetype= I
physics = N
ctrl = 0
anim = 1553
sprpriority = 3

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

[state 1000]
type = velset
trigger1 = time = 0
y = -10
x = -2

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

;Ice Debris
[StateDef 7503]
type = A
movetype= I
physics = N
ctrl = 0
anim = 1553
sprpriority = 3

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

[state 1000]
type = velset
trigger1 = time = 0
y = -6
x = 0.5

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

;Ice Debris
[StateDef 7504]
type = A
movetype= I
physics = N
ctrl = 0
anim = 1553
sprpriority = 3

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

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

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

;Ice Debris
[StateDef 7505]
type = A
movetype= I
physics = N
ctrl = 0
anim = 1553
sprpriority = 3

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

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

[State 1100, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 7510
ctrl = 0
;Poof
[StateDef 7510]
type = S
movetype= I
physics = S
anim = 19999
sprpriority = 3

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

[state 1000]
type = posset
trigger1 = time = 0
y = 0

[state 1000]
type = explod
trigger1 = time = 0
anim = F120
pos = 0,0
removetime = 10
ignorehitpause = 1
sprpriority = 5

[state 1000]
type = destroyself
trigger1 = time = 10

;---------------------------------------------------------------------------
; Override common states (use same number to override) :

[statedef -2]

[State 0, VarSet]
type = VarSet
trigger1 = p2movetype != H
v = 51    ;fv = 10
value = 0
;ignorehitpause =
;persistent =

[State 0, VarSet]
type = VarSet
trigger1 = var(51) >= 1
v = 51    ;fv = 10
value = 1
;ignorehitpause =
;persistent =

[State 0, VarAdd]
type = VarAdd
trigger1 = p2stateno = [7053,7055]
trigger2 = p2stateno = [7153,7155]
v = 51    ;fv =
value = 1

[State -2, 2a]
type = PlaySnd
triggerall = alive
triggerall = Random < 500
trigger1 = stateno = 5120
trigger1 = time = 1
value = 5120, 0+random%3
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%5
channel = 0
Volumescale = 125

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

[state -2]
type = varset
trigger1 = !p2movetype = H
var(20) = 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

;---------------------------------------------------------------------------

[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

[State -3, Level 1 Super AfterImage]
type = AfterImage
trigger1 = StateNo = 3000 && Time = 16
trigger2 = StateNo = 3010 && 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 = 3050 && 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,3501]
time = 2
ignorehitpause = 1

[State -3, AfterImage Off]
type = AfterImageTime
triggerAll = Time <= 1
trigger1 = StateNo = 3000 || stateno = 3050 || stateno = 3051 || stateno = 3052 || StateNo = 3500
;trigger2 = StateNo = 3300
time = 0
ignorehitpause = 1

[State -3, Landing Sound]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 52 ;Jump land
trigger2 = stateno = 1003
trigger3 = stateno = 1012
value = 40, 0
volumescale = 125