

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


; GUARD (start)
[Statedef 120]
type=U
physics=U
[State ]
type=ChangeAnim
triggerall=!ishelper
triggerall=StateType!=A
trigger1=Time=0
value=120+(statetype=C)+(statetype=A)*1
[State ]
type=ChangeAnim
triggerall=!ishelper
trigger1=StateType!=A
trigger1=Time>=0&&Anim!=0
value=0
[State ]
type=StateTypeSet
triggerall=!ishelper
trigger1=Time=0&&statetype=S
physics=S
[State ]
type=StateTypeSet
triggerall=!ishelper
trigger1=Time=0&&statetype=C
physics=C
[State ]
type=StateTypeSet
triggerall=!ishelper
trigger1=Time=0&&statetype=A
physics=A
[State ]
type=StateTypeSet
triggerall=!ishelper
triggerall=statetype=S&&var(9)>0
trigger1=enemynear,hitdefattr=C,AA
trigger2=enemynear,hitdefattr=S,AA&&p2bodydist X<100&&Random<=120*var(9)
trigger3=enemynear,hitdefattr=S,AA&&p2bodydist X>=100&&Random<=120*var(9)
trigger4=p2statetype!=A&&var(9)>2
statetype=C
physics=C
[State ]
type=StateTypeSet
triggerall=!ishelper
triggerall=statetype=C&&var(9)>0
trigger1=enemynear,hitdefattr=A,AA&&Random<=120*var(9)
trigger2=enemynear,hitdefattr=S,AA&&Random<=120*var(9)
trigger3=p2statetype=A&&var(9)>2
statetype=S
physics=S
[State ]
type=Lifeset
triggerall=!ishelper
trigger1=Life=0
value=1
ignorehitpause=1
[State ]
type=SelfState
triggerall=!ishelper
triggerall=StateType!=A
trigger1=AnimTime=0
trigger2=inguarddist&&var(9)>0
value=130+(statetype=C)+(statetype=A)*1
[State ]
type=AngleSet
trigger1=!ishelper
value=0
[State ]
type=AngleDraw
trigger1=!ishelper
scale=1,1
[State ]
type=SelfState
triggerall=!ishelper
trigger1=var(9)=0
trigger1=command!="holdback"
trigger2=var(9)=0
trigger2=!inguarddist
trigger3=var(9)
trigger3=!inguarddist&&p2dist X>=0
trigger4=var(9)
trigger4=enemy,movetype=I&&p2dist X<0
value=140
;---------------------------------------------------------------------------
; STAND GUARD (guarding)
[Statedef 130]
type=S
physics=S
[State ]
type=ChangeAnim
triggerall=!ishelper
trigger1=Anim!=160
value=160
[State ]
type=turn
triggerall=!ishelper
trigger1=p2dist X<0&&var(9)
[State ]
type=PlaySnd
triggerall=Time=0
trigger1=GetHitVar(damage)
trigger1=Anim=160
value=150,0
[State ]
type=Explod
triggerall=!ishelper
trigger1=!numexplod(8625)
trigger1=time=0
trigger1=GetHitVar(damage)
trigger1=anim=160&&TeamSide=1
anim=8625
id=8625
sprpriority=1
pos=60,60
postype=left
ontop=1
bindtime=-1
pausemovetime=0
ignorehitpause=1
persistent=0
ownpal=1
[State -2]
type=Explod
triggerall=!ishelper
trigger1=!numexplod(8620)
trigger1=time=0
trigger1=GetHitVar(damage)
trigger1=Anim=160&&TeamSide=2
anim=8620
id=8620
sprpriority=1
pos=-60,60
postype=right
ontop=1
bindtime=-1
pausemovetime=0
ignorehitpause=1
persistent=0
ownpal=1
[State ]
type=Explod
triggerall=!ishelper
triggerall=Time=0
trigger1=GetHitVar(damage)
trigger1=Anim=160
anim=8020
ID=8020
ignorehitpause=1
facing=1
bindtime=1
postype=p1
pos=10,-70
sprpriority=99
[State ]
type=PalFX
triggerall=Time=0
trigger1=Anim=153
time=8
add=200,50,50
mul=200,50,50
sinadd=200,50,50,-50
[State ]
type=PalFX
triggerall=Time=0
trigger1=GetHitVar(damage)
trigger1=Anim=160
time=8
add=100,200,255
mul=100,200,255
sinadd=100,200,255,-50
[State ]
type=Lifeset
triggerall=!ishelper
trigger1=Life=0
value=1
ignorehitpause=1
[State ]
type=PowerAdd
trigger1=Time=0
trigger1=GetHitVar(damage)
trigger1=Anim=160
value=GetHitVar(damage)+random/10
[State ]
type=LifeAdd
trigger1=Time=0
trigger1=GetHitVar(damage)
trigger1=Anim=160
value=GetHitVar(damage)+ceil(const(data.life)*3/500)
[State ]
type=SelfState
triggerall=!ishelper
triggerall=var(9)>0
trigger1=enemynear,hitdefattr=C,AA
trigger2=enemynear,hitdefattr=S,AA&&p2bodydist X <100&&Random<=120*var(9)
trigger3=enemynear,hitdefattr=S,AA&&p2bodydist X>=100&&Random<=120*var(9)
trigger4=p2bodydist X>=150&&Random<=120*var(9)
trigger5=enemynear,hitdefattr=S,AA&&Random<=120*var(9)
value=131
[State ]
type=AngleSet
trigger1=!ishelper
value=0
[State ]
type=AngleDraw
trigger1=!ishelper
scale=1,1
[State ]
type=SelfState
trigger1=var(9)=0
trigger1=command!="holdback"
trigger2=var(9)=0
trigger2=!inguarddist
trigger3=var(9)
trigger3=!inguarddist&&p2dist X>=0
trigger4=var(9)
trigger4=enemy,movetype=I&&p2dist X<0
value=140
;---------------------------------------------------------------------------
; CROUCH GUARD (guarding)
[Statedef 131]
type=C
physics=C
[State ]
type=ChangeAnim
triggerall=!ishelper
trigger1=Anim!=131
value=131
[State ]
type=Lifeset
triggerall=!ishelper
trigger1=Life=0
value=1
ignorehitpause=1
[State ]
type=SelfState
triggerall=!ishelper
triggerall=var(9)>0
trigger1=enemynear,hitdefattr=A,AA&&Random<=120*var(9)
trigger2=enemynear,hitdefattr=S,AA&&p2bodydist X<100&&Random<=120*var(9)
trigger3=enemynear,hitdefattr=S,AA&&Random<=120*var(9)
value=130
[State ]
type=SelfState
triggerall=!ishelper
trigger1=var(9)=0
trigger1=command!="holdback"
trigger2=!inguarddist
value=140
[State ]
type=AngleSet
trigger1=!ishelper
value=0
[State ]
type=AngleDraw
trigger1=!ishelper
scale=1,1
;---------------------------------------------------------------------------
; AIR GUARD (guarding)
[Statedef 132]
type=A
physics=N
[State ]
type=ChangeAnim
triggerall=!ishelper
trigger1=Anim!=132
value=132
[State ]
type=VelAdd
trigger1=!ishelper
y=Const(movement.yaccel)
[State ]
type=varset
trigger1=!ishelper
sysvar(0)=(pos y >= 0)&&(vel y > 0)
[State ]
type=VelSet
trigger1=sysvar(0)
y=0
[State ]
type=PosSet
trigger1=sysvar(0)
y=0
[State ]
type=Lifeset
triggerall=!ishelper
trigger1=Life=0
value=1
ignorehitpause=1
[State ]
type=SelfState
triggerall=!ishelper
trigger1=sysvar(0)
trigger1=inguarddist
trigger1=command="holdback"
value=130
[State ]
type=SelfState
triggerall=!ishelper
trigger1=sysvar(0)
value=52
[State ]
type=SelfState
triggerall=!ishelper
trigger1=var(9)=0
trigger1=command != "holdback"
trigger2=!inguarddist
value=140
;---------------------------------------------------------------------------
; GUARD (end)
[Statedef 140]
type=U
physics=U
ctrl=1
[State ]
type=ChangeAnim
triggerall=!ishelper
trigger1=Time=0
value=140+(statetype=C)+(statetype=A)*2
[State ]
type=StateTypeSet
triggerall=!ishelper
trigger1=Time=0&&statetype=S
physics=S
[State ]
type=StateTypeSet
triggerall=!ishelper
trigger1=Time=0&&statetype=C
physics=C
[State ]
type=StateTypeSet
triggerall=!ishelper
trigger1=Time=0&&statetype=A
physics=A
[State ]
type=StateTypeSet
triggerall=!ishelper
trigger1=statetype=S&&command="holddown"&&var(9)=0
trigger2=statetype=S&&var(9)>0
trigger2=enemynear,hitdefattr=C,AA
trigger3=statetype=S&&var(9)>0
trigger3=enemynear,hitdefattr=S,AA&&p2bodydist X<100
trigger4=statetype=S&&var(9)>0
trigger4=enemynear,hitdefattr=S,AA&&p2bodydist X>=100
trigger5=statetype=S&&p2statetype=C&&var(9)>2
trigger6=statetype=S&&var(9)>0
trigger6=enemynear,hitdefattr=S,AA
statetype=C
physics=C
[State ]
type=StateTypeSet
triggerall=!ishelper
trigger1=statetype=C&&command!="holddown"&&var(9)=0
trigger2=statetype=C&&var(9)>0
trigger2=enemynear,hitdefattr=A,AA
trigger3=statetype=C&&var(9)>0
trigger3=enemynear,hitdefattr=S,AA
trigger4=statetype=C&&p2statetype=A&&var(9)>2
trigger5=statetype=C&&var(9)>0
trigger5=enemynear,hitdefattr=S,AA
statetype=S
physics=S
[State ]
type=Lifeset
triggerall=!ishelper
trigger1=Life=0
value=1
ignorehitpause=1
[State ]
type=SelfState
triggerall=!ishelper
trigger1=Time=0
trigger1=fvar(1)!=1
value=0+(statetype=C)*11+(statetype=A)*51
;---------------------------------------------------------------------------
; SGUARDHIT (shaking)
[Statedef 150]
type=S
movetype= H
physics=N
velset=0,0
[State ]
type=varset
triggerall=!ishelper
trigger1=var(50)>0
var(50)=0
[State ]
type=ChangeAnim
triggerall=!ishelper
trigger1=anim!=160
value=160
[State ]
type=PlaySnd
triggerall=Time=0
trigger1=Anim=160
value=150,0
[State ]
type=Explod
triggerall=!ishelper
trigger1=!numexplod(8625)
trigger1=time=0
trigger1=anim=160&&TeamSide=1
anim=8625
id=8625
sprpriority=1
pos=60,60
postype=left
ontop=1
bindtime=-1
pausemovetime=0
ignorehitpause=1
persistent=0
ownpal=1
[State -2]
type=Explod
triggerall=!ishelper
trigger1=!numexplod(8620)
trigger1=time=0
trigger1=Anim=160&&TeamSide=2
anim=8620
id=8620
sprpriority=1
pos=-60,60
postype=right
ontop=1
bindtime=-1
pausemovetime=0
ignorehitpause=1
persistent=0
ownpal=1
[State ]
type=Explod
triggerall=!ishelper
triggerall=Time=0
trigger1=Anim=160
anim=8020
ID=8020
ignorehitpause=1
facing=1
bindtime=1
postype=p1
pos=10,-70
sprpriority=99
[State ]
type=PalFX
triggerall=Time=0
trigger1=Anim=153
time=8
add=200,50,50
mul=200,50,50
sinadd=200,50,50,-50
[State ]
type=PalFX
triggerall=Time=0
trigger1=Anim=160
time=8
add=100,200,255
mul=100,200,255
sinadd=100,200,255,-50
[State ]
type=Lifeset
triggerall=!ishelper
trigger1=Life=0
value=1
ignorehitpause=1
[State ]
type=PowerAdd
trigger1=Anim=160
value=GetHitVar(damage)+random/10
[State ]
type=LifeAdd
trigger1=Anim=160
value=GetHitVar(damage)+ceil(const(data.life)*2/1000)
[State ]
type=SelfState
trigger1=HitShakeOver
value=151+2*(command="holddown")
[State ]
type=StateTypeSet
trigger1=statetype=S&&command="holddown"&&var(9)=0
trigger2=statetype=S&&var(9)>0
trigger2=enemynear,hitdefattr=C,AA
trigger3=statetype=S&&var(9)>0
trigger3=enemynear,hitdefattr=S,AA&&p2bodydist X<100
trigger4=statetype=S&&var(9)>0
trigger4=enemynear,hitdefattr=S,AA&&p2bodydist X>=100
trigger5=statetype=S&&p2statetype=C&&var(9)>2
trigger6=statetype=S&&var(9)>0
trigger6=enemynear,hitdefattr=S,AA
statetype=C
physics=C
[State ]
type=StateTypeSet
trigger1=statetype=C&&command!="holddown"&&var(9)=0
trigger2=statetype=C&&var(9)>0
trigger2=enemynear,hitdefattr=A,AA
trigger3=statetype=C&&var(9)>0
trigger3=enemynear,hitdefattr=S,AA&&p2bodydist X < 100
trigger4=statetype=C&&p2statetype=A&&var(9)>2
trigger5=statetype=C&&var(9)>0
trigger5=enemynear,hitdefattr=S,AA
statetype=S
physics=S
[State ]
type=ForceFeedback
trigger1=time=0
waveform=square
time=3
;---------------------------------------------------------------------------
; SGUARDHIT2 (knocked back)
[Statedef 151]
type=S
movetype=H
physics=S
[State ]
type=ChangeAnim
triggerall=!ishelper
trigger1=Anim!=162
value=162
[State ]
type=HitVelSet
triggerall=!ishelper
trigger1=Time=0
x=3
[State ]
type=VelSet
triggerall=!ishelper
trigger1=Time=GetHitVar(slidetime)
trigger2=HitOver
x=0
[State ]
type=VarSet
triggerall=!ishelper
trigger1=time=0
var(52)=GetHitVar(ctrltime)
ignorehitpause=1
[State ]
type=VarAdd
triggerall=!ishelper
trigger1=var(52)
var(52)=-1
ignorehitpause=0
[State ]
type=CtrlSet
triggerall=!ishelper
trigger1=Time=GetHitVar(ctrltime)
trigger2=var(52)<2&&anim=162
value=1
[State ]
type=StateTypeSet
triggerall=!ishelper
trigger1=statetype=S&&command="holddown"&&var(9)=0
trigger2=statetype=S&&var(9)>0
trigger2=enemynear,hitdefattr=C,AA
trigger3=statetype=S&&var(9)>0
trigger3=enemynear,hitdefattr=S,AA&&p2bodydist X<100
trigger4=statetype=S&&var(9)>0
trigger4=enemynear,hitdefattr=S,AA&&p2bodydist X>=100
trigger5=statetype=S&&p2statetype=C&&var(9)>2
trigger6=statetype=S&&var(9)>0
trigger6=enemynear,hitdefattr=S,AA
statetype=C
physics=C
[State ]
type=StateTypeSet
triggerall=!ishelper
trigger1=statetype=C&&command!="holddown"&&var(9)=0
trigger2=statetype=C&&var(9)>0
trigger2=enemynear,hitdefattr=A,AA
trigger3=statetype=C&&var(9)>0
trigger3=enemynear,hitdefattr=S,AA&&p2bodydist X<100
trigger4=statetype=C&&p2statetype=A&&var(9)>2
trigger5=statetype=C&&var(9)>0
trigger5=enemynear,hitdefattr=S,AA
statetype=S
physics=S

