
;ignorehitpause =
;persistent =
;
;-------------------------------------------------------------------------
; Var(1) = Winstate Decider

; Var (59) = AI On

;-------------------------------------------------------------------------
; Normal CNS
[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 = 2
IntPersistIndex = 60
FloatPersistIndex = 40

[Size]
xscale = 1
yscale = 1
ground.back = 15
ground.front = 16
air.back = 12
air.front = 12
height = 60
attack.dist = 160
proj.attack.dist = 90
proj.doscale = 0
head.pos = -5, -90
mid.pos = -5, -60
shadowoffset = 0
draw.offset = 0,0

[Velocity]
walk.fwd  = 2.6    ;前進の速度
walk.back = -2.0     ;後退の速度
run.fwd  = 4.5, -3.8
run.back = -4.5,-3.8
jump.neu = 0,-8.8
jump.back = -2.55
jump.fwd = 2.5
runjump.back = -2.55,-8.1
runjump.fwd = 4,-8.1
airjump.neu = 0,-8.1
airjump.back = -2.55
airjump.fwd = 2.5

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

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

[State 0, snd]
type = PlaySnd
trigger1 = AnimElem = 38
value = s60,18

[State 8999, s2]
type = PlaySnd
trigger1 = AnimElem = 37
value = s60,17

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

[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) < 2
trigger2 = Time = 4
x = 0

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


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

[State 170, 1]
type = Playsnd
trigger1 = animelem = 7
value = s5000,4



[State 170, 3]
type = AssertSpecial
trigger1 = time < 164
flag = roundnotover

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

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

[State 180, 1]
type = VarRandom
trigger1 = Time = 0
v = 1
range = 0, 4

[State 180, 2]
type = ChangeState
trigger1 = Time = 1
value = 180 + var(1)



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

[State 181, a]
type = AssertSpecial
trigger1 = time >= 0
trigger1 = time <=575 ; Time when state's over
flag = RoundNotOver

[state 181, 0]
type = Explod
trigger1 = animelem = 8
persistent = 1
anim = 7777
postype = p1
pos = 0, 0
velocity = 0, 0
accel = 0, 0
sprpriority = -1
bindtime = -1
removetime = 600

[State 181, 1]
type = NotHitBy
trigger1 = 1
bindtime = -1
removetime = 535
value = SCA
time = 1

[State 181, 2]
type = PlaySnd
trigger1 = AnimElem = 1
value = 15,0



[State 181, 3]
type = PlaySnd
trigger1 = AnimElem = 8
value = 500,3

[State 181, 4]
type = PlaySnd
trigger1 = AnimElem = 12
value = 500,4
;---------------------------------------------------------------------------
; Win pose 2 - Box with Surprises, hehe
[Statedef 182]
type = S
ctrl = 0
anim = 8765
velset = 0,0

[State 182, a]
type = AssertSpecial
trigger1 = time >= 0
trigger1 = time <=360 ; Time when state's over
flag = RoundNotOver

[State 182, 2]
type = NotHitBy
trigger1 = 1
bindtime = -1
removetime = 500
value = SCA
time = 1



=
[State 182, 6]
type = PlaySnd
trigger1 = AnimElem = 13
value = s3100,1



[State 182, 8]
type = ChangeState
triggerall = numhelper(1003) = 1
trigger1 = time = 0
value = 184

;---------------------------------------------------------------------------
; Win pose 3 - Monkey Again!!!
[Statedef 183]
type = S
ctrl = 0
anim = 188
velset = 0,0

[State 183, a]
type = AssertSpecial
trigger1 = time >= 0
trigger1 = time <=360 ; Time when state's over
flag = RoundNotOver

[State 183, 1]
type = NotHitBy
trigger1 = 1
bindtime = -1
removetime = 500
value = SCA
time = 1

[State 183, 2]
type = Explod
trigger1 = animelem = 8
persistent = 1
anim = 189
postype = p1
pos = 0, 0
velocity = 0, 0
accel = 0, 0
sprpriority = -1
bindtime = -1
removetime = 500

[State 183, 3]
type = PlaySnd
trigger1 = AnimElem = 11
value = s1003,0

[State 183, 4]
type = PlaySnd
trigger1 = AnimElem = 7
value = s60,18

[State 183, 5]
type = PlaySnd
trigger1 = time = 1
value = s180,1

;---------------------------------------------------------------------------
; Win pose 4 - Rabbit Again!!!
[Statedef 184]
type = S
ctrl = 0
anim = 186
velset = 0,0

[State 184, a]
type = AssertSpecial
trigger1 = time >= 0
trigger1 = time <=360 ; Time when state's over
flag = RoundNotOver

[State 184, 2]
type = NotHitBy
trigger1 = 1
bindtime = -1
removetime = 500
value = SCA
time = 1

[State 184, 3]
type = Explod
trigger1 = animelem = 12
persistent = 1
anim = 187
postype = p1
pos = 0, 0
velocity = 0, 0
accel = 0, 0
sprpriority = 2
bindtime = -1
removetime = 500



[State 184, 5]
type = PlaySnd
trigger1 = AnimElem = 1
value = s3100,1





;--------------------------------------------------------
;Box
[Statedef 187]
type    = A
movetype= A
type = A
anim = 183
sprpriority = 2



[State 187, 2]
type = destroyself
trigger1 = time = 21

;--------------------------------------------------------
;Monkey/Rabbit
[Statedef 188]
type    = A
movetype= A
type = A
anim = 184
sprpriority = 2

[State 188, 1]
type = Changeanim
trigger1 = time = 0 && Random <= 500
value = 185

[State 188, 2]
type = PlaySnd
triggerall = anim = 184
trigger1 = time = 0
trigger2 = time = 40
trigger3 = time = 80
value = s180,1

[State 188, 3]
type = destroyself
trigger1 = time = 200

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

;---------------------------------------------------------------------------
;Introductions

[Statedef 190]
type = S

[State 190, 1]
type = VarRandom
trigger1 = Time = 0
v = 1
range = 0,300


[State 190, ]
type = ChangeState
triggerall = time = 0
trigger1 = p2name = "superman"
trigger2 = p2name = "robinDCVM"
trigger3 = p2name = "wonder woman"
trigger4 = p2name = "aquaman"
trigger5 = p2name = "j'onnj'onnz"
trigger6 = p2name = "harley quinn"
trigger7 = p2name = "flash"
trigger8 = p2name = "zatanna"
value = 197
ctrl = 0


[State 190, 2]
type = ChangeState
trigger1 = Var(1) = [0,100]
value = 191

[State 190, 3]
type = ChangeState
trigger1 = Var(1) = [101,200]
value = 192

[State 190, 2]
type = ChangeState
trigger1 = Var(1) = [201,300]
value = 193

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

;---------------------------------------------------------------------------
; Introduction 1  bang flag

[Statedef 191]
type = S
physics = N
ctrl = 0
anim = 190
velset = 0,0

[State 191, SND]
type = PlaySnd
trigger1 = AnimElem = 1
value = s15,1


[State 191, Explod]
type = Explod
trigger1 = AnimElem = 19
anim = 8883
pos = 100, -75
ontop = 1

[State 191, 2]
type = PlaySnd
trigger1 = AnimElem = 19
value = s32001,1

[State 191, 3]
type = AssertSpecial
trigger1 = Time = [0,320]
flag = Intro
flag2 = nobardisplay

[State 191, 4]
type = PlaySnd
trigger1 = AnimElem = 22
value = s11,0



[State 191, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 0

;-----------------------
; Intro 2 Rogues
[Statedef 192]
type = S
physics = N
ctrl = 0
anim = 197
velset = 0,0

[State 192, Black]
type = explod
trigger1 = animelem = 25
anim = 3377
id = 306
postype = back
sprpriority = 9
ontop = 1
supermovetime = 99999999
pausemovetime = 99999999
shadow = 68,68,68
ownpal = 1
removetime = 30
pos = 0,0
bindtime = -1
removeongethit = 1
ignorehitpause = 1


[State 192, gunfire]
type = Explod
trigger1 = animelem = 23
anim = 1717
ID = 921
pos = 0,0
removetime = 10
bindtime = 10
sprpriority = -1
ownpal = 1
removeongethit = 1


[State 192, Harley]
type = Explod
trigger1 = animelem = 25
anim = 177
ID = 921
pos = 30,-5
removetime = 143
bindtime = 143
sprpriority = -1
ontop = 0
ownpal = 1
removeongethit = 1

[State 192, Harley leave]
type = Explod
trigger1 = Time = 315
anim = 1777
ID = 922
pos = 30,-5
;removetime = 180
;bindtime = 180
sprpriority = -1
ontop = 0
ownpal = 1
removeongethit = 1

[State 192, Clayface]
type = Explod
trigger1 = animelem = 25
anim = 877
ID = 921
pos = 30,-5
removetime = 143
bindtime = 143
sprpriority = -2
ontop = 0
ownpal = 1
removeongethit = 1

[State 192, Clayface leave]
type = Explod
trigger1 = Time = 315
anim = 8777
ID = 922
pos = 30,-5
;removetime = 180
;bindtime = 180
sprpriority = -2
ontop = 0
ownpal = 1
removeongethit = 1

[State 192, Penguin]
type = Explod
trigger1 = animelem = 25
anim = 8990
ID = 923
pos = -20,10
removetime = 140
bindtime = 140
sprpriority = 3
ownpal = 1
removeongethit = 1

[State 192, Penguin leave]
type = Explod
trigger1 = Time = 310
anim = 8995
ID = 924
pos = -20,10
removetime = 55
sprpriority = 3
ownpal = 1
removeongethit = 1

[State 192, mrj snd]
type = PlaySnd
trigger1 = animelem = 26
value = S60,21

[State 193, slice hat]
type = PlaySnd
trigger1 = animelem = 38
value = S60,16
volume = 175


[State 192, fly off]
type = PlaySnd
trigger1 = animelem = 34
value = S60,19
volume = 175


[State 192, gun snd]
type = PlaySnd
trigger1 = animelem = 23
value = S8000,15




[State 192, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 0


[State 192, 2]
type = AssertSpecial
trigger1 = Time = [0,440]
flag = Intro
flag2 = nobardisplay

;------------------------------------------------------------------------
[Statedef 193]
type = S
ctrl = 0
anim = 186
velset = 0,0

[State 193, 1]
type = AssertSpecial
trigger1 = Time = [0,325]
flag = Intro
flag2 = nobardisplay

[State 193, 2]
type = NotHitBy
trigger1 = 1
bindtime = -1
removetime = 500
value = SCA
time = 1




[State 193, 5]
type = PlaySnd
trigger1 = AnimElem = 1
value = s3100,1


;---------------------------------------------------------------------------
; Introduction - Jump in cowl in intro
[Statedef 197]
type    = A
physics = N
anim = 2346
velset = const(velocity.jump.fwd.x), -2

[State 197, snd]
type = PlaySnd
trigger1 = AnimElem = 1
value = s10000,11

[State 197, 0]
type = ScreenBound
trigger1 = 1
movecamera = 0

[State 197, 1]
type = PosAdd
trigger1 = Time = 0
X = -101
y = -112

[State 197, 2]
type = AssertSpecial
trigger1 = 1
flag = intro
flag2 = nobardisplay

[State 197, Gravity]
type = VelAdd
trigger1 = 1
y = const(movement.yaccel)

[State 197, Land]
type = ChangeState
trigger1 = Pos Y >= 0
value = 4312

;---------------------------------------------------------------------------
; Intro 2 Jump Land
[Statedef 4312]
type    = S
physics = S
ctrl = 0
velset = 6,0
anim = 2345



[State 4312, 2]
type = AssertSpecial
trigger1 = Time = [0,320]
flag = Intro
flag2 = nobardisplay

[State 4312, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 0


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

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



[State 195, 3]
type = PlaySnd
trigger1 = AnimElem = 5
value = s60,17

[State 195, 4]
type = PlaySnd
trigger1 = AnimElem = 7
value = s60,18

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



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

[State 200, 15]
type = PlaySnd
trigger1 = animelem = 2
value = 500, 1

[state 200, 0]
type = Explod
trigger1 = animelem = 2
anim = 4371
pos = 0,0
ontop = 1
postype = p1

[State 200, 1]
type = HitDef
trigger1 = time = 0
attr = S, NA
damage = 30
animtype = Light
guardflag = MA
hitflag = MA
priority = 3, Hit
pausetime = 8, 8
sparkno = s910
guard.sparkno = s905
sparkxy = -10, -70
hitsound   = s1004,4
guardsound = s120,1
ground.type = High
ground.slidetime = 5
ground.hittime  = 12
ground.velocity = -4
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -1.4,-3
air.hittime = 12

[State 200, 2]
type = PlaySnd
trigger1 = AnimElem = 1
value = 200,0 + (random%6)

[State 200, 3]
type = PlaySnd
trigger1 = AnimElem = 1
value = s200,10

[State 200, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; Standing Medium Punch
; CNS difficulty: easy
[Statedef 210]
type    = S
movetype= A
physics = S
juggle  = 1
poweradd = 25
ctrl = 0
anim = 210

[State 210, 15]
type = PlaySnd
trigger1 = animelem = 3
value = 500, 2

[state 210, 0]
type = Explod
trigger1 = animelem = 3
anim = 4374
pos = 0,0
ontop = 1
postype = p1

[State 210, 1]
type = HitDef
trigger1 = Time = 0
attr = S, NA
animtype  = Medium
damage    = 65
getpower = 20,10
givepower = 15,8
priority = 3, Hit
guardflag = MA
pausetime = 8,8
sparkno = s910
guard.sparkno = s905
sparkxy = -10, -70
hitsound = s1004,3
guardsound = s120,1
ground.type = Low
ground.slidetime = 17
ground.hittime  = 17
ground.velocity = -10
guard.slidetime = 11
guard.hittime = 11
airguard.velocity = -6
guard.velocity = -8
air.velocity = -5
ground.cornerpush.veloff = -9.5
air.fall = 1
fall.recovertime = 26

[State 210, 2]
type = PlaySnd
trigger1 = AnimElem = 1
value = 200,0 + (random%6)

[State 210, 3]
type = PlaySnd
trigger1 = AnimElem = 1
value = s200,10


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

;---------------------------------------------------------------------------
; Standing Strong Punch
; CNS difficulty: easy
[Statedef 220]
type    = S
movetype= A
physics = S
juggle  = 1
poweradd= 40
ctrl = 0
anim = 220

[State 220, 15]
type = PlaySnd
trigger1 = animelem = 3
value = 500, 2

[state 220, 0]
type = Explod
trigger1 = animelem = 3
anim = 2410
pos = 0,0
ontop = 1
postype = p1

[State 220, 1]
type = HitDef
trigger1 = Palno <= 6 && AnimElem = 2
trigger2 = Palno > 6 && AnimElem = 4
attr = S, NA
animtype  = Hard
damage    = 96
getpower = 30,15
givepower = 15,8
guardflag = MA
pausetime = 9,9
sparkno = s910
guard.sparkno = s906
sparkxy = -10,-70
hitsound = s1004,3
guardsound = s120,1
ground.type = High
ground.slidetime = 21
ground.hittime  = 21
ground.velocity = -12
guard.slidetime = 11
guard.hittime = 11
airguard.velocity = -10
guard.velocity = -10
air.velocity = -4,-5
air.fall = 1
fall.recovertime = 28

[State 220, 1]
type = PlaySnd
trigger1 = time = 1
value = 200,0 + (random%6)

[State 220, 2]
type = PlaySnd
trigger1 = time = 1
value = s200,10

[State 220, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Standing light kick
; CNS difficulty: easy
[Statedef 230]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 22
ctrl = 0
velset = 0,0
anim = 230
sprpriority = 2

[State 230, 1]
type = PlaySnd
trigger1 = Time = 2
value = 200,11

[State 230, 2]
type = HitDef
trigger1 = Time = 0
attr = S, NA
animtype  = Medium
damage    = 25
guardflag = MA
pausetime = 12,12
sparkno = s900
guard.sparkno = s905
sparkxy = -10,-58
hitsound   = s200,24
guardsound = 6,0
ground.type = Low
ground.slidetime = 10
ground.hittime  = 11
ground.velocity = -5
air.velocity = -2.5,-3.5

[State 230, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1




; Standing Medium Kick
[Statedef 240]
type    = S
movetype= A
physics = S
juggle  = 5
poweradd= 65
ctrl = 0
velset = 0,0
anim = 240
sprpriority = 2

[State 240, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 200,0 + (random%6)

[State 240, 2]
type = PlaySnd
trigger1 = animelem = 1
value = s200,12

[State 240, 2]
type = HitDef
trigger1 = Time = 0
attr = S, NA
animtype  = Medium
damage    = 65
guardflag = MA
pausetime = 12,12
sparkno = s901
guard.sparkno = s905
sparkxy = -10,-90
hitsound   = s200,30
guardsound = s120,2
ground.type = Low
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -6
air.velocity = -2.2,-3.2

[State 240, 3]
type = PosAdd
trigger1 = AnimElem = 7
x = 12

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

;---------------------------------------------------------------------------
; Standing strong kick
; CNS difficulty: easy
[Statedef 250]
type    = S
movetype= A
physics = S
juggle  = 8
poweradd= 30
ctrl = 0
velset = 0,0
anim = 250
sprpriority = 2



[State 250, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 200,0 + (random%6)

[State 250, 2]
type = PlaySnd
trigger1 = animelem = 1
value = 200,12



[State 250, 2]
type = HitDef
trigger1 = Time = 0
attr = S, NA
animtype  = high
damage    = 96
priority = 6, Hit
getpower = 162,162
guardflag = MA
pausetime = 11,12
sparkno = s902
guard.sparkno = s906
sparkxy = -10,-70
hitsound   = s200,29
guardsound = s120,2
ground.type = low
ground.slidetime = 17
ground.hittime  = 17
ground.velocity = -5,-6.5
air.velocity = -5,-6.8
yaccel = 0.45
fall = 1
fall.recover = 0


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


;---------------------------------------------------------------------------
; Crouching Light Punch
; CNS difficulty: easy
; Description: Simple crouching attack. The HitDef's guardflag parameter
;     is set to "L", meaning that the move can only be guarded low
;     (crouching), and not by standing or jumping opponents.
;     Like for all light attacks, it's a good idea to keep the slidetime
;     and hittime parameters at a smaller number, so the opponent isn't
;     stunned for too long. For all crouching attacks you have to
;     remember to set the attr parameter to indicate that it is crouching
;     attack. In this case, "C, NA" stands for "crouching, normal attack".
;     The HitDef's priority is set at 3, instead of the default of 4,
;     so this attack has a lower priority than most others, meaning the
;     player will get hit instead of trading hits with the opponent if
;     their attack collision boxes (Clsn1) intersect each other's Clsn2
;     boxes at the same time.
[Statedef 400]
type    = C
movetype= A
physics = C
juggle  = 1
poweradd= 15
ctrl = 0
anim = 400

[State 400, 15]
type = PlaySnd
trigger1 = animelem = 2
value = 500, 1

[state 400, 0]
type = Explod
trigger1 = animelem = 2
anim = 4379
pos = 0,0
ontop = 1
postype = p1

[State 400, 1]
type = HitDef
trigger1 = AnimElem = 2
attr = C, NA
damage    = 30
animtype  = Light
getpower  = 10
givepower = 8
priority = 3
hitflag = MAf
guardflag = L
pausetime = 8,8
sparkno = s910
guard.sparkno = s905
sparkxy = -10,-52
hitsound   = s1004,4
guardsound = s120,1
ground.type = Low
ground.slidetime = 12
ground.hittime  = 12
ground.velocity = -6
air.velocity = -1.3,-3
ground.cornerpush.veloff = -8

[State 400, 2]
type = PlaySnd
trigger1 = AnimElem = 1
value = 200,0 + (random%6)

[State 400, 3]
type = PlaySnd
trigger1 = AnimElem = 1
value = s200,10

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

;---------------------------------------------------------------------------
; Crouching Medium Punch
[Statedef 410]
type    = C
movetype= A
physics = C
juggle  = 1
poweradd= 25
ctrl = 0
anim = 410

[State 410, 15]
type = PlaySnd
trigger1 = animelem = 3
value = 500, 2

[state 410, 0]
type = Explod
trigger1 = animelem = 3
anim = 4377
pos = 0,0
ontop = 1
postype = p1

[State 401, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 200,0 + (random%6)

[State 401, 2]
type = PlaySnd
trigger1 = AnimElem = 1
value = s200,10


[State 410, 1]
type = HitDef
trigger1 = AnimElem = 3
attr = C, NA
damage    = 65
getpower  = 20
givepower = 20
hitflag = MAf
guardflag = MAf
pausetime = 8,8
sparkno = s910
guard.sparkno = s905
sparkxy = -10,-52
hitsound = s1004,3
guardsound = s120,1
ground.type = Low
guard.velocity = -5
ground.slidetime = 17
ground.hittime  = 17
ground.velocity = -10
air.velocity = -2.2,-2
ground.cornerpush.veloff = -10

[State 410, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1

;---------------------------------------------------------------------------
; Crouching Strong Punch
[Statedef 420]
type    = C
movetype= A
physics = C
juggle  = 1
ctrl = 0
anim = 420

[State 410, 1]
type = PlaySnd
trigger1 = time = 1
value = 200,0 + (random%6)

[State 420, 15]
type = PlaySnd
trigger1 = animelem = 3
value = 500, 2

[State 410, 2]
type = PlaySnd
trigger1 = time = 1
value = s200,11

[state 410, 0]
type = Explod
trigger1 = animelem = 4
anim = 1333
pos = 0,0
ontop = 1
postype = p1


[State 420, 1]
type = HitDef
trigger1 = AnimElem = 2
attr = C, NA
damage = 96
animtype = Hard
getpower = 30,15
guardflag = L
hitflag = MAFD
pausetime = 13,15
sparkno = s910
guard.sparkno = s906
sparkxy = -10,-70
hitsound = s1004,3
guardsound = s120,1
ground.type = High
ground.slidetime = 15
ground.hittime  = 17
ground.velocity = -5
air.velocity = -2,-3
fall = 1

[State 420, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1
;---------------------------------------------------------------------------
; Crouching Light Kick
; CNS difficulty: easy
[Statedef 430]
type    = C
movetype= A
physics = C
juggle  = 4
poweradd= 15
ctrl = 0
anim = 430

[State 430, 1]
type = HitDef
trigger1 = AnimElem = 2
attr = C, NA
damage    = 25
animtype  = Light
getpower  = 10
givepower = 8
hitflag = MAFD
guardflag = L
pausetime = 8,8
sparkno = s900
guard.sparkno = s905
sparkxy = -10,-8
hitsound   = s200,24
guardsound = s120,2
ground.type = Low
ground.slidetime = 12
ground.hittime  = 12
ground.velocity = -6
air.velocity = -.3,-3
down.velocity = -3,-6
air.hittime = 12
sparkno = 0
air.fall = 1
fall.recover = 0
ground.cornerpush.veloff = -8

[State 430, 4]
type = PlaySnd
trigger1 = AnimElem = 1
value = 200,0 + (random%6)

[State 430, 5]
type = PlaySnd
trigger1 = AnimElem = 1
value = s200,11


[State 430, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1

;---------------------------------------------------------------------------
; Crouching Medium Kick
; CNS difficulty: easy
[Statedef 440]
type    = C
movetype= A
physics = C
juggle  = 4
poweradd= 25
ctrl = 0
anim = 440

[State 440, 1]
type = HitDef
trigger1 = AnimElem = 3
attr = C, NA
damage    = 65
animtype  = Med
getpower  = 20
givepower = 15
hitflag = MAFD
guardflag = L
pausetime = 8,8
sparkno = s901
guard.sparkno = s905
sparkxy = -10,-52
hitsound   = s200,29
guardsound = s120,1
ground.type = Low
down.velocity = -3,-6
air.hittime = 12
sparkno = 1
ground.slidetime = 17
ground.hittime  = 17
ground.velocity = -10
air.velocity = -2.2,-2
air.fall = 1
fall.recover = 0
ground.cornerpush.veloff = -10

[State 440, 4]
type = PlaySnd
trigger1 = AnimElem = 1
value = 200,0 + (random%6)

[State 440, 5]
type = PlaySnd
trigger1 = AnimElem = 1
value = s200,10


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

;---------------------------------------------------------------------------
; Crouch Strong Kick
; CNS difficulty: easy
; Description: This move uses "Trip" for the "ground.type" parameter in
;     its HitDef. It's a special type that puts the opponent in a tripped
;     animation as he falls. Also, the hitflag parameter in the HitDef
;     is set to "MAFD". The "D" indicates that a downed opponent can be
;     hit by the attack.
[Statedef 450]
type    = C
movetype= A
physics = C
juggle  = 1
poweradd= 40
ctrl = 0
anim = 450

[State 450, 1]
type = HitDef
trigger1 = AnimElem = 2
attr = C, NA
damage    = 85
animtype  = High
getpower = 30,15
givepower = 15,8
hitflag = MAFD
guardflag = L
pausetime = 9,9
sparkno = s902
guard.sparkno = s906
sparkxy = -10,-70
hitsound   = s200,30
guardsound = s120,2

ground.type = Trip
ground.slidetime = 4
ground.hittime  = 15
ground.velocity = -.1,-4
air.velocity = -1.3,-3
guard.velocity = -6
sparkno = 2
fall = 1
fall.recover = 0

[State 450, 5]
type = PlaySnd
trigger1 = AnimElem = 1
value = 200,0 + (random%6)

[State 450, 6]
type = PlaySnd
trigger1 = AnimElem = 1
value = 200,12

[State 450, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1


;---------------------------------------------------------------------------
;Jump Light Punch
; CNS difficulty: easy
[Statedef 600]
type    = A
movetype= A
physics = A
juggle  = 4
poweradd= 65
ctrl = 0
anim = 600
sprpriority = 2

[State 600, 15]
type = PlaySnd
trigger1 = animelem = 2
value = 500, 1

[state 600, 0]
type = Explod
trigger1 = animelem = 2
anim = 4378
pos = 0,0
ontop = 1
postype = p1

[State 600, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 200,0 + (random%6)

[State 600, 2]
type = PlaySnd
trigger1 = AnimElem = 1
value = s200,10

[State 600, 3]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage = 25
guardflag = HA
priority = 4
pausetime = 12,12
sparkno = s910
guard.sparkno = s905
sparkxy = -10,-58
hitsound   = s1004,4
guardsound = s120,1
animtype = Med
ground.type = High
ground.slidetime = 17
ground.hittime  = 17
ground.velocity = -5
air.velocity = -3,-4

;---------------------------------------------------------------------------
; Jump Medium Punch
; CNS difficulty: easy
[Statedef 610]
type    = A
movetype= A
physics = A
juggle = 1
poweradd= 25
ctrl = 0
anim = 610

[State 610, 15]
type = PlaySnd
trigger1 = animelem = 3
value = 500, 2

[state 610, 0]
type = Explod
trigger1 = animelem = 3
anim = 1493
pos = 0,0
ontop = 1
postype = p1



[State 610, 3]
type = HitDef
trigger1 = AnimElem = 4
attr = A, NA
damage    = 65
getpower  = 10
givepower = 15
guardflag = HA
pausetime = 8,8
sparkno = s910
guard.sparkno = s905
sparkxy = -10,-58
hitsound = s1004,3
guardsound = s120,1
ground.type = High
ground.slidetime = 12
ground.hittime  = 12
ground.velocity = -6
air.type = Low
air.velocity = 0,IfElse(Vel Y < 0, Vel Y * 1.1,-8)
air.hittime = 9
yaccel = Const(movement.yaccel)

[State 610, 3]
type = HitDef
trigger1 = AnimElem = 4
attr = A, NA
damage    = 11
getpower  = 10
givepower = 15
guardflag = HA
pausetime = 12,9
sparkno = s910
guard.sparkno = s906
sparkxy = -10,-70
hitsound   = s200,28
guardsound = s120,1
ground.type = High
ground.slidetime = 12
ground.hittime  = 12
ground.velocity = -6
air.type = High
yaccel = Const(movement.yaccel)
air.velocity = 0,-10.2
air.hittime = 12

[State 610, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 200,0 + (random%6)

[State 610, 2]
type = PlaySnd
trigger1 = AnimElem = 1
value = s200,10



[State 610, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 51
ctrl = 1



;---------------------------------------------------------------------------
;Jump Strong Punch
; CNS difficulty: easy
[Statedef 620]
type    = A
movetype= A
physics = A
juggle  = 4
poweradd= 65
ctrl = 0
anim = 620
sprpriority = 2

[State 620, 15]
type = PlaySnd
trigger1 = animelem = 3
value = 500, 2

[state 611, 0]
type = Explod
trigger1 = animelem = 3
anim = 4376
pos = 0,0
ontop = 1
postype = p1

[State 620, 1]
type = PlaySnd
trigger1 = time = 1
value = 200,0 + (random%6)

[State 620, 2]
type = PlaySnd
trigger1 = time = 1
value = 200,11


[State 620, 3]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage = 95
guardflag = HA
priority = 4
pausetime = 12,12
sparkno = s910
guard.sparkno = s906
sparkxy = -10,-70
hitsound = s1004,3
guardsound = s120,1
animtype = Med
ground.type = High
ground.slidetime = 17
ground.hittime  = 17
ground.velocity = -5
air.velocity = -3,-4

;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
;Jump Light Kick
; CNS difficulty: easy
[Statedef 630]
type    = A
movetype= A
physics = A
juggle  = 3
poweradd= 20
ctrl = 0
anim = 630
sprpriority = 2

[State 630, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 200,0 + (random%6)

[State 630, 2]
type = PlaySnd
trigger1 = AnimElem = 1
value = 200,11


[State 630, 2]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage = 25
guardflag = HA
priority = 3
pausetime = 8,8
sparkno = s900
guard.sparkno = s905
sparkxy = -5,-35
hitsound   = s200,24
guardsound = s120,2
ground.type = High
ground.slidetime = 6
ground.hittime  = 6
ground.velocity = -4
air.velocity = -2,-3

;---------------------------------------------------------------------------
; Jump Medium Kick
; CNS difficulty: easy
[Statedef 640]
type    = A
movetype= A
physics = A
juggle = 1
poweradd= 25
ctrl = 0
anim = 640



[State 640, 2]
type = PlaySnd
trigger1 = animelem = 2
value = 200,12


[State 640, 1]
type = HitDef
trigger1 = AnimElem = 2
attr = A, NA
damage    = 65
getpower  = 20
givepower = 15
guardflag = HA
priority = 3
pausetime = 8,8
sparkno = s901
guard.sparkno = s905
sparkxy = -10,-58
hitsound   = s200,29
guardsound = s120,1
ground.type = High
ground.slidetime = 13
ground.hittime  = 13
ground.velocity = -7
air.type = Low
yaccel = Const(movement.yaccel)
air.velocity = 0,IfElse(Vel Y < 0, Vel Y * .9,-5);0,-2.5
sparkno = 1
air.hittime = 9

[State 640, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 51
ctrl = 1



;---------------------------------------------------------------------------
;Jump Strong Kick
; CNS difficulty: easy
[Statedef 650]
type    = A
movetype= A
physics = A
juggle  = 4
poweradd= 65
ctrl = 0
anim = 650
sprpriority = 2

[State 650, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 200,0 + (random%6)

[State 650, 2]
type = PlaySnd
trigger1 = AnimElem = 1
value = 200,12

[State 650, 3]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage    = 95
guardflag = HA
priority = 4
pausetime = 12,12
sparkno = s902
hitsound   = s200,30
guard.sparkno = s905
sparkno = s902
guard.sparkno = s906
sparkxy = -10,-70
animtype = Med
ground.type = High
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -5
air.velocity = -3,-4

;---------------------------------------------------------------------------
; Throw 1 (Attempt)
[Statedef 800]
type    = S
movetype= A
physics = S
velset = 0
anim = 800
ctrl = 0
poweradd = 100

[State 800, 1]
type = HitDef
Trigger1 = AnimElem = 1
attr = S, NT
ID = 800
hitflag = M-
guardflag =
priority = 1
sparkno = -1
sparkxy = -5,-72
hitsound = S1,4
p2facing = 1
p1stateno = 810
p2stateno = 820
numhits = 0

[State 800, 2]
type = HitDef
trigger1 = AnimElem = 1
Trigger1 = command = "back_y" || command = "back_z"
attr = S, NT
ID = 800
hitflag = M-
guardflag =
priority = 1
sparkno = -1
sparkxy = 100,-72
hitsound = S1,4
p1facing = -1
p2facing = 1
p1stateno = 810
p2stateno = 820
numhits = 0

[State 800, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------
; Throw 1 (Success)
[Statedef 810]
type    = S
movetype= A
physics = N
anim = 810

[State 810, 1]
type = NotHitBy
trigger1 = Time >= 0
value = SCA

[State 810, 2]
type = TargetBind
trigger1 = AnimElem = 1, >= 0
trigger1 = AnimElem = 3, < 0
pos = 50,0

[State 810, 3]
type = TargetBind
trigger1 = AnimElem = 3, >= 0
trigger1 = AnimElem = 4, < 0
pos = 63,-92

[State 810, 4]
type = TargetBind
trigger1 = AnimElem = 4, >= 0
trigger1 = AnimElem = 20, < 0
pos = 49,-68

[State 810, 4]
type = TargetBind
trigger1 = AnimElem = 20, >= 0
trigger1 = AnimElem = 21, < 0
pos = 47,-53

[State 810, 5]
type = TargetBind
trigger1 = AnimElem = 21, >= 0
trigger1 = AnimElem = 22, < 0
pos = 34,-49

[state 820, 0]
type = Explod
trigger1 = Time = 20
anim = 1501
pos = -60,-30
ontop = 1
postype = P2

[State 810, 4]
type = HitDef
trigger1 = Time = 0
attr = S, NT
ID = 800
ChainID = 800
animtype = Hard
damage = 60
guardflag =
pausetime = 0,9
snap = 95,-10
sparkno = s902
guard.sparkno = s906
sparkxy = -50,-100
hitsound = s1004,3
guardsound = s120,1
ground.type = Low
ground.hittime = 15
ground.velocity = -12,-3
air.type = low
air.velocity = -12,-3
fall = 1
fall.recover = 0
numhits = 0

[State 810, 6]
type = PlaySnd
trigger1 = Animelem = 23
value = 10000,7

[State 810, 6]
type = PlaySnd
trigger1 = Animelem = 4
trigger2 = Animelem = 10
trigger3 = Animelem = 16
value = 0,0

[State 810, 6]
type = TargetLifeAdd
trigger1 = Animelem = 4
trigger2 = Animelem = 10
trigger3 = Animelem = 16
value = -20



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

;---------------------------------------------------------
; Throw 1 (Being Thrown)
[Statedef 820]
type    = S
movetype= H
physics = N
velset = 0,0
ctrl = 0

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

[State 820, 2]
type = PalFX
trigger1 = AnimElem = 3
time = 80
add = 0,0,255
sinadd = 0,80,15,20
color = 0
invertall = 1



[State 820, 3]
type = PlayerPush
trigger1 = Time >= 0
value = 0

;---------------------------------------------------------
;---------------------------------------------------------------------------
;Thrown by Joker Throw - thrown into the air
[Statedef 821]
type    = A
movetype= H
physics = N
velset = -3,-8
poweradd = 40

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

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

; Throw Addon (Roller Dash)
[Statedef 830]
type    = S
movetype= A
physics = S
juggle  = 0
poweradd= 120
anim = 830
ctrl = 0
sprpriority = 2

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

[State 830, 2]
type = PlaySnd
trigger1 = animelem = 3
value = s11, 0

[State 830, 3]
type = PlaySnd
trigger1 = animelem = 3
value = s1002, 1

[State 830, 4]
type = VelSet
trigger1 = animelem >= 3
x = 40

[State 830, 5]
type = PlayerPush
trigger1 = Time >= 0
value = 0

[State 830, 6]
type = HitDef
trigger1 = time = 0
attr = S, SA
animtype  = Light
damage    = 60, 5
getpower  = 0
priority  = 5
hitflag = MAFD
guardflag = MA
pausetime = 0,0
sparkxy = -10,-50
sparkno = s902
guard.sparkno = s906
hitsound   = s200,20
guardsound = s120,0
ground.type = Low
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -4
guard.velocity = -4
air.velocity = -4,-3
airguard.velocity = -5, -4
down.velocity = -3,-2
down.hittime = 20
fall.recover = 0

[state 830, 7]
type = explod
trigger1 = animelem = 3
id = 1019
anim = 1019
postype = p1
pos = 11,5
accel = 0,0
pausemovetime = 0
supermovetime = 0
sprpriority = 1
bindtime = -1
ownpal = 1
ignorehitpause = 1
persistent = 1
facing = 1
removeongethit = 1
removetime = 10
scale = .92,.92

[State 830, 8]
type = PalFX
trigger1 = animelem = 3
time = 10
add = 240,50,0

[State 830, 9]
type = hitadd
trigger1 = time = 0
value = -1

[State 830, 10]
type = ChangeState
trigger1 = animtime = 0
value = 1021
ctrl = 0


;---------------------------------------------------------------------------
; Override common states (use same number to override) :
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Jump Land
[Statedef 52]
type    = S
physics = S
ctrl = 0
anim = 47

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

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

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

[State 52, 4]
type = varset
triggerall = stateno = 52 && prevstateno != 610
trigger1 = time = 0
var(10) = 0

[State 52, 5]
type = varset
triggerall = stateno = 52 && prevstateno != 615
trigger1 = time = 0
var(11) = 0

[State 52, 6]
type = Changeanim
triggerall = var(10) = 0
trigger1 = time = 0
value = 47

[State 52, 7]
type = Changeanim
triggerall = var(11) = 0
trigger1 = time = 0
value = 47

[State 52, 8]
type = Changeanim
triggerall = var(10) = 1
trigger1 = time = 0
value = 617

[State 52, 9]
type = Changeanim
triggerall = var(10) = 2
trigger1 = time = 0
value = 618

[State 52, 10]
type = Changeanim
triggerall = var(11) = 1
trigger1 = time = 0
value = 617

[State 52, 11]
type = Changeanim
triggerall = var(11) = 2
trigger1 = time = 0
value = 618

[State 52, 12]
type = Playsnd
trigger1 = time = 0
value = s10,0

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

;---------------------------------------------------------------------------
; RUN_FORWARD
[Statedef 100]
type    = A
physics = A
ctrl = 0
anim = 100
sprpriority = 1
ctrl = 0

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

[State 100, 2]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 52


;---------------------------------------------------------------------------
; RUN_BACK
[Statedef 105]
type    = A
physics = A
ctrl = 0
anim = 105
sprpriority = 1
ctrl = 0

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

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

;---------------------------------------------------------------------------
; HITL_SHAKE
[Statedef 5080]
type    = L
movetype= H
physics = N
velset = 0,0

[State 5080, 1] ;Set default anim
type = VarSet
trigger1 = !time
sysvar(2) = ifelse (GetHitVar(yvel) = 0, 5080, 5090)

[State 5080, 2]
type = VarAdd
trigger1 = !time
trigger1 = (anim = [5081,5089]) || (anim = [5111,5119])
trigger1 = SelfAnimExist(sysvar(2) + (anim % 10))
sysvar(2) = anim % 10

[State 5080, 3] ;If 5090 doesn't exist, default to 5030
type = VarSet
trigger1 = !time
trigger1 = sysvar(2) = 5090
trigger1 = !SelfAnimExist(5090)
sysvar(2) = 5030

[State 5080, 3] ;Freeze
type = ChangeAnim
trigger1 = 1
value = sysvar(2)

[State 5080, 4]
type = ChangeState
trigger1 = HitShakeOver
trigger1 = GetHitVar(yvel) = 0
value = 5081 ;HITL_SLIDE

[State 5080, 5]
type = ChangeState
trigger1 = HitShakeOver
trigger1 = GetHitVar(yvel) != 0
value = 5030 ;HITA_UP

;---------------------------------------------------------------------------
;----------------------------------------------------------------------------
[Statedef 5100]
type    = L
movetype= H
physics = N



[State 5100, 1]
type = VelSet
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) = 0
trigger1 = vel x > 1
x = 1

[State 5100, EnvShake]
type = FallEnvShake
trigger1 = Time = 0

[State 5100, Var] ;Save fall velocity
type = VarSet
trigger1 = Time = 0
;trigger1 = GetHitVar(fall.yvel) = 0
sysvar(1) = floor(vel y)

[State 5100, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = anim != 8100
triggerall = time = 0
trigger1 = (anim != [5051,5059]) && (anim != [5061,5069])
trigger2 = !SelfAnimExist(5100 + (anim % 10))
value = 5100

[State 5100, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
triggerall = anim != 8100
trigger1 = time = 0
trigger1 = (anim = [5051,5059]) || (anim = [5061,5069])
trigger1 = SelfAnimExist(5100 + (anim % 10))
value = 5100 + (anim % 10)

[State 5100, 4]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5100, 5]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5100, 6] ;Reduce speed
type = VelMul
trigger1 = Time = 0
x = 0.75

[State 5100, 7]
type = ChangeState
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) = 0
value = 5110 ;HIT_LIEDOWN

[State 5100, 8]
type = GameMakeAnim
trigger1 = Time = 1
;value = 61
;pos = 0, 0
;under = 1
value = 60 + (sysvar(1) > 5) + (sysvar(1) > 14)
pos = 0, 0
under = sysvar(1) <= 10

[State 5100, 9]
type = HitFallDamage
trigger1 = Time = 3

[State 5100, 10]
type = PlaySnd
trigger1 = Time = 1
value = s8000,1 ;Hit ground
;value = F7, (sysvar(1) > 5) + (sysvar(1) > 14)

[State 5100, 11]
type = PosFreeze
trigger1 = 1

[State 5100, 12]
type = ChangeState
trigger1 = AnimTime = 0
value = 5101

[State 5100, 13]
type = ForceFeedback
trigger1 = Time = 0
waveform = sinesquare
ampl = 128,-3,-.2,.005
time = 20

;---------------------------------------------------------------------------
; HIT_BOUNCE (bounce into air)
[Statedef 5101]
type    = L
movetype= H
physics = N

[State 5101,ChangeAnim]
type = ChangeAnim
triggerall = !Alive
triggerall = (RoundNo = 2 || RoundNo = 3) && PrevStateNo = 5100
trigger1 = Time = 0
value = 8160



[State 5101, 1] ;Coming hit ground anim (normal)
type = ChangeAnim
triggerall = anim != 8160
triggerall = time = 0
trigger1 = anim != [5101,5109]
trigger2 = !SelfAnimExist(5160 + (anim % 10))
value = 5160

[State 5101, 2] ;Coming hit ground anim (for hit up)
type = ChangeAnim
triggerall = anim != 8160
triggerall = time = 0
trigger1 = anim = [5101,5109]
trigger1 = SelfAnimExist(5160 + (anim % 10))
value = 5160 + (anim % 10)

[State 5101, 3]
type = HitFallVel
trigger1 = Time = 0

[State 5101, 4]
type = PosSet
trigger1 = Time = 0
y = 20

[State 5101, 5] ;Acceleration
type = VelAdd
trigger1 = 1
y = .4

[State 5101, 6] ;Hit ground
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 20
type = ChangeState
value = 5110

;---------------------------------------------------------------------------
; HIT_LIEDOWN
[Statedef 5110]
type    = L
movetype= H
physics = N

[State 5110, EnvShake]
type = FallEnvShake
trigger1 = Time = 0



[State 5110,ChangeAnim]
type = ChangeAnim
triggerall = !Alive
triggerall = (RoundNo = 2 || RoundNo = 3) && (PrevStateNo = 5101 || PrevStateNo = 5110)
triggerall = anim != [5110,5119]
triggerall = anim != 8110
trigger1 = Time = 0
value = 8170

[State 5110, 1] ;For hit up/up-diag type (from state 5081)
type = ChangeAnim
persistent = 0
triggerall = anim != 8110 && Anim != 8170
trigger1 = SelfAnimExist(5110 + (anim % 10))
trigger1 = anim = [5081,5089]
value = 5110 + (anim % 10)

[State 5110, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = anim != 8110 && Anim != 8170
triggerall = time = 0
triggerall = anim != [5110,5119] ;Not already changed anim
trigger1 = anim != [5161,5169]
trigger2 = !SelfAnimExist(5170 + (anim % 10))
value = 5170

[State 5110, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
triggerall = anim != 8110 && Anim != 8170
triggerall = time = 0
triggerall = anim != [5110,5119] ;Not already changed anim
trigger1 = anim = [5161,5169]
trigger1 = SelfAnimExist(5170 + (anim % 10))
value = 5170 + (anim % 10)

[State 5110, 4]
type = HitFallDamage
trigger1 = Time = 0

[State 5110, 5]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5110, Var] ;Get fall velocity
type = VarSet
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) != 0
sysvar(1) = floor(vel y)

[State 5110, 6]
type = PlaySnd
trigger1 = Time = 0
trigger1 = !SysVar(0)
value = s8000,ifelse(prevstateno = 5071, 1, 2) ;Hit ground
;value = F7, (sysvar(1) > 5) + (sysvar(1) > 14)

[State 5110, 7]
type = GameMakeAnim
trigger1 = Time = 0
trigger1 = !SysVar(0)
value = 60 + (sysvar(1) > 5) + (sysvar(1) > 14)
pos = 0, 0
under = sysvar(1) <= 10

[State 5110, 8]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5110,ChangeAnim]
type = ChangeAnim
persistent = 0
triggerall = !Alive
triggerall = (RoundNo = 2 || RoundNo = 3) && (PrevStateNo = 5101 || PrevStateNo = 5110)
triggerall = Anim = 8170
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground frame
value = 8110

[State 5110, 9] ;For hit up type
type = ChangeAnim
persistent = 0
triggerall = anim != 8110 && Anim != 8170
triggerall = anim = [5171,5179]
triggerall = SelfAnimExist(5110 + (anim % 10))
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground anim
value = 5110 + (anim % 10)

[State 5110, 10] ;For normal
type = ChangeAnim
persistent = 0
triggerall = anim != 8110 && Anim != 8170
triggerall = Anim != [5111,5119]
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground frame
value = 5110

[State 5110, 11] ;If just died
type = ChangeState
triggerall = !alive
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground frame
trigger3 = Anim = [5110,5119]
value = 5150

[State 5110, 12]
type = VarSet
trigger1 = SysVar(0)
trigger1 = Time = 0
sysvar(0) = 0

[State 5110, 13] ;Friction
type = VelMul
trigger1 = 1
x = 0.85

[State 5110, 14]
type = ForceFeedback
trigger1 = alive
trigger1 = Time = 0
time = 8
ampl = 240
waveform = sine

[State 5110, 15]
type = ForceFeedback
trigger1 = !alive
trigger1 = Time = 0
ampl = 200, 7, -.467
time = 30
waveform = sine

;---------------------------------------------------------------------------
; HIT_GETUP
[Statedef 5120]
type    = L
movetype= I
physics = N



[State 5120, 1a] ;Get up anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim != [5111,5119]
trigger2 = !SelfAnimExist(5120 + (anim % 10))
value = 5120

[State 5120, 1b] ;Get up anim (for hit up/diag-up)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim = [5111,5119]
trigger1 = SelfAnimExist(5120 + (anim % 10))
value = 5120 + (anim % 10)

[State 5120, 2]
type = VelSet
trigger1 = Time = 0
x = 0

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

[State 5120, 4]
type = HitFallSet
trigger1 = AnimTime = 0
value = 1

[State 5120, 5] ;Can't be thrown right after getting up
type = NotHitBy
trigger1 = AnimTime = 0
value = , NT,ST,HT
time = 12

[State 5120, 6] ;Can't be hit right after getting up (short time)
type = NotHitBy
trigger1 = AnimTime = 0
value2 = SCA
time = 3

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

;---------------------------------------------------------------------------
; HIT_LIEDEAD
[Statedef 5150]
type    = L
movetype= H
physics = N
sprpriority = -3


[State 5150, 1] ;Normal anim
type = ChangeAnim
triggerall = Time = 0 && anim != 8110 && Anim != 8170
triggerall = SelfAnimExist(5140)
trigger1 = (anim != [5111,5119]) && (anim != [5171,5179])
trigger2 = !SelfAnimExist(5140 + (anim % 10))
value = 5140

[State 5150, 3] ;Hit up type anim
type = ChangeAnim
trigger1 = Time = 0 && anim != 8110 && Anim != 8170
trigger1 = (anim = [5111,5119]) || (anim = [5171,5179])
trigger1 = SelfAnimExist(5140 + (anim % 10))
value = 5140 + (anim % 10)

[State 5150, 4] ;Match over anim
type = ChangeAnim
persistent = 0
;trigger1 = Time = 0 && anim != 8110 && Anim != 8170
trigger1 = MatchOver = 1
trigger1 = Anim = [5140,5149]
trigger1 = SelfAnimExist(anim+10)
value = anim+10

[State 5150, 5] ;Switch to 5110 if liedead anim does not exist
type = ChangeAnim
trigger1 = Time = 0
trigger1 = Anim != [5140,5159]
trigger1 = Anim != [5110,5119]
value = ifelse(((RoundNo = 2 || RoundNo = 3) && PrevStateNo = 5110 && !Alive),8110,5110)

[State 5150, 5]
type = ChangeAnim
triggerall = !alive
triggerall = RoundNo = 1
triggerall = anim = 5110
trigger1 = Time = 50
value = 8180

[State 5150, 6] ;Friction
type = VelMul
trigger1 = 1
x = 0.85

[State 5150, 7] ;Friction
type = VelSet
trigger1 = Vel x < .05
persistent = 0
x = 0

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

[State 5150, 9]
type = PlaySnd
trigger1 = time = 1
value = s180,3

;---------------------------------------------------------------------------
; Liedown Roll Forward (Author MystikBlaze)
[Statedef 8300]
type    = C
movetype= I
physics = N
poweradd= 0
velset = 8,0
ctrl = 0
anim = 850
sprpriority = -1

[State 8300, PlayerPush]
type = PlayerPush
trigger1 = Time >= 0
value = 0

[State 8300, VelSet]
type = VelSet
trigger1 = AnimTime = 0
x = 0

[State 8300, PosSet]
type = PosSet
trigger1 = Time >= 0
y = 0

[State 8300, MakeDust]
type = MakeDust
trigger1 = Time >= 0
pos = -16,0
spacing = 6

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

[State 8300, sound]
type = PlaySnd
trigger1 = AnimElem = 5
value = 30,2

[State 8300, ChangeState]
type = ChangeState
trigger1 = AnimTime = 0
value = 8301
ctrl = 1

[Statedef 8301]
type    = C
movetype= I
physics = N
poweradd= 0
velset = 2,0
ctrl = 0
anim = 5120
sprpriority = -1

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

; Liedown Roll Backwards (Author MystikBlaze)
[Statedef 8305]
type    = C
movetype= I
physics = N
poweradd= 0
velset = -8,0
ctrl = 0
anim = 851
sprpriority = -1

[State 8305, PlayerPush]
type = PlayerPush
trigger1 = Time >= 0
value = 0

[State 8305, VelSet]
type = VelSet
trigger1 = AnimTime = 0
x = 0

[State 8305, PosSet]
type = PosSet
trigger1 = Time >= 0
y = 0

[State 8305, MakeDust]
type = MakeDust
trigger1 = Time >= 0
pos = -16,0
spacing = 6

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

[State 8305, sound]
type = PlaySnd
trigger1 = AnimElem = 5
value = 30,2

[State 8305, ChangeState]
type = ChangeState
trigger1 = AnimTime = 0
value = 8302
ctrl = 1

[Statedef 8302]
type    = C
movetype= I
physics = N
poweradd= 0
velset = -2,0
ctrl = 0
anim = 5120
sprpriority = -1

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





;===========================================================================
;--------------------------------- super jump ------------------------------
;===========================================================================

[statedef 7000]
type    = s
physics = s
anim = 40
ctrl = 0
sprpriority = 1

[State 7000, ]
type = PlaySnd
trigger1 = Time = 0
value = 9999,5


[state 7000, super jump]
type = varset
trigger1 = time = 0
sysvar(1) = 0

[state 7000, super jump]
type = varset
trigger1 = command = "holdfwd"
trigger2 = var(42) = -1
sysvar(1) = 1

[state 7000 super jump]
type = varset
trigger1 = command = "holdback"
sysvar(1) = -1

[state 7000, super jump]
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))) * 1.35
y = 1.55*const(velocity.jump.y)

;===Put in .cns file statedef for sjump
;from wonder woman's sjump
[State 700, ai]
type = Velset
trigger1 = Var(12) && (prevstateno=420)
x = 6
y = -12

[state 7000, super jump]
type = velset
trigger1 = animtime = 0
trigger1 = prevstateno = 100 ;run_fwd
trigger1 = sysvar(1) = 1
x = const(velocity.runjump.fwd.x)

[state 7000,super jump]
type = afterimage
trigger1 = time = 1
length = 30;100
PalBright   =  0,0,0;320, 320, 320
PalContrast =  120,120,220;0, 0, 0
PalAdd      =  0,0,0;80,80,100
PalMul      = 1,1,1;.50,.50,.50
TimeGap  = 1
FrameGap = 5
Trans = Add
time = 20

[state 7000, super jump]
type = explod
trigger1 = time = 0
anim = F61
pos = 0, 0

[state 7000, super jump]
type = playsnd
trigger1 = time = 0
value = 6,2

[state 7000, super jump]
type = velmul
trigger1 = command = "holdback"
trigger1 = time > 10
x = -1.2



[state 7000, super jump]
type = changestate
trigger1 = animtime = 0
value = 50
ctrl = 1


;---------------------------------------------------------------------------
;Super Jump opponent locator
[Statedef 9910]
type    = A
physics = N
ctrl = 0
sprpriority = 2

[State 9910, arrow]
type = ChangeAnim
trigger1 = IsHelper(7000)
value = 9910
;ignorehitpause =
;persistent =

[State 0, PosSet]
type = PosSet
trigger1 = 1
x = Floor(enemy,pos x)
y = (floor(pos y) + (240-floor(ScreenPos Y)))
;ifelse(facing = 1, (Floor(enemy,pos x)+160),320-(Floor(enemy,pos x)+160)),-120
;ignorehitpause =
;persistent =





[State 9910, destroyself]
type = DestroySelf
triggerall = IsHelper(7000)
trigger1 = enemy,screenpos y <300


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



;----------------------------------------------------------------
; Hyper Electricity
[Statedef 7600]
type = A
physics = N
movetype = H
velset = 0,0
ctrl = 0
anim = 5030
juggle = 0

[State 7600, Shock Animation]
type = ChangeAnim
trigger1 = AnimExist(7696)
trigger1 = Anim != 7696
value = 7696

[State 7600, Fau-Shock]
type = Palfx
trigger1 = !AnimExist(7696) && TimeMod = 3, 1
time = 2
mul = 199,198,226

[State 7600, Fau-Shock]
type = Palfx
trigger1 = !AnimExist(7696) && TimeMod = 4, 2
time = 3
add = 0,0,255
sinadd = 0,80,15,20
color = 0
invertall = 1

[State 7600, Fall Back]
type = velset
trigger1 = Time = 30
x = -1.8
y = -9.4

[State 7600, Fall Back]
type = gravity
trigger1 = Time >= 30

[State 7600, Change]
type = Selfstate
trigger1 = Pos Y > 0
value = 5100

; Hit by Electric Batarang
[Statedef 7696]
type    = A
physics = N
movetype = H
ctrl = 0
anim = 5002

[State 7696, 1]
type = VelSet
trigger1 = Time = 0
x = -4
y = -5

[State 3210, Electrocuted FXs]
type = PalFX
trigger1 = Time % 4
trigger1 = !AnimExist(7696)
time = 1
color = 64
invertall = 1
add = -90,0,140
sinadd = 100,100,100,10


[State 3210, Electrocuted FXs]
type = Palfx
trigger1 = !AnimExist(7696) && TimeMod = 3, 1
time = 2
mul = 199,198,226

[State 7696, Electrocuted_Anim]
type = Changestate;Anim
trigger1 = AnimExist(7696)
trigger1 = Anim != 7696
value = 27696

[State 7696, 5]
type = VelAdd
trigger1 = Time > 2
y = 0.45

[State 7696, 6]
type = SelfState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 5100


; Hit by Electric Batarang
[Statedef 27696]
type    = A
physics = N
movetype = H
ctrl = 0
anim = 7696

[State 7696, 1]
type = VelSet
trigger1 = Time = 0
x = -4
y = -5

[State 7696, 5]
type = VelAdd
trigger1 = Time > 2
y = 0.45

[State 7696, 6]
type = SelfState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 5100

; SuperMan Hit by Kryptonite Batarang
[Statedef 7670]
type    = A
physics = N
movetype = H
ctrl = 0
anim = 5300

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

[State 0, ]
type = PowerAdd
trigger1 = 1
value = -5

[State 7697, Green_FX]
type = PalFX
trigger1 = Anim = 5300
trigger1 = Time = 1
time = 200
add = -150,-40,-100
sinadd = 0,80,15,20
color = 0
invertall = 1

[State 7696, 6]
type = SelfState
trigger1 = Time = 200
ctrl = 1
value = 5070




;---------------------------------------------------------------------------
; States that are always executed (use statedef -2)
;---------------------------------------------------------------------------
[Statedef -2]

[State -2, varset]
type = Varset
trigger1 = Time = 0
var(24) = ifelse(numhelper(1003) = 1, 1, 0)

;For debugging purposes
[State -2, Debug Info]
type = DisplayToClipboard
trigger1 = roundstate > 0
;text = "Hits: %d, Screen Pack %d, AI On %d, Super Jump %d"
;text = "Intro No. %d, Win No. %d, Enemy Proj: %d, Enemy Helpers: %d"
;text = "Score %d"
text = "P2 Distance X from P1 %f, P2 Distance Y from P1 %f"

;params = var(8), var(17), var(59), var(0)
;params = var(1), var(2), var(7), var(6)
;params = var(11)
;params = P2BodyDist X, P2BodyDist Y
params = P2BodyDist X, screenpos Y



[State -2, Landing Dust]
type = Explod
triggerall =  NumExplod(9200) < 1
triggerall = Time = 3
trigger1 = StateNo = 52 ;Jump land
trigger2 = StateNo = 101 ;Run-fdw land
trigger3 = StateNo = 106 ;Run-back land
trigger4 = PrevStateNo = 52 && StateNo = 11 ;Jump land/crouch
persistent = 0
ID = 9200
anim = 9200
postype = p1
pos = 7, 3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = -2
ownpal = 1

[State -2, blood spark]
type = explod
trigger1 = ProjHit2765 = 1
anim = 910
pos = 35,-75
facing = -1
postype = P2
sprpriority = 2
bindtime = -1
removetime = 35

;---------------------------------------------------------------------------
; States that are executed when in self's state file (use statedef -3)
;---------------------------------------------------------------------------
[Statedef -3]

; based on FlowaGirl and Ethan Lives codes
; taken with permission from McCready's Guido char
[State -3, Finish Hit Explod - Helper]
type = Helper
triggerall = WinKO && NumHelper(8900) = 0
trigger1 = RoundState = 3
helpertype = Normal
name = "Finish Hit Explod"
id = 8900
pos = 0, 0
postype = p1
facing = 0
stateno = 8900
keyctrl = 0
ownpal = 1
supermovetime = 1000
pausemovetime = 1000
ignorehitpause = 1

;This controller plays a sound everytime Joker lands from his back-dash.
[State -3, Landing Sound]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 106 ;Run-back land
value = s10, 0

[State -3]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 105 || stateno = 100
value = s10000, 24



[State -3, Jump Sound]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 50
value = s50, 0

[State -3,PlaySnd]
type = PlaySnd
triggerall = Time = 1 && Alive ;&& Random <= 500
triggerall = StateNo = 5000 || StateNo = 5010 || StateNo = 5070
trigger1 = Anim = 5000 || Anim = 5001 || Anim = 5002 || Anim = 5010 || Anim = 5011 || Anim = 5012 || Anim = 5020 || Anim = 5021 || Anim = 5022 || Anim = 5070
value = s1001,1 + (random%6)

[State -3,PlaySnd]
type = PlaySnd
triggerall = Time = 1 && Alive
triggerall = StateNo = 5035
trigger1 = Anim = 5035
value = 5300,0 + (random%2)


[State -3, superjump opponent locator]
type = Helper
triggerall = (NumHelper(7000) = 0)
trigger1 = enemy,screenpos y >300
ID = 7000
pos = ifelse(facing = 1, (Floor(enemy,pos x)+160),320-(Floor(enemy,pos x)+160)),-120
postype = back
stateno = 9910
facing = 1


