; Common state file for M.U.G.E.N beta 2002.04.14
;
; System variables usage
; ----------------------
; Var name    Type   Purpose
; --------    ----   -------
; sysvar(0)   Temp   Set by state 5081 (HITL_SLIDE) to 1 to prevent
;                    showing ground hit frame in state 5110 (HIT_LIEDOWN).
;                    Used by guarding states.
; sysvar(1)   Temp   Used by state 40 (Jump Start) amd 45 (Air Jump Start)
;                    to keep track of which way to jump.
;                    Used by state 5100 and 5110 to remember downward
;                    velocity of player just before hitting the ground.
;                    Used in state 5080 for storing the anim # to display.

; The following states have special handling within MUGEN, and should be
; overridden with caution:
; Jump Start (40): airjumping bookkeeping at time = 0
; All guard states (120-155): guard handling throughout state
; Hit_trip, shaking (5070): defence increases at time = 0
; Hit_bounce (5100): defence increases at time = 0, player becomes
;                    invincible if within 10 ticks of getting up
; Hit_liedown (5110): player changes to get-up state (5120) when ready
; Hit_getup (5120): player's defence is restored to normal at time = 0
; Hitfall_recover (5200): player's defence is restored at time = 0
; Hitfall_airrecover (5210): player's defence is restored at time = 0

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

[State 0, CtrlSet]
type = CtrlSet
trigger1 = prevstateno != [190,199]
value = 1
;ignorehitpause =
;persistent =


[State 0, 2]
type = VarSet
trigger1 = !Time
var(5) = 0

[State 0, 1]
type = ChangeAnim
triggerall = Var(9) = 0
trigger1 = Anim != 0 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0 ;Turn anim over
Value = 0

[State 0, 1]
type = ChangeAnim
triggerall = Var(9) = 1
trigger1 = Anim != 20000 && Anim != 20005
trigger2 = Anim = 20005 && AnimTime = 0 ;Turn anim over
Value = 20000

[State 0, ChangeAnim]
type = null
trigger1 = Var(9) = 1
trigger1 = Anim != 20000
Value = 20000

[State 0, AfterImageTime]
type = AfterImageTime
trigger1 = Var(9) = 0
Time = 0

[State 0, 2]
type = VelSet
trigger1 = Time = 0
Y = 0

[State 0, 3] ;Stop moving if low velocity or 4 ticks pass
type = VelSet
trigger1 = abs(vel x) < 2
trigger2 = Time = 4
x = 0

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



;---------------------------------------------------------------------------
; Stand to Crouch
[Statedef 10]
type    = C
physics = C

[State 10, 2]
type = ChangeState
trigger1 = var(9) = 1
Value = 0
ctrl = 1

[State 10, anim]
type = changeanim
trigger1 = anim != 10
value = 10

[State 10, 2]
type = ChangeState
trigger1 = AnimTime = 0
Value = 11

;---------------------------------------------------------------------------
; Crouching
[Statedef 11]
type    = C
physics = C
anim = 11

[State 11, 1] ;Change from turning animation
type = ChangeAnim
trigger1 = Anim = 6 && AnimTime = 0
Value = 11

[State 10, 2]
type = ChangeState
trigger1 = command != "holddown"
Value = 12

;---------------------------------------------------------------------------
; Crouch to Stand
[Statedef 12]
type    = S
physics = S
anim = 12


[State 12, 1]
type = ChangeState
trigger1 = AnimTime = 0
Value = 0

;---------------------------------------------------------------------------
; Walk
[Statedef 20]
type    = S
physics = S
sprpriority = 0

[State 0, 2]
type = VarSet
trigger1 = !Time
var(5) = 20

[State 200, 2]
type = PlaySnd
trigger1 = AnimELem = 4
trigger2 = AnimELem = 8
value = 100, 0

[State 20, 1]
type = VelSet
triggerall = Var(9) = 0
trigger1 = Command = "holdfwd"
x = const(velocity.walk.fwd.x)

[State 20, 1]
type = VelSet
triggerall = Var(2) = 25
trigger1 = Command = "holdfwd"
x = const(velocity.walk.fwd.x) + 1

[State 20, 1]
type = VelSet
triggerall = Var(9) = 1
trigger1 = Command = "holdfwd"
x = const(velocity.walk.fwd.x) + 2

[State 20, 2]
type = VelSet
triggerall = Var(9) = 0
trigger1 = Command = "holdback"
x = const(velocity.walk.back.x)

[State 20, 2]
type = VelSet
triggerall = Var(2) = 25
trigger1 = Command = "holdback"
x = const(velocity.walk.back.x) + 1

[State 20, 2]
type = VelSet
triggerall = Var(9) = 1
trigger1 = Command = "holdback"
x = const(velocity.walk.back.x) - 2

[State 20, 3]
type = ChangeAnim
triggerall = Var(9) = 0
triggerall = vel x > 0
trigger1 = Anim != 20 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
Value = 20

[State 20, 3]
type = ChangeAnim
triggerall = Var(9) = 1
triggerall = vel x > 0
trigger1 = Anim != 20020
Value = 20020

[State 20, 4]
type = ChangeAnim
triggerall = Var(9) = 0
triggerall = vel x < 0
trigger1 = Anim != 21 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
Value = 21

[State 20, 4]
type = ChangeAnim
triggerall = Var(9) = 1
triggerall = vel x < 0
trigger1 = Anim != 20021
Value = 20021

;---------------------------------------------------------------------------
; Jump Start
[Statedef 40]
type    = S
physics = S
ctrl = 0
sprpriority = 1

[State 0, 2]
type = VarSet
trigger1 = !Time
var(5) = 40

[State 0, Explod]
type = Explod
trigger1 = !time
anim = 11300
ID = 11300
removetime = -2
sprpriority = 3
ownpal = 1
scale = 0.5,0.5
removeongethit = 0

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = var(9) = 0
trigger1 = Anim != 40
value = 40

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = var(9) = 1
trigger1 = Anim != 20040
value = 20040

[State 0, VarSet]
type = VarSet
trigger1 = time = 0
v = 15    ;fv = 10
value = 1

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

[State 140, 2]
type = VarSet
trigger1 = command = "holdfwd"
sysvar(1) = 1

[State 140, 3]
type = VarSet
trigger1 = command = "holdback"
sysvar(1) = -1

[State 140, 4]
type = VelSet
trigger1 = AnimTime = 0
x = ifelse(sysvar(1)=0, const(velocity.jump.neu.x), ifelse(sysvar(1)=1, const(velocity.jump.fwd.x), const(velocity.jump.back.x)))
y = const(velocity.jump.y)

[State 140, 5]
type = VelSet
trigger1 = AnimTime = 0
trigger1 = prevstateno = 100 ;RUN_FWD
trigger1 = sysvar(1) = 1
x = const(velocity.runjump.fwd.x)