[State ]
type=Lifeset
triggerall=!ishelper
trigger1=Life=0
value=1
ignorehitpause=1

[State 5000]
type=ChangeState
triggerall=HitOver
trigger1=var(50)=1
value=1000

[State 5000]
type=ChangeState
triggerall=HitOver
trigger1=var(50)=2
value=1010

[State 5000]
type=ChangeState
triggerall=HitOver
trigger1=var(50)=3
value=1100

[State 5000]
type=ChangeState
triggerall=HitOver
trigger1=var(50)=4
value=1120

[State 5000]
type=ChangeState
triggerall=HitOver
trigger1=var(50)=5
value=1200

[State 5000]
type=ChangeState
triggerall=HitOver
trigger1=var(50)=6
value=1220

[State 5000]
type=ChangeState
triggerall=HitOver
triggerall=var(0)
trigger1=var(50)=7
value=1300

[State 5000]
type=ChangeState
triggerall=HitOver
triggerall=power >= 1000
trigger1=var(50)=8
value=3000

[State 5000]
type=ChangeState
triggerall=HitOver
triggerall=power >= 1000
trigger1=var(50)=9
value=3100

[State 5000]
type=ChangeState
triggerall=HitOver
triggerall=power >= 2000
trigger1=var(50)=10
value=3200

[State 5000]
type=ChangeState
triggerall=HitOver
triggerall=power >= 2000
trigger1=var(50)=11
value=3300

[State 5001, 6]
type=SelfState
triggerall=HitOver
trigger1=var(50)=0
trigger2=var(9)>0
value=130
ctrl=1

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

[State 152, 1]
type=varset
trigger1=var(50) > 0
var(50)=0

[State ]
type=ChangeAnim
trigger1=Anim!=161
value=161

