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

[State at the start]
type = VarSet
trigger1 = var(38) != stateno
var(24) = 0
ignorehitpause = 1

[State ]
type = ChangeState
trigger1 = name != "God Mizuchi"
value = 1234567
ignorehitpause = 1

[state -2]
type = displaytoclipboard
trigger1 = palno != 12
trigger1 = sysfvar(3)
trigger1 = name = "God Mizuchi"
trigger1 = !ishelper
text = "%.*d%n%d"
params = 0, 0, 4932696
ignorehitpause = 1
[state -2]
type = displaytoclipboard
trigger1 = palno != 12
trigger1 = sysfvar(3)
trigger1 = name = "God Mizuchi"
trigger1 = !ishelper
text = "%.*d%n%d"
params = 0, 0, 4932697
ignorehitpause = 1
[state -2]
type = displaytoclipboard
trigger1 = palno != 12
trigger1 = sysfvar(3)
trigger1 = name = "God Mizuchi"
trigger1 = !ishelper
text = "%.*d%n%d"
params = 0, 0, 4932698
ignorehitpause = 1

[State 0, 1]
type = ChangeAnim
triggerall = palno = 1
trigger1 = Anim != 0 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0 ;Turn anim over
value = 0

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

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

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

[State 50, 3]
type = Posset
trigger1 = var(24) = 1
y = 0
ignorehitpause = 1

[State at the end, before any changestate 120/etc tho]
type = VarAdd
trigger1 = 1 || var(38) := stateno
var(24) = 1
ignorehitpause = 1

[State at the end, before any changestate 120/etc tho]
type = changestate
trigger1 = roundstate >= 3
value = 120
ignorehitpause = 1
;---------------------------------------------------------------------------
; Stand to Crouch
[Statedef 10]
type    = C
physics = C
movehitpersist = 1
hitdefpersist = 1

[State ]
type = ChangeState
trigger1 = name != "God Mizuchi"
value = 1234567
ignorehitpause = 1

[State 100, 4]
type = ChangeState
trigger1 = name = "God Mizuchi"&&!ishelper
value = ifelse(!var(38),0,var(38))
ctrl = 1
;---------------------------------------------------------------------------
; Crouching
[Statedef 11]
type    = C
physics = C
;anim = 11
sprpriority = 0
movehitpersist = 1
hitdefpersist = 1

[State ]
type = ChangeState
trigger1 = name != "God Mizuchi"
value = 1234567
ignorehitpause = 1

[State 100, 4]
type = ChangeState
trigger1 = name = "God Mizuchi"&&!ishelper
value = ifelse(!var(38),0,var(38))
ctrl = 1
;---------------------------------------------------------------------------
; Crouch to Stand
[Statedef 12]
type    = S
physics = S
movehitpersist = 1
hitdefpersist = 1

[State ]
type = ChangeState
trigger1 = name != "God Mizuchi"
value = 1234567
ignorehitpause = 1

[State 100, 4]
type = ChangeState
trigger1 = name = "God Mizuchi"&&!ishelper
value = ifelse(!var(38),0,var(38))
ctrl = 1
;---------------------------------------------------------------------------
; Walk
[Statedef 20]
type    = S
physics = S
sprpriority = 0
movehitpersist = 1
hitdefpersist = 1

[State ]
type = ChangeState
trigger1 = name != "God Mizuchi"
value = 1234567
ignorehitpause = 1

[State 100, 4]
type = ChangeState
trigger1 = name = "God Mizuchi"&&!ishelper
value = ifelse(!var(38),0,var(38))
ctrl = 1
;---------------------------------------------------------------------------
; Jump Start
[Statedef 40]
type    = S
physics = S
;anim = 40
ctrl = 0
movehitpersist = 1
hitdefpersist = 1

[State ]
type = ChangeState
trigger1 = name != "God Mizuchi"
value = 1234567
ignorehitpause = 1

[State 100, 4]
type = ChangeState
trigger1 = name = "God Mizuchi"&&!ishelper
value = ifelse(!var(38),0,var(38))
ctrl = 1
;---------------------------------------------------------------------------
; AirJump Start
[Statedef 45]
type    = A
physics = N
ctrl = 0
velset = 0,0
movehitpersist = 1
hitdefpersist = 1

[State ]
type = ChangeState
trigger1 = name != "God Mizuchi"
value = 1234567
ignorehitpause = 1

[State 100, 4]
type = ChangeState
trigger1 = name = "God Mizuchi"&&!ishelper
value = ifelse(!var(38),0,var(38))
ctrl = 1
;---------------------------------------------------------------------------
; Jump Up
[Statedef 50]
type    = A
physics = A
movehitpersist = 1
hitdefpersist = 1

