[Data]
life = 800			;Amount of life to start with
attack = 75		;attack power (more is stronger)
defence = 100		;defensive power (more is stronger)
fall.defence_up = 50	;Percentage to increase defense everytime player is knocked down
liedown.time = 30		;Time which player lies down for, before getting up
airjuggle = 15		;Number of points for juggling
sparkno = 2			;Default hit spark number for HitDefs
guard.sparkno = 40	;Default guard spark number
KO.echo = 0			;1 to enable echo on KO
volume = 128			;Volume offset (negative for softer)
IntPersistIndex = 58	;Variables with this index and above will not have their values
FloatPersistIndex = 40  ;reset to 0 between rounds or matches. There are 60 int variables,

[Size]
xscale = 1
yscale = 1
ground.back = 27
ground.front = 27
air.back = 21
air.front = 15
z.width = 3
height = 60
attack.width = 4,4
attack.dist = 160
proj.attack.dist = 90
proj.doscale = 0
head.pos = 6, -81
mid.pos = -6, -53
draw.offset=0,1  		;Player drawing offset in pixels (x, y)

[Velocity]
walk.fwd  = 3.2
walk.back = -2.1
run.fwd  = 9, 0
run.back = -9,-3.75
jump.neu = 0,-9.5
jump.back = -4.5
jump.fwd = 4.5
runjump.back = -7,-10
runjump.fwd = 7,-10
airjump.neu = 0,-7.5
airjump.back = -4.5
airjump.fwd = 4.5

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

;---------------------------------------------------------------------------
; Format:
; [Statedef STATENO]
; type = ?      S/C/A/L  stand/crouch/air/liedown
; movetype = ?  I/A/H    idle/attack/gethit
; physics = ?   S/C/A/N  stand/crouch/air/none
; juggle = ?             air juggle points move requires
;
; [State STATENO, ?]     ? - any number you choose
; type = ?
; ...

;---------------------------------------------------------------------------
; Lose by Time Over
; CNS difficulty: basic
[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, winSGS]
type=changestate
trigger1=prevstateno=360
value=360

[State 0, ChangeState]
type = ChangeState
trigger1 =prevstateno!=360
value = 181+(random%2)

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

[State 0, Explod]
type = Explod
trigger1 = animelem=4
anim = 189
ID = 189
pos = ifelse(facing=-1,-2,0),0
postype = p1
facing=ifelse(facing=-1,-1,1)
bindtime = -1
removetime = -2
scale = const(size.xscale),const(size.yscale)
sprpriority = 0

[State 0, PlaySnd]
type = PlaySnd
triggerall = anim=180
trigger1 = animelem = 4
value = S3,20+(random%2)
channel = 5

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

;---------------------------------------------------------------------------
; Win
[Statedef 182]
type = S
ctrl = 0
anim = 181+(random%2)
velset = 0,0

[State 0, PlaySnd]
type = PlaySnd
triggerall = anim=181
trigger1 = animelem = 4
value = S3,20+(random%2)
channel = 5

[State 0, PlaySnd]
type = PlaySnd
triggerall = anim = 181
trigger1 = animelemtime(5)=0
value = S3,10
channel = 5

[State 0, PlaySnd]
type = PlaySnd
triggerall = anim=182
trigger1 = time=2
value = S3,4
channel = 5

[State 0, Explod]
type = Explod
triggerall = anim = 181
trigger1 = animelemtime(5)=0
anim = 8030
ID = 8030
pos = ceil(-50*const(size.xscale)),0
postype = p1
bindtime = 1
removetime = -2
scale = .6,.6
sprpriority = -1
supermovetime=9999
pausemovetime=9999
ownpal = 1
removeongethit = 1

[State 0, EnvShake]
type = EnvShake
triggerall = anim=181
trigger1 = animelem = 5
time = 20
ampl = -4
phase = 90
[State 0, PlaySnd]
type = PlaySnd
triggerall = anim=181
trigger1 = animelem = 5
value = S181,1
channel = -1

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

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

[State 194, vs Evil Ryu/Violent Ken]
type = changestate
triggerall = numenemy
triggerall = !(teammode = simul) && !(enemy, teammode = simul)
trigger1 = enemy, authorname = "DCL, Vyn, Scar" && enemy, name = "Eternity of Heroes: Ryu"
trigger1 = enemy,var(58)=2
trigger2 = enemy, authorname = "DCL, Scar" && enemy, name = "Eternity of Heroes: Ken"
trigger2 = enemy,var(58)=1
;trigger3 = enemy, authorname = "DCL, Vyn" && enemy, name = "Eternity of Heroes: Gouki"
value = 194

[State 190, 1] ;Freeze animation until PreIntro is over
type = ChangeState
trigger1 = RoundState = 0
trigger1 = palno = 12
value = 199

[State 190, 1] ;Freeze animation until PreIntro is over
type = ChangeState
trigger1 = RoundState = 0
trigger1 = palno != 12
value = 191;+(random%2)

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

[State 190, 4] ;Change to stand state
type = ChangeState
trigger1 = AnimTime = 0
value = 22
;---------------------------------------------------------------------------
; Introduction
[Statedef 191]
type = S
ctrl = 0
anim = 190+(random%2)
velset = 0,0

[State 0, Explod]
type = Explod
triggerall=anim=191
trigger1 = animelem=10
anim = 197
ID = 197
facing=ifelse(facing=-1,-1,1)
pos = ifelse(facing=-1,-24,0),0
postype = p1
bindtime = -1
removetime = -2
sprpriority = 5
ownpal = 1

[State 0, Explod]
type = Explod
triggerall=anim=190
trigger1 = time=0
anim = 192
ID = 199
pos = ifelse(facing=-1,-2,0),0
postype = p1
facing=ifelse(facing=-1,-1,1)
bindtime = -1
removetime = -2
scale = const(size.xscale),const(size.yscale)
sprpriority = 3

[State 0, Explod]
type = Explod
triggerall = anim = 190
trigger1 = animelemtime(5)=0
anim = 8030
ID = 8030
pos = ceil(-50*const(size.xscale)),0
postype = p1
bindtime = 1
removetime = -2
scale = .6,.6
sprpriority = -1
supermovetime=9999
pausemovetime=9999
ownpal = 1
removeongethit = 1

[State 0, Explod]
type = Explod
triggerall = anim = 191
trigger1 = animelemtime(6)=0
anim = 8030
ID = 8030
pos = ceil(-58*const(size.xscale)),0
postype = p1
bindtime = 1
removetime = -2
scale = .6,.6
sprpriority = -1
supermovetime=9999
pausemovetime=9999
ownpal = 1
removeongethit = 1

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

[State 0, EnvShake]
type = EnvShake
triggerall = anim=190
trigger1 = animelem = 5
time = 20
ampl = -4
phase = 90
[State 0, PlaySnd]
type = PlaySnd
triggerall = anim=190
trigger1 = animelem = 5
value = S181,1
channel = -1

[State 0, PlaySnd]
type = PlaySnd
triggerall = anim=190
trigger1 = animelem = 5
value = S3,4
channel = 5

[State 0, EnvShake]
type = EnvShake
triggerall = anim=191
trigger1 = animelem = 6
time = 20
ampl = -4
phase = 90
[State 0, PlaySnd]
type = PlaySnd
triggerall = anim=191
trigger1 = animelem = 6
value = S181,1
channel = -1

[State 0, PlaySnd]
type = PlaySnd
triggerall = anim=191
trigger1 = animelem = 6
value = S3,4
channel = 5