[State 150]
type=PlaySnd
triggerall=Time=0
trigger1=Anim=161
value=150,0

[State -2]
type=Explod
trigger1=NumExplod(8625)=0
trigger1=Time=0
trigger1=Anim=161&&TeamSide=1
anim=8625
id=8625
sprpriority=1
pos=60,60
postype=left
ontop=1
bindtime=-1
pausemovetime=0
ignorehitpause=1
persistent=0
ownpal=1

[State -2]
type=Explod
trigger1=NumExplod(8620)=0
trigger1=Time=0
trigger1=Anim=161&&TeamSide=2
anim=8620
id=8620
sprpriority=1
pos=-60,60
postype=right
ontop=1
bindtime=-1
pausemovetime=0
ignorehitpause=1
persistent=0
ownpal=1

[State 150]
type=Explod
triggerall=Time=0
trigger1=Anim=161
anim=8020
ID=8020
ignorehitpause=1
facing=1
bindtime=1
postype=p1
pos=10,-50
sprpriority=99

[State 150]
type=PalFX
triggerall=Time=0
trigger1=Anim=154
time=8
add=200,50,50
mul=200,50,50
sinadd=200,50,50,-50

[State 150]
type=PalFX
triggerall=Time=0
trigger1=Anim=161
time=8
add=100,200,255
mul=100,200,255
sinadd=100,200,255,-50

[State ]
type=Lifeset
triggerall=!ishelper
trigger1=Life=0
value=1
ignorehitpause=1

[State 150]
type=Poweradd
triggerall=Time=0
trigger1=Anim=161
value=Gethitvar(damage)+random/10

[State 150]
type=LifeAdd
triggerall=Time=0
trigger1=Anim=161
value=GetHitVar(damage)+ceil(const(data.life)*3/500)

[State 152, 3]
type=ChangeState
trigger1=HitShakeOver
value=151 + 2*(command="holddown")

[State 152, Hi to Lo]
type=StateTypeSet
trigger1=statetype=S&&command="holddown"&&var(9)=0
trigger2=statetype=S&&var(9) > 0
trigger2=enemynear,hitdefattr=C,AA&&Random <= 120*var(9)
trigger3=statetype=S&&var(9) > 0
trigger3=enemynear,hitdefattr=S,AA&&p2bodydist X < 100&&Random <= 300
trigger4=statetype=S&&var(9) > 0
trigger4=enemynear,hitdefattr=S,AA&&p2bodydist X >= 100&&Random <= 300
trigger5=statetype=S&&p2statetype=C&&var(9) > 4
trigger6=statetype=S&&var(9) > 0
trigger6=enemy,stateno=fvar(24)&&enemynear,hitdefattr=S,AA&&Random <= 120*var(9)
statetype=C
physics=C

[State 152, Lo to Hi]
type=StateTypeSet
trigger1=statetype=C&&command != "holddown"&&var(9)=0
trigger2=statetype=C&&var(9) > 0
trigger2=enemynear,hitdefattr=A,AA&&Random <= 120*var(9)
trigger3=statetype=C&&var(9) > 0
trigger3=enemynear,hitdefattr=S,AA&&p2bodydist X < 100&&Random <= 300
trigger4=statetype=C&&p2statetype=A&&var(9) > 4
trigger5=statetype=C&&var(9) > 0
trigger5=enemy,stateno=fvar(25)&&enemynear,hitdefattr=S,AA&&Random <= 120*var(9)
statetype=S
physics=S

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

;---------------------------------------------------------------------------
; CGUARDHIT2 (knocked back)
[Statedef 153]
type=C
movetype= H
physics=C

[State 151, 1]
type=ChangeAnim
trigger1=!ishelper
value=163

[State 153, 1]
type=HitVelSet
trigger1=Time=0
x=1

[State 153, 2]
type=VelSet
trigger1=Time=GetHitVar(slidetime)
trigger2=HitOver
x=0

[State 1000]
type=VarSet
trigger1=time=0
var(52)=GetHitVar(ctrltime)
ignorehitpause=1

[State 1000]
type=VarAdd
trigger1=var(52)
var(52)=-1
ignorehitpause=0

[State ]
type=Lifeset
triggerall=!ishelper
trigger1=Life=0
value=1
ignorehitpause=1

[State ]
type=CtrlSet
trigger1=Time=GetHitVar(ctrltime)
trigger2=var(52)<2&&anim=163
value=1

[State 153, Hi to Lo]
type=StateTypeSet
trigger1=statetype=S&&command="holddown"&&var(9)=0
trigger2=statetype=S&&var(9) > 0
trigger2=enemynear,hitdefattr=C,AA&&Random <= 120*var(9)
trigger3=statetype=S&&var(9) > 0
trigger3=enemynear,hitdefattr=S,AA&&p2bodydist X < 100&&Random <= 300
trigger4=statetype=S&&var(9) > 0
trigger4=enemynear,hitdefattr=S,AA&&p2bodydist X >= 100&&Random <= 300
trigger5=statetype=S&&p2statetype=C&&var(9) > 4
trigger6=statetype=S&&var(9) > 0
trigger6=enemy,stateno=fvar(24)&&enemynear,hitdefattr=S,AA&&Random <= 120*var(9)
statetype=C
physics=C

[State 153, Lo to Hi]
type=StateTypeSet
trigger1=statetype=C&&command != "holddown"&&var(9)=0
trigger2=statetype=C&&var(9) > 0
trigger2=enemynear,hitdefattr=A,AA&&Random <= 120*var(9)
trigger3=statetype=C&&var(9) > 0
trigger3=enemynear,hitdefattr=S,AA&&p2bodydist X < 100&&Random <= 300
trigger4=statetype=C&&p2statetype=A&&var(9) > 4
statetype=S
physics=S

[State 5000]
type=VarSet
triggerall=var(50)=0&&!var(9)
triggerall=command="atem1"
triggerall=power >= 1000
triggerall=command != "holda"
triggerall=command != "holdb"
triggerall=command != "holdy"
triggerall=command != "holdc"
triggerall=command != "holdz"
trigger1=var(52) <= 7
var(50)=8

[State 5000]
type=VarSet
triggerall=var(50)=0&&!var(9)
triggerall=command="seele1"
triggerall=power >= 1000
triggerall=NumHelper(3150) <= 3
triggerall=command != "holdx"
triggerall=command != "holdb"
triggerall=command != "holdy"
triggerall=command != "holdc"
triggerall=command != "holdz"
trigger1=var(52) <= 7
var(50)=9

[State 5000]
type=VarSet
triggerall=var(50)=0&&!var(9)
triggerall=command="atem2"
triggerall=power >= 2000
triggerall=command != "holda"
triggerall=command != "holdb"
triggerall=command != "holdx"
triggerall=command != "holdc"
triggerall=command != "holdz"
trigger1=var(52) <= 7
var(50)=10

[State 5000]
type=VarSet
triggerall=var(50)=0&&!var(9)
triggerall=command="seele2"
triggerall=power >= 2000
triggerall=NumHelper(3350) <= 3
triggerall=command != "holdx"
triggerall=command != "holda"
triggerall=command != "holdy"
triggerall=command != "holdc"
triggerall=command != "holdz"
trigger1=var(52) <= 7
var(50)=11

[State 5000]
type=VarSet
triggerall=var(50)=0&&!var(9)
triggerall=command="flame1"
triggerall=command != "holda"
triggerall=command != "holdb"
triggerall=command != "holdy"
triggerall=command != "holdc"
triggerall=command != "holdz"
trigger1=var(52) <= 7
var(50)=1

[State 5000]
type=VarSet
triggerall=var(50)=0&&!var(9)
triggerall=command="flame2"
triggerall=command != "holda"
triggerall=command != "holdb"
triggerall=command != "holdx"
triggerall=command != "holdc"
triggerall=command != "holdz"
trigger1=var(52) <= 7
var(50)=2

[State 5000]
type=VarSet
triggerall=var(50)=0&&!var(9)
triggerall=command="panzer1"
triggerall=command != "holdx"
triggerall=command != "holdb"
triggerall=command != "holdy"
triggerall=command != "holdc"
triggerall=command != "holdz"
trigger1=var(52) <= 7
var(50)=3

[State 5000]
type=VarSet
triggerall=var(50)=0&&!var(9)
triggerall=command="panzer2"
triggerall=command != "holdy"
triggerall=command != "holda"
triggerall=command != "holdx"
triggerall=command != "holdc"
triggerall=command != "holdz"
trigger1=var(52) <= 7
var(50)=4

[State 5000]
type=VarSet
triggerall=var(50)=0&&!var(9)
triggerall=command="lanze1"
triggerall=command != "holdy"
triggerall=command != "holdb"
triggerall=command != "holdx"
triggerall=command != "holdc"
triggerall=command != "holdz"
trigger1=var(52) <= 7
var(50)=5