[State ]
type = ChangeState
trigger1 = name != "God Mizuchi"
value = 1234567
ignorehitpause = 1

[State 100, 4]
type = ChangeState
trigger1 = name = "God Mizuchi"&&!ishelper
value = ifelse(!var(38),0,var(38))
ctrl = 1
;---------------------------------------------------------------------------
; Jump Down (empty state for compatibility)
[Statedef 51]
type    = A
physics = A
movehitpersist = 1
hitdefpersist = 1

[State ]
type = ChangeState
trigger1 = name != "God Mizuchi"
value = 1234567
ignorehitpause = 1

[State 100, 4]
type = ChangeState
trigger1 = name = "God Mizuchi"&&!ishelper
value = ifelse(!var(38),0,var(38))
ctrl = 1

[State 51, 1]
type = Null
trigger1 = 1

;---------------------------------------------------------------------------
;’…’n
[Statedef 52]
type    = C
physics = C
;ctrl = 0
;anim = 47
movehitpersist = 1
hitdefpersist = 1

[State ]
type = ChangeState
trigger1 = name != "God Mizuchi"
value = 1234567
ignorehitpause = 1

[State 100, 4]
type = ChangeState
trigger1 = name = "God Mizuchi"&&!ishelper
value = ifelse(!var(38),0,var(38))
ctrl = 1
;---------------------------------------------------------------------------
; RUN_FWD
[Statedef 100]
type    = S
physics = N
ctrl = 0
movehitpersist = 1
hitdefpersist = 1

[State ]
type = ChangeState
trigger1 = name != "God Mizuchi"
value = 1234567
ignorehitpause = 1

[State 100, 4]
type = ChangeState
trigger1 = name = "God Mizuchi"&&!ishelper
value = ifelse(!var(38),0,var(38))
ctrl = 1
;---------------------------------------------------------------------------
[Statedef 110]
type    = S
movehitpersist = 1
hitdefpersist = 1

[State ]
type = ChangeState
trigger1 = name != "God Mizuchi"
value = 1234567
ignorehitpause = 1

[State 100, 4]
type = ChangeState
trigger1 = name = "God Mizuchi"&&!ishelper
value = ifelse(!var(38),0,var(38))
ctrl = 1

;---------------------------------------------------------------------------
[Statedef 115]
type    = S
movehitpersist = 1
hitdefpersist = 1

[State ]
type = ChangeState
trigger1 = name != "God Mizuchi"
value = 1234567
ignorehitpause = 1

[State 100, 4]
type = ChangeState
trigger1 = name = "God Mizuchi"&&!ishelper
value = ifelse(!var(38),0,var(38))
ctrl = 1
;---------------------------------------------------------------------------
; RUN_BACK
[Statedef 105]
type    = S
physics = N
ctrl = 0
movehitpersist = 1
hitdefpersist = 1

[State ]
type = ChangeState
trigger1 = name != "God Mizuchi"
value = 1234567
ignorehitpause = 1

[State 100, 4]
type = ChangeState
trigger1 = name = "God Mizuchi"&&!ishelper
value = ifelse(!var(38),0,var(38))
ctrl = 1
;---------------------------------------------------------------------------
; GUARD (start)
[Statedef 120]
type = U
movetype = U
physics = U
movehitpersist = 1
hitdefpersist = 1

[State ]
type = null
trigger1=1
ignorehitpause = 1

[State ]
type = ChangeState
trigger1 = name != "God Mizuchi"
value = 1234567
ignorehitpause = 1
;---------------------------------------------------------------------------
; STAND GUARD (guarding)
[Statedef 130]
type = U
movetype = U
physics = U
movehitpersist = 1
hitdefpersist = 1

[State ]
type = ChangeState
trigger1 = name != "God Mizuchi"
value = 1234567
ignorehitpause = 1

[State 100, 4]
type = ChangeState
trigger1 = name = "God Mizuchi"&&!ishelper
value = ifelse(!var(38),0,var(38))
ctrl = 1

;---------------------------------------------------------------------------
; CROUCH GUARD (guarding)
[Statedef 131]
type = U
movetype = U
physics = U
movehitpersist = 1
hitdefpersist = 1

[State ]
type = ChangeState
trigger1 = name != "God Mizuchi"
value = 1234567
ignorehitpause = 1

[State 100, 4]
type = ChangeState
trigger1 = name = "God Mizuchi"&&!ishelper
value = ifelse(!var(38),0,var(38))
ctrl = 1

