; 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, 1]
type = ChangeAnim
trigger1 = Anim != 0 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0 ;Turn anim over
value = 0
[State 0, 2]
type = VelSet
trigger1 = Time = 0
y = 0
[State 0, 3] ;Stop moving if low velocity or 4 ticks pass
type = VelSet
trigger1 = abs(vel x) < 2
trigger2 = Time = 4
x = 0
[State 0, 4] ;Are you dead?
type = ChangeState
trigger1 = !alive
value = 5050
;---------------------------------------------------------------------------
; Stand to Crouch
[Statedef 10]
type = C
physics = C
anim = 10
[State 10, 1]
type = VelMul
trigger1 = Time = 0
x = .75
[State 10, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
;---------------------------------------------------------------------------
; Crouching
[Statedef 11]
type = C
physics = C
anim = 11
sprpriority = 0
[State 11, 1] ;Change from turning animation
type = ChangeAnim
trigger1 = Anim = 6 && AnimTime = 0
value = 11
;---------------------------------------------------------------------------
; 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 20, 1]
type = VelSet
trigger1 = command = "holdfwd"
x = const(velocity.walk.fwd.x)
[State 20, 2]
type = VelSet
trigger1 = command = "holdback"
x = const(velocity.walk.back.x)
[State 20, 3]
type = ChangeAnim
triggerall = vel x > 0
trigger1 = Anim != 20 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 20
[State 20, 4]
type = ChangeAnim
triggerall = vel x < 0
trigger1 = Anim != 21 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 21
[State 20, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 3
value = S20,0
volume = 10000
channel = -1
[State 20, PlaySnd2]
type = PlaySnd
trigger1 = AnimElem = 6
value = S20,1
volume = 10000
channel = -1
;---------------------------------------------------------------------------
; Jump Start
[Statedef 40]
type = S
physics = S
anim = 40
ctrl = 0
sprpriority = 1
[State 40, 1]
type = VarSet
trigger1 = Time = 0
sysvar(1) = 0
[State 40, 2]
type = VarSet
trigger1 = command = "holdfwd"
sysvar(1) = 1
[State 40, 3]
type = VarSet
trigger1 = command = "holdback"
sysvar(1) = -1
[State 40, 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 40, 5]
type = VelSet
trigger1 = AnimTime = 0
trigger1 = prevstateno = 100 ;RUN_FWD
trigger1 = sysvar(1) = 1
x = const(velocity.runjump.fwd.x)
[State 40, Dust1]
type = Explod
trigger1 = AnimElem = 1
anim = 8500
sprpriority = 5
Ownpal = 1
[State 40, Dust1]
type = Explod
trigger1 = AnimElem = 1
anim = 8510
pos = 0,4
sprpriority = -1
ownpal = 1
scale = 1.4, 1.2
[State 40, 6]
type = ChangeState
trigger1 = AnimTime = 0
value = 50
ctrl = 1
;---------------------------------------------------------------------------
; AirJump Start
[Statedef 45]
type = A
physics = N
ctrl = 0
velset = 0,0
[State 45, 1]
type = ChangeAnim
trigger1 = SelfAnimExist(44)
value = 44
[State 45, 2]