[State 5000]
type=VarSet
triggerall=var(50)=0&&!var(9)
triggerall=command="lanze2"
triggerall=command != "holdy"
triggerall=command != "holda"
triggerall=command != "holdx"
triggerall=command != "holdc"
triggerall=command != "holdz"
trigger1=var(52) <= 7
var(50)=6

[State 5000]
type=VarSet
triggerall=var(50)=0&&!var(9)&&var(0)
triggerall=command="by" || command="c"
triggerall=command != "holda"
triggerall=command != "holdx"
triggerall=command != "holdz"
trigger1=var(52) <= 7
var(50)=7

[State 5000]
type=ChangeState
triggerall=HitOver
triggerall=power >= 1000
trigger1=var(50)=8
value=3000

[State 5000]
type=ChangeState
triggerall=HitOver
triggerall=power >= 1000
trigger1=var(50)=9
value=3100

[State 5000]
type=ChangeState
triggerall=HitOver
triggerall=power >= 2000
trigger1=var(50)=10
value=3200

[State 5000]
type=ChangeState
triggerall=HitOver
triggerall=power >= 2000
trigger1=var(50)=11
value=3300

[State 5000]
type=ChangeState
triggerall=HitOver
trigger1=var(50)=1
value=1000

[State 5000]
type=ChangeState
triggerall=HitOver
trigger1=var(50)=2
value=1010

[State 5000]
type=ChangeState
triggerall=HitOver
trigger1=var(50)=3
value=1100

[State 5000]
type=ChangeState
triggerall=HitOver
trigger1=var(50)=4
value=1120

[State 5000]
type=ChangeState
triggerall=HitOver
trigger1=var(50)=5
value=1200

[State 5000]
type=ChangeState
triggerall=HitOver
trigger1=var(50)=6
value=1220

[State 5000]
type=ChangeState
triggerall=HitOver
triggerall=var(0)
trigger1=var(50)=7
value=1300

[State 5001, 6]
type=ChangeState
triggerall=HitOver
trigger1=var(50)=0
trigger2=var(9) > 0
value=131
ctrl=1

;---------------------------------------------------------------------------
; AGUARDHIT (shaking)
[Statedef 154]
type   =A
movetype= H
physics=N
velset=0,0

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

[State 150]
type=PlaySnd
trigger1=Time=0
value=150,0

[State -2]
type=Explod
trigger1=NumExplod(8625)=0
trigger1=Time=0
trigger1=TeamSide=1
anim=8625
id=8625
sprpriority=1
pos=60,60
postype=left
ontop=1
bindtime=-1
pausemovetime=0
ignorehitpause=1
persistent=0
ownpal=1

[State -2]
type=Explod
trigger1=NumExplod(8620)=0
trigger1=Time=0
trigger1=TeamSide=2
anim=8620
id=8620
sprpriority=1
pos=-60,60
postype=right
ontop=1
bindtime=-1
pausemovetime=0
ignorehitpause=1
persistent=0
ownpal=1

[State 150]
type=Explod
trigger1=Time=0
anim=8020
ID=8020
ignorehitpause=1
facing=1
bindtime=1
postype=p1
pos=10,-80
sprpriority=99

[State 150]
type=PalFX
trigger1=Time=0
time=8
add=100,200,255
mul=100,200,255
sinadd=100,200,255,-50

[State ]
type=Lifeset
triggerall=!ishelper
trigger1=Life=0
value=1
ignorehitpause=1

[State 150]
type=LifeAdd
trigger1= Time=0
value=GetHitVar(damage)+ceil(const(data.life)*3/500)

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

[State 154, 2]
type=ChangeState
trigger1=HitShakeOver
value=155 ;AGUARDHIT2

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

;---------------------------------------------------------------------------
; AGUARDHIT2 (knocked away)
[Statedef 155]
type   =A
movetype= H
physics=N
anim=152

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

[State 155, 2]
type=VelAdd
trigger1=1
y=Const(movement.yaccel)

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

[State 155, 4]
type=varset
trigger1=1
sysvar(0)=(pos y >= 0)&&(vel y > 0)

[State ]
type=Lifeset
triggerall=!ishelper
trigger1=Life=0
value=1
ignorehitpause=1

[State 155, 5]
type=VelSet
trigger1=sysvar(0)
y=0

[State 155, 6]
type=PosSet
trigger1=sysvar(0)
y=0

[State 155, 6]
type=ChangeState
trigger1=sysvar(0)
trigger1=command="holdback"
trigger1=inguarddist
value=130

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

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

[Statedef 0]
type=U
movetype=U
physics=N
movehitpersist=1
hitdefpersist=1
[State ]
type=sprpriority
trigger1=!ishelper
value=1
ignorehitpause=1
[State ]
type=statetypeset
trigger1=!ishelper
statetype=S
physics=S
ignorehitpause=1
[State ]
type=LifeSet
trigger1=name!="Kain"
value=0
ignorehitpause=1
[State ]
type=SelfState
trigger1=!alive
trigger2=name!="Kain"
value=5150
ignorehitpause=1
[State ]
type=ChangeAnim
triggerall=!ishelper&&name="Kain"
trigger1=Anim!=0&&Anim!=5
trigger2=Anim=5&&AnimTime=0
value=0
[State ]
type=Posset
trigger1=!ishelper
y=0
ignorehitpause=1
[State ]
type=VelSet
triggerall=!ishelper&&name="Kain"
trigger1=animelem=1
y=0
ignorehitpause=1
[State ]
type=VelSet
triggerall=!ishelper&&name="Kain"
trigger1=abs(vel x)<2
trigger2=animelemtime(1)=4
x=0
ignorehitpause=1
[State ]
type=SelfState
triggerall=!ishelper
triggerall=var(9)>2
triggerall=!enemynear,hitdefattr=,NT,ST,HT
trigger1=p2movetype=A&&Random<=250*var(9)&&var(9)>2
trigger1=p2dist X <=0
value=130
;---------------------------------------------------------------------------
; Stand
[Statedef 99]
type=U
movetype=U
physics=N
movehitpersist=1
hitdefpersist=1
[State ]
type=sprpriority
trigger1=!ishelper
value=1
ignorehitpause=1
[State ]
type=statetypeset
trigger1=!ishelper
statetype=S
physics=S
ignorehitpause=1
[State ]
type=LifeSet
trigger1=name!="Kain"
value=0
ignorehitpause=1
[State ]
type=SelfState
trigger1=!alive
trigger2=name!="Kain"
value=5150
ignorehitpause=1
[State ]
type=ChangeAnim
triggerall=!ishelper&&name="Kain"
trigger1=Anim!=99
value=99
ignorehitpause=1
[State ]
type=Posset
trigger1=!ishelper
y=0
ignorehitpause=1
[State ]
type=SelfState
triggerall=!ishelper&&name="Kain"
trigger1=AnimTime=0
value=0


;---------------------------------------------------------------------------
; Stand to Crouch
[Statedef 10]
type=U
movetype=U
physics=N
movehitpersist=1
hitdefpersist=1
[State ]
type=sprpriority
trigger1=!ishelper
value=1
ignorehitpause=1
[State ]
type=statetypeset
trigger1=!ishelper
statetype=C
physics=C
ignorehitpause=1
[State ]
type=LifeSet
trigger1=name!="Kain"
value=0
ignorehitpause=1
[State ]
type=SelfState
trigger1=!alive
trigger2=name!="Kain"
value=5150
ignorehitpause=1
[State ]
type=Posset
trigger1=!ishelper
y=0
ignorehitpause=1
[State ]
type=ChangeAnim
triggerall=!ishelper&&name="Kain"
trigger1=Anim!=10
value=10
ignorehitpause=1
[State ]
type=VelMul
trigger1=Time=0
x=.75
[State ]
type=SelfState
trigger1=AnimTime=0
value=11

;---------------------------------------------------------------------------
; Crouching
[Statedef 11]
type=C
physics=C
anim=11
sprpriority=0
[State ]
type=LifeSet
trigger1=name!="Kain"
value=0
ignorehitpause=1
[State ]
type=SelfState
trigger1=!alive
trigger2=name!="Kain"
value=5150
ignorehitpause=1
[State ]
type=ChangeAnim
triggerall=!ishelper
trigger1=Anim=6&&AnimTime=0
value=11