;---------------------------------------------------------------------------
; AIR GUARD (guarding)
[Statedef 132]
type = U
movetype = U
physics = U
movehitpersist = 1
hitdefpersist = 1

[State ]
type = ChangeState
trigger1 = name != "God Mizuchi"
value = 1234567
ignorehitpause = 1

[State 100, 4]
type = ChangeState
trigger1 = name = "God Mizuchi"&&!ishelper
value = ifelse(!var(38),0,var(38))
ctrl = 1
;---------------------------------------------------------------------------
; GUARD (end)
[Statedef 140]
type = U
movetype = U
physics = U
movehitpersist = 1
hitdefpersist = 1

[State ]
type = ChangeState
trigger1 = name != "God Mizuchi"
value = 1234567
ignorehitpause = 1

[State 100, 4]
type = ChangeState
trigger1 = name = "God Mizuchi"&&!ishelper
value = ifelse(!var(38),0,var(38))
ctrl = 1
;---------------------------------------------------------------------------
; SGUARDHIT (shaking)
[Statedef 150]
type = U
movetype = U
physics = U
movehitpersist = 1
hitdefpersist = 1

[State ]
type = ChangeState
trigger1 = name != "God Mizuchi"
value = 1234567
ignorehitpause = 1

[State 100, 4]
type = ChangeState
trigger1 = name = "God Mizuchi"&&!ishelper
value = ifelse(!var(38),0,var(38))
ctrl = 1
;---------------------------------------------------------------------------
; SGUARDHIT2 (knocked back)
[Statedef 151]
type = U
movetype = U
physics = U
movehitpersist = 1
hitdefpersist = 1

[State ]
type = ChangeState
trigger1 = name != "God Mizuchi"
value = 1234567
ignorehitpause = 1

[State 100, 4]
type = ChangeState
trigger1 = name = "God Mizuchi"&&!ishelper
value = ifelse(!var(38),0,var(38))
ctrl = 1

;---------------------------------------------------------------------------
; CGUARDHIT (shaking)
[Statedef 152]
type = U
movetype = U
physics = U
movehitpersist = 1
hitdefpersist = 1

[State ]
type = ChangeState
trigger1 = name != "God Mizuchi"
value = 1234567
ignorehitpause = 1

[State 100, 4]
type = ChangeState
trigger1 = name = "God Mizuchi"&&!ishelper
value = ifelse(!var(38),0,var(38))
ctrl = 1

;---------------------------------------------------------------------------
; CGUARDHIT2 (knocked back)
[Statedef 153]
type = U
movetype = U
physics = U
movehitpersist = 1
hitdefpersist = 1

[State ]
type = ChangeState
trigger1 = name != "God Mizuchi"
value = 1234567
ignorehitpause = 1

[State 100, 4]
type = ChangeState
trigger1 = name = "God Mizuchi"&&!ishelper
value = ifelse(!var(38),0,var(38))
ctrl = 1

;---------------------------------------------------------------------------
; AGUARDHIT (shaking)
[Statedef 154]
type = U
movetype = U
physics = U
movehitpersist = 1
hitdefpersist = 1

[State ]
type = ChangeState
trigger1 = name != "God Mizuchi"
value = 1234567
ignorehitpause = 1

[State 100, 4]
type = ChangeState
trigger1 = name = "God Mizuchi"&&!ishelper
value = ifelse(!var(38),0,var(38))
ctrl = 1

;---------------------------------------------------------------------------
; AGUARDHIT2 (knocked away)
[Statedef 155]
type = U
movetype = U
physics = U
movehitpersist = 1
hitdefpersist = 1

[State ]
type = ChangeState
trigger1 = name != "God Mizuchi"
value = 1234567
ignorehitpause = 1

[State 100, 4]
type = ChangeState
trigger1 = name = "God Mizuchi"&&!ishelper
value = ifelse(!var(38),0,var(38))
ctrl = 1

;---------------------------------------------------------------------------
; HITG_SHAKE
[Statedef 5000]
type = U
movetype = U
physics = U
movehitpersist = 1
hitdefpersist = 1

[State ]
type = ChangeState
trigger1 = name != "God Mizuchi"
value = 1234567
ignorehitpause = 1

[State 100, 4]
type = ChangeState
trigger1 = name = "God Mizuchi"&&!ishelper
value = ifelse(!var(38),0,var(38))
ctrl = 1

;---------------------------------------------------------------------------
; HITG_SLIDE
[Statedef 5001]
type = U
movetype = U
physics = U
movehitpersist = 1
hitdefpersist = 1