[State 140, PlaySnd]
type = PlaySnd
trigger1 = time = 2
value = S40,0

[State 140, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S40,1
volume = 100

[State 140, 6]
type = ChangeState
trigger1 = AnimTime = 0
value = 50
ctrl = 1

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

[State 0, 2]
type = VarSet
trigger1 = !Time
var(5) = 45

[State 0, VarSet]
type = VarSet
trigger1 = time = 0
v = 15    ;fv = 10
value = 0

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

[State 145, 3]
type = VarSet
trigger1 = stateno = 10052
var(13) = 1

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

[State 145, 4]
type = VarSet
trigger1 = command = "holdfwd"
sysvar(1) = 1

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

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

[State 145, 6]
type = VelSet
triggerall = var(9) = 1
trigger1 = Time = 2
x = ifelse(sysvar(1)=0, const(velocity.airjump.neu.x), ifelse(sysvar(1)=1, const(velocity.airjump.fwd.x) +1, const(velocity.airjump.back.x)-1))
y = const(velocity.airjump.y) - 1

[State 145, PlaySnd]
type = PlaySnd
trigger1 = time = 2
value = S40,0

[State 145, 7]
type = ChangeState
trigger1 = Time = 2
value = 50
ctrl = 1

;---------------------------------------------------------------------------
; Jump Up
[Statedef 50]
type    = A
physics = A

[State 0, 2]
type = VarSet
trigger1 = !Time
var(5) = 50

[State 50, snd]
type = playsnd
trigger1 = !time
value = 0,40

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

[State 50, 2]
type = ChangeAnim
triggerall = Var(9) = 0
trigger1 = Time = 0
value = ifelse((vel x)=0, 41, ifelse((vel x)>0, 42, 43))
[State 50, 2]
type = ChangeAnim
triggerall = Var(9) = 1
trigger1 = Time = 0
value = ifelse((vel x)=0, 41, ifelse((vel x)>0, 42, 43))+20000

[State 20, 1]
type = Veladd
trigger1 = command = "holdfwd"
x = 0.06

[State 20, 2]
type = Veladd
trigger1 = command = "holdback"
x = -0.06

[State 50, 3]
type = ChangeAnim
trigger1 = Vel y > -2
trigger1 = SelfAnimExist(anim + 3)
persistent = 0
Value = anim + 3

[State 50, 3]
type = Changestate
trigger1 = Vel y > 0
Value = 51

;---------------------------------------------------------------------------
; Jump Down (empty state for compatibility)
[Statedef 51]
type    = A
physics = A

[State 0, 2]
type = VarSet
trigger1 = !Time
var(5) = 51

[State 20, 1]
type = Veladd
trigger1 = command = "holdfwd"
x = 0.06

[State 20, 2]
type = Veladd
trigger1 = command = "holdback"
x = -0.06

;---------------------------------------------------------------------------
; Jump Land
[Statedef 52]
type    = S
physics = S
ctrl = 0
anim = 47

[State 0, 2]
type = VarSet
trigger1 = !Time
var(5) = 52

[State 0, Explod]
type = Explod
trigger1 = !time
anim = 11400
ID = 11400
removetime = -2
ontop = 0
ownpal = 1
scale = 0.5,0.5
removeongethit = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
value = S0,51
volume = 100

[State 52, 1]
type = ChangeAnim
triggerall = Var(9) = 1
trigger1 = Anim != 20000
Value = 20000

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

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

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

[State 52, 4]
type = ChangeState
trigger1 = AnimTime = 0
Value = 0
ctrl = 1

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

;Run_Fwd
[Statedef 100]
type 		= S
movetype	= I
physics		= N
anim		= 100
;velset		= 0,0
ctrl		= 0
poweradd	= 0
juggle		= 0
facep2		= 0
hitdefpersist	= 0
movehitpersist	= 0
hitcountpersist	= 0
sprpriority		= 1

[State 100:		AssertSpecial]
type			= AssertSpecial
trigger1		= 1
flag			= NoWalk
flag2			= NoAutoTurn

[State 100:		AssertSpecial]
type			= AssertSpecial
trigger1		= 1
flag			= NoStandGuard
flag2			= NoCrouchGuard

[State 100:		ScreenBound]
type			= ScreenBound
trigger1		= (BackEdgeBodyDist <= -5)
value			= 0
movecamera		= 0,0

[State 100:		CtrlSet]
type			= CtrlSet
trigger1		= 1
value			= (IfElse(BackEdgeBodyDist > -5,1,0))

[State 100:		VelSet]
type			= VelSet
trigger1		= (!Time)
x			= 0
y			= 0

[State 100: 	VelSet]
type 			= VelSet
trigger1 		= (Time > 6)
x 			= Const(Velocity.Run.Fwd.X)
y			= 0

[State 100:		PlaySnd]
type			= PlaySnd
trigger1		= (AnimElem = 2)
value			= S1,10

[State 100: 	MakeDust]
type 			= MakeDust
trigger1 		= 1
pos 			= -5, 0
spacing 		= 4

[State 1300,0]
type = AfterImage
trigger1 = Time = 0
time = 30
trans = add1
TimeGap  = 2
FrameGap = 2
length = 6
PalBright   =   0,  0,  0
PalContrast = 128,128,128
PalAdd      =   0,  0,  0
PalMul      =   1,  1,  1

[State 3001, Explod - arena]
type = Explod
trigger1 =  (AnimElem = 2)
anim =  11500 ;POLVO
ID =    11500
pos =  5,5
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
supermove
pausemove
scale = 0.7,0.7
sprpriority = 2
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 0

[State 100:		ChangeState]
type			= ChangeState
trigger1		= (Command != "holdfwd") && (BackEdgeBodyDist > -1)
value			= 101

[State fly, Changestate]
type = ChangeState
trigger1 = Pos Y < 0
value =  990

;---------------------------------------------------------------------------
;Run_Fwd - Stop
[Statedef 101]
type 		= S
movetype	= I
physics		= N
anim		= 101
velset		= 0,0
ctrl		= 0
poweradd	= 0
juggle		= 0
facep2		= 0
hitdefpersist	= 0
movehitpersist	= 0
hitcountpersist	= 0
sprpriority	= 1


[State 101, VelMul]
type = VelMul
trigger1 = 1
x = .3
;y =
;ignorehitpause = 0
;persistent = 1


[State 101: 	MakeDust]
type 			= MakeDust
trigger1 		= 1
pos 			= -5, 0
spacing 		= 4
[State 0, VelAdd]
type = VelAdd
trigger1 = time = 0
x = 0.5
y = 0

[State 100, 2] ;Prevent run from canceling into walk
type = AssertSpecial
trigger1 = 1
flag = NoWalk

[State 100, 3] ;Prevent from turning
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State 100, 4]
type = ChangeState
;trigger1 = vel X = 0
trigger1 = animtime = 0
value = 0