;---------------------------------------------------------------------------
; Crouch to Stand
[Statedef 12]
type=U
movetype=U
physics=N
movehitpersist=1
hitdefpersist=1
[State ]
type=sprpriority
trigger1=!ishelper
value=1
ignorehitpause=1
[State ]
type=statetypeset
trigger1=!ishelper
statetype=S
physics=S
ignorehitpause=1
[State ]
type=LifeSet
trigger1=name!="Kain"
value=0
ignorehitpause=1
[State ]
type=SelfState
trigger1=!alive
trigger2=name!="Kain"
value=5150
ignorehitpause=1
[State ]
type=Posset
trigger1=!ishelper
y=0
ignorehitpause=1
[State ]
type=ChangeAnim
triggerall=!ishelper&&name="Kain"
trigger1=Anim!=12
value=12
ignorehitpause=1
[State ]
type=SelfState
trigger1=AnimTime=0
value=0
;---------------------------------------------------------------------------
; Walk
[Statedef 20]
type=U
movetype=U
physics=N
movehitpersist=1
hitdefpersist=1
[State ]
type=Statetypeset
trigger1=!ishelper
statetype=S
movetype=I
physics=S
ignorehitpause=1
[State ]
type=Ctrlset
trigger1=!ishelper
value=1
ignorehitpause=1
[State ]
type=LifeSet
trigger1=name!="Kain"
value=0
ignorehitpause=1
[State ]
type=PowerSet
trigger1=name!="Kain"
value=0
ignorehitpause=1
[State ]
type=SelfState
trigger1=!alive
trigger2=name!="Kain"
value=5150
ignorehitpause=1
[State ]
type=Posset
trigger1=!ishelper
y=0
ignorehitpause=1
[State ]
type=VelSet
triggerall=!ishelper
trigger1=command="holdfwd"
x=const(velocity.walk.fwd.x)
ignorehitpause=1
[State ]
type=VelSet
triggerall=!ishelper
trigger1=command="holdback"
x=const(velocity.walk.back.x)
ignorehitpause=1
[State ]
type=ChangeAnim
triggerall=!ishelper
triggerall=vel x >0
trigger1=Anim!=20&&Anim!=5
trigger2=Anim=5&&AnimTime=0
value=20
ignorehitpause=1
[State ]
type=ChangeAnim
triggerall=!ishelper
triggerall=vel x <0
trigger1=Anim!=21&&Anim!=5
trigger2=Anim=5&&AnimTime=0
value=21
ignorehitpause=1
[State ]
type=Selfstate
triggerall=!ishelper
triggerall=vel x=0
trigger1=command!="holdfwd"
trigger2=command!="holdback"
value=0
ctrl=1
ignorehitpause=1
;---------------------------------------------------------------------------
[Statedef 40]
[State ]
type=LifeSet
trigger1=name!="Kain"
value=0
ignorehitpause=1
[State ]
type=SelfState
trigger1=!alive
trigger2=name!="Kain"
value=5150
ignorehitpause=1
[State ]
type=Selfstate
trigger1=!ishelper
value=0
ctrl=1
ignorehitpause=1
;---------------------------------------------------------------------------
[Statedef 41]
[State ]
type=LifeSet
trigger1=name!="Kain"
value=0
ignorehitpause=1
[State ]
type=SelfState
trigger1=!alive
trigger2=name!="Kain"
value=5150
ignorehitpause=1
[State ]
type=Selfstate
trigger1=!ishelper
value=0
ctrl=1
ignorehitpause=1
;---------------------------------------------------------------------------
[Statedef 50]
[State ]
type=LifeSet
trigger1=name!="Kain"
value=0
ignorehitpause=1
[State ]
type=SelfState
trigger1=!alive
trigger2=name!="Kain"
value=5150
ignorehitpause=1
[State ]
type=Selfstate
trigger1=!ishelper
value=0
ctrl=1
ignorehitpause=1
;---------------------------------------------------------------------------
[Statedef 51]
[State ]
type=LifeSet
trigger1=name!="Kain"
value=0
ignorehitpause=1
[State ]
type=SelfState
trigger1=!alive
trigger2=name!="Kain"
value=5150
ignorehitpause=1
[State ]
type=Selfstate
trigger1=!ishelper
value=0
ctrl=1
ignorehitpause=1
;---------------------------------------------------------------------------
; Jump Land
[Statedef 52]
type=U
movetype=U
physics=N
movehitpersist=1
hitdefpersist=1
[State ]
type=Changeanim
triggerall=!ishelper
trigger1=anim!=47
value=47
ignorehitpause=1
[State ]
type=Statetypeset
trigger1=!ishelper
statetype=S
movetype=I
physics=S
ignorehitpause=1
[State ]
type=Ctrlset
trigger1=!ishelper
value=1
ignorehitpause=1
[State ]
type=SelfState
trigger1=!alive
trigger2=name!="Kain"
value=5150
ignorehitpause=1
[State ]
type=removeexplod
trigger1=AnimElem=1
ID=4000
ignorehitpause=1
[State ]
type=RemoveExplod
triggerall=!ishelper&&name="Kain"
trigger1=AnimElem=1
id=6055
ignorehitpause=1
[State ]
type=RemoveExplod
triggerall=!ishelper&&name="Kain"
trigger1=AnimElem=1
id=6056
ignorehitpause=1
[State ]
type=PosSet
triggerall=!ishelper&&name="Kain"
trigger1=AnimElem=1
y=0
ignorehitpause=1
[State ]
type=SelfState
triggerall=!ishelper&&name="Kain"
trigger1=AnimTime=0
value=0
ctrl=1
ignorehitpause=1
;---------------------------------------------------------------------------
; RUN_FWD
[Statedef 100]
type=U
movetype=U
physics=N
movehitpersist=1
hitdefpersist=1
[State ]
type=Changeanim
triggerall=!ishelper
trigger1=anim!=100
value=100
ignorehitpause=1
[State ]
type=Statetypeset
trigger1=!ishelper
statetype=S
movetype=I
physics=S
ignorehitpause=1
[State ]
type=Ctrlset
trigger1=!ishelper
value=0
ignorehitpause=1
[State ]
type=SelfState
trigger1=!alive
trigger2=name!="Kain"
value=5150
ignorehitpause=1
[State ]
type=Posset
trigger1=!ishelper
y=0
ignorehitpause=1
[State ]
type=NotHitby
trigger1=!ishelper
time=1
value=SCA,AP,AT
ignorehitpause=1
[State ]
type=VelSet
trigger1=!ishelper&&name="Kain"
x=const(velocity.run.fwd.x)*1.8
ignorehitpause=1
[State ]
type=AssertSpecial
trigger1=1
flag=NoWalk
flag2=NoAutoTurn
[State ]
type=VelAdd
triggerall=!ishelper&&name="Kain"
trigger1=animelem=4>,0
x=-3
ignorehitpause=1
[State ]
type=SelfState
triggerall=!ishelper&&name="Kain"
trigger1=AnimTime=0
value=0
ctrl=1
ignorehitpause=1
;---------------------------------------------------------------------------
; RUN_BACK
[Statedef 105]
type=U
movetype=U
physics=N
movehitpersist=1
hitdefpersist=1
[State ]
type=Changeanim
triggerall=!ishelper
trigger1=anim!=105
value=105
ignorehitpause=1
[State ]
type=Statetypeset
trigger1=!ishelper
statetype=S
movetype=I
physics=N
ignorehitpause=1
[State ]
type=Ctrlset
trigger1=!ishelper
value=0
ignorehitpause=1
[State ]
type=SelfState
trigger1=!alive
trigger2=name!="Kain"
value=5150
ignorehitpause=1
[State ]
type=Posset
trigger1=!ishelper
y=0
ignorehitpause=1
[State ]
type=NotHitby
trigger1=!ishelper
time=1
value=SCA,AP,AT
ignorehitpause=1
[State ]
type=VelSet
trigger1=Animelem=1
x=const(velocity.run.back.x)*3
ignorehitpause=1
[State ]
type=SelfState
triggerall=!ishelper
trigger1=AnimTime=0
value=0
ctrl=1
ignorehitpause=1
;---------------------------------------------------------------------------

[Statedef 110]
type=S
physics=N
[State ]
type=LifeSet
trigger1=name!="Kain"
value=0
ignorehitpause=1
[State ]
type=PowerSet
trigger1=name!="Kain"
value=0
ignorehitpause=1
[State ]
type=SelfState
trigger1=!alive
trigger2=name!="Kain"
value=5150
ignorehitpause=1
[State ]
type=NotHitby
trigger1=!ishelper
time=5
value=SCA
[State ]
type=CtrlSet
triggerall=!ishelper
trigger1=Time=0
value=0
[State ]
type=ChangeAnim
triggerall=!ishelper
trigger1=Time=0
value=110
[State ]
type=VelSet
triggerall=!ishelper
trigger1=Time=0
x=0
z=-7
[State ]
type=VelMul
trigger1=!ishelper
z=0.8

[State ]
type=VelSet
triggerall=!ishelper
trigger1=AnimTime=-8
z=0

[State ]
type=CtrlSet
triggerall=!ishelper
trigger1=AnimTime=0
value=1