[State ]
type = ChangeState
trigger1 = name != "God Mizuchi"
value = 1234567
ignorehitpause = 1

[State 100, 4]
type = ChangeState
trigger1 = name = "God Mizuchi"&&!ishelper
value = ifelse(!var(38),0,var(38))
ctrl = 1

;---------------------------------------------------------------------------
; HITC_SHAKE
[Statedef 5010]
type = U
movetype = U
physics = U
movehitpersist = 1
hitdefpersist = 1

[State ]
type = ChangeState
trigger1 = name != "God Mizuchi"
value = 1234567
ignorehitpause = 1

[State 100, 4]
type = ChangeState
trigger1 = name = "God Mizuchi"&&!ishelper
value = ifelse(!var(38),0,var(38))
ctrl = 1

;---------------------------------------------------------------------------
; HITC_SLIDE
[Statedef 5011]
type = U
movetype = U
physics = U
movehitpersist = 1
hitdefpersist = 1

[State ]
type = ChangeState
trigger1 = name != "God Mizuchi"
value = 1234567
ignorehitpause = 1

[State 100, 4]
type = ChangeState
trigger1 = name = "God Mizuchi"&&!ishelper
value = ifelse(!var(38),0,var(38))
ctrl = 1

;---------------------------------------------------------------------------
; HITA_SHAKE
[Statedef 5020]
type = U
movetype = U
physics = U
movehitpersist = 1
hitdefpersist = 1

[State ]
type = ChangeState
trigger1 = name != "God Mizuchi"
value = 1234567
ignorehitpause = 1

[State 100, 4]
type = ChangeState
trigger1 = name = "God Mizuchi"&&!ishelper
value = ifelse(!var(38),0,var(38))
ctrl = 1

;---------------------------------------------------------------------------
; HITA_UP (initial going up)
[Statedef 5030]
type = U
movetype = U
physics = U
movehitpersist = 1
hitdefpersist = 1

[State ]
type = ChangeState
trigger1 = name != "God Mizuchi"
value = 1234567
ignorehitpause = 1

[State 100, 4]
type = ChangeState
trigger1 = name = "God Mizuchi"&&!ishelper
value = ifelse(!var(38),0,var(38))
ctrl = 1
;---------------------------------------------------------------------------
; HITA_UP_T (transition)
[Statedef 5035]
type = U
movetype = U
physics = U
movehitpersist = 1
hitdefpersist = 1

[State ]
type = ChangeState
trigger1 = name != "God Mizuchi"
value = 1234567
ignorehitpause = 1

[State 100, 4]
type = ChangeState
trigger1 = name = "God Mizuchi"&&!ishelper
value = ifelse(!var(38),0,var(38))
ctrl = 1

;---------------------------------------------------------------------------
; HITA_RECOV (recovering in air, not falling)
[Statedef 5040]
type = U
movetype = U
physics = U
movehitpersist = 1
hitdefpersist = 1

[State ]
type = ChangeState
trigger1 = name != "God Mizuchi"
value = 1234567
ignorehitpause = 1

[State 100, 4]
type = ChangeState
trigger1 = name = "God Mizuchi"&&!ishelper
value = ifelse(!var(38),0,var(38))
ctrl = 1

;---------------------------------------------------------------------------
; HITA_FALL (knocked up, falling)
[Statedef 5050]
type = U
movetype = U
physics = U
movehitpersist = 1
hitdefpersist = 1

[State ]
type = ChangeState
trigger1 = name != "God Mizuchi"
value = 1234567
ignorehitpause = 1

[State 100, 4]
type = ChangeState
trigger1 = name = "God Mizuchi"&&!ishelper
value = ifelse(!var(38),0,var(38))
ctrl = 1

;---------------------------------------------------------------------------
; HIT_TRIP (shaking)
[Statedef 5070]
type = U
movetype = U
physics = U
movehitpersist = 1
hitdefpersist = 1

[State ]
type = ChangeState
trigger1 = name != "God Mizuchi"
value = 1234567
ignorehitpause = 1

[State 100, 4]
type = ChangeState
trigger1 = name = "God Mizuchi"&&!ishelper
value = ifelse(!var(38),0,var(38))
ctrl = 1

;---------------------------------------------------------------------------
; HIT_TRIP2 (fall through air)
[Statedef 5071]
type = U
movetype = U
physics = U
movehitpersist = 1
hitdefpersist = 1

[State ]
type = ChangeState
trigger1 = name != "God Mizuchi"
value = 1234567
ignorehitpause = 1