[State 190, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 22
;---------< INTRO vs EVIL RYU >---------
[Statedef 194]
type = S
physics = N
anim = 194
sprpriority = 0
[State 194, intro]
type = assertspecial
trigger1 = 1
flag = intro
[State 194, Camera]
type = helper
trigger1 = !numhelper(7650)
helpertype = normal
stateno = 7650
ID = 7650
name = "Camera"
postype = p1
[State 194, screen]
type = screenbound
trigger1 = 1
value = 0
movecamera = 0, 1

[State 194, Vel]
type = posset
trigger1 = !time
x = -240 * facing
[State 194, Vel]
type = velset
trigger1 = !time
x = 6
[State 194, Snd]
type = playsnd
trigger1 = !time
value = S10, 15

[State 0, AfterImage]
type = AfterImage
trigger1 = animelem = 1
time = 2
length = 15
framegap = 3
timegap = 1
trans = none ;"none","add1","sub"
;paladd = 10,10,25
[State 0, AfterImage]
type = AfterImageTime
trigger1 = animelemtime(2)>=0
time = 0

[State 194, Anim]
type = changeanim
trigger1 = animelemtime(2) < 0 && p2dist x <= 72
value = 194
elem = 2
[State 194, Snd]
type = playsnd
trigger1 = animelem = 2
value = S3,16
channel = 5
[State 194, Vel]
type = velset
trigger1 = animelemtime(2) >= 0 && animelemtime(3) < 0
x = 0
[State 194, Pos]
type = posset
trigger1 = animelemtime(2) >= 0 && animelemtime(3) < 0
x = -36 * facing

[State 194, fadeout]
type = allpalfx
trigger1 = animelemtime(2) = 10
time = 20
sinadd = -255, -255, -255, 80
[State 194, black]
type = envcolor
trigger1 = animelemtime(2) >= 30 && animelemtime(3) < 0
time = 2
value = 0, 0, 0
[State 194, Assert]
type = assertspecial
trigger1 = animelemtime(2) >= 30 && animelemtime(3) < 0
flag = nobardisplay

[State 194, HitSound]
type = playsnd
trigger1 = animelemtime(2) >= 30 && animelemtime(3) < 0
trigger1 = (animelemtime(2) % 3) = 1
value = S2, 0
[State 194, Sparks]
type = explod
trigger1 = animelemtime(2) >= 30 && animelemtime(3) < 0
trigger1 = (animelemtime(2) % 3) = 1
anim = 8105
ID = 8105
sprpriority = 5
postype = p2
pos = 0, -70
random = 60, 60
facing = -1
ownpal = 1
ontop = 1
pausemovetime = 300
supermovetime = 300
[State 194, Shake]
type = envshake
trigger1 = animelemtime(2) >= 30 && animelemtime(3) < 0
trigger1 = (animelemtime(2) % 3) = 1
time = 2
freq = 120
ampl = -3

[State 194, Anim]
type = changeanim
trigger1 = animelemtime(2) >= 72 && animelemtime(3) < 0;animelemtime(2) >= 72 && animelemtime(3) < 0
value = 194
elem = 3
[State 194, Snd]
type = playsnd
trigger1 = animelem = 3
value = S5000, 0
channel = 5

[State 194, Snd]
type = playsnd
trigger1 = animelem = 3
value = S10, 30
[State 194, lightning]
type = helper
trigger1 = animelem = 3
helpertype = normal
stateno = 7250
ID = 7250
postype = left
pos = 160, -60
ownpal = 1
supermovetime = 999

[State 192, Vel]
type = velset
trigger1 = animelem = 3
x = -6
[State 192, Pos]
type = posset
trigger1 = animelemtime(3) >= 0 && (helper(7650), rootdist x <= 0)
x = ceil(helper(7650), pos x)
[State 192, Vel]
type = velset
trigger1 = animelemtime(3) >= 0 && (helper(7650), rootdist x <= 0)
x = 0
[State 192, End]
type = changestate
trigger1 = !animtime
value = 0
;---------------------------------------------------------------------------
; Taunt
[Statedef 195]
type = S
ctrl = 0
anim = 195+(random%2)
velset = 0,0
movetype = A
physics = S
juggle = 1
sprpriority = 2

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

[State 0, BGPalFX]
type = BGPalFX
triggerall = anim = 196
trigger1 = time = [14,37]
time=2
add = -255+(time*6),-255+(time*6),-255+(time*6)
[State 0, PalFX]
type = PalFX
triggerall = anim = 196
trigger1 = time = [14,37]
time=2
add = -255+(time*6),-255+(time*6),-255+(time*6)

[State 0, Explod]
type = Explod
triggerall = anim = 195
trigger1 = animelemtime(5)=0
anim = 8030
ID = 8030
pos = ceil(-50*const(size.xscale)),0
postype = p1
bindtime = 1
removetime = -2
scale = .6,.6
sprpriority = -1
supermovetime=9999
pausemovetime=9999
ownpal = 1
removeongethit = 1

[State 0, Explod]
type = Explod
triggerall = anim = 196
trigger1 = animelemtime(5)=0
anim = 8030
ID = 8030
pos = ceil(-58*const(size.xscale)),0
postype = p1
bindtime = 1
removetime = -2
scale = .6,.6
sprpriority = -1
supermovetime=9999
pausemovetime=9999
ownpal = 1
removeongethit = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 15
value = S3,22
channel = 5

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 15
value = S181,1
channel = -1
[State 0, EnvShake]
type = EnvShake
triggerall = anim = 195
trigger1 = time = 15
time = 15
ampl = 3
[State 0, EnvShake]
type = EnvShake
triggerall = anim = 196
trigger1 = time = 15
time = 20
ampl = 5

[State 220, hit]
type=hitdef
triggerall = anim = 195
trigger1=animelem=5
attr=S,NA
damage=5,0
animtype=Hard
guardflag=MA
hitflag=AFD
priority=4,Hit
pausetime=2,2
sparkno=s8200+(random%8)
guard.sparkno=s8100
sparkxy = -15,-10
hitsound=s1,0
guardsound=s2,0
ground.type=Low
ground.slidetime=14
ground.hittime=15
ground.velocity=0,0
ground.cornerpush.veloff=0
air.type=Low
air.hittime=15
air.velocity=0,6.5
fall.yvelocity=0
down.velocity=0,0
yaccel = .63
envshake.time=10
envshake.ampl=2
getpower=0

[State 220, hit]
type=hitdef
triggerall = anim = 196
trigger1=animelem=5
attr=S,NA
damage=10,0
animtype=Hard
guardflag=MA
hitflag=MAFD
priority=4,Hit
pausetime=2,2
sparkno=s8200+(random%8)
guard.sparkno=s8100
sparkxy = -15,-50
hitsound=s1,8
guardsound=s2,0
ground.type=Low
ground.slidetime=14
ground.hittime=15
ground.velocity=-3,-5
ground.cornerpush.veloff=0
air.type=Low
air.hittime=15
air.velocity=-3,-6.5
down.velocity=0,0
fall=1
fall.recover=0
fall.yvelocity=0
yaccel = .63
envshake.time=10
envshake.ampl=2
palfx.time = 48
palfx.sinadd = 64, 64, 64, 4
palfx.mul = 128, 128, 128
getpower=0

[State 0, Dark Fire Explod]
type = Explod
triggerall = anim=196
triggerall = NumExplod(8060)<5
trigger1 = movehit && numtarget
trigger1 = !(target, time)
anim = 8060+(random%4)
ID = 8060
postype = p2
pos = enemy,const(size.mid.pos.x),enemy,const(size.mid.pos.y)
random=60,60
bindtime = -1
removetime = -2
sprpriority = ifelse(random<500,5,-1)
ownpal = 1
removeongethit = 0
ignorehitpause = 1

[State 195, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;-------------------------------------------------------------------------------
[Statedef 199]
type = S
ctrl = 0
anim = 199

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

[State 0, Explod]
type = Explod
trigger1=Numexplod(19999)=0
trigger1=time=0
anim=19999
ID=19999
pos=0,0
postype=p1
bindtime=-1
removetime=-2
scale=const(size.xscale),const(size.yscale)
sprpriority=5
ownpal=1
removeongethit=1

[State 0, PalFX]
type=BGPalFX
trigger1=time<125
time=2
add=-255+(time*2),-255+(time*2),-255+(time*2)
mul=256,256,256
color=256

[State 0, PalFX]
type=PalFX
trigger1=animelemtime(2)<0
time=2
add=-255+(time),-255+(time),-255+(time)
mul=256,256,256
color=256

[State 0, Explod]
type = Explod
trigger1=animelemtime(2)<0
trigger1=numexplod(7503)=0
anim=7503
ID=7503
pos=0,0
postype=p1
bindtime=1
removetime = -2
supermovetime=9999
pausemovetime=9999
scale=.6,.6
sprpriority=-1
ownpal=1
ignorehitpause=1

[State 0, EnvShake]
type = EnvShake
trigger1=animelemtime(2)<0
trigger1=(time%9)=1
time=9
ampl=3
ignorehitpause=1

[State 0, PlaySnd]
type = PlaySnd
trigger1=animelemtime(2)<0
trigger1=time=1
value=S10,18
volume=255
channel=10
loop=1

[State 0, StopSnd]
type = StopSnd
trigger1=animelemtime(2)=0
trigger2=command="x"||command="y"||command="z"||command="a"||command="b"||command="c"
channel=10
ignorehitpause=1

[State 0, Helper]
type = Helper
trigger1=Time=0
trigger1=!numhelper(1)
helpertype=normal ;player
name="Aura"
ID=1
stateno=1
pos=0,0
postype=p1
ownpal=1

[State 0, Explod]
type = Explod
trigger1 = animelemtime(7)=0
anim = 8030
ID = 8030
pos = ceil(-50*const(size.xscale)),0
postype = p1
bindtime = 1
removetime = -2
scale = .6,.6
sprpriority = -1
supermovetime=9999
pausemovetime=9999
ownpal = 1
removeongethit = 1

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

[State 0, EnvShake]
type = EnvShake
trigger1 = animelem = 7
time = 20
ampl = -4
phase = 90
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 7
value = S181,1
channel = -1

[State 0, PlaySnd]
type = PlaySnd
trigger1=animelemtime(2)<0
trigger1=time=155
value=S3,19
channel=5

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

;---------------------------------------------------------------------------
;Tech Hitted
[Statedef 345]
type    = S				;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= I				;Move-type: A-attack, I-idle, H-gethit
physics = S				;Physics: S-stand, C-crouch, A-air
juggle  = 0				;Number of air juggle points move takes
velset = -2,0			;Set velocity (x,y) (Def: no change)
ctrl = 0
anim = 345				;Set ctrl (Def: no change)
poweradd = 0			;Power to add (Def: 0)
sprpriority = 2	;Set layering priority to 2 (in front)

[State 0, EnvShake]
type = EnvShake
;trigger1 = enemynear,life >0
trigger1 = time = 0
time = 15
freq = 60
ampl = -4

[State 0, EnvColor]
type = EnvColor
trigger1 = !time
value = 255,255,255
time = 2

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S5000,3
channel = 5

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S2,3
volume = 0
channel = -1

[State 3805, end]
type=selfstate
trigger1 = animtime =0
value=0
ctrl=1

;---------------------------------------------------------------------------
;Tech Hitted
[Statedef 346]
type    = A				;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= I				;Move-type: A-attack, I-idle, H-gethit
physics = A				;Physics: S-stand, C-crouch, A-air
juggle  = 0				;Number of air juggle points move takes
velset = -2,-8			;Set velocity (x,y) (Def: no change)
ctrl = 0
anim = 346				;Set ctrl (Def: no change)
poweradd = 0			;Power to add (Def: 0)
sprpriority = 2	;Set layering priority to 2 (in front)

[State 0, EnvShake]
type = EnvShake
;trigger1 = enemynear,life >0
trigger1 = time = 0
time = 15
freq = 60
ampl = -4

[State 0, EnvColor]
type = EnvColor
trigger1 = !time
value = 255,255,255
time = 2

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S5000,3
channel = 5

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S2,3
volume = 0
channel = -1

[State 3805, end]
type=selfstate
trigger1 = animtime =0
value=50
ctrl=1

;---------------------------------------------------------------------------
;Tech Hitted Low
[Statedef 347]
type    = C				;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= I				;Move-type: A-attack, I-idle, H-gethit
physics = C				;Physics: S-stand, C-crouch, A-air
juggle  = 0				;Number of air juggle points move takes
velset = -2,0			;Set velocity (x,y) (Def: no change)
ctrl = 0
anim = 347				;Set ctrl (Def: no change)
poweradd = 0			;Power to add (Def: 0)
sprpriority = 2	;Set layering priority to 2 (in front)

[State 0, EnvShake]
type = EnvShake
;trigger1 = enemynear,life >0
trigger1 = time = 0
time = 15
freq = 60
ampl = -4

[State 0, EnvColor]
type = EnvColor
trigger1 = !time
value = 255,255,255
time = 2

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S5000,3
channel = 5

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S2,3
volume = 0
channel = -1

[State 3805, end]
type=selfstate
trigger1 = animtime =0
value=11
ctrl=1
;---------------------------------------------------------------------------
; Throw Forward - Attempt
[Statedef 800]
type    = S
movetype= A
physics = S
juggle  = 0
velset = 0,0
ctrl = 0
anim = 800
p2facing = 1
facep2 = 1
sprpriority = 2

[State 0, VarSet]
type = VarSet
triggerall = command="a"||command="b"||command="c"
trigger1 = time=0
var(9)= 1

[State 0, VarSet]
type = VarSet
trigger1 = time=0
var(10)=ifelse(command="z"||command="c", 2, 1)

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 1
value = S0,5
volume = 0
channel = -1

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

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=5
value = S5000,2
channel = 5

[State 800, 1]
type = HitDef
triggerall = var(9)=0
Trigger1 = Time = 0
attr = S, NT
hitflag = M-
priority = 1, Miss
sparkno = -1
sparkxy = -13, -72
hitsound = s1,16
sprpriority = 1
p1facing = ifelse (command = "holdback", 1, -1)
p2facing = 1
p1stateno = 801
p2stateno = 810
ground.velocity=0,ifelse(var(10)=2, -7.5, 10)
air.velocity=0,ifelse(var(10)=2, -7.5, 10)
guard.dist = 0
numhits=0
fall = 1
fall.recover=ifelse(var(10)=2,1,0)
fall.envshake.time = 12
fall.envshake.freq = 60
fall.envshake.ampl = -6
fall.damage=ifelse(var(10)=2,0,90)
yaccel=.63

[State 800, 1]
type = HitDef
triggerall = var(9)=1
Trigger1 = Time = 0
attr = S, NT
hitflag = M-
priority = 1, Miss
sparkno = -1
sparkxy = -13, -72
hitsound = s1,16
sprpriority = 1
p1facing = ifelse (command = "holdback", 1, -1)
p2facing = 1
p1stateno = ifelse(var(10)=2,803,802)
p2stateno = ifelse(var(10)=2,816,815)
ground.velocity=0,-7.5
air.velocity=0,-7.5
guard.dist = 0
numhits=0
fall = 1
fall.recover=1;ifelse(var(10)=2,1,0)
fall.envshake.time = 12
fall.envshake.freq = 60
fall.envshake.ampl = -6
;fall.damage=ifelse(var(10)=4,0,90)
yaccel=.63

[State 800, 2]
type = ChangeState
Trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; Throw Forward
[Statedef 801]
type    = S
movetype= A
physics = S
juggle  = 0
velset = 0,0
ctrl = 0
anim = 801
sprpriority = 3

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

[State 0, Width]
type = Width
trigger1 = animelemtime(1)>=0&&animelemtime(4)<0
edge = const(size.ground.front)+target,const(size.ground.front),0
[State 0, Width]
type = Width
trigger1 = animelemtime(4)>=0&&animelemtime(5)<0
edge = 0,30
[State 0, Width]
type = Width
trigger1 = animelemtime(5)>=0&&animelemtime(6)<0
edge = 0,50
[State 0, Width]
type = Width
trigger1 = animelemtime(6)>=0&&animelemtime(7)<0
edge = 0,80

[State 810, Playerpush]
type = Playerpush
trigger1 = 1
value = 0

[State 801, Throw Sound]
type = PlaySnd
trigger1 = AnimElem = 4
value = s3,8

[State 801, Throw Sound]
type = PlaySnd
trigger1 = AnimElem = 4
value = s0,5

[State 801, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(1)>=0&&animelemtime(2)<0
pos = const(size.ground.front)+target,const(size.ground.front),0;45, 0

[State 801, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(2)>=0&&animelemtime(3)<0
pos = 35, -90

[State 801, Bind 2-4]
type = TargetBind
trigger1 = AnimElemTime(3)>=0&&animelemtime(4)<0
pos = 10, -85

[State 801, Bind 5]
type = TargetBind
trigger1 = AnimElemTime(4)>=0&&animelemtime(5)<0
pos = -40, -75

[State 801, Bind 6]
type = TargetBind
trigger1 = AnimElemTime(5)>=0&&animelemtime(6)<0
pos = -40, -75

[State 801, Bind 8]
type = TargetBind
triggerall=var(10)=1
trigger1 = AnimElem = 6
pos = -100,-45;-60, -40

[State 801, Bind 8]
type = TargetBind
triggerall=var(10)=2
trigger1 = AnimElem = 6
pos = -100,-90;-60, -40

[State 0, TargetState]
type = TargetState
triggerall = var(10)=2
trigger1 = animelem=6
value = 811

[State 0, TargetLifeAdd]
type = TargetLifeAdd
triggerall = var(10)=2
trigger1 = animelem=6
value = -90

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

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

[State 800, 2]
type = ChangeState
Trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; Throw Forward
[Statedef 802]
type    = S
movetype= A
physics = N
juggle  = 0
velset = 0,0
ctrl = 0
anim = 802
sprpriority = 3

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

[State 0, TargetState]
type = TargetState
trigger1 = time=0
value = 815
ID=805

[State 0, Width]
type = Width
trigger1 = animelemtime(1)>=0&&animelemtime(2)<0
edge = const(size.ground.front)+target,const(size.ground.front),0
[State 0, Width]
type = Width
trigger1 = animelemtime(2)>=0&&animelemtime(3)<0
edge = 0,40
[State 0, Width]
type = Width
trigger1 = animelemtime(3)>=0&&animelemtime(4)<0
edge = 0,80
[State 0, Width]
type = Width
trigger1 = animelemtime(4)>=0&&animelemtime(5)<0
edge = 0,120

[State 810, Playerpush]
type = Playerpush
trigger1 = 1
value = 0

[State 801, Throw Sound]
type = PlaySnd
trigger1 = AnimElem = 4
value = s3,8

[State 801, Throw Sound]
type = PlaySnd
trigger1 = AnimElem = 3
value = s0,5

[State 801, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(1)>=0&&animelemtime(2)<0
pos = const(size.ground.front)+target,const(size.ground.front),0;45, 0

[State 801, Bind 2]
type = TargetBind
trigger1 = AnimElemTime(2)>=0&&animelemtime(3)<0
pos = 18, 0

[State 801, Bind 3-4]
type = TargetBind
trigger1 = AnimElemTime(3)>=0&&animelemtime(4)<0
pos = -48, -50

[State 801, Bind 5]
type = TargetBind
trigger1 = AnimElemTime(4)>=0&&animelemtime(5)<0
pos = -80, -65

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

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

[State 800, 2]
type = ChangeState
Trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; Throw Forward
[Statedef 803]
type    = S
movetype= A
physics = N
juggle  = 0
velset = 0,0
ctrl = 0
anim = 803
sprpriority = 3

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

[State 0, TargetState]
type = TargetState
trigger1 = time=0
value = 816
ID=805

[State 0, Width]
type = Width
trigger1 = animelemtime(1)>=0&&animelemtime(2)<0
edge = const(size.ground.front)+target,const(size.ground.front),0
[State 0, Width]
type = Width
trigger1 = animelemtime(2)>=0&&animelemtime(3)<0
edge = 0,40
[State 0, Width]
type = Width
trigger1 = animelemtime(3)>=0&&animelemtime(19)<0
edge = 30,30
[State 0, Width]
type = Width
trigger1 = animelemtime(19)>=0&&animelemtime(20)<0
edge = 0,80
[State 0, Width]
type = Width
trigger1 = animelemtime(20)>=0&&animelemtime(21)<0
edge = 0,120

[State 810, Playerpush]
type = Playerpush
trigger1 = 1
value = 0

[State 801, Throw Sound]
type = PlaySnd
trigger1 = AnimElem = 20
value = s3,8

[State 801, Throw Sound]
type = PlaySnd
trigger1 = AnimElem = 3
trigger2 = AnimElem = 7
trigger3 = AnimElem = 11
trigger4 = AnimElem = 15
trigger5 = AnimElem = 19
value = s0,5

[State 0, VelSet]
type = VelSet
trigger1 = time=19
x = -7
y = -3

[State 0, VelAdd]
type = VelAdd
trigger1 = time>=19
trigger1 = Pos Y != 0
y = .2

[State 0, VelSet]
type = VelSet
trigger1 = time>=19
trigger1 = Pos Y >= 0
trigger1 = Vel Y >= 0
y = 0

[State 0, PosSet]
type = PosSet
trigger1 = time>=19
trigger1 = Pos Y >= 0
trigger1 = Vel Y >= 0
y = 0

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = Pos Y != 0
statetype = A       ;S,A,C,L
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = Pos Y >= 0
statetype = S

[State 801, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(1)>=0&&animelemtime(2)<0
pos = const(size.ground.front)+target,const(size.ground.front),0;45, 0

[State 801, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(2)>=0&&animelemtime(3)<0
pos = 18, 0

[State 801, Bind]
type = TargetBind
trigger1 = AnimElemTime(3)>=0&&animelemtime(4)<0
trigger2 = AnimElemTime(7)>=0&&animelemtime(8)<0
trigger3 = AnimElemTime(11)>=0&&animelemtime(12)<0
trigger4 = AnimElemTime(15)>=0&&animelemtime(16)<0
pos = -5, -55
[State 801, Bind]
type = TargetBind
trigger1 = AnimElemTime(4)>=0&&animelemtime(5)<0
trigger2 = AnimElemTime(8)>=0&&animelemtime(9)<0
trigger3 = AnimElemTime(12)>=0&&animelemtime(13)<0
trigger4 = AnimElemTime(16)>=0&&animelemtime(17)<0
pos = -25, -30
[State 801, Bind]
type = TargetBind
trigger1 = AnimElemTime(5)>=0&&animelemtime(6)<0
trigger2 = AnimElemTime(9)>=0&&animelemtime(10)<0
trigger3 = AnimElemTime(13)>=0&&animelemtime(14)<0
trigger4 = AnimElemTime(17)>=0&&animelemtime(18)<0
pos = 20, -15
[State 801, Bind]
type = TargetBind
trigger1 = AnimElemTime(6)>=0&&animelemtime(7)<0
trigger2 = AnimElemTime(10)>=0&&animelemtime(11)<0
trigger3 = AnimElemTime(14)>=0&&animelemtime(15)<0
trigger4 = AnimElemTime(18)>=0&&animelemtime(19)<0
pos = 30, -45

[State 801, Bind 3-5]
type = TargetBind
trigger1 = AnimElemTime(19)>=0&&animelemtime(20)<0
pos = -48, -50

[State 801, Bind 6]
type = TargetBind
trigger1 = AnimElemTime(20)>=0&&animelemtime(21)<0
pos = -80, -65

[State 801, 5]
type = PlaySnd
trigger1 = p2stateno = 5100
value = s1,6
persistent = 0

[State 0, VelSet]
type = VelSet
trigger1 = animelem=19
x = 0
y = 0

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

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

[State 800, 2]
type = ChangeState
Trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; Throw Forward - Attempt
[Statedef 805]
type    = S
movetype= A
physics = S
juggle  = 0
velset = 0,0
ctrl = 0
anim = 800
p2facing = 1
facep2 = 1
sprpriority = 2

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

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 1
value = S0,5
volume = 0
channel = -1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=5
value = S5000,2
channel = 5

[State 800, 1]
type = HitDef
Trigger1 = Time = 0
attr = S, NT
ID=805
hitflag = M-
priority = 1, Miss
sparkno = -1
sparkxy = -13, -50
hitsound = s1,16
sprpriority = 1
sound
p1facing = ifelse (command = "holdback", 1, -1)
p2facing = 1
p1stateno = 806
p2stateno = 820
ground.velocity=0,-7.5
air.velocity=0,-7.5
guard.dist = 0
fall = 1
fall.recover=1
numhits=0
fall.envshake.time = 12
fall.envshake.freq = 60
fall.envshake.ampl = -6
yaccel=.63

[State 800, 2]
type = ChangeState
Trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; Throw Forward
[Statedef 806]
type    = S
movetype= A
physics = S
juggle  = 0
velset = 0,0
ctrl = 0
;anim = 806
sprpriority = 3

[State 0, VarAdd]
type = VarAdd
triggerall = var(10)<60
trigger1 = command="a"||command="b"||command="c"
v = 10
value = 1

[State 0, PalFX]
type = PalFX
trigger1 = command="a"||command="b"||command="c"
time = 1
add = 128,128,128

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = anim!=806
value = 806

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

[State 0, Width]
type = Width
trigger1 = animelemtime(1)>=0&&animelemtime(2)<0
edge = const(size.ground.front)+target,const(size.ground.front),0
[State 0, Width]
type = Width
trigger1 = animelemtime(2)>=0&&animelemtime(3)<0
edge = 40,0
[State 0, Width]
type = Width
trigger1 = animelemtime(3)>=0&&animelemtime(5)<0
edge = 80,0

[State 810, Playerpush]
type = Playerpush
trigger1 = 1
value = 0

[State 801, Throw Sound]
type = PlaySnd
trigger1 = AnimElem = 3
trigger2 = AnimElem = 8
value = s3,8

[State 801, Throw Sound]
type = PlaySnd
trigger1 = AnimElem = 2
trigger2 = AnimElem = 7
value = s0,5

[State 801, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(1)>=0&&animelemtime(2)<0
trigger2 = AnimElemTime(6)>=0&&animelemtime(7)<0
pos = const(size.ground.front)+target,const(size.ground.front),0;45, 0

[State 801, Bind 2]
type = TargetBind
trigger1 = AnimElemTime(2)>=0&&animelemtime(3)<0
trigger2 = AnimElemTime(5)>=0&&animelemtime(6)<0
trigger3 = AnimElemTime(7)>=0&&animelemtime(8)<0
trigger4 = AnimElemTime(10)>=0
pos = 60, -55

[State 801, Bind 3]
type = TargetBind
trigger1 = AnimElemTime(3)>=0&&animelemtime(5)<0
trigger2 = AnimElemTime(8)>=0&&animelemtime(10)<0
pos = 80, -60

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=3
trigger2 = animelem=8
value = S1,0
channel = -1

[State 0, Explod]
type = Explod
trigger1 = animelem=3
trigger2 = animelem=8
anim = 8200+(random%8)
ID = 8200
pos = 55,-55
postype = p1
bindtime = 1
removetime = -2
supermovetime=9999
pausemovetime=9999
sprpriority = 10
ownpal = 1

[State 0, VarAdd]
type = VarAdd
trigger1 = animelem=3
trigger2 = animelem=8
v = 28
value = 1

[State 0, HitAdd]
type = HitAdd
trigger1 = animelem=3
trigger2 = animelem=8
value = 1

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = animelem=3
trigger2 = animelem=8
value = -10
ID = 805
kill=0

[State 800, 2]
type = ChangeState
triggerall = var(10)>=10
Trigger1 = AnimTime = 0
value = 807

[State 800, 2]
type = ChangeState
triggerall = var(10)<10
Trigger1 = AnimTime = 0
value = 802
;---------------------------------------------------------------------------
; Throw Forward
[Statedef 807]
type    = S
movetype= A
physics = S
juggle  = 0
velset = 0,0
ctrl = 0
sprpriority = 3

[State 0, TargetState]
type = TargetState
trigger1 = time=0
value = 821
ID=805

[State 0, VarAdd]
type = VarAdd
triggerall = var(10)<60
trigger1 = command="a"||command="b"||command="c"
v = 10
value = 1

[State 0, PalFX]
type = PalFX
triggerall = var(10)<60
trigger1 = command="a"||command="b"||command="c"
time = 1
add = 128,128,128

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = anim!=807
value = 807

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

[State 0, Width]
type = Width
trigger1 = animelemtime(1)>=0&&animelemtime(2)<0
edge = const(size.ground.front)+target,const(size.ground.front),0
[State 0, Width]
type = Width
trigger1 = animelemtime(2)>=0&&animelemtime(3)<0
edge = 40,0
[State 0, Width]
type = Width
trigger1 = animelemtime(3)>=0&&animelemtime(5)<0
edge = 80,0

[State 810, Playerpush]
type = Playerpush
trigger1 = 1
value = 0

[State 801, Throw Sound]
type = PlaySnd
trigger1 = AnimElem = 3
trigger2 = AnimElem = 8
value = s3,8

[State 801, Throw Sound]
type = PlaySnd
trigger1 = AnimElem = 2
trigger2 = AnimElem = 7
value = s0,5

[State 801, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(1)>=0&&animelemtime(2)<0
trigger2 = AnimElemTime(6)>=0&&animelemtime(7)<0
pos = const(size.ground.front)+target,const(size.ground.front),0;45, 0

[State 801, Bind 2]
type = TargetBind
trigger1 = AnimElemTime(2)>=0&&animelemtime(3)<0
trigger2 = AnimElemTime(5)>=0&&animelemtime(6)<0
trigger3 = AnimElemTime(7)>=0&&animelemtime(8)<0
trigger4 = AnimElemTime(10)>=0
pos = 60, -55

[State 801, Bind 3]
type = TargetBind
trigger1 = AnimElemTime(3)>=0&&animelemtime(5)<0
trigger2 = AnimElemTime(8)>=0&&animelemtime(10)<0
pos = 80, -60

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=3
trigger2 = animelem=8
value = S1,0
channel = -1

[State 0, Explod]
type = Explod
trigger1 = animelem=3
trigger2 = animelem=8
anim = 8200+(random%8)
ID = 8200
pos = 55,-55
postype = p1
bindtime = 1
removetime = -2
supermovetime=9999
pausemovetime=9999
sprpriority = 10
ownpal = 1

[State 0, VarAdd]
type = VarAdd
trigger1 = animelem=3
trigger2 = animelem=8
v = 28
value = 1

[State 0, HitAdd]
type = HitAdd
trigger1 = animelem=3
trigger2 = animelem=8
value = 1

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = animelem=3
trigger2 = animelem=8
value = -5
ID = 805
kill=0

[State 800, 2]
type = ChangeState
triggerall = var(10)>=20
Trigger1 = AnimTime = 0
value = 808

[State 800, 2]
type = ChangeState
triggerall = var(10)<20
Trigger1 = AnimTime = 0
value = 802

;---------------------------------------------------------------------------
; Throw Forward
[Statedef 808]
type    = S
movetype= A
physics = S
juggle  = 0
velset = 0,0
ctrl = 0
sprpriority = 3

[State 0, TargetState]
type = TargetState
trigger1 = animtime=0
value = 822
ID=805

[State 0, VarAdd]
type = VarAdd
triggerall = var(10)<60
trigger1 = command="a"||command="b"||command="c"
v = 10
value = 1

[State 0, PalFX]
type = PalFX
triggerall = var(10)<60
trigger1 = command="a"||command="b"||command="c"
time = 1
add = 128,128,128

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = anim!=808
value = 808

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

[State 0, Width]
type = Width
trigger1 = animelemtime(1)>=0&&animelemtime(2)<0
edge = const(size.ground.front)+target,const(size.ground.front),0
[State 0, Width]
type = Width
trigger1 = animelemtime(2)>=0&&animelemtime(3)<0
edge = 40,0
[State 0, Width]
type = Width
trigger1 = animelemtime(3)>=0&&animelemtime(5)<0
edge = 80,0

[State 810, Playerpush]
type = Playerpush
trigger1 = 1
value = 0

[State 801, Throw Sound]
type = PlaySnd
trigger1 = AnimElem = 3
trigger2 = AnimElem = 8
value = s3,8

[State 801, Throw Sound]
type = PlaySnd
trigger1 = AnimElem = 2
trigger2 = AnimElem = 7
value = s0,5

[State 801, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(1)>=0&&animelemtime(2)<0
trigger2 = AnimElemTime(6)>=0&&animelemtime(7)<0
pos = const(size.ground.front)+target,const(size.ground.front),0;45, 0

[State 801, Bind 2]
type = TargetBind
trigger1 = AnimElemTime(2)>=0&&animelemtime(3)<0
trigger2 = AnimElemTime(5)>=0&&animelemtime(6)<0
trigger3 = AnimElemTime(7)>=0&&animelemtime(8)<0
trigger4 = AnimElemTime(10)>=0
pos = 60, -55

[State 801, Bind 3]
type = TargetBind
trigger1 = AnimElemTime(3)>=0&&animelemtime(5)<0
trigger2 = AnimElemTime(8)>=0&&animelemtime(10)<0
pos = 80, -60

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=3
trigger2 = animelem=8
value = S1,0
channel = -1

[State 0, Explod]
type = Explod
trigger1 = animelem=3
trigger2 = animelem=8
anim = 8200+(random%8)
ID = 8200
pos = 55,-55
postype = p1
bindtime = 1
removetime = -2
supermovetime=9999
pausemovetime=9999
sprpriority = 10
ownpal = 1

[State 0, VarAdd]
type = VarAdd
trigger1 = animelem=3
trigger2 = animelem=8
v = 28
value = 1

[State 0, HitAdd]
type = HitAdd
trigger1 = animelem=3
trigger2 = animelem=8
value = 1

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = animelem=3
trigger2 = animelem=8
value = -2
ID = 805
kill=0

[State 800, 2]
type = ChangeState
Trigger1 = var(10)<30
trigger1 = animtime=0
trigger2 = (var(10)=[30,39])&&time>=32
trigger3 = (var(10)=[40,49])&&time>=48
trigger4 = (var(10)=[50,59])&&time>=64
trigger5 = (var(10)>=60)&&time>=80
value = 803
;---------------------------------------------------------------------------
; Thrown by Throw Forward
[Statedef 810]
type    = S
movetype= H
physics = N
velset = 0,0

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem = 2
statetype = A       ;S,A,C,L
movetype = H        ;I,A,H
physics = N         ;A,C,S,N

[State 820, ScreenBound]
type = ScreenBound
trigger1 = animelemtime(6) < 0
value = 0

[State 0, HitVelSet]
type = HitVelSet
trigger1 = time=28
y=1

[State 0, VelSet]
type = VelSet
trigger1 = Pos Y >= const(size.mid.pos.y)/2 && Vel Y > 0
x = 5.5

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

[State 0, VelAdd]
type = VelAdd
trigger1 = time>=28
y = gethitvar(yaccel)

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

[State 820, End]
type = Changestate
trigger1 = Pos Y >= const(size.mid.pos.y)/2 && Vel Y > 0 && time > 23
value = 812

;---------------------------------------------------------------------------
; Thrown by Throw Forward
[Statedef 811]
type    = A
movetype= H
physics = N
velset = 0,0

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

[State 0, VelSet]
type = VelSet
trigger1 =time=0
x = 5.5

[State 0, HitVelSet]
type = HitVelSet
trigger1 = time=0
y = 1

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

[State 0, VelAdd]
type = VelAdd
trigger1 = time>=0
y = gethitvar(yaccel)

[State 5050, 4] ;Recover near ground
type = SelfState
triggerall = Vel Y > 0
triggerall = Pos Y >= -20
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery"
value = 5200 ;HITFALL_RECOVER

[State 5050, 5]; Recover in mid air
type = SelfState
triggerall = Vel Y > -1
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery"
value = 5210 ;HITFALL_AIRRECOVER

[State 820, End]
type = Changestate
trigger1 = Pos Y >= const(size.mid.pos.y)/2 && Vel Y > 0
value = 812

;---------------------------------------------------------------------------
; HIT_BOUNCE (hit ground)
[Statedef 812]
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
sysvar(1) = floor(vel y)

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

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

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

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

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

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

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

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

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

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

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

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

;---------------------------------------------------------------------------
; Thrown by Throw Forward
[Statedef 815]
type    = A
movetype= H
physics = N
velset = 0,0

[State 832, ScreenBound]
type = ScreenBound
trigger1 = animelemtime(4) < 0
value = 0

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

[State 832, Velset]
type = Velset
trigger1 = animelemtime(4) = 0
x = 7.5

[State 0, HitVelSet]
type = HitVelSet
trigger1 = animelemtime(4) = 0
y = 1

[State 0, VelAdd]
type = VelAdd
trigger1 = animelemtime(4)>=0
y = gethitvar(yaccel)

[State 5050, 4] ;Recover near ground
type = SelfState
triggerall = animelemtime(6)>=0
triggerall = Vel Y > 0
triggerall = Pos Y >= -20
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery"
value = 5200 ;HITFALL_RECOVER

[State 5050, 5]; Recover in mid air
type = SelfState
triggerall = animelemtime(6)>=0
triggerall = Vel Y > -1
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery"
value = 5210 ;HITFALL_AIRRECOVER

[State 832, Vel]
type = Velset
trigger1 = Pos Y >= const(size.mid.pos.y)/2 && Vel Y > 0 && animelemtime(4) > 0
x = 2.0

[State 801, Hurt 11]
type = LifeAdd
trigger1 = animelemtime(4)=0;Pos Y >= const(size.mid.pos.y)/2 && Vel Y > 0 && animelemtime(4) > 0
value = -90
persistent = 0

[State 0, EnvShake]
type = EnvShake
trigger1 = Pos Y >= const(size.mid.pos.y)/2 && Vel Y > 0 && animelemtime(4) > 0
time = 12
freq = 60
ampl = -6
persistent = 0

[State 832, SelfState]
type = changestate
trigger1 = Pos Y >= const(size.mid.pos.y)/2 && Vel Y > 0 && animelemtime(4) > 0
value = 812

;---------------------------------------------------------------------------
; Thrown by Throw Forward
[Statedef 816]
type    = A
movetype= H
physics = N
velset = 0,0

[State 832, ScreenBound]
type = ScreenBound
trigger1 = animelemtime(16) < 0
value = 0

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

[State 832, Velset]
type = Velset
trigger1 = animelemtime(20) = 0
x = 7.5

[State 0, HitVelSet]
type = HitVelSet
trigger1 = animelemtime(20) = 0
y = 1

[State 0, VelAdd]
type = VelAdd
trigger1 = animelemtime(20)>=0
y = gethitvar(yaccel)

[State 832, Vel]
type = Velset
trigger1 = Pos Y >= const(size.mid.pos.y)/2 && Vel Y > 0 && animelemtime(20) > 0
x = 2.0

[State 801, Hurt 11]
type = LifeAdd
trigger1 = animelemtime(20)=0
value = -90
persistent = 0

[State 5050, 4] ;Recover near ground
type = SelfState
triggerall = animelemtime(22)>=0
triggerall = Vel Y > 0
triggerall = Pos Y >= -20
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery"
value = 5200 ;HITFALL_RECOVER

[State 5050, 5]; Recover in mid air
type = SelfState
triggerall = animelemtime(22)>=0
triggerall = Vel Y > -1
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery"
value = 5210 ;HITFALL_AIRRECOVER

[State 0, EnvShake]
type = EnvShake
trigger1 = Pos Y >= const(size.mid.pos.y)/2 && Vel Y > 0 && animelemtime(20) > 0
time = 12
freq = 60
ampl = -6
persistent = 0

[State 832, SelfState]
type = changestate
trigger1 = Pos Y >= const(size.mid.pos.y)/2 && Vel Y > 0 && animelemtime(20) > 0
value = 812

;---------------------------------------------------------------------------
; Get Hit
[Statedef 820]
type    = A
movetype= H
physics = N
velset = 0,0

[State 0, PosSet]
type = PosSet
trigger1 = time=0
y = 0

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

[State 0, NotHitBy]
type = HitBy
trigger1 = 1
value = SCA

[State 820, End]
type = Selfstate
trigger1 = time>=60
value = 5040
ctrl=1

;---------------------------------------------------------------------------
; Get Hit
[Statedef 821]
type    = A
movetype= H
physics = N
velset = 0,0

[State 0, PosSet]
type = PosSet
trigger1 = time=0
y = 0

[State 820, 1]
type = ChangeAnim2
Trigger1 = Time = 0&&anim!=821
value = 821

[State 0, NotHitBy]
type = HitBy
trigger1 = 1
value = C,NT

[State 820, End]
type = Selfstate
trigger1 = time>=30
value = 5040
ctrl=1

;---------------------------------------------------------------------------
; Get Hit
[Statedef 822]
type    = A
movetype= H
physics = N
velset = 0,0

[State 0, PosSet]
type = PosSet
trigger1 = time=0
y = 0

[State 820, 1]
type = ChangeAnim2
Trigger1 = Time = 0&&anim!=822
value = 822

[State 0, NotHitBy]
type = HitBy
trigger1 = 1
value = C,NT

[State 820, End]
type = Selfstate
trigger1 = time>=30
value = 5040
ctrl=1

;---------------------------------------------------------------------------
; Throw Forward - Attempt
[Statedef 850]
type    = A
movetype= A
physics = A
juggle  = 8
ctrl = 0
anim = 850
p2facing = 1
facep2 = 1
sprpriority = 2

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=4
value = S5000,2
channel = 5

[State 0, VarSet]
type = VarSet
triggerall = command="a"||command="b"||command="c"
trigger1 = time=0
var(9)= 1

[State 0, VarSet]
type = VarSet
triggerall = command="x"||command="y"||command="z"
trigger1 = time=0
var(9)= 0

[State 0, VarSet]
type = VarSet
trigger1 = time=0
var(10)=ifelse(command="z"||command="c", 2, 1)

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 1
value = S0,5
volume = 0
channel = -1

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

[State 800, 1]
type = HitDef
triggerall = var(9)=0
Trigger1 = Time = 0
id=850
attr = A, NT
hitflag = AF
priority = 1, Miss
sparkno = -1
sparkxy = -13, -72
hitsound = s1,16
sprpriority = 1
p1facing = ifelse (command = "holdback", 1, -1)
p2facing = 1
p1stateno = 851
p2stateno = 860
ground.velocity=0,-7.5
air.velocity=0,-7.5
guard.dist = 0
fall = 1
fall.recover=0
fall.envshake.time = 12
fall.envshake.freq = 60
fall.envshake.ampl = -6
;fall.damage=ifelse(var(10)=2,0,90)
yaccel=.63

[State 800, 1]
type = HitDef
triggerall = var(9)=1
Trigger1 = Time = 0
id=855
attr = A, NT
hitflag = AF
priority = 1, Miss
sparkno = -1
sparkxy = -13, -72
hitsound = s1,16
sprpriority = 1
p1facing = ifelse (command = "holdback", 1, -1)
p2facing = 1
p1stateno = 855;ifelse(var(10)=2,803,802)
p2stateno = 870;ifelse(var(10)=2,816,815)
ground.velocity=0,-7.5
air.velocity=0,-7.5
guard.dist = 0
fall = 1
fall.recover=1;ifelse(var(10)=2,1,0)
fall.envshake.time = 12
fall.envshake.freq = 60
fall.envshake.ampl = -6
;fall.damage=ifelse(var(10)=4,0,90)
yaccel=.63

[State 0, CtrlSet]
type = CtrlSet
trigger1 = animelemtime(5)>=0
value = 1

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelemtime(4)>=0
movetype = I

;---------------------------------------------------------------------------
; Throw Forward
[Statedef 851]
type    = A
movetype= A
physics = N
juggle  = 0
;velset = 0,0
ctrl = 0
anim = 851
sprpriority = 3

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

[State 0, PosFreeze]
type = PosFreeze
trigger1 = time < 11
value = 1

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

[State 810, Playerpush]
type = Playerpush
trigger1 = 1
value = 0

[State 801, Throw Sound]
type = PlaySnd
trigger1 = AnimElem = 3
trigger2 = AnimElem = 5
value = s0,5

[State 0, VelMul]
type = VelMul
trigger1 = time=11
y = .5

[State 0, VelAdd]
type = VelAdd
triggerall = !Vel X
trigger1 = time=11
x = -2

[State 0, VelAdd]
type = VelAdd
trigger1 = time>=11
trigger1 = Pos Y != 0
y = .5

[State 0, VelSet]
type = VelSet
trigger1 = time>=11
trigger1 = Pos Y >= -10
trigger1 = Vel Y >= 0
y = 0

[State 0, PosSet]
type = PosSet
trigger1 = time>=11
trigger1 = Pos Y >= -10
trigger1 = Vel Y >= 0
y = 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = animtime=0
value = 851
elem = 2

[State 801, Bind]
type = TargetBind
trigger1 = AnimElemTime(2)>=0&&animelemtime(3)<0
pos = -5, -55
[State 801, Bind]
type = TargetBind
trigger1 = AnimElemTime(3)>=0&&animelemtime(4)<0
pos = -25, -30
[State 801, Bind]
type = TargetBind
trigger1 = AnimElemTime(4)>=0&&animelemtime(5)<0
pos = 20, -15
[State 801, Bind]
type = TargetBind
trigger1 = AnimElemTime(1)>=0&&animelemtime(2)<0
trigger2 = AnimElemTime(5)>=0
pos = 30, -45

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

[State 800, 2]
type = ChangeState
triggerall = animelemtime(2)>=0
Trigger1 = Pos Y >= -10
trigger1 = Vel Y >= 0
value = 852

;---------------------------------------------------------------------------
[StateDef 852]
type = A
movetype= A
physics = N
velset = 0,0
ctrl = 0
anim = 852
sprpriority = 2

[State 0, PosSet]
type = PosSet
trigger1 = time = 0
y = 0

[State 0, TargetState]
type = TargetState
triggerall=numtarget(850)
trigger1 = time=0
value = 861
ID = 850

[State 0, TargetBind]
type = TargetBind
trigger1 = time < 15
id = 850
pos = -40,-30

[State 0, VelSet]
type = VelSet
trigger1 = animelem = 5
x = 4
y = -7

[State 0, Explod]
type = Explod
trigger1 = animelem=1
anim = 8210+(random%8)
ID = 8200
pos = -40,-10
postype = p1  ;p2,front,back,left,right
bindtime = 1
removetime = -2
supermovetime=9999
pausemovetime=9999
scale = 1,1
sprpriority = 10
ownpal = 1
removeongethit = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem=1
value = S1,3
channel = -1

[State 0, HitAdd]
type = HitAdd
triggerall = numtarget(850)
trigger1 = animelemtime(1)=0
value = 1
[State 0, VarAdd]
type = VarAdd
triggerall = numtarget(850)
trigger1 = animelemtime(1)=0
v = 28
value = 1

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelemtime(5)>=0
statetype = A
movetype = I
physics = A

;---------------------------------------------------------------------------
; Throw Forward
[Statedef 855]
type    = A
movetype= A
physics = N
juggle  = 0
;velset = 0,0
ctrl = 0
anim = 855
sprpriority = 3

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

[State 0, VelMul]
type = VelMul
trigger1 = time=0
x = .1
y = .1

[State 0, VelSet]
type = VelSet
triggerall = animelemtime(5)<0
trigger1 = Pos Y >= 0
trigger1 = Vel Y >= 0
x = 0
y = 0

[State 0, PosSet]
type = PosSet
triggerall = animelemtime(5)<0
trigger1 = Pos Y >= 0
trigger1 = Vel Y >= 0
y = 0

[State 0, Width]
type = Width
trigger1 = animelemtime(1)>=0&&animelemtime(2)<0
edge = 30,20
[State 0, Width]
type = Width
trigger1 = animelemtime(2)>=0&&animelemtime(3)<0
edge = 0,50
[State 0, Width]
type = Width
trigger1 = animelemtime(3)>=0&&animelemtime(4)<0
edge = 0,80

[State 810, Playerpush]
type = Playerpush
trigger1 = 1
value = 0

[State 801, Throw Sound]
type = PlaySnd
trigger1 = AnimElem = 3
value = s3,8

[State 801, Throw Sound]
type = PlaySnd
trigger1 = AnimElem = 2
value = s0,5

[State 801, Bind 2]
type = TargetBind
trigger1 = AnimElemTime(1)>=0&&animelemtime(2)<0
pos = 32, -14

[State 801, Bind 3-4]
type = TargetBind
trigger1 = AnimElemTime(2)>=0&&animelemtime(3)<0
pos = 0, -92

[State 801, Bind 5]
type = TargetBind
trigger1 = AnimElemTime(3)>=0&&animelemtime(4)<0
pos = -27, -101

[State 0, Turn]
type = Turn
trigger1 = animelem = 5

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

[State 0, CtrlSet]
type = CtrlSet
trigger1 = animelemtime(9)>=0
value = 1

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelemtime(6)>=0
movetype = I
physics = A
;---------------------------------------------------------------------------
; Thrown by Throw Forward
[Statedef 860]
type    = A
movetype= H
physics = N
velset = 0,0

[State 832, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0

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

[State 832, SelfState]
type = Selfstate
;trigger1 = !numenemy
trigger1 = !gethitvar(isbound)
value = 5040
ctrl=1

;---------------------------------------------------------------------------
; Thrown by Throw Forward
[Statedef 861]
type    = A
movetype= H
physics = N
velset = 0,0

[State 832, ScreenBound]
type = ScreenBound
trigger1 = animelemtime(5) < 0
value = 0

[State 832, 1]
type = ChangeAnim2
Trigger1 = Time = 0&&anim!=861
value = 861

[State 0, HitVelSet]
type = VelSet
trigger1 = animelemtime(5) = 0
x = 5
y = -7

[State 0, VelAdd]
type = VelAdd
trigger1 = animelemtime(5)>=0
y = .63

[State 0, LifeAdd]
type = LifeAdd
trigger1 = animelemtime(1)=0
value = -90

[State 832, Vel]
type = Velset
trigger1 = Pos Y >= const(size.mid.pos.y)/2 && Vel Y > 0 && animelemtime(5) > 0
x = 2.0

[State 5050, 4] ;Recover near ground
type = SelfState
triggerall = animelemtime(5)>=10
triggerall = Vel Y > 0
triggerall = Pos Y >= -20
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery"
value = 5200 ;HITFALL_RECOVER

[State 5050, 5]; Recover in mid air
type = SelfState
triggerall = animelemtime(5)>=10
triggerall = Vel Y > -1
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery"
value = 5210 ;HITFALL_AIRRECOVER

[State 0, EnvShake]
type = EnvShake
trigger1 = Pos Y >= const(size.mid.pos.y)/2 && Vel Y > 0 && animelemtime(5) > 0
time = 12
freq = 60
ampl = -6
persistent = 0

[State 832, SelfState]
type = changestate
trigger1 = Pos Y >= const(size.mid.pos.y)/2 && Vel Y > 0 && animelemtime(5) > 0
value = 812

;---------------------------------------------------------------------------
; Thrown by Throw Forward
[Statedef 870]
type    = A
movetype= H
physics = N
velset = 0,0

[State 832, ScreenBound]
type = ScreenBound
trigger1 = animelemtime(3) < 0
value = 0

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

[State 832, Velset]
type = Velset
trigger1 = animelemtime(3) = 0
x = 7.5

[State 0, HitVelSet]
type = HitVelSet
trigger1 = animelemtime(3) = 0
y = 1

[State 0, VelAdd]
type = VelAdd
trigger1 = animelemtime(3)>=0
y = gethitvar(yaccel)

[State 5050, 4] ;Recover near ground
type = SelfState
triggerall = animelemtime(5)>=0
triggerall = Vel Y > 0
triggerall = Pos Y >= -20
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery"
value = 5200 ;HITFALL_RECOVER

[State 5050, 5]; Recover in mid air
type = SelfState
triggerall = animelemtime(5)>=0
triggerall = Vel Y > -1
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery"
value = 5210 ;HITFALL_AIRRECOVER

[State 832, Vel]
type = Velset
trigger1 = Pos Y >= const(size.mid.pos.y)/2 && Vel Y > 0 && animelemtime(3) > 0
x = 2.0

[State 801, Hurt 11]
type = LifeAdd
trigger1 = animelemtime(4)=0;Pos Y >= const(size.mid.pos.y)/2 && Vel Y > 0 && animelemtime(4) > 0
value = -90
persistent = 0

[State 0, EnvShake]
type = EnvShake
trigger1 = Pos Y >= const(size.mid.pos.y)/2 && Vel Y > 0 && animelemtime(3) > 0
time = 12
freq = 60
ampl = -6
persistent = 0

[State 832, SelfState]
type = changestate
trigger1 = Pos Y >= const(size.mid.pos.y)/2 && Vel Y > 0 && animelemtime(3) > 0
value = 812
;---------------------------------------------------------------------------
; roll recovery
[Statedef 900]
type    = S				;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= I				;Move-type: A-attack, I-idle, H-gethit
physics = N				;Physics: S-stand, C-crouch, A-air
juggle  = 0				;Number of air juggle points move takes
velset = 0,0			;Set velocity (x,y) (Def: no change)
ctrl = 0				;Set ctrl (Def: no change)
anim = 900				;Change animation (Def: no change)
poweradd = 20			;Power to add (Def: 0)
sprpriority = 1			;Set layering priority to 2 (in front)

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

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

[State 0, VelSet]
type = VelSet
trigger1 = animelem = 2
x =7.5
y = 0

[State 0, VelSet]
type = VelSet
trigger1 = animelem=10
x = 0

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

[State 0, PosSet]
type = PosSet
trigger1 = time = 0
y = 0

[State 5700, VarSet]
type = VarSet
trigger1 = Time = 0
var(22) = 0

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

[State 200, 5]
type = ChangeState
trigger1 = (AnimElemTime(2)>=0&&AnimElemTime(10)<0)&&FrontEdgeBodyDist <= 10
trigger2 = command = "holddown"&&AnimElem=10
value = 11
ctrl = 1
;---------------------------------------------------------------------------
; roll recovery
[Statedef 901]
type    = S				;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= I				;Move-type: A-attack, I-idle, H-gethit
physics = N				;Physics: S-stand, C-crouch, A-air
juggle  = 0				;Number of air juggle points move takes
velset = 0,0			;Set velocity (x,y) (Def: no change)
ctrl = 0				;Set ctrl (Def: no change)
anim = 901				;Change animation (Def: no change)
poweradd = 20			;Power to add (Def: 0)
sprpriority = 1		;Set layering priority to 2 (in front)

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

[State 0, VelSet]
type = VelSet
trigger1 = animelem = 1
x =-7.5
y = 0

[State 0, VelSet]
type = VelSet
trigger1 = animelem=10
x = 0

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

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

[State 0, PosSet]
type = PosSet
trigger1 = time = 0
y = 0

[State 5700, VarSet]
type = VarSet
trigger1 = Time = 0
var(22) = 0

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

[State 200, 5]
type = ChangeState
trigger1 = (AnimElemTime(2)>=0&&AnimElemTime(10)<0)&&backEdgeBodyDist <= 10
trigger2 = command = "holddown"&&AnimElem=10
value = 11
ctrl = 1
;---------------------------------------------------------------------------
; roll recovery
[Statedef 902]
type    = S				;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= I				;Move-type: A-attack, I-idle, H-gethit
physics = N				;Physics: S-stand, C-crouch, A-air
juggle  = 0				;Number of air juggle points move takes
velset = 0,0			;Set velocity (x,y) (Def: no change)
ctrl = 0				;Set ctrl (Def: no change)
anim = 902				;Change animation (Def: no change)
poweradd = 20			;Power to add (Def: 0)
sprpriority = 1			;Set layering priority to 2 (in front)

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

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

[State 0, VelSet]
type = VelSet
trigger1 = animelem = 2
x =7.5
y = 0

[State 0, VelSet]
type = VelSet
trigger1 = animelem=6
x = 0

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

[State 0, PosSet]
type = PosSet
trigger1 = time = 0
y = 0

[State 5700, VarSet]
type = VarSet
trigger1 = Time = 0
var(22) = 0

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

[State 200, 5]
type = ChangeState
trigger1 = (AnimElemTime(2)>=0&&AnimElemTime(6)<0)&&FrontEdgeBodyDist <= 10
trigger2 = command = "holddown"&&AnimElem=6
value = 11
ctrl = 1
;---------------------------------------------------------------------------
; roll recovery
[Statedef 903]
type    = S				;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= I				;Move-type: A-attack, I-idle, H-gethit
physics = N				;Physics: S-stand, C-crouch, A-air
juggle  = 0				;Number of air juggle points move takes
velset = 0,0			;Set velocity (x,y) (Def: no change)
ctrl = 0				;Set ctrl (Def: no change)
anim = 903				;Change animation (Def: no change)
poweradd = 20			;Power to add (Def: 0)
sprpriority = 1		;Set layering priority to 2 (in front)

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

[State 0, VelSet]
type = VelSet
trigger1 = animelem = 1
x =-7.5
y = 0

[State 0, VelSet]
type = VelSet
trigger1 = animelem=6
x = 0

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

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

[State 0, PosSet]
type = PosSet
trigger1 = time = 0
y = 0

[State 5700, VarSet]
type = VarSet
trigger1 = Time = 0
var(22) = 0

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

[State 200, 5]
type = ChangeState
trigger1 = (AnimElemTime(2)>=0&&AnimElemTime(6)<0)&&backEdgeBodyDist <= 10
trigger2 = command = "holddown"&&AnimElem=6
value = 11
ctrl = 1

;==========<ZERO COUNTER>==========
[Statedef 750]
type=S
physics=S
movetype=I
anim=750
ctrl=0
velset=0,0
poweradd=-500
sprpriority=2

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

[State 750, strengthvar]
type=varset
trigger1=!time&&var(59)<=0
var(10)=ifelse((command="bdx"||command="bdy"||command="bdz"),1,2)
ignorehitpause=1

[State 750, strengthvar (AI)]
type=varset
trigger1=!time&&var(59)=1
var(10)=1
ignorehitpause=1

[State 750, snd]
type=playsnd
trigger1=time = 0
value=2,3
channel=0

[State 750, superpause]
type=superpause
trigger1=!time
time=20
movetime=20
anim=-1
sound=s3,0
p2defmul=1
darken=0

[State 3000, carga]
type=helper
trigger1=time = 0
helpertype=normal
stateno=9750
ID=9750
name="fx"
postype=p1
pos = 50,-55
ownpal=1
persistent=0
supermovetime=9999

[State 750, end]
type=changestate
trigger1=time>=20
value=ifelse(var(10)=1,1102,450)

;==========<ZERO COUNTER>==========
[Statedef 751]
type=A
physics=N
movetype=I
anim=751
ctrl=0
velset=0,0
poweradd=-500
sprpriority=2

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

[State 750, strengthvar]
type=varset
trigger1=!time&&var(59)<=0
var(10)=ifelse((command="bdx"||command="bdy"||command="bdz"),1,2)
ignorehitpause=1

[State 750, strengthvar (AI)]
type=varset
trigger1=!time&&var(59)=1
var(10)=1
ignorehitpause=1

[State 750, snd]
type=playsnd
trigger1=time = 0
value=2,3
channel=0

[State 750, superpause]
type=superpause
trigger1=!time
time=20
movetime=20
anim=-1
sound=s3,0
p2defmul=1
darken=0

[State 3000, carga]
type=helper
trigger1=time = 0
helpertype=normal
stateno=9750
ID=9750
name="fx"
postype=p1
pos = 50,-90
ownpal=1
persistent=0
supermovetime=9999

[State 750, end]
type=changestate
trigger1=time>=20
value=ifelse(var(10)=1,1105,1205)

;;-----------------------------
; Charge
[Statedef 950]
type    = S				;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= I				;Move-type: A-attack, I-idle, H-gethit
physics = S				;Physics: S-stand, C-crouch, A-air
juggle  = 1				;Number of air juggle points move takes
velset = 0,0			;Set velocity (x,y) (Def: no change)
ctrl = 0				;Set ctrl (Def: no change)
anim = 950				;Change animation (Def: no change)
poweradd = 0			;Power to add (Def: 0)
sprpriority = 2			;Set layering priority to 2 (in front)

[State 820, PowerAdd]
type = PowerAdd
triggerall = Anim = 950
trigger1 = 1
value = 2* ((time+12)/12)

[State 820, Anim]
type = ChangeAnim
triggerall=var(59)<=0
;triggerall = Time >= 4
trigger1 = (Command != "chargey" || Command != "chargeb") || (power >= 3000)
value = 951
persistent = 0

[State 740, fx]
type=helper
trigger1=anim=950&&!numhelper(7240)&&animelem =2
helpertype=normal
stateno=7240
ID=7240
name="Power Charge"
postype=p1
ownpal=1
persistent=0

[State 820, StateChange]
type = ChangeState
trigger1 = anim = 951 && AnimTime = 0
value = 0
ctrl = 1

;==================================================================================
;======| RELACIONADO À AI - AI RELATED |===========================================
;==================================================================================

; (Credit to ANMC, Bagaliao, and FlowaGirl for the basic helper method concept.)
;
;------------------
; AI Activation Helper State - Primary Version
; (Credit to YongMing for the basic HitPause bugfix concept.)
;
; var(1) - First tick button activation prevention.
; var(2) - Used for pause/superpause and custom state check, basically.
; var(3) - (Super/)Pause & custom state-triggered dir detection disabler.
; var(4) - Persistent direction command detection enabler (due to 2002.04.14).
; var(9) - AutoTurn bug fixer.
; parent's var(57) - Parent's GameTime var, for pause and custom state check.
; parent's var(59) - Parent's primary AI variable.
;
; The code in this state is mostly simply copy/pasteable.
; But if you're using different indices for the parent's variables,
; or if you change your character's basic commands' names, you'll
; of course need to change the code in this state accordingly.

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

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

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

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

[State 9741, DirTurnOffAI]
type = ParentVarSet
triggerall = !var(3)
triggerall = Parent,var(59)
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(59) = (var(4):=0)

[State 9741, ButtonTurnOnAI]
type = ParentVarSet
triggerall = var(1)
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(59) = 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(59) = -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(59)
trigger2 = !(Parent,Alive)
trigger3 = (RoundState != 2)


;------------------
; AI Activation Helper State - Compatibly Partnered Version
;
; var(1) - First tick dir activation prevention
; var(2) - Used for pause/superpause and custom state check, basically.
; var(3) - (Super/)Pause & custom state-triggered dir detection disabler.
; var(4) - Hitpause check.
; var(5) - No button on previous tick.
; var(6) - Any dir on this tick.
; var(7) - Any button on this tick.
; var(8) - Matching partner button detected.
; var(9) - AutoTurn bug fixer.
; parent's var(57) - Parent's GameTime var, for pause and custom state check.
; parent's var(59) - Parent's primary AI variable.
;
; The code in this state is mostly simply copy/pasteable.
; But if you're using different indices for the parent's variables,
; or if you change your character's basic commands' names, you'll
; of course need to change the code in this state accordingly.

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

[State 9742, PauseCheck]
type = VarSet
trigger1 = (GameTime>Parent,var(57))
trigger2 = !(Parent,Alive)
trigger3 = (RoundState != 2)
trigger4 = Parent,var(59)
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, 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(15):=0)
var(15) = 1

[State 9742, DirTurnOnAI]
type = ParentVarSet
trigger1 = var(1)
trigger1 = var(6)
trigger1 = !var(3)
trigger1 = !var(4)
trigger1 = !var(9)
var(59) = 1

[State 9742, DirTurnOffAI]
type = ParentVarSet
triggerall = var(6)
triggerall = !var(3)
triggerall = Parent,var(59)
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(59) = 0

[State 9742, ButtonTurnOnAI]
type = ParentVarSet
trigger1 = var(5)
trigger1 = var(7)
trigger1 = !var(2)
trigger1 = !var(15)
var(59) = 1

[State 9742, ButtonTurnOffAI]
type = ParentVarSet
triggerall = var(7)
triggerall = !var(2)
triggerall = !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(59) = -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(59)
trigger2 = !(Parent,Alive)
trigger3 = (RoundState != 2)

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

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


;------------------
; XOR Method's HitPauseTime Helper State

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

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

[State 9743, HitPauseTime]
type = VarSet
trigger1 = !(Parent,HitPauseTime)
trigger2 = (GameTime>Parent,var(57))
var(1) = Parent,HitPauseTime

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