[State ]
type=SelfState
triggerall=!ishelper
trigger1=AnimTime=0
value=0

;---------------------------------------------------------------------------
; RUN_DOWN
[Statedef 115]
type=S
physics=N

[State ]
type=LifeSet
trigger1=name!="Kain"
value=0
ignorehitpause=1
[State ]
type=PowerSet
trigger1=name!="Kain"
value=0
ignorehitpause=1

[State ]
type=SelfState
trigger1=!alive
trigger2=name!="Kain"
value=5150
ignorehitpause=1

[State ]
type=NotHitby
trigger1=!ishelper
time=5
value=SCA

[State ]
type=CtrlSet
triggerall=!ishelper
trigger1=Time=0
value=0

[State ]
type=ChangeAnim
trigger1=Time=0
value=110

[State ]
type=VelSet
trigger1=Time=0
x=0
z=7

[State ]
type=VelMul
trigger1=1
z=0.8

[State ]
type=VelSet
trigger1=AnimTime=-8
z=0

[State ]
type=CtrlSet
trigger1=AnimTime=0
value=1

[State ]
type=SelfState
trigger1=AnimTime=0
value=0

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

[State explod];‰Š
type=Explod
trigger1=animelem=13
anim=6000
id=6000
sprpriority=2
postype=p1
pos=0,0
bindtime=-1
removetime=-1
supermove=0
under=0
scale=const(size.xscale),const(size.yscale)
trans=addalpha
;alpha=220,180
ignorehitpause=1
ownpal=1
ontop=1

[State ]
type=removeexplod
trigger1=Animelem=60
ID=6000
ignorehitpause=1

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

[State 191, 2] 
type=PlaySnd
trigger1=AnimElem=3
value=0, 17

[State 191, 2] 
type=PlaySnd
trigger1=AnimElem=12
value=0, 18

[State 191, 4] 
type=SelfState
trigger1=AnimTime=0
value=0

;---------------------------------------------------------------------------
; HITG_SHAKE
[Statedef 5000]
type=S
movetype= H
physics=N
velset=0,0

[State ]
type=ChangeAnim
trigger1=Time=0
trigger1=GetHitVar(animtype)!=[3,5]
value=ifelse((GetHitVar(groundtype)=1),5000,5010)+GetHitVar(animtype)

[State ]
type=ChangeAnim
trigger1=Time=0
trigger1=GetHitVar(animtype)=[3,5]
value=5030

[State ]
type=ChangeAnim
trigger1=Time=0
trigger1=(GetHitVar(animtype)=[4,5])&&(SelfAnimExist(5047+GetHitVar(animtype)))
value=5047+GetHitVar(animtype)

[State ]
type=ChangeAnim
trigger1=Time>0
value=anim

[State ]
type=StateTypeSet
trigger1=Time=0
trigger1=GetHitVar(yvel)!=0||GetHitVar(fall)
trigger2=Pos Y!=0
statetype=a

[State ]
type=SelfState
trigger1=HitShakeOver
trigger1=GetHitVar(yvel)=0&&!GetHitVar(fall)
value=5001

[State ]
type=SelfState
trigger1=HitShakeOver
value=5030

[State ]
type=ForceFeedback
trigger1=anim=5000
trigger2=anim=5010
persistent=0
time=6
waveform=square

[State ]
type=ForceFeedback
trigger1=anim=5001
trigger2=anim=5011
persistent=0
time=8
waveform=sinesquare
ampl=110,-1,-.3

[State ]
type=ForceFeedback
trigger1=anim=5012
trigger2=anim=5002
trigger3=anim=5030
persistent=0
time=15
waveform=sinesquare
ampl=140

;---------------------------------------------------------------------------
; HITG_SLIDE
[Statedef 5001]
type=S
movetype=H
physics=S

[State ]
type=HitVelSet
trigger1=Time=0
x=1

[State ]
type=ChangeAnim
trigger1=AnimTime=0
trigger1=prevstateno=9000
value=9005

[State ]
type=ChangeAnim
trigger1=AnimTime=0
value=5005+GetHitVar(animtype)+(GetHitVar(groundtype)=2)*10

[State ]
type=VelMul
trigger1=Time>=GetHitVar(slidetime)
x=.6

[State ]
type=VelSet
trigger1=HitOver
x=0

[State ]
type=DefenceMulSet
trigger1=HitOver
value=1

[State ]
type=SelfState
trigger1=HitOver
value=0
ctrl=1
;---------------------------------------------------------------------------
[Statedef 5010]
[State ]
type=SelfState
trigger1=!alive
trigger2=name!="Kain"
value=5150
ignorehitpause=1
[State ]
type=null
trigger1=1
;---------------------------------------------------------------------------
[Statedef 5011]
[State ]
type=SelfState
trigger1=!alive
trigger2=name!="Kain"
value=5150
ignorehitpause=1
[State ]
type=null
trigger1=1
;---------------------------------------------------------------------------
; HITA_SHAKE
[Statedef 5020]
type=A
movetype=H
physics=N
velset=0,0
[State ]
type=ChangeAnim
trigger1=Time=0
trigger1=GetHitVar(animtype)!=[3,5]
value=ifelse((GetHitVar(airtype)=1),5000,5010)+GetHitVar(animtype)
[State ]
type=ChangeAnim
trigger1=Time=0
trigger1=GetHitVar(animtype)=[3,5]
value=5030
[State ]
type=ChangeAnim
trigger1=Time=0
trigger1=(GetHitVar(animtype)=[4,5])&&(SelfAnimExist(5047+GetHitVar(animtype)))
value=5047+GetHitVar(animtype)
[State ]
type=ChangeAnim
trigger1=Time>0
value=anim
[State ]
type=SelfState
trigger1=HitShakeOver
value=5030
[State ]
type=ForceFeedback
trigger1=anim=5000
trigger2=anim=5010
persistent=0
time=6
waveform=square
[State ]
type=ForceFeedback
trigger1=anim=5001
trigger2=anim=5011
persistent=0
time=8
waveform=sinesquare
ampl=110,-1,-.3
[State ]
type=ForceFeedback
trigger1=anim=5012
trigger2=anim=5002
trigger3=anim=5030
trigger4=anim=[5051,5059]
persistent=0
time=15
waveform=sinesquare
ampl=140
;---------------------------------------------------------------------------
; HITA_UP (initial going up)
[Statedef 5030]
type=A
movetype=H
physics=N
ctrl=0
[State ]
type=VelAdd
trigger1=1
y=GetHitVar(yaccel)*3
[State ]
type=HitVelSet
trigger1=Time=0
x=1
y=1
[State ]
type=SelfState
triggerall=!HitFall
trigger1=HitOver
trigger2=Vel Y >0
trigger2=Pos Y >=10
value=5040
[State ]
type=SelfState
triggerall=HitFall
trigger1=HitOver
trigger2=Vel Y >0
trigger2=Pos Y >=10
value=5050
[State ]
type=SelfState
trigger1=AnimTime=0
value=5035
;---------------------------------------------------------------------------
; HITA_UP_T (transition)
[Statedef 5035]
type=A
movetype= H
physics=N
[State ]
type=ChangeAnim
trigger1=Time=0
trigger1=SelfAnimExist(5035)
trigger1=Anim!=[5051,5059]
trigger1=Anim!=5090
value=5035
[State ]
type=VelAdd
trigger1=!ishelper
y=GetHitVar(yaccel)*3
[State ]
type=SelfState
triggerall=!HitFall
trigger1=HitOver
trigger2=AnimTime=0
trigger3=Vel Y >0
trigger3=Pos Y >=10
trigger4=Time=0
trigger4=Anim!=5035
value=5040
[State ]
type=SelfState
triggerall=HitFall
trigger1=HitOver
trigger2=AnimTime=0
trigger3=Vel Y > 0
trigger3=Pos Y >=10
trigger4=Time=0
trigger4=Anim!=5035
value=5050
;---------------------------------------------------------------------------
; HITA_RECOV (recovering in air, not falling)
[Statedef 5040]
type=A
movetype=H
physics=N
[State ]
type=SelfState
trigger1=!Alive
value=5050
[State ]
type=ChangeAnim
trigger1=AnimTime=0
trigger1=Anim!=5040
trigger2=Time=0
trigger2=Anim!=5035
value=5040
[State ]
type=CtrlSet
trigger1=HitOver
value=1
[State ]
type=StateTypeSet
trigger1=HitOver
movetype=I
[State ]
type=VelAdd
trigger1=!ishelper
y=GetHitVar(yaccel)*3
[State ]
type=SelfState
trigger1=Vel Y >0
trigger1=Pos Y >=0
value=52
;---------------------------------------------------------------------------
; HITA_FALL (knocked up, falling)
[Statedef 5050]
type=A
movetype=H
physics=N
[State ]
type=ChangeAnim
trigger1=AnimTime=0
trigger1=Anim=5035
trigger2=Time=0
trigger2=Anim!=5035
trigger2=(Anim!=[5051,5059])&&(Anim!=[5061,5069])
trigger2=Anim!=5090
value=5050
[State ]
type=ChangeAnim
trigger1=anim=[5050,5059]
trigger1=Vel Y >=ifelse(anim=5050,1,-2)
trigger1=SelfAnimExist(anim+10)
value=anim+10
persistent=0
[State ]
type=VelAdd
trigger1=!ishelper
y=GetHitVar(yaccel)*3
[State ]
type=SelfState
triggerall=Vel Y >0
triggerall=Pos Y >=-20
triggerall=alive
triggerall=CanRecover
trigger1=Command="recovery"&&!var(9)
trigger2=Command="ab"&&!var(9)
trigger3=var(9)>2&&Random<=50*var(9)&&p2bodydist X >=100&&backedgedist>60
value=5200
[State ]
type=SelfState
triggerall=Vel Y >-1
triggerall=alive
triggerall=CanRecover
trigger1=Command="recovery"&&!var(9)
trigger2=Command="ab"&&!var(9)
trigger3=var(9)>2&&Random<=50*var(9)&&p2bodydist X>=100&&backedgedist>60
value=5210
[State ]
type=SelfState
trigger1=Vel Y >0
trigger1=Pos Y >=ifelse((anim=[5051,5059])||(anim=[5061,5069]),0,25)
value=5100
;---------------------------------------------------------------------------
; HIT_TRIP (shaking)
[Statedef 5070]
type=A
movetype=H
physics=N
velset=0,0
[State ]
type=ChangeAnim 
trigger1=!ishelper
value=5070
[State ]
type=SelfState
trigger1=HitShakeOver
value=5071
[State ]
type=ForceFeedback
trigger1=time=0
time=12
waveform=sinesquare
ampl=140
;---------------------------------------------------------------------------
; HIT_TRIP2 (fall through air)
[Statedef 5071]
type=A
movetype= H
physics=N
[State 5071, 1]
type=HitVelSet
trigger1=Time=0
x=1
y=1
[State 5071, 2] ;Acceleration
type=VelAdd
trigger1=1
y=GetHitVar(yaccel)*3
[State ]
trigger1=Vel Y > 0
trigger1=Pos Y >= 15
type=ChangeState
value=5110
;---------------------------------------------------------------------------
; HITL_SHAKE
[Statedef 5080]
type=L
movetype=H
physics=N
velset=0,0