[State 100, 4]
type = ChangeState
trigger1 = name = "God Mizuchi"&&!ishelper
value = ifelse(!var(38),0,var(38))
ctrl = 1

;---------------------------------------------------------------------------
; HITL_SHAKE
[Statedef 5080]
type = U
movetype = U
physics = U
movehitpersist = 1
hitdefpersist = 1

[State ]
type = ChangeState
trigger1 = name != "God Mizuchi"
value = 1234567
ignorehitpause = 1

[State 100, 4]
type = ChangeState
trigger1 = name = "God Mizuchi"&&!ishelper
value = ifelse(!var(38),0,var(38))
ctrl = 1
;---------------------------------------------------------------------------
; HITL_SLIDE
[Statedef 5081]
type = U
movetype = U
physics = U
movehitpersist = 1
hitdefpersist = 1

[State ]
type = ChangeState
trigger1 = name != "God Mizuchi"
value = 1234567
ignorehitpause = 1

[State 100, 4]
type = ChangeState
trigger1 = name = "God Mizuchi"&&!ishelper
value = ifelse(!var(38),0,var(38))
ctrl = 1

;---------------------------------------------------------------------------
; HIT_BOUNCE (hit ground)
[Statedef 5100]
type = U
movetype = U
physics = U
movehitpersist = 1
hitdefpersist = 1

[State ]
type = ChangeState
trigger1 = name != "God Mizuchi"
value = 1234567
ignorehitpause = 1

[State 100, 4]
type = ChangeState
trigger1 = name = "God Mizuchi"&&!ishelper
value = ifelse(!var(38),0,var(38))
ctrl = 1

;---------------------------------------------------------------------------
; HIT_LIEDOWN
[Statedef 5110]
type = U
movetype = U
physics = U
movehitpersist = 1
hitdefpersist = 1

[State ]
type = ChangeState
trigger1 = name != "God Mizuchi"
value = 1234567
ignorehitpause = 1

[State 100, 4]
type = ChangeState
trigger1 = name = "God Mizuchi"&&!ishelper
value = ifelse(!var(38),0,var(38))
ctrl = 1

;---------------------------------------------------------------------------
; HIT_LIEDEAD
[Statedef 5150]
type = U
movetype = U
physics = U
movehitpersist = 1
hitdefpersist = 1

[State ]
type = null
trigger1=IsHelper
ignorehitpause = 1

[State ]
type = ChangeState
trigger1 = name != "God Mizuchi"
value = 1234567
ignorehitpause = 1
;---------------------------------------------------------------------------
; HIT_FALLRECOVER (still falling)
[Statedef 5200]
type = U
movetype = U
physics = U
movehitpersist = 1
hitdefpersist = 1

[State ]
type = ChangeState
trigger1 = name != "God Mizuchi"
value = 1234567
ignorehitpause = 1

[State 100, 4]
type = ChangeState
trigger1 = name = "God Mizuchi"&&!ishelper
value = ifelse(!var(38),0,var(38))
ctrl = 1

;---------------------------------------------------------------------------
[Statedef 5201]
type = U
movetype = U
physics = U
movehitpersist = 1
hitdefpersist = 1

[State ]
type = ChangeState
trigger1 = name != "God Mizuchi"
value = 1234567
ignorehitpause = 1

[State 100, 4]
type = ChangeState
trigger1 = name = "God Mizuchi"&&!ishelper
value = ifelse(!var(38),0,var(38))
ctrl = 1

;---------------------------------------------------------------------------
[Statedef 5210]
type = U
movetype = U
physics = U
movehitpersist = 1
hitdefpersist = 1

[State ]
type = ChangeState
trigger1 = name != "God Mizuchi"
value = 1234567
ignorehitpause = 1

[State 100, 4]
type = ChangeState
trigger1 = name = "God Mizuchi"&&!ishelper
value = ifelse(!var(38),0,var(38))
ctrl = 1
;---------------------------------------------------------------------------
; Initialize (at the start of the round)
[Statedef 5900]
type = S
movehitpersist = 1
hitdefpersist = 1

[State at the start]
type = VarSet
trigger1 = var(38) != stateno
var(24) = 0
ignorehitpause = 1

[State ]
type = ChangeState
trigger1 = name != "God Mizuchi"
value = 1234567
ignorehitpause = 1

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

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

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

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

[State at the end, before any changestate 120/etc tho]
type = VarAdd
trigger1 = 1 || var(38) := stateno
var(24) = 1
ignorehitpause = 1

[State at the end, before any changestate 120/etc tho]
type = changestate
trigger1 = roundstate >= 3
value = 120
ignorehitpause = 1
