;====================== Variable List =================
; Var(0) to VAR(10) - HELPER VAR: AI ACTIVATION
; Var(3)  - HELPER VAR: PROJECTILE HIT DETECTION
; Var(10) - STRENGTH VAR
; Var(11) - HELPER VAR: 1390, HITS
; Var(12) - PROJECTILE HELPER EXPLOSION STATE
; Var(14) - HIT COUNT
; Var(15) - NO JUGGLE
; Var(16) - FOCUS ATTACK CHARGE LVL
; Var(17) - FOCUS ATTACK LIFE METTER
; Var(18) - FOCUS ATTACK PREV STATE
; Var(19) - COUNTER FLAG
; Var(20) - CUSTOM COMBO
; Var(21) - CUSTOM COMBO CHAIN
; Var(23) - SUPER JUMP COMMAND
; Var(24) - SHORT JUMP COMMAND
; Var(25) - P2 TECH RECOVER
; Var(30) - HIT DETECTION
; Var(33) - HITSPARK LEVEL
; Var(34) - GUARDSPARK LEVEL
; Var(35) - HITSPARK X POS
; Var(36) - HITSPARK Y POS
; Var(37) - KO DETECTION
; Var(50) - HELPER VAR: SUPERSPARK TIME
; Var(57) - AI ACTIVATION
; Var(58) - AI ACTIVATION
; Var(59) - AI ACTIVATION
;====================== Float Variable List =================
; fVar(1) - HELPER VAR: 8071, 9750
; fVar(10) - DAMAGE DAMPENER
; fVar(11) - DAMAGE DAMPENER
; fVar(12) - DAMAGE DAMPENER
;========================== Channels =======================
; 0 - Get Hit Voice
; 1 - Voice
; 2 - Woosh
; 3 - Steps, Jumps
; 12 - Intro/Winpose voice
; 13 - Intro/Winpose fx
;========================== FALTA ==============================

;small portrait
;sprites de god end a normal rugal

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

[Size]
xscale = 1.05
yscale = 1
ground.back = 20
ground.front = 22
air.back = 20
air.front = 22
height = 60
attack.dist = 160
proj.attack.dist = 90
proj.doscale = 0
head.pos = -10, -120
mid.pos = -10, -65
shadowoffset = 0
draw.offset = 0,1

[Velocity]
walk.fwd  = 3.47
walk.back = -2.64
run.fwd  =5.66, 0
run.back = -7.5,-4.5
jump.neu = 0,-9.5
jump.back = -3.37
jump.fwd = 3.92
runjump.back = -5.06,-12
runjump.fwd = 5.88,-10.5
airjump.neu = 0,-3
airjump.back = -2.55
airjump.fwd = 2.5