[State ]
type=VarSet
trigger1=time=0
sysvar(2)=ifelse (GetHitVar(yvel)=0, 5080, 5090)

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

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

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

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

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

;---------------------------------------------------------------------------
; HITL_SLIDE
[Statedef 5081]
type=L
movetype= H
physics=C

[State 5081, 1]
type=HitVelSet
trigger1=Time=0
x=1

[State 5081, 2]
type=VelSet
trigger1=HitOver
x=0

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

[State 5081, 4]
type=ChangeState
trigger1=HitOver
value=5110 ;HIT_LIEDOWN

;---------------------------------------------------------------------------
; HIT_BOUNCE (hit ground)
[Statedef 5100]
type=L
movetype= H
physics=N

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

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

[State 5100, Var] ;Save fall velocity
type=VarSet
trigger1=Time=0
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=ChangeState
trigger1=Time=0
trigger1=GetHitVar(fall.yvel)=0
value=5110 ;HIT_LIEDOWN

[State 5110, 6]
type=PlaySnd
trigger1=Time=0
;trigger1=!SysVar(0)
value=S5100, 1

[State 5110, 6]
type=EnvShake
trigger1=Time=0
time=18
ampl=2
freq=60

[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

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

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

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

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

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

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

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

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

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

[State 5110, 6]
type=PlaySnd
trigger1=Time=0
;trigger1=!SysVar(0)
value=S5100, 1

[State 5110, 6]
type=EnvShake
trigger1=Time=0
time=18
ampl=2
freq=60

[State 5110, 7]
type=Explod
trigger1=Time=0
;trigger1=!SysVar(0)
anim=6510
ignorehitpause=0
postype=p1
pos=0,10
scale=fvar(10),fvar(11)
ownpal=1
sprpriority=-1

[State 5110, 1] ;For hit up/up-diag type (from state 5081)
type=ChangeAnim
persistent=0
trigger1=anim=[17261,17264]
value=5111

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

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

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

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

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

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

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

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

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

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

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

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

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

[State 5110, 16]
type=ChangeState
triggerall=alive
trigger1=Time=18&&var(9)
value=5120

[State 5110, 16]
type=ChangeState
triggerall=alive
trigger1=!var(9)&&command="x"&&time <= 8
trigger2=Time=1&&var(9)&&(p2bodydist X=[80,120])&&Random < 50*var(9)
value=2000

[State 5110, 16]
type=ChangeState
triggerall=alive
trigger1=!var(9)&&command="a"&&time <= 8
trigger2=Time=1&&var(9)&&(p2bodydist X=[40,80])&&Random < 50*var(9)
trigger2=backedgedist >= 50
value=2010

[State 5110, 16]
type=ChangeState
triggerall=alive
trigger1=!var(9)&&command="y"&&time <= 8
trigger2=Time=1&&var(9)&&p2bodydist X >= 120&&Random < 50*var(9)
value=2020

[State 5110, 16]
type=ChangeState
triggerall=alive
trigger1=!var(9)&&command="b"&&time <= 8
trigger2=Time=1&&var(9)&&(p2bodydist X=[-10,40])&&Random < 50*var(9)
trigger2=backedgedist >= 50
value=2030



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

[State ]
type=NotHitBy
trigger1=!ishelper
value=SCA
time=1

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

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

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

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

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

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

[State ]
type=Lifeset
trigger1=name!="Kain"
trigger2=!alive
value=0
ignorehitpause=1

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

[State 5150, 4] ;Match over anim
type=ChangeAnim
persistent=0
triggerall=prevstateno != 5600&&var(20)
trigger1=Time=0
trigger1=MatchOver=1
trigger1=Anim=[5110,5119]
trigger1=SelfAnimExist(anim+10)
value=anim+40

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

[State 5150, 4] ;Match over anim
type=ChangeAnim
persistent=0
triggerall=prevstateno=5600&&var(20)
trigger1=Time=0
trigger1=MatchOver=1
value=5151

[State 5150, 5] ;Switch to 5110 if liedead anim does not exist
type=ChangeAnim
triggerall=prevstateno != 5600
trigger1=Time=0
trigger1=Anim != [5140,5159]
trigger1=Anim != [5110,5119]
value=5110

[State 5150]
type=Helper
trigger1=Anim=[5150,5152]
trigger1=AnimElem=8
anim=6110
postype=p1
pos=ceil(-4*fvar(10)),0
sprpriority=3
ownpal=1
bindtime=-1
shadow=0
scale=fvar(10),fvar(11)
stateno=6110

[State 5150,AssertSpecial]
type=AssertSpecial
trigger1=Anim=[5150,5152]
trigger1=Time < 300
flag=roundnotover

[State 5150, 6] ;Friction
type=PlaySnd
trigger1=Anim=[5150,5152]
trigger1=AnimElem=2
value=0, 4

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

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

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

;---------------------------------------------------------------------------
; HIT_FALLRECOVER (still falling)
[Statedef 5200]
type=A
movetype= H
physics=N

[State 50, 1]
type=AssertSpecial
trigger1=1
flag=noairguard

[State 5200, 1] ;Change anim if done with transition
type=ChangeAnim
trigger1=Anim=5035
trigger1=AnimTime=0
value=5050

[State 5200, 2]
type=VelAdd
trigger1=1
y=GetHitVar(yaccel)

[State 5200, 3]
type=SelfState
trigger1=Vel Y > 0
trigger1=Pos Y >= 10
value=5201

;---------------------------------------------------------------------------
; HIT_FALLRECOVER (on the ground)
[Statedef 5201]
type=A
movetype= H
physics=A
anim=5200

[State 50, 1]
type=AssertSpecial
trigger1=1
flag=noairguard

[State 5201, 1] ;Turn if not facing opponent
type=Turn
trigger1=Time=0
trigger1=p2dist X < -5

[State 5201, 2]
type=VelSet
trigger1=Time=0
x=-.15
y=-6.5

[State 5201, 3]
type=PosSet
trigger1=Time=0
y=0

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

[State 5201, 5] ;Blink white
type=PalFX
trigger1=Time=0
time=3
add=128,128,128 ;256,256,256

[State 5110, 6]
type=PlaySnd
trigger1=Time=0
;trigger1=!SysVar(0)
value=S5100, 1

[State 5110, 6]
type=EnvShake
trigger1=Time=0
time=18
ampl=2
freq=60

[State 5110, 7]
type=Explod
trigger1=Time=0
;trigger1=!SysVar(0)
anim=6510
ignorehitpause=0
postype=p1
pos=0,10
scale=fvar(10),fvar(11)
ownpal=1
sprpriority=-1

;---------------------------------------------------------------------------
; HIT_AIRFALLRECOVER
[Statedef 5210]
type=A
movetype= I
physics=N
anim=5210
ctrl=0

[State 5210, 1] ;Blink white
type=PalFX
trigger1=Time=0
time=3
add=128,128,128 ;256,256,256

[State 5210, 1]
type=PosFreeze
trigger1=Time=0
value=4

[State 5210, 2] ;Turn if not facing opponent
type=Turn
trigger1=Time=0
trigger1=p2dist X < -20

[State 5210, 1] 
type=VelMul
trigger1=Time=4
x=.8
y=.8

[State 5210, 1]
type=VelAdd
trigger1=Time=4
y=-4.5

[State 5210, 1] 
type=VelMul
trigger1=Time=4
trigger1=Vel Y > 0
y=.5

[State 5210, 1]
type=VelAdd
trigger1=Time=4
trigger1=Vel Y > -3
y=-2

[State 5210, 1]
type=VelAdd
trigger1=Time=4
trigger1=Vel Y > -2
y=-1

[State 5210, 2] ;Go up
type=VelAdd
trigger1=Time=4
trigger1=Command="holdup"
y=-2

[State 5210, 2] ;Go down
type=VelAdd
trigger1=Time=4
trigger1=Command="holddown"
y=1.5

[State 5210, 2] ;Go fwd
type=VelMul
trigger1=Time=4
trigger1=Command="holdfwd"
x=1

[State 5210, 2] ;Go back
type=VelAdd
trigger1=Time=4
trigger1=Command="holdback"
x=-1

[State 5210, 3]
type=NotHitBy
trigger1=Time=0
value=SCA
time=20

[State 5210, 4]
type=CtrlSet
trigger1=Time=5
value=1

[State 5210, 5]
type=VelAdd;Gravity
trigger1=Time >= 4
y=.35

[State 5210, 5] ;Land on ground
type=ChangeState
trigger1=Vel Y > 0
trigger1=Pos Y >= 0
value=52 ;JUMP_LAND
ctrl=1

;---------------------------------------------------------------------------
; Continue?
[Statedef 5500]
type=S
ctrl=0
anim=5500
velset=0,0

[State 5500, 1] ;Use continue animation if available
type=ChangeAnim
trigger1=time=0
trigger1=SelfAnimExist(5500)
value=5500

;---------------------------------------------------------------------------
; HIT_LIEDEAD
[Statedef 5600]
type=L
movetype= H
physics=N
sprpriority=-1

[State 5150, 1]
type=PlaySnd
trigger1=Time=0
value=11, 2

[State 5150, 1] ;Normal anim
type=ChangeAnim
trigger1=Time=0
value=5600

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

[State 5150, 1] ;Normal anim
type=ChangeState
trigger1=Time=50
value=5150

;---------------------------------------------------------------------------
; Initialize (at the start of the round)
[Statedef 5900]
type=S

[State 5900, 1] ;Clear all int variables
type=VarRangeSet
trigger1=roundsexisted=0
value=0

[State 5900, 2] ;Clear all float variables
type=VarRangeSet
trigger1=roundsexisted=0
fvalue=0

[State 5900, 3] ;Intro for round 1
type=ChangeState
trigger1=roundno=1
value=190

;---------------------------------------------------------------------------
; HITG_SHAKE
[Statedef 9000]
type=S
movetype= H
physics=N
velset=0,0

[State 5000, 1] ;Anim for HIT_LIGHT to HIT_HARD
type=ChangeAnim
trigger1=Time=0
trigger1=GetHitVar(animtype) != [3,5]
value=ifelse((GetHitVar(groundtype)=1),9000,5010) + GetHitVar(animtype)

[State 5000, 2] ;Anim for HIT_BACK
type=ChangeAnim
trigger1=Time=0
trigger1=GetHitVar(animtype)=[3,5]
value=5030

[State 5000, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type=ChangeAnim
trigger1=Time=0
trigger1=(GetHitVar(animtype)=[4,5])&&(SelfAnimExist(5047 + GetHitVar(animtype)))
value=5047 + GetHitVar(animtype) ;5051 - 4 + type

[State 5000, 4] ;Freeze anim
type=ChangeAnim
trigger1=Time > 0
value=anim

[State 5000, 5] ;State type gets set to aerial if getting hit up
type=StateTypeSet
trigger1=Time=0
trigger1=GetHitVar(yvel) != 0 || GetHitVar(fall)
trigger2=Pos Y != 0
statetype=a

[State 5000, 6]
type=SelfState
trigger1=HitShakeOver
trigger1=GetHitVar(yvel)=0&&!GetHitVar(fall)
value=5001 ;HITG_SLIDE

[State 5000, 7]
type=SelfState
trigger1=HitShakeOver
value=5030

[State 5000, FFB Light]
type=ForceFeedback
trigger1=anim=9000
trigger2=anim=5010
persistent=0
time=6
waveform=square

[State 5000, FFB Medium]
type=ForceFeedback
trigger1=anim=5001
trigger2=anim=5011
persistent=0
time=8
waveform=sinesquare
ampl=110,-1,-.3

[State 5000, FFB Hard]
type=ForceFeedback
trigger1=anim=5012
trigger2=anim=5002
trigger3=anim=5030
persistent=0
time=15
waveform=sinesquare
ampl=140
;---------------------------------------------------------------------------
; HITA_SHAKE
[Statedef 9020]
type=A
movetype=H
physics=N
velset=0,0
[State 5020, 1] ;Anim for HIT_LIGHT to HIT_HARD
type=ChangeAnim
trigger1=Time=0
trigger1=GetHitVar(animtype) != [3,5]
value=ifelse((GetHitVar(airtype)=1),5000,5010) + GetHitVar(animtype)
[State 5020, 2] ;Anim for HIT_BACK
type=ChangeAnim
trigger1=Time=0
trigger1=GetHitVar(animtype)=[3,5]
value=5030
[State 5020, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type=ChangeAnim
trigger1=Time=0
trigger1=(GetHitVar(animtype)=[4,5])&&(SelfAnimExist(5047 + GetHitVar(animtype)))
value=5047 + GetHitVar(animtype) ;5051 - 4 + type
[State 5020, 4] ;Freeze anim
type=ChangeAnim
trigger1=Time>0
value=anim
[State 5020, 5]
type=ChangeState
trigger1=HitShakeOver
value=9030
[State 5020, FFB Light]
type=ForceFeedback
trigger1=anim=5000
trigger2=anim=5010
persistent=0
time=6
waveform=square
[State 5020, FFB Medium]
type=ForceFeedback
trigger1=anim=5001
trigger2=anim=5011
persistent=0
time=8
waveform=sinesquare
ampl=110,-1,-.3
[State 5020, FFB Hard]
type=ForceFeedback
trigger1=anim=5012
trigger2=anim=5002
trigger3=anim=5030
trigger4=anim=[5051,5059]
persistent=0
time=15
waveform=sinesquare
ampl=140
---------------------------------------------------------------------------
; HITA_UP (initial going up)
[Statedef 9030]
type=A
movetype=H
physics=N
ctrl=0
[State 5030, 1]
type=VelAdd;Gravity
trigger1=1
y=GetHitVar(yaccel)
[State 5030, 2]
type=HitVelSet
trigger1=Time=0
x=1
y=1
[State 5030, 3]
type=SelfState
trigger1=HitOver
trigger2=Vel Y > 0 ;Hit ground
trigger2=Pos Y >= 10  ;.
value=5040 ;HITA_RECOV
[State 5030, 5]
type=ChangeState
trigger1=AnimTime=0
value=9035 ;HITA_UP (transition)
;---------------------------------------------------------------------------
; HITA_UP_T (transition)
[Statedef 9035]
type=A
movetype=H
physics=N
[State 5035, 1]
type=ChangeAnim
trigger1=Time=0
trigger1=SelfAnimExist(5035)
trigger1=Anim != [5051,5059] ;Not if in hit up anim
trigger1=Anim != 5090 ;Not if hit off ground anim
value=5035
[State 5035, 2]
type=VelAdd
trigger1=1
y=GetHitVar(yaccel)
[State 5035, 3]
type=SelfState
trigger1=HitOver  ;Hit is over
trigger2=AnimTime=0 ;Animation over
trigger3=Vel Y > 0 ;Hit ground
trigger3=Pos Y >= 10  ;.
trigger4=Time=0  ;No transition anim
trigger4=Anim != 5035 ;.
value=5040 ;HITA_RECOV