;---------------------------------------------------------------------------
; RUN_FWD
[Statedef 102]
type    = A
physics = N
anim = 46
sprpriority = 2

[State 0, Explod]
type = Explod
trigger1 = !time
anim = 11500
ID = 11500
pos = -7,8
removetime = -2
sprpriority = 3
ownpal = 1
facing = -1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
value = S0,101
volume = 100

[State 0, VelSet]
type = VelSet
trigger1 = !time
y = 0

[State 0, 2]
type = VarSet
trigger1 = !Time
var(5) = 102

[State 40, ChangeAnim]
type = ChangeAnim
trigger1 = Var(9) = 1
trigger1 = Anim != 20046
Value = 20046

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

[State 100, 1]
type = VelSet
trigger1 = Var(9) = 1
x = const(velocity.run.back.x)-5

[State 100, 2] ;Prevent run from canceling into walk
type = AssertSpecial
trigger1 = 1
flag = NoWalk

[State 100, 3] ;Prevent from turning
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State 100, 4]
type = ChangeState
trigger1 = time = 15
Value = 51
ctrl = 1
anim = ifelse(var(9)=1,20043,45)
;---------------------------------------------------------------------------
; RUN_BACK
[Statedef 105]
type    = A
physics = A
ctrl = 0
anim = 105
sprpriority = 1

[State 0, 2]
type = VarSet
trigger1 = !Time
var(5) = 105

[State 40, ChangeAnim]
type = ChangeAnim
trigger1 = Var(9) = 1
trigger1 = Anim != 201005
Value = 20105

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

[State 105, 1]
type = VelSet
trigger1 = Var(2) = 25
x = const(velocity.run.back.x)- 1.5
y = const(velocity.run.back.y)- .5

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

[State 105, 2]
type = CtrlSet
trigger1 = Time = 2
Value = 1

[State 105, 3]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
Value = 51

;---------------------------------------------------------------------------
; RUN_BACK2 (land)
[Statedef 106]
type    = S
physics = S
ctrl = 0
anim = 47

[State 0, 2]
type = VarSet
trigger1 = !Time
var(5) = 106

[State 40, ChangeAnim]
type = ChangeAnim
trigger1 = Var(9) = 1
trigger1 = Anim != 20000
Value = 20000

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

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

[State 106, 3]
type = MakeDust
trigger1 = Time = 2
pos = -5,-2
spacing = 1

[State 106, 4]
type = ChangeState
trigger1 = Time = 7
Value = 0
ctrl = 1

;---------------------------------------------------------------------------
; RUN_UP
[Statedef 110]
type    = S
physics = N

[State 110, 0]
type = CtrlSet
trigger1 = Time = 0
Value = 0

[State 110, 1]
type = ChangeAnim
trigger1 = Time = 0
Value = 110

[State 110, 2]
type = HitBy
trigger1 = Time = 0
value = SCA, NT, ST, HT
Time = 30

[State 110, 3]
type = VelSet
trigger1 = Time = 0
x = 0
z = -7

[State 110, 4]
type = VelMul
trigger1 = 1
z = 0.8

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

[State 110, 7]
type = CtrlSet
trigger1 = AnimTime = 0
Value = 1

[State 110, 8]
type = ChangeState
trigger1 = AnimTime = 0
Value = 0

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

[State 115, 0]
type = CtrlSet
trigger1 = Time = 0
Value = 0

[State 115, 1]
type = ChangeAnim
trigger1 = Time = 0
Value = 110

[State 115, 2]
type = HitBy
trigger1 = Time = 0
value = SCA, NT, ST, HT
Time = 30

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

[State 115, 4]
type = VelMul
trigger1 = 1
z = 0.8

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

[State 115, 7]
type = CtrlSet
trigger1 = AnimTime = 0
Value = 1

[State 115, 8]
type = ChangeState
trigger1 = AnimTime = 0
Value = 0

;---------------------------------------------------------------------------
; GUARD (start)
[Statedef 120]
type = U    ;Leave state type unchanged
physics = U ;Leave physics unchanged

[State 120, 1]
type = ChangeAnim
trigger1 = Time = 0
Value = 120 + (statetype = C) + (statetype = A) * 2

[State 120, 2]
type = StateTypeSet
trigger1 = Time = 0 && statetype = S
physics = S

[State 120, 3]
type = StateTypeSet
trigger1 = Time = 0 && statetype = C
physics = C

[State 120, 4]
type = StateTypeSet
trigger1 = Time = 0 && statetype = A
physics = A

[State 120, Hi to Lo]
type = StateTypeSet
trigger1 = statetype = S && command = "holddown"
statetype = C
physics = C

[State 120, Lo to Hi]
type = StateTypeSet
trigger1 = statetype = C && command != "holddown"
statetype = S
physics = S

[State 120, ChangeAnim]
type = ChangeAnim
trigger1 = Var(9) = 1
trigger1 = Anim != 50130
Value = 50130

[State 120, 5]
type = ChangeState
trigger1 = AnimTime = 0
Value = 130 + (statetype = C) + (statetype = A) * 2

[State 120, Stop Guarding]
type = ChangeState
trigger1 = command != "holdback"
trigger2 = !inguarddist
Value = 140

;---------------------------------------------------------------------------
; STAND GUARD (guarding)
[Statedef 130]
type    = S
physics = S

[State 130, 1]
type = ChangeAnim
trigger1 = Anim != 130
Value = 130

[State 130, Hi to Lo]
type = ChangeState
trigger1 = Command = "holddown"
Value = 131

[State 130, Stop Guarding]
type = ChangeState
trigger1 = command != "holdback"
trigger2 = !inguarddist
Value = 140

;---------------------------------------------------------------------------
; CROUCH GUARD (guarding)
[Statedef 131]
type    = C
physics = C

[State 131, 1]
type = ChangeAnim
trigger1 = Anim != 131
Value = 131

[State 131, Lo to Hi]
type = ChangeState
trigger1 = command != "holddown"
Value = 130

[State 131, Stop Guarding]
type = ChangeState
trigger1 = command != "holdback"
trigger2 = !inguarddist
Value = 140

;---------------------------------------------------------------------------
; AIR GUARD (guarding)
[Statedef 132]
type    = A
physics = N

[State 132, 1]
type = ChangeAnim
trigger1 = Anim != 132
Value = 132

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

[State 132, 3]
type = VarSet
trigger1 = 1
sysvar(0) = (pos y >= 0) && (vel y > 0)

[State 132, 4]
type = VelSet
trigger1 = sysvar(0)
Y = 0

[State 132, 5]
type = PosSet
trigger1 = sysvar(0)
Y = 0

[State 132, 6]
type = ChangeState
trigger1 = sysvar(0)
trigger1 = Command = "holdback"
trigger1 = inguarddist
Value = 130

[State 132, 7]
type = ChangeState
trigger1 = sysvar(0)
Value = 52

[State 132, Stop Guarding]
type = ChangeState
trigger1 = command != "holdback"
trigger2 = !inguarddist
Value = 140