[Movement]
airjump.num = 0
airjump.height = 28
yaccel = .5
stand.friction = .85
crouch.friction = .82
;---------------------------------------------------------------------------
; Lose by Time Over
[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
[Statedef 180]
type = S

[State 180, 1]
type = ChangeState
trigger1 = time = 0
value = 181+(random%3)

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

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 2
value = S180,6
volume = 0
channel = 12

[State 190, Voice]
type = PlaySnd
trigger1 = AnimElem = 4
value = 0,0

[State 0, Null]
type = Null
trigger1 =  1
;---------------------------------------------------------------------------
; Win pose 2
[Statedef 182]
type = S
ctrl = 0
anim = 181
velset = 0,0

[State 0, Null]
type = Null
trigger1 =  1
;---------------------------------------------------------------------------
; Win pose 3
[Statedef 183]
type = S
ctrl = 0
anim = 182
velset = 0,0

[State 190, Voice]
type = PlaySnd
trigger1 = AnimElem = 4
trigger2 = AnimElem = 7
value = 100,1

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

[State 190, 0]
type = ChangeState
triggerall = roundstate = 0
trigger1 = enemy, name = "cvsvice"
trigger2 = enemy, name = "Vice"
value = 197

[State 190, 0]
type = ChangeState
triggerall = roundstate = 0
trigger1 = enemy, name = "Guile" && Enemy, AuthorName = "Jmorphman"
value = 198

[State 190, 1]
type = ChangeState
trigger1 = RoundState = 0
value = ifelse(random<=500,191,196)

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

[State 190, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
;---------------------------------------------------------------------------
; Introduction
[Statedef 191]
type = S
ctrl = 0
anim = 191
velset = 0,0

[State 191, Cloth]
type = Helper
trigger1 = Time = 0
ID = 192
stateno = 192
postype = p1
pos = -32,5
name = "pantera"

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 2
value = S180,0+(random%2)
volume = 0
channel = 12

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

[State 190, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
;---------------------------------------------------------------------------
; Introduction2
[Statedef 196]
type = S
ctrl = 0
anim = 196
velset = 0,0

[State 191, Cloth]
type = Helper
trigger1 = Time = 1
ID = 193
stateno = 193
postype = p1
pos = -32,5
name = "pantera"

[State 190, Voice]
type = PlaySnd
trigger1 = AnimElem = 2
value = 180, 3
channel = 12

[State 190, Voice]
type = PlaySnd
trigger1 = AnimElem = 44
value = 180, 4
channel = 12

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

[State 190, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
;---------------------------------------------------------------------------
;pantera1
[Statedef 192]
ctrl = 0
anim = 192+(random%2)
sprpriority = 5
velset = 0,0

[State 1100, Velocity]
type = VelSet
trigger1 = anim = 192 && AnimElem = 44
trigger2 = anim = 193 && AnimElem = 39
x = -2.5

[State 8200, Destroy]
type = DestroySelf
trigger1 = RoundState = 2
;---------------------------------------------------------------------------
;pantera2
[Statedef 193]
ctrl = 0
anim = 194
sprpriority = 5
velset = 0,0

[State 1100, Velocity]
type = VelSet
trigger1 = AnimElem = 37
x = -2.5

[State 190, Voice]
type = PlaySnd
trigger1 = AnimElem = 8
value = 180, 7
channel = 13

[State 0, StopSnd]
type = StopSnd
trigger1 = RoundState = 2
channel = 13

[State 8200, Destroy]
type = DestroySelf
trigger1 = RoundState = 2
---------------------------------------------------------------------------
; Intro vs Vice
[Statedef 197]
type = S
ctrl = 0
anim = 197
velset = 0,0

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

[State 190, Voice]
type = PlaySnd
trigger1 = AnimElem = 3
value = 180, 2
channel = 12

[State 190, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
---------------------------------------------------------------------------
; Intro vs Guile
[Statedef 198]
type = S
ctrl = 0
anim = 198
velset = 0,0

[State 191, Guile statue]
type = Helper
trigger1 = Time = 0
ID = 10197
stateno = 10197
postype = p1
pos = 72,0
name = "guile statue"

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

[State 190, Voice]
type = PlaySnd
trigger1 = AnimElem = 2
value = 180, 1
channel = 0

[State 8201, HitOverRide]
type = HitOverRide
trigger1 = 1
attr = SC, AP
stateno = 199

;part 2
[Statedef 199]
type    = S
anim = 199
velset = 0,0
ctrl = 0

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

[State 1000, Effect]
type = PlaySnd
trigger1 = AnimElem = 1
value = 2, 0
channel = 1

[State 1000, Effect]
type = PlaySnd
trigger1 = AnimElem = 15
trigger2 = AnimElem = 16
value = 199,0

[State 1000, Spark]
type = Explod
trigger1 = AnimElem = 15
Anim = 1290
pos = 45, -60
postype = p1
ownpal = 1
bindtime = -1
ignorehitpause = 1
removeongethit = 1
sprpriority = 4
scale = .5,.5

[State 1000, Spark]
type = Explod
trigger1 = AnimElem = 15
Anim = 1290
pos = 45, -20
postype = p1
ownpal = 1
bindtime = -1
ignorehitpause = 1
removeongethit = 1
sprpriority = 5
scale = .5,.5

[State 1000, Spark]
type = Explod
trigger1 = AnimElem = 16
Anim = 8320
pos = 60, -40
postype = p1
ownpal = 1
bindtime = -1
ignorehitpause = 1
removeongethit = 1
sprpriority = 5
scale = .5,.5

[State -2, Sparks]
type=helper
trigger1 = AnimElem = 1
helpertype=normal
stateno=8105
ID=8000
name="Spark"
postype=p1
pos = 40, -80
ownpal=1
pausemovetime=65535
supermovetime=65535
ignorehitpause=1
size.xscale =1.1
size.yscale =1.1

[State 1000, Effect]
type = PlaySnd
trigger1 = AnimElem = 9
value = 1000, 0
channel = 1

[State 1000, Effect]
type = PlaySnd
trigger1 = AnimElem = 9
value = 1100,0
channel = 10

[State 0, Explod]
type = Explod
trigger1 = animelem = 9
anim = 1092
pos = 8,-87
postype = p1
bindtime = 1
removetime = -2
supermove
pausemove
scale = .5,.5
sprpriority = 3
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 1

[State 1000, ChangeState]
type = ChangeState
trigger1 = AnimTime = 0
value = 0



;---------------------------------------------------------------------------
;Guile Statue
[Statedef 10197]
ctrl = 0
anim = 10197
sprpriority = -1
velset = 0,0

[State 10197, ChangeState]
type = ChangeState
trigger1 = root,stateno = 199
value = 10198


[Statedef 10198]
ctrl = 0
anim = 10198
velset = 0,0

[State 190, Voice]
type = PlaySnd
trigger1 = AnimElem = 4
value = 100, 3

[State 1000, Effect]
type = PlaySnd
trigger1 = AnimElem = 8
value = 100, 6

[State 903, EnvShake]
type = EnvShake
trigger1 = AnimElem = 8
time = 8
ampl = 2

[State 1000, Spark]
type = Explod
trigger1 = AnimElem = 8
Anim = 7102
pos = -16, 0
postype = p1
ownpal = 1
sprpriority = -3
;pausemovetime = -1
supermovetime = -1
scale = .5,.5

[State 1000, ChangeState]
type = ChangeState
trigger1 = root,stateno = 199 && root,animelem = 16
value = 10199


[Statedef 10199]
ctrl = 0
anim = 10199
velset = 0,0

[State 190, 2]
type = AssertSpecial
trigger1 = 1
flag = Intro
flag2 = noshadow

[State 8200, Transparency]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256-(time*10),time*10

[State 8200, Destroy]
type = DestroySelf
trigger1 = Time = 25
---------------------------------------------------------------------------
; Taunt
[Statedef 195]
type = S
ctrl = 0
anim = 195
velset = 0,0
movetype = I
physics = S
sprpriority = 2

[State 0, PowerAdd]
type = PowerAdd
trigger1 = time = 0
value = 100


[State 195, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;===========================================================================
;=================================<THROWS>==================================
;===========================================================================
;----------------throw punches----------------
[Statedef 800]
type    = S
movetype = A
physics = S
juggle = 0
velset = 0,0
ctrl = 0
anim = 800
poweradd=36*!var(20)

[State 900, 1]
type = HitDef
triggerall = Anim = 800
triggerall = P2MoveType != H
triggerall = P2StateNo != [150,155]
trigger1 = AnimElem = 2
attr = S, NT
hitflag = M-
priority = 3, Miss
sparkno = -1
p1facing = ifelse(command = "holdfwd", 1, -1)
p2facing = 1
p1stateno = 801
p2stateno = 809
guard.dist = 0
numhits = 0

[State 900, 1]
type = HitDef
triggerall = Anim = 800
triggerall = P2StateNo != [150,155]
trigger1 = AnimElem = 2
attr = S, NT
hitflag = MF
priority = 3, Miss
sparkno = -1
p1facing = ifelse(command = "holdfwd", 1, -1)
p2facing = 1
p1stateno = 801
p2stateno = 809
guard.dist = 0
numhits = 0

[State 105, 1]
type = statetypeset
trigger1 = AnimElem = 4
movetype = I

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 3
value = S0,0
volume = 0
channel = 5

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 3
value = S5000,0
volume = 0
channel = 1

[State 900, 2]
type = ChangeState
Trigger1 = AnimTime = 0
value = 0
ctrl = 1
;----------------throw kicks----------------
[Statedef 820]
type    = S
movetype = A
physics = S
juggle = 0
velset = 0,0
ctrl = 0
anim = 810
poweradd=36*!var(20)

[State 900, 1]
type = HitDef
triggerall = Anim = 810
triggerall = P2MoveType != H
triggerall = P2StateNo != [150,155]
trigger1 = AnimElem = 2
attr = S, NT
hitflag = M-
priority = 3, Miss
sparkno = -1
p1facing = ifelse(command = "holdfwd", 1, -1)
p2facing = 1
p1stateno = 811
p2stateno = 819
guard.dist = 0
numhits = 0

[State 900, 1]
type = HitDef
triggerall = Anim = 810
triggerall = P2StateNo != [150,155]
trigger1 = AnimElem = 2
attr = S, NT
hitflag = MF
priority = 3, Miss
sparkno = -1
p1facing = ifelse(command = "holdfwd", 1, -1)
p2facing = 1
p1stateno = 811
p2stateno = 819
guard.dist = 0
numhits = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 3
value = S0,0
volume = 0
channel = 5

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 3
value = S5000,0
volume = 0
channel = 1

[State 105, 1]
type = statetypeset
trigger1 = AnimElem = 4
movetype = I

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

;---------------------------------------------------------------------------
[Statedef 801]
type    = S
movetype = A
physics = N
poweradd = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S1,9
volume = 0
channel = -1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 19
value = S0,2
volume = 100
channel = -1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 4
value = S3,0
volume = 0
channel = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 19
value = S3,2
volume = 0
channel = 1

[State 1201, 2]
type = Playerpush
trigger1 = 1
value = 0

[State 901, Throw]
type = TargetState
trigger1 = Time = 0
value = 805

[State 1025, p2fx]
type=helper
trigger1= animelemtime(19)=1; movehit && numtarget && numhelper(7300)<1
;trigger1= !(target,time) && (target,movetype=H)
helpertype=normal
stateno=7300
ID=7300
name="p2fx"
postype=p2
bindtime=1000
ownpal=1
facing=-1
size.ground.front=0
size.ground.back=0
ignorehitpause=1
persistent=0

[State 0, PlaySnd]
type = PlaySnd
trigger1= animelemtime(4) > 0
trigger1= animelemtime(19) < 0
value = S2000,12
volume = -150
channel = -1

[State 1710, FireB]
type = Explod
triggerall= animelemtime(4) > 0
triggerall= animelemtime(19) < 0
triggerall = p2movetype = H
trigger1 = numexplod(7300) < 1
ignorehitpause = 1
anim = 7301
id = 7300
scale = 0.55,0.55
postype = p2
pos=((enemynear,const(size.mid.pos.x))+5),30
random = 20,60
bindtime = -1
sprpriority = 2
ownpal = 1
removetime = 15

[State 1710, FireA]
type = Explod
triggerall= animelemtime(4) > 0
triggerall= animelemtime(19) < 0
triggerall = p2movetype = H
trigger1 = numexplod(7300) < 1
ignorehitpause = 1
anim = 7301
id = 7300
scale = 0.55,0.55
postype = p2
pos=((enemynear,const(size.mid.pos.x))+5),30
random = 20,60
bindtime = -1
sprpriority = 2
ownpal = 1
removetime = 15

[State 820, Anim]
type = ChangeAnim
trigger1 = Time = 0
value = 801
persistent = 0

[State 3001, Width]
type = Width
trigger1 = animelemtime(19) < 0
edge = 60,0

[State 3001, Width]
type = Width
trigger1 = animelemtime(19) = 0
edge = 90,0

[State 901,1]
type = TargetBind
trigger1 = animelem = 1
pos = 35,0
postype = P1
time = -1

[State 901,1]
type = TargetBind
trigger1 = animelem = 2
pos = 20,-5
postype = P1
time = -1

[State 901,1]
type = TargetBind
trigger1 = animelem = 3
trigger2 = animelem = 16
pos = 27,-114
postype = P1
time = -1

[State 901,1]
type = TargetBind
trigger1 = animelem = 4
trigger2 = animelem = 7
trigger3 = animelem = 10
trigger4 = animelem = 13
pos = 54,-134
postype = P1
time = -1

[State 901,1]
type = TargetBind
trigger1 = animelem = 5
trigger2 = animelem = 8
trigger3 = animelem = 11
trigger4 = animelem = 14
pos = 56,-135
postype = P1
time = -1

[State 901,1]
type = TargetBind
trigger1 = animelem = 6
trigger2 = animelem = 9
trigger3 = animelem = 12
trigger4 = animelem = 15
pos = 54,-133
postype = P1
time = -1

[State 901,1]
type = TargetBind
trigger1 = animelem = 17
pos = 11, -113
postype = P1
time = -1

[State 901,1]
type = TargetBind
trigger1 = animelem = 18
pos = 12, -107
postype = P1
time = -1

[State 901,1]
type = TargetBind
trigger1 = animelem = 19
pos = 70, -20
postype = P1

[State 3001, Add Hits]
type = HitAdd
trigger1 = AnimElem = 19
value = 1

[State 901, Hurt]
type = TargetLifeAdd
trigger1 = AnimElem = 19
value = -80

[State 901, Hurt]
type = TargetPowerAdd
trigger1 = AnimElem = 19
value = 35

[State 901, State End]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
[Statedef 805]
type    = A
movetype = H
physics = N
velset = 0,0
sprpriority = -1

[State 1201, screenbound]
type = screenbound
trigger1 = animelemtime(8) < 0
value = 1

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

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

[State 903, Shock]
type = PalFX
trigger1 = animelemtime(4) = 1
time = 105
add = 10,10,100
sinadd = -20,-20,-89,8
color = 20

[State 1100, Velocity]
type = VelSet
trigger1 = AnimElem = 8
x = -6.5
y = -9

[State 903, Vel]
type = veladd
trigger1 = AnimElemTime(8) > 0
y = .49

[State 903, EnvShake]
type = EnvShake
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
time = 20

[State 903, 2]
type = SelfState
triggerall = AnimElemTime(8) > 0
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 5100

;---------------------------------------------------------------------------
[Statedef 809]
type    = A
movetype = H
physics = N
velset = 0,0
ctrl = 0

[State 1205, ChangeState]
type = selfstate
trigger1 = Time > 5
value = 5100

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

;---------------------------------------------------------------------------
[Statedef 811]
type    = S
movetype = A
physics = N
poweradd = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S1,9
volume = 0
channel = -1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 4
value = S180,5
volume = 0
channel = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 4
value = S0,2
volume = 100
channel = 5

[State 1201, 2]
type = Playerpush
trigger1 = 1
value = 0

[State 901, Throw]
type = TargetState
trigger1 = Time = 0
value = 815

[State 820, Anim]
type = ChangeAnim
trigger1 = Time = 0
value = 811
persistent = 0

[State 3001, Width]
type = Width
trigger1 = animelemtime(3) < 0
edge = 60,0

[State 3001, Width]
type = Width
trigger1 = animelemtime(3) >= 0 && animelemtime(4) < 0
edge = 75,0

[State 3001, Width]
type = Width
trigger1 = animelemtime(4) >= 0 && animelemtime(5) < 0
edge = 90,0

[State 3001, Width]
type = Width
trigger1 = animelemtime(5) = 0
edge = 160,0

[State 901,1]
type = TargetBind
trigger1 = animelem = 1
pos = -48, 0
postype = P1
time = -1

[State 901,1]
type = TargetBind
trigger1 = animelem = 2
pos = -58, -80
postype = P1
time = -1

[State 901,1]
type = TargetBind
trigger1 = animelem = 3
pos = 4, -85
postype = P1
time = -1

[State 901,1]
type = TargetBind
trigger1 = animelem = 4
pos = 70, -84
postype = P1
time = -1

[State 901,1]
type = TargetBind
trigger1 = animelem = 5
pos = 100, -30
postype = P1
time = 1

[State 3001, Add Hits]
type = HitAdd
trigger1 = AnimElem = 5
value = 1

[State 901, Hurt]
type = TargetLifeAdd
trigger1 = animelem = 5
value = -80

[State 901, Hurt]
type = TargetPowerAdd
trigger1 = AnimElem = 5
value = 35

[State 220, Position]
type = PosAdd
trigger1 = AnimTime = 0
x = 11

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

;---------------------------------------------------------------------------
[Statedef 815]
type    = A
movetype = H
physics = N
velset = 0,0
sprpriority = 3

[State 1201, screenbound]
type = screenbound
trigger1 = AnimElemTime(5) < 0
value = 1

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

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

[State 1100, Velocity]
type = VelSet
trigger1 = AnimElemTime(5) = 0
x = -6
y = -7

[State 903, Vel]
type = veladd
trigger1 = AnimElemTime(5) > 0
y = .49

[State 1300,Turn]
type = Turn
trigger1 = AnimElemTime(5) > 0
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0

[State 903, 2]
type = SelfState
trigger1 = AnimElemTime(5) > 0
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 5100

;---------------------------------------------------------------------------
[Statedef 819]
type    = A
movetype = H
physics = N
velset = 0,0
ctrl = 0

[State 1201, screenbound]
type = screenbound
trigger1 = 1
value = 1

[State 1205, ChangeState]
type = selfstate
trigger1 = Time > 5
value = 5100

[State 170, 1]
type = NotHitBy
trigger1 = 1
value = SCA
;==================================================================================
;============| AI HELPERS |===========================================
;==================================================================================

[StateDef 9741]
type = S
movetype = I
physics = N
anim = 9741
ctrl = 0

[State 9741, Safety]; Just in case your opponent is very poorly coded.
type = SelfState
trigger1 = !IsHelper
value = 5050

[State 9741, UglyHack]
type = VarSet
trigger1 = !var(1)
var(2) = 2

[State 9741, PauseCheck]
type = VarSet
trigger1 = GameTime > Parent,var(57)
trigger2 = !(Parent,Alive)
trigger3 = RoundState != 2
trigger4 = Parent,var(58)
trigger5 = var(3):=0
var(2) = (var(3):=1)+(var(4):=0)

[State 9741, Facing]
type = Turn
trigger1 = var(9):=(Facing != Parent,Facing)
trigger1 = !(var(4):=0)

[State 9741, DirTurnOnAI]
type = ParentVarSet
triggerall = !(var(3) || var(9))
trigger1 = Parent,command = "holdfwd"
trigger2 = Parent,command = "holdback"
trigger3 = Parent,command = "holdup"
trigger4 = Parent,command = "holddown"
trigger5 = !(var(4):=1)
var(58) = var(4)

[State 9741, DirTurnOffAI]
type = ParentVarSet
triggerall = !var(3)
triggerall = Parent,var(58)
trigger1 = command = "holdfwd"
trigger1 = Parent,command = "holdfwd"
trigger2 = command = "holdback"
trigger2 = Parent,command = "holdback"
trigger3 = command = "holdup"
trigger3 = Parent,command = "holdup"
trigger4 = command = "holddown"
trigger4 = Parent,command = "holddown"
var(58) = var(4):=0

[State 9741, ButtonTurnOnAI]
type = ParentVarSet
triggerall = !var(2)
trigger1 = Parent,command = "a"
trigger2 = Parent,command = "b"
trigger3 = Parent,command = "c"
trigger4 = Parent,command = "x"
trigger5 = Parent,command = "y"
trigger6 = Parent,command = "z"
trigger7 = Parent,command = "start"
var(58) = 1

[State 9741, ButtonTurnOffAI]
type = ParentVarSet
triggerall = !var(2)
trigger1 = command = "a"
trigger1 = Parent,command = "a"
trigger2 = command = "b"
trigger2 = Parent,command = "b"
trigger3 = command = "c"
trigger3 = Parent,command = "c"
trigger4 = command = "x"
trigger4 = Parent,command = "x"
trigger5 = command = "y"
trigger5 = Parent,command = "y"
trigger6 = command = "z"
trigger6 = Parent,command = "z"
trigger7 = command = "start"
trigger7 = Parent,command = "start"
var(58) = -1

[State 9741, UnPauseCheck]
type = VarSet
triggerall = var(2)
trigger1 = Parent,command = "a"
trigger2 = Parent,command = "b"
trigger3 = Parent,command = "c"
trigger4 = Parent,command = "x"
trigger5 = Parent,command = "y"
trigger6 = Parent,command = "z"
trigger7 = Parent,command = "start"
trigger8 = var(2) = 2
trigger8 = var(2):=0
var(2) = 2

[State 9741, Goodbye]
type = DestroySelf
triggerall = var(1):=1
trigger1 = Parent,var(58)
trigger2 = !(Parent,Alive)
trigger3 = RoundState != 2

[StateDef 9742]
type = S
movetype = I
physics = N
anim = 9741
ctrl = 0

[State 9742, Safety]; Just in case your opponent is very poorly coded.
type = SelfState
trigger1 = !IsHelper
value = 5050

[State 9742, UglyHack]
type = VarSet
trigger1 = !var(1)
var(2) = var(3):=2

[State 9742, PauseCheck]
type = VarSet
trigger1 = GameTime > Parent,var(57)
trigger2 = !(Parent,Alive)
trigger3 = RoundState != 2
trigger4 = Parent,var(58)
trigger5 = var(1)
trigger5 = var(3):=0
var(2) = var(3):=1

[State 9742, Facing]
type = Turn
trigger1 = var(9):=(Facing != Parent,Facing)

[State 9742, ParentDirCheck]
type = VarSet
trigger1 = Parent,command = "holdfwd"
trigger2 = Parent,command = "holdback"
trigger3 = Parent,command = "holdup"
trigger4 = Parent,command = "holddown"
trigger5 = var(6):=0
var(6) = 1

[State 9742, BufferCheck]
type = VarSet
trigger1 = var(3) || var(4) || var(10)
var(10) = var(6)

[State 9742, ParentButtonCheck]
type = VarSet
trigger1 = Parent,command = "a"
trigger2 = Parent,command = "b"
trigger3 = Parent,command = "c"
trigger4 = Parent,command = "x"
trigger5 = Parent,command = "y"
trigger6 = Parent,command = "z"
trigger7 = Parent,command = "start"
trigger8 = var(7):=0
var(7) = 1

[State 9742, SameButtonCheck]
type = VarSet
triggerall = var(7)
triggerall = !var(2)
triggerall = NumPartner
trigger1 = Parent,command = "a"
trigger1 = Partner,command = "a"
trigger2 = Parent,command = "b"
trigger2 = Partner,command = "b"
trigger3 = Parent,command = "c"
trigger3 = Partner,command = "c"
trigger4 = Parent,command = "x"
trigger4 = Partner,command = "x"
trigger5 = Parent,command = "y"
trigger5 = Partner,command = "y"
trigger6 = Parent,command = "z"
trigger6 = Partner,command = "z"
trigger7 = Parent,command = "start"
trigger7 = Partner,command = "start"
trigger8 = var(8):=0
var(8) = 1

[State 9742, DirTurnOnAI]
type = ParentVarSet
trigger1 = var(6)
trigger1 = !(var(9) || var(10))
var(58) = 1

[State 9742, DirTurnOffAI]
type = ParentVarSet
triggerall = var(6)
triggerall = !var(3)
triggerall = Parent,var(58)
trigger1 = command = "holdfwd"
trigger1 = Parent,command = "holdfwd"
trigger2 = command = "holdback"
trigger2 = Parent,command = "holdback"
trigger3 = command = "holdup"
trigger3 = Parent,command = "holdup"
trigger4 = command = "holddown"
trigger4 = Parent,command = "holddown"
var(58) = 0

[State 9742, ButtonTurnOnAI]
type = ParentVarSet
trigger1 = var(5) && var(7)
trigger1 = !(var(2) || var(8))
var(58) = 1

[State 9742, ButtonTurnOffAI]
type = ParentVarSet
triggerall = var(7)
triggerall = !(var(2) || var(8))
trigger1 = command = "a"
trigger1 = Parent,command = "a"
trigger2 = command = "b"
trigger2 = Parent,command = "b"
trigger3 = command = "c"
trigger3 = Parent,command = "c"
trigger4 = command = "x"
trigger4 = Parent,command = "x"
trigger5 = command = "y"
trigger5 = Parent,command = "y"
trigger6 = command = "z"
trigger6 = Parent,command = "z"
trigger7 = command = "start"
trigger7 = Parent,command = "start"
var(58) = -1

[State 9742, UnPauseCheck]
type = VarSet
triggerall = var(2)
triggerall = !var(4)
trigger1 = var(7)
trigger2 = var(2) = 2
trigger2 = var(2):=0
var(2) = 2

[State 9742, Goodbye]
type = DestroySelf
trigger1 = Parent,var(58)
trigger2 = !(Parent,Alive)
trigger3 = RoundState != 2

[State 9742, HitPauseCheck]
type = VarSet
trigger1 = var(6) || var(7)
trigger2 = !(Parent,HitPauseTime)
var(4) = Parent,HitPauseTime

[State 9742, Delay]
type = VarSet
trigger1 = var(1):=1
var(5) = !var(7)

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

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

[StateDef -2]

[State -2, StopAI]
type = VarSet
triggerall = var(58) > 0 && !IsHelper
trigger1 = RoundState != 2
trigger2 = !Alive
var(58) = -2
IgnoreHitPause = 1

[State -2, Simplifier]
type = VarSet
triggerall = !IsHelper
trigger1 = var(58) = 1
trigger2 = var(0):=0
var(0) = 1
IgnoreHitPause = 1

[State 0, VarSet]
type = VarSet
trigger1 = 1
v = 59
value = var(58)
;============================== DEBUG ====================================
[State -2, Debug]
type=displaytoclipboard
trigger1= 1
text="AI=%d Damage=%f NoJuggle=%d Focus=%d Counter=%d "
params=var(58), fvar(10), var(15), var(16), var(19)
ignorehitpause=1
;============================= HIT COUNT ======================
[State -2, Hitcount]
type=varadd
trigger1= movehit=1
trigger1= !(hitdefattr=SCA,AT)
var(14)=1

[State -2, Hitcount Reset]
type=varset
trigger1= numenemy && var(14)
trigger1= (enemynear,movetype!=H) && (enemynear,stateno!=5300)
var(14)=0
ignorehitpause=1
;============================ HITSPARKS ==================================
[State -2, Hit Detection]
type=varset
trigger1= movecontact!=1
var(30)=2
ignorehitpause=1

[State -2, Sparks]
type=helper
triggerall= movecontact=1 && var(30)=1
trigger1= movehit=1 && numenemy
trigger1= var(33)=8010  || var(33)=8015 || var(33)=8020 || var(33)=8021 || var(33)=8025 || var(33)=8030 || var(33)=8035
trigger2= moveguarded=1 && numenemy
trigger2= var(34)=8100 || var(34)=8105
helpertype=normal
stateno=ifelse(moveguarded, var(34), var(33))
ID=8000
name="Spark"
postype=p1
pos= ifelse(p2dist x<0, (ceil(p2dist x)), ifelse(p2dist x<var(35), ceil(p2dist x), var(35))), var(36)
facing= ifelse((p2bodydist x >=-5),-1,1);-1;enemynear,facing
ownpal=1
pausemovetime=65535
supermovetime=65535
ignorehitpause=1
size.xscale =1.1
size.yscale =1.1

[State -2, Counter FX]
type=helper
trigger1= movehit=1 && var(30)=1
trigger1= numenemy && var(19)
trigger1= !(hitdefattr=SCA,AT)
helpertype=normal
stateno=8011
ID=8011
name="Counter FX"
postype=p1
pos= ifelse(p2dist x<0, (ceil(p2dist x)), ifelse(p2dist x<var(35), ceil(p2dist x), var(35))), var(36)
facing= -1
ownpal=1
pausemovetime=255
supermovetime=255
ignorehitpause=1

[State -2, Counter Flag]
type=varset
trigger1= numenemy
var(19)=ifelse((enemynear,movetype=A),1,0)
ignorehitpause=1

[State -2, Pause] ;Counter Pause
type = Pause
triggerall = enemynear,alive
trigger1= numenemy ;&& var(19)
trigger1= numhelper(8011);=1
time = 6
movetime = 6
ignorehitpause = 1

[State -2, Hit Detection]
type=varrangeset
trigger1= movetype=I
trigger2= movetype=H && time
first=30
last=36
value=-1
ignorehitpause=1

[State -2, Hit Detection]
type=varadd
trigger1= var(30)>0
var(30)=-1
ignorehitpause=1
;--------------------------------------------------------------
[State -2, P2 Facing]
type=targetfacing
trigger1= movecontact=1 && numtarget
trigger1= !(target,hitshakeover) && !(target,hitfall) && (target,time<=1)
value= ifelse(p2dist x>=0, -1, 1)
ignorehitpause=1
;=========================== DAMAGE DAMPENER ==========================
[State -2, Damage based on hits]
type=varset
trigger1= numenemy
fvar(12)= enemynear,gethitvar(hitcount)
ignorehitpause=1

[State -2, Reset var when the opponent recovers]
type=varset
trigger1= numenemy
trigger1= (enemynear,movetype!=H)
trigger2= !numenemy
fvar(12)=0

[State -2, Dampener]
type=varset
trigger1 = var(20)<=0
trigger1 = stateno != [3000,3999]
fvar(10)= ifelse((fvar(12)>=20),.05,(1.00-(fvar(12)*.05)))
ignorehitpause=1

[State -2, Dampener For Supers]
type=varset
trigger1 = var(20)<=0
trigger1 = stateno = [3000,3999]
trigger1 = prevstateno = [2000,2999]
fvar(10)= .7
ignorehitpause=1

[State -2, Dampener For Supers]
type=varset
trigger1 = var(20)<=0
trigger1 = stateno = [3000,3999]
trigger1 = prevstateno = [1000,1999]
fvar(10)= .8
ignorehitpause=1

[State -2, Dampener For Supers]
type=varset
trigger1 = var(20)<=0
trigger1 = stateno = [3000,3999]
trigger1 = prevstateno = [200,699]
fvar(10)= .9
ignorehitpause=1

[State -2, Dampener For Custom Combo]
type=varset
trigger1 = var(20)>0
fvar(10)= .45
ignorehitpause=1

[State -2, VarSet]
type = VarSet
trigger1 = 1
fv = 11
value = (fvar(10)*ifelse(var(19),1.2,1))

[State -2, Dampener itself]
type=attackmulset
trigger1= 1
value=fvar(11)
ignorehitpause=1
;============================= CUSTOM COMBO ============================
[State -2, End]
type=varset
trigger1= var(20)<0
trigger2= movetype=H
trigger3= roundstate!=2
trigger4= (power <= 0) && (stateno != [3000,3999])
;trigger5= stateno = [3000,3999]
var(20)=0
ignorehitpause=1

[State -2, Original Combo Time]
type=varadd
trigger1= var(20)>0
var(20)=-1
ignorehitpause=1

[State -2, Free Juggling]
type=assertspecial
trigger1= var(20)>0
trigger2= roundstate!=2
flag=nojugglecheck
ignorehitpause=1

[State -2, Original Combo Guard]
type=assertspecial
trigger1= var(20)>0
flag= nostandguard
flag2=nocrouchguard
flag3=noairguard
ignorehitpause=1

[State -2, Original Combo PalFX]
type=palfx
trigger1= var(20)>60
time=2
add=32+ceil(sin(var(20)/16.0*pi)*32),32+ceil(sin(var(20)/16.0*pi)*32),32+ceil(sin(var(20)/16.0*pi)*32)
ignorehitpause=1

[State -2, Original Combo PalFX]
type=palfx
trigger1= var(20)=[1,60]
time=2
add=64+ceil(sin(var(20)/8.0*pi)*64),64+ceil(sin(var(20)/8.0*pi)*64),64+ceil(sin(var(20)/8.0*pi)*64)
ignorehitpause=1

[State -2, PowerAdd]
type = PowerAdd
trigger1 = var(20) > 0
value = ifelse((movetype = A),-13,-10)
ignorehitpause = 1
;persistent =

;============================= SPECIAL KO  ===================
[State -2, HyperComboFinish]
type = Helper
triggerall = roundstate >= 2
triggerall = WinKo && !var(37)
trigger1 = stateno = [3000, 3999]
;trigger2 = Var(18)
;trigger3 = fvar(9)=12
;trigger4 = projhittime(3005) = 1 || projhittime(3405) = 1
ID = 9000
stateno = 9994;ifelse(fvar(9)=12,9020,ifelse((var(20)=[3,5]),9010,9000))
postype = back
pos = 0,0
pausemovetime = 999999
supermovetime = 999999
ignorehitpause = 1
ownpal = 1

[State -2, SpecialComboFinish]
type = Helper
triggerall = roundstate >= 2
triggerall = WinKo && !var(37)
trigger1 = stateno = [1000, 1999]
trigger2 = stateno = [2000, 2999]
;trigger2 = Var(18)
;trigger3 = fvar(9)=12
;trigger4 = projhittime(3005) = 1 || projhittime(3405) = 1
ID = 9001
stateno = 9995;ifelse(fvar(9)=12,9020,ifelse((var(20)=[3,5]),9010,9000))
postype = back
pos = 0,0
pausemovetime = 999999
supermovetime = 999999
ignorehitpause = 1
ownpal = 1

[State -2,KO]
type = Varadd
trigger1 = roundstate = 3
ignorehitpause = 1
var(37) = 1

[State -2,KO]
type = Varset
trigger1 = roundstate = 0
ignorehitpause = 1
var(37) = 0
;=========================== P2 FACING ============================
[State -2, targetfacing]
type=targetfacing
trigger1= movecontact=1 && numtarget
trigger1= !(target,hitshakeover) && !(target,hitfall) && (target,time<=1)
value= ifelse(p2dist x>=0, -1, 1)
ignorehitpause=1
;========================= P2 TECH RECOVER =====================
[State -2, varset]
type= varset
trigger1= movehit=1
var(25)= (stateno=[200,1999])
ignorehitpause=1

[State -2, targetstate]
type= targetstate
trigger1= var(25)
trigger1= roundstate=2 && (ctrl || movetype=H)
trigger1= numtarget
trigger1= target,command="recovery"
trigger1= target,alive && target,hitfall
trigger1= target,stateno=5030 || target,stateno=5035 || target,stateno=5050
trigger1= target,pos y>=-15
value= 5205 + 0*(var(25):=0)
ignorehitpause=1

[State -2, varset]
type= varset
triggerall= var(25)
trigger1= !numtarget || var(20)>0>0
trigger2= numenemy=1
trigger2= enemy,statetype!=A
trigger3= numenemy>=2
trigger3= enemynear(0),statetype!=A && enemynear(1),statetype!=A
;trigger4= numhelper(3005)
;trigger4= helper(3005),var(3)
var(25)= 0
ignorehitpause=1
;==================================================================================
 ;---------------------------------------------------------------------------
; States that are executed when in self's state file (use statedef -3)
;---------------------------------------------------------------------------

[Statedef -3]

[State -3, SetAI]
type = VarSet
triggerall = Alive && !IsHelper
triggerall = IsHomeTeam
trigger1 = TeamSide = 2
trigger2 = MatchNo > 1
var(58) = 1

[State -3, AI Helper - Compatibly Partnered Version]
type = Helper
trigger1 = !var(58) && !IsHelper
trigger1 = !NumHelper(9742)
trigger1 = Alive && RoundState = 2
trigger1 = NumPartner
trigger1 = Partner,SelfAnimExist(9741)
HelperType = normal
name = "AI Helper (Simul Version)"
ID = 9742
pos = 9999999,99999
StateNo = 9742
KeyCtrl = 1
PauseMoveTime = 2147483647
SuperMoveTime = 2147483647

[State -3, AI Helper]
type = Helper
triggerall = !var(58) && !IsHelper
triggerall = !NumHelper(9741)
triggerall = Alive && RoundState = 2
trigger1 = !NumPartner
trigger2 = !(Partner,SelfAnimExist(9741))
HelperType = normal
name = "AI Helper"
ID = 9741
pos = 9999999,99999
StateNo = 9741
KeyCtrl = 1
PauseMoveTime = 2147483647
SuperMoveTime = 2147483647

[State -3, TurnBackOnAI]
type = VarSet
trigger1 = var(58) = -2 && !IsHelper
trigger1 = Alive && RoundState = 2
var(58) = 1

[State -3, GameTimeVar]
type = VarSet
trigger1 = !IsHelper
var(57) = GameTime
IgnoreHitPause = 1

;==================================================================================
;==================================================================================
;==================================================================================

;======================== GET HIT SOUND ==========================
[State -3, StopSnd]
type = StopSnd
trigger1 = movetype = h
channel = 1
ignorehitpause=1

[State -3, playsnd]
type=playsnd
triggerall= alive && time=1
triggerall= stateno=5000 || stateno=5010
trigger1= gethitvar(animtype)>=2 && random<500
trigger2= gethitvar(animtype)=1 && random<375
trigger3= gethitvar(animtype)=0 && random<250
value=5000,0+(random%3)
channel=0
ignorehitpause=1

[State -3, playsnd]
type=playsnd
triggerall= alive && time=1
trigger1= (stateno=5000 || stateno=5010) && numenemy
trigger1= gethitvar(fall) || (enemynear,hitdefattr=SCA,SA,HA)
trigger2= (stateno=5020 || stateno=5070 || stateno=5080)
trigger3= (stateno=5050 || stateno=5100) && (prevstateno!=[5000,5199])
value=5000,0+(random%3)
channel=0
ignorehitpause=1

;========================= CHEAP KO ===========================
[State -3, changestate]
type=changestate
trigger1= !alive && (stateno=[5000,5010])
trigger1= (prevstateno=[130,131]) || (prevstateno=[140,141]) || (prevstateno=[150,153])
value=5950
ignorehitpause=1

[State -3, Cchangestate]
type=assertspecial
trigger1= (stateno=[5000,5010])
trigger1= (prevstateno=[130,131]) || (prevstateno=[140,141]) || (prevstateno=[150,153])
flag=nokosnd
ignorehitpause=1
;=============================== LANDING FX ==============================
[State -3, Landing Anim]
type = Explod
triggerall = Time = 1
;trigger1 = stateno = 52 ;Jump land
trigger1 = stateno = 106
trigger2 = stateno = 101
trigger3 = stateno = 1601
trigger4 = stateno = 1105
trigger5 = stateno = 2601
trigger6 = stateno = 3410
trigger7 = stateno = 103
trigger8 = stateno = 3105
anim = 7102
ID = 7102
pos = 2,0
postype = p1
bindtime = 1
removetime = -2
supermove = 9999
pausemove = 9999
scale = .45,.5
sprpriority = -1
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause =1
persistent =0

[State -3, Landing Sound]
type = PlaySnd
triggerall = Time = 1
;trigger1 = stateno = 52 ;Jump land
trigger1 = stateno = 106 ;Run-back land
trigger2 = stateno = 101
trigger3 = stateno = [900,901]
trigger4 = stateno = 1601
trigger5 = stateno = 1105
trigger6 = stateno = 2601
trigger7 = stateno = 3410
trigger8 = stateno = 103
trigger9 = stateno = 3105
value = s52,0
;======================= SUPER JUMP AFTERIMAGE ==========================
[State -3, AfterImage]
type=afterimage
triggerall = var(20)<=0
triggerall= time=1
trigger1= stateno=50 && ((var(23)) || (var(23)))
time=2
timegap=1
framegap=4
length=9
palbright=0,0,0
palcontrast=128,128,128
palpostbright=0,0,0
paladd=0,0,0
palmul=.9,.9,.9
trans=add1
;======================= EX MOVES FX ===========================
[State -3, Ex Flash]
type=palfx
triggerall = var(20)<=0
triggerall =stateno = [2000,2999]
trigger1= !(gametime%3)
time=1
color= 0
mul= 256, 250, 0
add= 150,150,150
ignorehitpause=1

;[State -3, AfterImage]
;type=afterimage
;triggerall = var(20)<=0
;trigger1= stateno = [2000,2999]
;trigger1 =time=1
;time=6
;timegap=1
;framegap=1
;length=4
;palbright=0,0,0
;palcontrast=250,220,0
;palpostbright=0,0,0
;paladd=0,0,0
;palmul=.75,.75,.75
;trans=add1
;palcolor=256
;===========================SUPER LVL1 AFTERIMAGE =============
[State -3, AfterImage]
type=afterimage
triggerall = var(20)<=0
triggerall =time=45
trigger1 = stateno = 3000
trigger2 = stateno = 3500
trigger3 = stateno = 3100
time=2
timegap=1
framegap=12
length=25
palbright=0,0,0
palcontrast=128,128,128
palpostbright=0,0,0
paladd=0,0,0
palmul=.75,.75,.75
trans=add1
;===========================SUPER LVL2 AFTERIMAGE ==============
[State -3, AfterImage]
type=afterimage
triggerall = var(20)<=0
triggerall =time=45
trigger1 = stateno = 3050
trigger2 = stateno = 3400
trigger3 = stateno = 3550
time=2
timegap=1
framegap=12
length=25
palbright=0,0,0
palcontrast=32,32,160
palpostbright=0,0,0
paladd=0,0,0
palmul=.75,.75,.75
trans=add1
;===========================SUPER LVL3 AFTERIMAGE ==============
[State -3, AfterImage]
type=afterimage
triggerall = var(20)<=0
triggerall =time=45
trigger1 = stateno = 3300
time=2
timegap=1
framegap=12
length=25
palbright=1,1,1
palcontrast=150,50,50
paladd=0,0,0
palmul=.5,.5,.5
trans=add1

[State -3, AfterImage persist]
type=afterimagetime
trigger1= (stateno=50 || (stateno=[600,699])) && (var(20)<=0)
trigger1= (var(23)) && (vel y <-2)
trigger2= (stateno=50 || (stateno=[600,699])) && (var(20)<=0)
trigger2= (var(23)) && (vel y <-2)
;trigger3= (stateno=[2000,2999]) && (var(20)<=0)
trigger3 = stateno = [3000,3999]
trigger3 = (var(20)<=0)
;trigger4= (stateno=[1600,1603]) && (var(20)<=0)
trigger4= var(20)>0
ignorehitpause=1
time=2

;=========================== SLOW MOTION ===============================
;[State -3,Slow]
;type = Pause
;trigger1 = stateno = 3100
;trigger1 = anim = 3101
;trigger1 = (GameTime%1) = 0
;trigger1 = roundstate = 2
;trigger1 = time <=60
;time = 1
;movetime = 0
;ignorehitpause = 0
;============================== PARRY ================================
[State -3, Parry Detection]
type=helper
triggerall= roundstate=2 && !numhelper(4065) ;&& !var(20)
triggerall= (movetype=I && ctrl) || (stateno=[4000,4020])
triggerall= (command!="rlsfwd" && command!="rlsback" && command!="rlsup" && command!="rlsdown") ;|| var(59)>=1
trigger1= var(59)<=0 && (statetype=S || statetype=C) && (command="Forward" || command="Down")
trigger2= var(59)<=0 && statetype=A && command="Forward"
helpertype=normal
stateno=4065
ID=4065
name="Parry Detection"
postype=p1
pausemovetime=65535
supermovetime=65535

[State -3, Parry Attacks]
type=changestate
trigger1= (stateno!=[4000,4020]) && numhelper(4065)
trigger1= helper(4065),stateno=4066
value= ifelse((helper(4065),anim=4067), 4020, ifelse((helper(4065),anim=4066), 4010, 4000))
ignorehitpause=1

[State -3, Parry Projectiles]
type=hitoverride
trigger1= (stateno!=[4000,4020]) && numhelper(4065)
trigger1= !(helper(4065),var(0)) && (helper(4065),anim=4065)
attr=SA,AP
stateno=4000
slot=0
time=1
ignorehitpause=1

[State -3, Parry Projectiles]
type=hitoverride
trigger1= (stateno!=[4000,4020]) && numhelper(4065)
trigger1= !(helper(4065),var(0)) && (helper(4065),anim=4066)
attr=C,AP
stateno=4010
slot=0
time=1
ignorehitpause=1

[State -3, Parry Projectiles]
type=hitoverride
trigger1= (stateno!=[4000,4020]) && numhelper(4065)
trigger1= !(helper(4065),var(0)) && (helper(4065),anim=4067)
attr=SCA,AP
stateno=4020
slot=0
time=1
ignorehitpause=1
;======================= CUSTOM COMBO CHAIN =====================
[State -3, Chain Reset]
type=varset
trigger1= 1
var(21)=0
ignorehitpause=1

[State -3, Chain Check]
type=varset
trigger1= var(20) && (stateno=[200,699]) && movecontact
trigger2= var(20) && (stateno=[1000,1999]) && movecontact ;&& statetype!=A && (movecontact || var(18))
trigger3= var(20) && (stateno=[1000,2999]) && (numhelper(1090))
trigger3 =helper(1090),var(5)
;trigger3= var(20) && (stateno=[1000,3999]) && (numhelper(1090)) && (helper(1090),var(5))
;trigger3= numhelper(1000) && (helper(1000),var(3))
;trigger3= var(20) && stateno=1000 && animelemtime(6)>=0
;trigger4= var(20) && stateno=1230 && animelemtime(12)>=0
;trigger5= var(20) && stateno=1250 && animelemtime(9)>=0
var(21)=1
ignorehitpause=1
;======================= NO JUGGLE VAR RESET =====================
[State -3, Hitcount Reset]
type=varset
trigger1= numenemy && var(15)
trigger1= (enemynear,movetype!=H) && (enemynear,stateno!=5300)
trigger2= numenemy && var(15)
trigger2= (enemynear,statetype!=A) ;&& (enemynear,stateno!=5300)
var(15)=0
ignorehitpause=1
;============================ FOCUS ATTACK  ==========================
[State -3, VarSet]
type = VarSet
trigger1 = stateno !=[790,794]
v = 16
value = 0

[State -3, VarSet]
type = VarSet
trigger1 = stateno !=[790,794]
v = 17
value = 0

[State -3, VarSet]
type = VarSet
trigger1 = stateno !=[790,794]
v = 18
value = 0
;============================ PATCHES ==========================
[State -3, StopSnd] ;intro sound
type = StopSnd
trigger1 = RoundState = 2
channel = 12

[State -3, StopSnd] ;intro sound
type = StopSnd
trigger1 = RoundState = 2
channel = 13

[State -3, RemoveExplod]
type = RemoveExplod
trigger1 = anim !=1000
id = 1092

[State -3, RemoveExplod]
type = RemoveExplod
trigger1 = stateno !=[1400,1420]
id = 1490

[State -3, RemoveExplod]
type = RemoveExplod
trigger1 = stateno !=[1400,1420]
id = 1491

[State -3, RemoveExplod]
type = RemoveExplod
trigger1 = stateno !=[1100,1120]
id = 1190

[State -3, RemoveExplod]
type = RemoveExplod
trigger1 = anim !=[1600,1620]
id = 1692

[State -3, RemoveExplod]
type = RemoveExplod
trigger1 = anim !=2400
id = 2491

[State -3, RemoveExplod]
type = RemoveExplod
trigger1 = anim !=2400
id = 2490

[State -3, RemoveExplod]
type = RemoveExplod
trigger1 = anim !=2100
id = 2191

[State -3, RemoveExplod]
type = RemoveExplod
trigger1 = anim !=2100
id = 2190