;---------------------------------------------------------------------------
; GUARD (end)
[Statedef 140]
type = U    ;Leave state type unchanged
physics = U ;Leave physics unchanged
ctrl = 1

[State 140, 1]
type = ChangeAnim
trigger1 = Time = 0
Value = 140 + (statetype = C) + (statetype = A) * 2

[State 140, 2]
type = StateTypeSet
trigger1 = Time = 0 && statetype = S
physics = S

[State 140, 3]
type = StateTypeSet
trigger1 = Time = 0 && statetype = C
physics = C

[State 140, 4]
type = StateTypeSet
trigger1 = Time = 0 && statetype = A
physics = A

[State 140, Hi to Lo]
type = StateTypeSet
trigger1 = statetype = S && command = "holddown"
statetype = C
physics = C

[State 140, Lo to Hi]
type = StateTypeSet
trigger1 = statetype = C && command != "holddown"
statetype = S
physics = S

;[State 140, 5] ;Implemented within engine
;type = ChangeState
;trigger1 = AnimTime = 0
;value = (statetype = C)*11 + (statetype = A)*51


;---------------------------------------------------------------------------
; SGUARDHIT (shaking)
[Statedef 150]
type    = S
movetype = H
physics = N
velset = 0,0

[State 150, 1]
type = ChangeAnim
trigger1 = 1
Value = 150

[State 150, 2]
type = ChangeState
trigger1 = HitShakeOver
Value = 151 + 2 * (Command = "holddown")

[State 150, Hi to Lo]
type = StateTypeSet
trigger1 = statetype = S && command = "holddown"
statetype = C
physics = C

[State 150, Lo to Hi]
type = StateTypeSet
trigger1 = statetype = C && command != "holddown"
statetype = S
physics = S

[State 150, 3]
type = ForceFeedback
trigger1 = Time = 0
waveform = square
Time = 3

;---------------------------------------------------------------------------
; SGUARDHIT2 (knocked back)
[Statedef 151]
type    = S
movetype = H
physics = S
anim = 150

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

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

[State 151, 3]
type = CtrlSet
trigger1 = Time = GetHitVar(ctrltime)
Value = 1

[State 151, Hi to Lo]
type = StateTypeSet
trigger1 = statetype = S && command = "holddown"
statetype = C
physics = C

[State 151, Lo to Hi]
type = StateTypeSet
trigger1 = statetype = C && command != "holddown"
statetype = S
physics = S

[State 151, 4]
type = ChangeState
trigger1 = HitOver
Value = 130
ctrl = 1

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

[State 152, 1]
type = ChangeAnim
trigger1 = 1
Value = 151

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

[State 152, Hi to Lo]
type = StateTypeSet
trigger1 = statetype = S && command = "holddown"
statetype = C
physics = C

[State 152, Lo to Hi]
type = StateTypeSet
trigger1 = statetype = C && command != "holddown"
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
anim = 151

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

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

[State 153, 3]
type = CtrlSet
trigger1 = Time = GetHitVar(ctrltime)
Value = 1

[State 153, Hi to Lo]
type = StateTypeSet
trigger1 = statetype = S && command = "holddown"
statetype = C
physics = C

[State 153, Lo to Hi]
type = StateTypeSet
trigger1 = statetype = C && command != "holddown"
statetype = S
physics = S

[State 153, 4]
type = ChangeState
trigger1 = HitOver
Value = 131
ctrl = 1

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

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

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

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

;---------------------------------------------------------------------------
; 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 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 = ChangeState
trigger1 = sysvar(0)
Value = 52

;---------------------------------------------------------------------------
; LOSE (Time over)
[Statedef 170]
type = S
ctrl = 0
anim = 1902
velset = 0,0

[State 170, 1]
type = NotHitBy
trigger1 = 1
Value = SCA
Time = 1

;--------------------------------------------------------------
; Lose Tired
[Statedef 17411]
type    = S
ctrl = 0
anim = 170
sprpriority = 1

[State 0, EnvColor]
type = EnvColor
trigger1 = AnimElem = 4
value = 255,255,255
time = 3
ignorehitpause = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 4
value = 730,0; CAMBIAY ABAYA QUE PESA
volume = 100
channel = 1

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

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = Time < 180
flag = roundnotover

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

;---------------------------------------------------------------------------
; DRAWGAME (Time over)
[Statedef 175]
type = S
ctrl = 0
velset = 0,0

[State 175, 1] ; If no anim, use go to lose state.
type = ChangeState
trigger1 = Time = 0
trigger1 = !SelfAnimExist(175)
Value = 1902

[State 175, 2]
type = ChangeAnim
trigger1 = Time = 0
Value = 175

[State 175, 3]
type = NotHitBy
trigger1 = 1
Value = SCA
Time = 1
;--------------------------------------------------------------------------
;Win state decider
[Statedef 180]
type = S

[State 180: 1]
type = ChangeState
trigger1 = (!time)
value = ifelse(random > 500,181,182)
;---------------------------------------------------------------------------
;Win pose 1 -"all my training and your still tough"
[Statedef 181]
type = S
ctrl = 0
anim = 7020
velset = 0,0



[State 181, 1]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1
;-------------------------------------------------------------------------------
;Win pose 1 -"Is that All you got?"
[Statedef 182]
type = S
ctrl = 0
anim = 1902
velset = 0,0


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

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


[State 180, 1]
type = ChangeState
trigger1 = random <= 449
value = 191


[State 180, 1]
type = ChangeState
trigger1 = random <= 449
value = 192

[State 180, 1]
type = ChangeState
trigger1 = random <= 449
value = 193




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

;-intro--------------------------------------------------------------------------
[Statedef 191]
type 			= S
movetype		= I
physics			= N
anim			= 514
velset			= 0,0
ctrl			= 0
poweradd		= 0
juggle			= 0
facep2			= 0
hitdefpersist	= 0
movehitpersist	= 0
hitcountpersist	= 0
;sprpriority	= 0

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

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


[State 191,3]
type			= EnvShake
trigger1 = (Time > 520) && (Time < 600) && ((GameTime%5) = 0)
time			= 5
freq			= 140
ampl			= -3
phase			= 90


[State 191,	2]
type			= PalFX
trigger1 = (Time > 720) && (Time < 1310) && ((GameTime%5) = 0)
time			= 5
add 			= 15,20,0
sinadd 		= 40,35,5,4

[State 191,3]
type			= EnvShake
trigger1 = (Time > 720) && (Time < 1310) && ((GameTime%5) = 0)
time			= 5
freq			= 140
ampl			= -3
phase			= 90

;_____________________xplods____________________________________________________________________________
;effet dust MB







[State 0, Explod]
type = Explod
triggerall = pos y = 0
trigger1 = AnimElem=33
anim = 7021 ; PIEDRAS
ID = 7021
pos = 0,0
postype = p1
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
scale = ifelse(power < 3000 ,.8, 1),ifelse(power < 3000 ,.6, 1)
sprpriority = -2
ontop = 0
shadow = 0,0,0
ownpal = 1



[State 0, Explod]
type = Explod
triggerall = pos y = 0
trigger1 = AnimElem=25
anim = 11500 ; VIENTO
ID = 11500
pos = ifelse(power < 3000 ,-5, -10) ,0
postype = p1
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
scale = ifelse(power < 3000 ,.8, 1),ifelse(power < 3000 ,.6, 1)
sprpriority = -2
ontop = 0
shadow = 0,0,0
ownpal = 1

[State 0, Explod]
type = Explod
triggerall = pos y = 0
trigger1 = AnimElem=25
anim = 11500
ID =11500
pos = ifelse(power < 3000 ,5, 10) ,0
postype = p1
facing = -1
vfacing = 1
bindtime = 1
removetime = -2
scale = ifelse(power < 3000 ,.8, 1),ifelse(power < 3000 ,.6, 1)
sprpriority = -2
ontop = 0
shadow = 0,0,0
ownpal = 1





[State 191:	RemoveExplod]
type			= RemoveExplod
trigger1		= Time = 1310
id			= 11500



;VIEU CERCLE
[State 191, 6]
type = Explod
trigger1 	= AnimElem = 25
Anim = 8011; circulo inicio
Pos = 3,-50
Id = 8011
sprpriority = 5
removeongethit = 1
removetime = -2
bindtime = -1
Postype = p1
SuperMove = 1
ownpal = 1
;scale = 0.8, 0.8


[State 730, Aura]
type = Explod
trigger1 = animelem = 25
anim = 731
ID = 731
sprpriority = -1
removetime = -1
bindtime = -1
ownpal = 1
removeongethit = 1
scale = 0.8, 0.8
ontop = 1



[State 191:	RemoveExplod]
type			= RemoveExplod
trigger1		= Time = 1310
id			= 731



;ring
[State 191, 6]
type = Explod
trigger1 = AnimElem = 25
Anim = 9992 ; CIRCULO PISO
Pos = 0,0
Id = 9992
sprpriority = 5
removeongethit = 1
removetime = -1
bindtime = -1
Postype = p1
SuperMove = 1
ownpal = 1
scale = 0.8, 0.8

[State 191:	RemoveExplod]
type			= RemoveExplod
trigger1		= Time = 1310
id			= 9992



;blanc
[State 191, 6]
type = Explod
trigger1		= Time = 1310
Anim = 8011
Pos = 3,-50
Id = 8011
sprpriority = 5
removeongethit = 1
removetime = -2
bindtime = -1
Postype = p1
SuperMove = 1
ownpal = 1
scale = 2, 2

[State 191:		AssertSpecial]
type			= AssertSpecial
trigger1		= (Time < 150)
flag			= Intro
flag2			= NoBarDisplay

;---------------------SOUNDS-------------------------------------------------------------------------

[State 191, 1]
type = PlaySnd
trigger1= Time = 720
value = 730,5; inicio charge
channel = 7

[State 191, 1]
type = PlaySnd
trigger1 = animelem = 22
value = 2200,10;GOLPE

[State 191, 1]
type = PlaySnd
trigger1 = animelem = 23
value = 9,7

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 36
value = S1,8


[State 191, 1]
type = PlaySnd
trigger1 = animelem = 34
value = 99,8




[State 191, PlaySnd]
type = PlaySnd
trigger1 = (Time > 720) && (Time < 1310) && ((GameTime%95) = 0)
value	= S4,1 ; chargue
volume = 10
channel = 7

[State 805, StopSnd]
type = StopSnd
trigger1 = Time = 1310
channel = 7

[State 191, 1]
type = PlaySnd
trigger1 = Time = 1310
value = S730,5; termina chargue


;[State 191, StopSnd]
;type = StopSnd
;trigger1 = (AnimElem = 77)
;channel = 2
;---------------------------------------------------------------------------------------------------------


[State 191, 1]
type = ChangeState
trigger1 = AnimTime = 1
value = 0
;--------------------------------------------------------------------------------------------------


; INTRO (override this state to give character an intro)
[Statedef 192]
type = S
ctrl = 0
anim = 7023

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

[State 0, PlaySnd]
type = PlaySnd
trigger1 = TIME= 150
value = S180,0


[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 5
value = S1,8

[State 192, 1]
type = ChangeState
trigger1 = time = 330
Value = 0


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


; INTRO (override this state to give character an intro)
[Statedef 195]
type = S
ctrl = 0
anim =191

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

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 2
value = 9,9


[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 8
value = S1,8

[State 195, 1]
type = ChangeState
trigger1 = time = 330
Value = 0
;-----------------------------------------------------------------------------------------------------


;-----------------------------------------------------------------------------------------------------
; INTRO (override this state to give character an intro)
[Statedef 193]
type = S
ctrl = 0
anim = 193

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

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 2
value = S1,8

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 30
value = S4,1
channel = 1
loop = 1

[State 0, EnvShake]
type = EnvShake
trigger1 = time >= 30 && time%2
time = 2
freq = 60
ampl = -4
phase = 90



[State 0, Explod]
type = Explod
trigger1 = time = 30
anim = 11100
ID = 11100
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime = 150
supermove
pausemove
scale = 1,1
sprpriority = 0
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 0
;ignorehitpause =
;persistent =

[State 0, Helper]
type = Helper
trigger1 = time = 30
helpertype = normal ;player
name = "reiatsu"
ID = 194
stateno = 194
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0

[State 0, StopSnd]
type = StopSnd
trigger1 = time = 180
channel = 1

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

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 180
value = 194

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 190
value = S1,8

[State 191, 1]
type = ChangeState
trigger1 = time = 200
Value = 0






;----------------------------------------------------------------------------------------------------------
;Rafaga de espada A
[Statedef 207]
type    = A
movetype= A
physics = N
juggle  = 1
velset = 0,0
ctrl = 0
anim = 294
poweradd = 0

[State 207]
type = VelSet
trigger1 = AnimElem = 2
x = 2

[State 0, Explod]
type = Explod
trigger1 = animelem = 2
anim = 2224
ID = 2224
bindtime = -1
removetime = -2
sprpriority = 3
ownpal = 1
removeongethit = 1
scale= .2,.4
pos= 35,-45

[State 207, 2]
type = HitDef
trigger1 = animelem = 2
trigger2 = animelem = 3
trigger3 = animelem = 4
trigger4 = animelem = 5
trigger5 = animelem = 6
trigger6 = animelem = 7
attr = S,NA
hitflag = MAF
guardflag =MA
animtype = Light
air.animtype = Light
fall.animtype = Back
damage = 7,2
pausetime = 5,10
animtype =light
ground.type = high
ground.velocity = -4
ground.slidetime =10
ground.hittime = 12
sparkxy = -20,-40
sparkno = s10010 + random%8
hitsound= s1,5
kill = !var(58) || 1*p2stateno = 003




[State 207, 1]
type = PlaySnd
trigger1 = animelem = 2
trigger2 = animelem = 3
trigger3 = animelem = 4
trigger4 = animelem = 5
trigger5 = animelem = 6
trigger6 = animelem = 7
value = 1,4

[State 207, 4]
type = ChangeState
trigger1 = animTime = 0
value = 0
ctrl = 1
;--------------------------------------------------------------------------------------------------------
; Rafagas de ESPADA B
[Statedef 208]
type    = A
movetype= A
physics = N
juggle  = 1
velset = 0,0
ctrl = 0
anim = 295     ;animacion puņoz
poweradd = 0

[State 208]
type = VelSet
trigger1 = AnimElem = 2
x = 2

[State 0, Explod]
type = Explod
trigger1 = animelem = 2
anim = 2224
ID = 2224
bindtime = -1
removetime = -2
sprpriority = 3
ownpal = 1
removeongethit = 1
scale= .2,.4
pos= 70,-49

[State 208, 2]
type = HitDef
trigger1 = animelem = 2
trigger2 = animelem = 3
trigger3 = animelem = 4
trigger4 = animelem = 5
trigger5 = animelem = 6
trigger6 = animelem = 7
attr = S,NA
hitflag = MAF
guardflag =MA
animtype = Light
air.animtype = Light
fall.animtype = Back
damage = 7,2
pausetime = 5,10
animtype =light
ground.type = high
ground.velocity = -4
ground.slidetime =10
ground.hittime = 12
sparkxy = -20,-40
sparkno = s10010 + random%8
hitsound= s1,5
kill = !var(58) || 1*p2stateno = 003

[State 208, 1]
type = PlaySnd
trigger1 = animelem = 2
trigger2 = animelem = 3
trigger3 = animelem = 4
trigger4 = animelem = 5
trigger5 = animelem = 6
trigger6 = animelem = 7
value = 1,4


[State 208, 4]
type = ChangeState
trigger1 = animTime = 0
value = 0
ctrl = 1

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


;Rafaga de espada
[Statedef 209]
type    = c
movetype= A
physics = s
juggle  = 3
velset = 0,0
ctrl = 0
anim = 299
poweradd = 0

[State 209]
type = VelSet
trigger1 = AnimElem = 2
x = 2

[State 0, Explod]
type = Explod
trigger1 = animelem = 2
anim = 2224
ID = 2224
bindtime = -1
removetime = -2
sprpriority = 3
ownpal = 1
removeongethit = 1
scale= .2,.4
pos= 35,-38

[State 209, 2]
type = HitDef
trigger1 = animelem = 2
trigger2 = animelem = 3
trigger3 = animelem = 4
trigger4 = animelem = 5
trigger5 = animelem = 6
trigger6 = animelem = 7
attr = S,NA
hitflag = MAF
guardflag =MA
animtype = Light
air.animtype = Light
fall.animtype = Back
damage = 7,2
pausetime = 5,10
animtype =light
ground.type = high
ground.velocity = -4
ground.slidetime =10
ground.hittime = 12
sparkxy = -20,-40
sparkno = s10010 + random%8
hitsound= s1,5
kill = !var(58) || 1*p2stateno = 003



[State 209, 1]
type = PlaySnd
trigger1 = animelem = 2
trigger2 = animelem = 3
trigger3 = animelem = 4
trigger4 = animelem = 5
trigger5 = animelem = 6
trigger6 = animelem = 7
value = 1,4

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

;---------------------------------------------------------------------
;Rafaga de espada
[Statedef 206]
type    = c
movetype= A
physics = s
juggle  = 3
velset = 0,0
ctrl = 0
anim = 300
poweradd = 0

[State 206]
type = VelSet
trigger1 = AnimElem = 2
x = 2

[State 0, Explod]
type = Explod
trigger1 = animelem = 2
anim = 2224
ID = 2224
bindtime = -1
removetime = -2
sprpriority = 3
ownpal = 1
removeongethit = 1
scale= .2,.4
pos= 35,-39

[State 206, 2]
type = HitDef
trigger1 = animelem = 2
trigger2 = animelem = 3
trigger3 = animelem = 4
trigger4 = animelem = 5
trigger5 = animelem = 6
trigger6 = animelem = 7
attr = S,NA
hitflag = MAF
guardflag =MA
animtype = Light
air.animtype = Light
fall.animtype = Back
damage =7,2
pausetime = 5,10
animtype =light
ground.type = high
ground.velocity = -4
ground.slidetime =10
ground.hittime = 12
sparkxy = -20,-40
sparkno = s10010 + random%8
hitsound= s1,5
kill = !var(58) || 1*p2stateno = 003



[State 206, 1]
type = PlaySnd
trigger1 = animelem = 2
trigger2 = animelem = 3
trigger3 = animelem = 4
trigger4 = animelem = 5
trigger5 = animelem = 6
trigger6 = animelem = 7
value = 1,4

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


;---------------------------------------------------------------------------
; INTRO (override this state to give character an intro)
[Statedef 194]
type = S
ctrl = 0
anim = 11110
sprpriority = 4

[State 0, VarSet]
type = VarSet
trigger1 = !time
fvar(2) = 0.1
[State 0, VarAdd]
type = VarAdd
trigger1 = time%2
fv = 2
value = 0.03
[State 0, VarSet]
type = VarSet
trigger1 = fvar(2) >= 1
fvar(2) = 1

[State 0, AngleDraw]
type = AngleDraw
trigger1 = 1
scale = 0.5,fvar(2)

[State 0, Trans]
type = Trans
trigger1 = 1
trans = add

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

[State 191, 1]
type = destroyself
trigger1 = time = 140

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



[State 0, PlaySnd]
type = PlaySnd
trigger1 =time = 0 & random <= 700
value = S5000,0
volume = 200

[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), 5000, 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 = ChangeState
trigger1 = HitShakeOver
trigger1 = GetHitVar(yvel) = 0 && !GetHitVar(fall)
value = 5001 ;HITG_SLIDE

[State 5000, 7]
type = ChangeState
trigger1 = HitShakeOver
Value = 5030

[State 5000, FFB Light]
type = ForceFeedback
trigger1 = anim = 5000
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

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

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

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

[State 5001, 3] ;Stop sliding back
type = VelMul
trigger1 = Time >= GetHitVar(slidetime)
x = 0.6

[State 5001, 4]
type = VelSet
trigger1 = HitOver
x = 0

[State 5001, 5]
type = DefenceMulSet
trigger1 = HitOver
Value = 1

[State 5001, 6]
type = ChangeState
trigger1 = HitOver
Value = 0
ctrl = 1

;---------------------------------------------------------------------------
; HITC_SHAKE
[Statedef 5010]
type    = C
movetype = H
physics = N
velset = 0,0

[State 5010, 1] ;Anim for HIT_LIGHT to HIT_HARD
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) != [3,5]
Value = 5020 + GetHitVar(animtype)

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

[State 5010, 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 5010, 4] ;Freeze anim
type = ChangeAnim
trigger1 = Time > 0
Value = anim

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

[State 5010, 6]
type = ChangeState
trigger1 = HitShakeOver
trigger1 = GetHitVar(yvel) = 0 && !GetHitVar(fall)
value = 5011 ;HITC_SLIDE

[State 5010, 7]
type = ChangeState
trigger1 = HitShakeOver
Value = 5030

[State 5010, FFB Light]
type = ForceFeedback
trigger1 = anim = 5020
persistent = 0
Time = 6
waveform = square

[State 5010, FFB Medium]
type = ForceFeedback
trigger1 = anim = 5021
persistent = 0
Time = 8
waveform = sinesquare
ampl = 110,-1,-.3

[State 5010, FFB Hard]
type = ForceFeedback
trigger1 = anim = 5022
persistent = 0
Time = 15
waveform = sinesquare
ampl = 140

;---------------------------------------------------------------------------
; HITC_SLIDE
[Statedef 5011]
type    = C
movetype = H
physics = C

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

[State 5011, 2]
type = ChangeAnim
trigger1 = AnimTime = 0
Value = 5025 + GetHitVar(animtype)

[State 5011, 3] ;Stop sliding back
type = VelMul
trigger1 = Time >= GetHitVar(slidetime)
x = 0.6

[State 5011, 4]
type = VelSet
trigger1 = HitOver
x = 0

[State 5011, 5]
type = DefenceMulSet
trigger1 = HitOver
Value = 1

[State 5011, 6]
type = ChangeState
trigger1 = HitOver
Value = 11
ctrl = 1


;---------------------------------------------------------------------------
; HITA_SHAKE
[Statedef 5020]
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 = 5030

[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 5030]
type    = A
movetype = H
physics = N
ctrl = 0

[State 0, Helper]
type = Helper
trigger1 = !alive && var(9)
helpertype = normal ;player
name = "reiatsu"
ID = 3002
stateno = 3002
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime = 999
pausemovetime = 999

[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 = ChangeState
triggerall = !HitFall
trigger1 = HitOver
trigger2 = Vel Y > 0    ;Hit ground
trigger2 = Pos Y >= 10  ;.
value = 5040 ;HITA_RECOV

[State 5030, 4]
type = ChangeState
triggerall = HitFall
trigger1 = HitOver
trigger2 = Vel Y > 0    ;Hit ground
trigger2 = Pos Y >= 10  ;.
value = 5050 ;HITA_FALL

[State 5030, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 5035 ;HITA_UP (transition)

;---------------------------------------------------------------------------
; HITA_UP_T (transition)
[Statedef 5035]
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 = ChangeState
triggerall = !HitFall
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

[State 5035, 4]
type = ChangeState
triggerall = HitFall
trigger1 = HitOver  ;Hit is over
trigger2 = AnimTime = 0 ;Anim is over
trigger3 = Vel Y > 0    ;Hit ground
trigger3 = Pos Y >= 10  ;.
trigger4 = Time = 0     ;No transition anim
trigger4 = Anim != 5035 ;.
value = 5050 ;HITA_FALL

;---------------------------------------------------------------------------
; HITA_RECOV (recovering in air, not falling)
[Statedef 5040]
type    = A
movetype = H
physics = N

[State 5040, 1]
type = ChangeState
trigger1 = !alive
Value = 5050

[State 5000, ChangeAnim]
type = ChangeAnim
trigger1 = Var(9) = 1
trigger1 = Anim != 20044
Value = 20044

[State 5040, 2]
type = ChangeAnim
trigger1 = AnimTime = 0
trigger1 = Anim != 5040
trigger2 = Time = 0
trigger2 = Anim != 5035
Value = 5040

[State 5000, ChangeAnim]
type = ChangeAnim
trigger1 = Var(0) = 76
trigger1 = Anim != 7000
Value = 7000

[State 5040, 3]
type = CtrlSet
trigger1 = HitOver
Value = 1

[State 5040, 4]
type = StateTypeSet
trigger1 = HitOver
movetype = I

[State 5040, 5]
type = VelAdd
trigger1 = 1
Y = GetHitVar(yaccel)

[State 5040, 6]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 52 ;JUMPLAND

;---------------------------------------------------------------------------
; HITA_FALL (knocked up, falling)
[Statedef 5050]
type    = A
movetype = H
physics = N

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time =0 & random <= 700
value = S5000,2
volume = 200

[State 5050, 1] ;Change anim when done with transition
type = ChangeAnim
trigger1 = AnimTime = 0
trigger1 = anim = 5035
trigger2 = Time = 0     ;If no transition anim
trigger2 = Anim != 5035
trigger2 = (Anim != [5051, 5059]) && (Anim != [5061, 5069])
trigger2 = Anim != 5090 ;Not if hit off ground anim
Value = 5050

[State 5050, 2] ;Coming down anim
type = ChangeAnim
trigger1 = anim = [5050,5059]
trigger1 = Vel Y >= ifelse(anim = 5050, 1, -2)
trigger1 = SelfAnimExist(anim + 10)
Value = anim + 10
persistent = 0

[State 5050, 3] ;Gravity
type = VelAdd
trigger1 = 1
Y = GetHitVar(yaccel)

[State 5000, ChangeAnim]
type = ChangeAnim
trigger1 = Var(0) = 76
trigger1 = Anim != 7000
Value = 7000

[State 6000, ChangeAnim]
type = ChangeAnim
trigger1 = Var(0) = 75
trigger1 = Anim != 6000
Value = 6000

[State 5050, 4] ;Recover near ground
type = ChangeState
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 = ChangeState
triggerall = Vel Y > -1
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery"
value = 5210 ;HITFALL_AIRRECOVER

[State 5050, 6]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= ifelse((anim = [5051,5059]) || (anim = [5061,5069]), 0, 25)
value = 5100 ;HIT_BOUNCE

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

[State 5070, 1]
type = ChangeAnim
trigger1 = 1
Value = 5070

[State 5000, ChangeAnim]
type = ChangeAnim
trigger1 = Var(9) = 1
trigger1 = Anim != 15500
Value = 15500

[State 5070, 2]
type = ChangeState
trigger1 = HitShakeOver
Value = 5071

[State 5070, 3]
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 5000, ChangeAnim]
type = ChangeAnim
trigger1 = Var(9) = 1
trigger1 = anim != 5110
Value = 5110

[State 5071, 2] ;Acceleration
type = VelAdd
trigger1 = 1
Y = GetHitVar(yaccel)

[State 5071, 3] ;Hit ground
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 5080, 1] ;Set default anim
type = VarSet
trigger1 = Time = 0
sysvar(2) = ifelse(GetHitVar(yvel) = 0, 5080, 5090)

[State 5000, ChangeAnim]
type = ChangeAnim
trigger1 = Var(9) = 1
trigger1 = Anim != 15500
Value = 15500

[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 ;HITA_UP

;---------------------------------------------------------------------------
; 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 5000, ChangeAnim]
type = ChangeAnim
trigger1 = Var(9) = 1
trigger1 = Anim != 15500
Value = 15500

[State 5081, 3] ;Don't show hit ground frame
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 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 = ChangeState
trigger1 = AnimTime = 0
Value = 5101

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

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



[State 5101, 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 = 0.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, 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, 4]
type = HitFallDamage
trigger1 = Time = 0

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

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

[State 5110, 6]
type = PlaySnd
trigger1 = Time = 0
trigger1 = !SysVar(0)
value = F7, (sysvar(1) > 5) + (sysvar(1) > 14)

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

[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

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

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

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

[State 5000, ChangeAnim]
type = ChangeAnim
trigger1 = Var(9) = 1
trigger1 = Anim != 25120
Value = 25120

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

[State 5120, 3]
type = NotHitBy
trigger1 = 1
Value = SCA
Time = 1

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

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

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

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

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

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

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

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

[State 5000, ChangeAnim]
type = ChangeAnim
trigger1 = Var(9) = 1
trigger1 = Anim != 15510
Value = 15510

[State 5150, 4] ;Match over anim
type = ChangeAnim
persistent = 0
;trigger1 = Time = 0
trigger1 = MatchOver = 1
trigger1 = anim = [5140,5149]
trigger1 = SelfAnimExist(anim + 10)
Value = anim + 10

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

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

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

[State 5150, 8]
type = NotHitBy
trigger1 = 1
Value = SCA
Time = 1

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

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

[State 5000, ChangeAnim]
type = ChangeAnim
trigger1 = Var(9) = 1
trigger1 = Anim != 15000
Value = 15000

[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 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 = -0.15
Y = -3.5

[State 5000, ChangeAnim]
type = ChangeAnim
trigger1 = Var(9) = 1
trigger1 = Anim != 20044
Value = 20044

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

[State 5201, 4]
type = NotHitBy
trigger1 = 1
Value = SCA
Time = 1

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

[State 5201, 6]
type = GameMakeAnim
trigger1 = Time = 1
Value = 60
pos = 0, 0
under = 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 5000, ChangeAnim]
type = ChangeAnim
trigger1 = Var(9) = 1
trigger1 = Anim != 20044
Value = 20044

[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 = 0.8
Y = 0.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 = 0.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 = 15

[State 5210, 4]
type = CtrlSet
trigger1 = Time = 20
Value = 1

[State 5210, 5]
type = VelAdd;Gravity
trigger1 = Time >= 4
Y = 0.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 = 5300
velset = 0,0

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

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

;aura

[Statedef 9991, aura]
Type = S
movetype= A
physics = N
ctrl = 0
velset = 0,0
anim = 9991
sprpriority = 0


[State 0, Aura 1]
type = Explod
trigger1 =random<500
anim =8015
ID =8015
pos = -20,-0
postype = p1
bindtime = -1
vel = 0,2
random =30,10
removetime = -2
scale = 0.12,0.12
ontop = ifelse(random<500,1,0)
ownpal = ifelse(var(11)>0,0,1)
removeongethit = 0

[State 0, Aura 1b]
type = Explod
trigger1 =random<500
anim =8015
ID =8015
pos = 20,-0
postype = p1
bindtime = -1
facing = -1
vel = 0,-2
random =30,10
removetime = -2
scale = 0.12,0.12
ontop = ifelse(random<500,1,0)
ownpal = ifelse(var(11)>0,0,1)
removeongethit = 0

[State 0, Aura 2]
type = Explod
trigger1 =random<500
anim =8014
ID =8014
pos = 0,-30
postype = p1
bindtime = -1
vel = ifelse(random<500,1,-1),1
random =0,60
removetime = -2
scale = 0.12,0.12
ontop = ifelse(random<500,1,0)
ownpal = ifelse(var(11)>0,0,1)
removeongethit = 0

[State 0, Aura 2b]
type = Explod
trigger1 =random<500
anim =8014
ID =8014
pos = 0,-30
postype = p1
bindtime = -1
facing=-1
vel = ifelse(random<500,1,-1),1
random = 20,60
removetime = -2
scale = 0.12,0.12
ontop = ifelse(random<500,1,0)
ownpal = ifelse(var(11)>0,0,1)
removeongethit = 0

[State 0, Aura 3]
type = Explod
trigger1 =random<500
anim =8015
ID =8015
pos = -15,-25
postype = p1
bindtime = -1
vel = 0,2
random =10,25
removetime = -2
scale = 0.12,0.12
ontop = ifelse(random<500,1,0)
ownpal = ifelse(var(11)>0,0,1)
removeongethit = 0

[State 0, Aura 3b]
type = Explod
trigger1 =random<500
anim =8015
ID =8015
pos = 15,-25
postype = p1
bindtime = -1
facing = -1
vel = 0,-2
random =10,25
removetime = -2
scale = 0.12,0.12
ontop = ifelse(random<500,1,0)
ownpal = ifelse(var(11)>0,0,1)
removeongethit = 0


[State 0, DestroySelf]
type = DestroySelf
trigger1 = Time = 360

;---------------------------------------------------------------------------
;Rocas/Helper
[Statedef 6010]
type = S
anim = 6010+random%2
sprpriority = 0+random%3
supermove = 1
supermovetime = -1
pausemovetime = -1

[State 0, VelSet]
type = VelSet
trigger1 = time = 0
y = -1

[State 0, VelAdd]
type = VelAdd
triggerall = parent,stateno = 730
trigger1 = timemod = 10,1
y = -0.15

[State 0, VelAdd]
type = VelAdd
triggerall = parent,stateno != 730
trigger1 = timemod = 10,1
y = 0.5

[State 0, DestroySelf]
type = DestroySelf
triggerall = parent,stateno != 730
trigger1 = Pos Y >= 0
trigger2 = Pos Y <= -400

;=========================|

;---------------------------------------------------------------------------
; 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

;-------------- Generated by Fighter Factory -------------

;--------------------- Variable List ----------------------

; Var(1) - StateDef 1011, 1311, -2
; Var(2) - StateDef 1000, qcf abc, 1200, qcf abc, 1210, qcf abc
; Var(3) - StateDef 700, b
; Var(10) - StateDef 1001, 1011, 1112, 1113, 1201, 1211, 1311
; Var(37) - StateDef -2
; Var(50) - StateDef -3

;--------------------- Float Variable List ----------------------

; fVar(1) - StateDef 1001, 1011, 1112, 1113, 1311
; fVar(10) - StateDef -2
; fVar(11) - StateDef -2
; fVar(12) - StateDef -2
