[State -1, AI Guard]
type = ChangeState
triggerall = !(enemynear(var(59)),hitdefattr = SCA,AT,ST,NT) && enemynear(var(59)),movetype = A
triggerall = ailevel > 1 && roundstate = 2 && numenemy && alive
triggerall = (ctrl || stateno = 70 && time > 2 || StateNo = 21 || stateno = 501 || (Anim = 5120 && AnimTime >= -1)) && (stateno != [120, 155])
trigger1 = ((cond(((enemynear(var(59)),stateno = [200,999]) && enemynear(var(59)),movetype = A), 500, cond((enemynear(var(59)),stateno=[1000,3000]), 750, 900))+(roundno*5)+(matchno*4)+32*(life<lifemax<2)+55*(life<lifemax/3)+64*(life<lifemax/4)-250*(ailevel < 5)+55*(ailevel>6)+666*(prevstateno = [5120,5299])) * (AIlevel ** 2 / 64.0))
trigger1 = enemynear(var(59)), movetype != I && enemynear(var(59)), movetype != H
trigger1 = !(p2bodydist x < 200 && statetype != A && enemynear(var(59)),movetype = A && (enemynear(var(59)), pos y < -60))
value = 120
;---------------------------------------------------------------------------
; guard
[Statedef 120]
type = U
physics = U
[State 120, 1]
type = ChangeAnim
trigger1 = Time = 0
value = (120 + (statetype = C) + (statetype = A)*2)+var(11)
[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 Hi_Lo]
type = StateTypeSet
triggerall = statetype = S
trigger1 = !AILevel
trigger1 = command = "holddown"
trigger2 = AILevel
trigger2 = P2StateType = C
trigger2 = Random < ((811) * (AIlevel ** 2 / 64.0))
statetype = C
physics = C
[State Lo_Hi]
type = StateTypeSet
triggerall = statetype = C
trigger1 = !AILevel
trigger1 = command != "holddown"
trigger2 = AILevel
trigger2 = P2StateType = A
trigger2 = Random < ((811) * (AIlevel ** 2 / 64.0))
trigger3 = AILevel
trigger3 = P2StateType != C && P2MoveType = A
trigger3 = Random < ((811) * (AIlevel ** 2 / 64.0))
statetype = S
physics = S
[State 120, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 130 + (statetype = C) + (statetype = A)*2
[State 120, Stop Guarding]
type = ChangeState
trigger1 = !AILevel
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+var(11)
[State 130, Hi to Lo Human]
type = ChangeState
trigger1 = !AILevel
trigger1 = command = "holddown"
value = 131
[State 130, Hi to Lo AI]
type = ChangeState
triggerall = AILevel
trigger1 = P2StateType = C
value = 131
[State 130, Stop Guarding]
type = ChangeState
trigger1 = !AILevel
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+var(11)
[State 131, Lo to Hi Human]
type = ChangeState
triggerall = !AILevel
trigger1 = command != "holddown"
value = 130
[State 131, Lo to Hi AI]
type = ChangeState
triggerall = AILevel
trigger1 = P2StateType = A
trigger2 = P2StateType !=C && P2MoveType = A
value = 130
[State 131, Stop Guarding]
type = ChangeState
trigger1 = !AILevel
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+var(11)
[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" || (ailevel)
trigger1 = inguarddist
value = 130
[State 132, 7]
type = ChangeState
trigger1 = sysvar(0)
value = 52
[State 132, Stop Guarding]
type = ChangeState
trigger1 = !ailevel
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)+var(11)
[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 = !AILevel
trigger1 = statetype = S && command = "holddown"
statetype = C
physics = C
[State 140, Lo to Hi]
type = StateTypeSet
trigger1 = !AILevel
trigger1 = statetype = C && command != "holddown"
statetype = S
physics = S
;---------------------------------------------------------------------------
; Stand guard hit (shaking)
[Statedef 150]
type = S
movetype= H
physics = N
velset = 0,0
[State 150, 1]
type = ChangeAnim
trigger1 = 1
value = 150+var(11)
[State 150, 2]
type = ChangeState
trigger1 = HitShakeOver
value = 151 + 2*(StateType=C)
[State Hi_Lo]
type = StateTypeSet
triggerall = statetype = S
trigger1 = !AILevel
trigger1 = command = "holddown"
trigger2 = AILevel
trigger2 = P2StateType = C
trigger2 = Random < ((811) * (AIlevel ** 2 / 64.0))
statetype = C
physics = C
[State Lo_Hi]
type = StateTypeSet
triggerall = statetype = C
trigger1 = !AILevel
trigger1 = command != "holddown"
trigger2 = AILevel
trigger2 = P2StateType = A
trigger2 = Random < ((811) * (AIlevel ** 2 / 64.0))
trigger3 = AILevel
trigger3 = P2StateType != C && P2MoveType = A
trigger3 = Random < ((811) * (AIlevel ** 2 / 64.0))
statetype = S
physics = S
[State 150, 3]
type = ForceFeedback
trigger1 = time = 0
waveform = square
time = 3
;---------------------------------------------------------------------------
; Stand guard hit (knocked back)
[Statedef 151]
type = S
movetype= H
physics = S
anim = 150+var(11)
[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 Hi_Lo]
type = StateTypeSet
triggerall = statetype = S
trigger1 = !AILevel
trigger1 = command = "holddown"
trigger2 = AILevel
trigger2 = P2StateType = C
trigger2 = Random < ((811) * (AIlevel ** 2 / 64.0))
statetype = C
physics = C
[State Lo_Hi]
type = StateTypeSet
triggerall = statetype = C
trigger1 = !AILevel
trigger1 = command != "holddown"
trigger2 = AILevel
trigger2 = P2StateType = A
trigger2 = Random < ((811) * (AIlevel ** 2 / 64.0))
trigger3 = AILevel
trigger3 = P2StateType != C && P2MoveType = A && Enemynear,time > 8 && var(4) = 1
trigger3 = Random < ((811) * (AIlevel ** 2 / 64.0))
statetype = S
physics = S
[State 151, 4]
type = ChangeState
trigger1 = HitOver
value = 130
ctrl = 1
;---------------------------------------------------------------------------
; Crouch guard hit (shaking)
[Statedef 152]
type = C
movetype= H
physics = N
velset = 0,0
[State 152, 1]
type = ChangeAnim
trigger1 = 1
value = 151+var(11)
[State 152, 3]
type = ChangeState
trigger1 = HitShakeOver
value = 151 + 2*(StateType=C)
[State Hi_Lo]
type = StateTypeSet
triggerall = statetype = S
trigger1 = !AILevel
trigger1 = command = "holddown"
trigger2 = AILevel
trigger2 = P2StateType = C
trigger2 = Random < ((811) * (AIlevel ** 2 / 64.0))
statetype = C
physics = C
[State Lo_Hi]
type = StateTypeSet
triggerall = statetype = C
trigger1 = !AILevel
trigger1 = command != "holddown"
trigger2 = AILevel
trigger2 = P2StateType = A
trigger2 = Random < ((811) * (AIlevel ** 2 / 64.0))
trigger3 = AILevel
trigger3 = P2StateType != C && P2MoveType = A
trigger3 = Random < ((811) * (AIlevel ** 2 / 64.0))
statetype = S
physics = S
[State 152, 4]
type = ForceFeedback
trigger1 = time = 0
waveform = square
time = 4
;---------------------------------------------------------------------------
; Crouch guard hit (knocked back)
[Statedef 153]
type = C
movetype= H
physics = C
anim = 151+var(11)
[State 153, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1
[State 153, 2]
type = VelSet
trigger1 = Time = GetHitVar(slidetime)
trigger2 = HitOver
x = 0
[State 151, 3]
type = CtrlSet
trigger1 = Time = GetHitVar(ctrltime)
value = 1
[State Hi_Lo]
type = StateTypeSet
triggerall = statetype = S
trigger1 = !AILevel
trigger1 = command = "holddown"
trigger2 = AILevel
trigger2 = P2StateType = C
trigger2 = Random < ((811) * (AIlevel ** 2 / 64.0))
statetype = C
physics = C
[State Lo_Hi]
type = StateTypeSet
triggerall = statetype = C
trigger1 = !AILevel
trigger1 = command != "holddown"
trigger2 = AILevel
trigger2 = P2StateType = A
trigger2 = Random < ((811) * (AIlevel ** 2 / 64.0))
trigger3 = AILevel
trigger3 = P2StateType != C && P2MoveType = A
trigger3 = Random < ((811) * (AIlevel ** 2 / 64.0))
statetype = S
physics = S
[State 153, 4]
type = ChangeState
trigger1 = HitOver
value = 131
ctrl = 1
;---------------------------------------------------------------------------
; Air guard hit (shaking)
[Statedef 154]
type = A
movetype= H
physics = N
velset = 0,0
[State 154, 1]
type = ChangeAnim
trigger1 = 1
value = 152+var(11)
[State 154, 2]
type = ChangeState
trigger1 = HitShakeOver
value = 155;AGUARDHIT2
[State 154, 3]
type = ForceFeedback
trigger1 = time = 0
waveform = square
time = 4
;---------------------------------------------------------------------------
; Air guard hit (knocked away)
[Statedef 155]
type = A
movetype= H
physics = N
anim = 152+var(11)
[State 155, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1
y = 1
[State 155, 2]
type = VelAdd
trigger1 = 1
y = Const(movement.yaccel)
[State 151, 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" || ailevel
trigger1 = inguarddist
value = 130
[State 155, 7]
type = ChangeState
trigger1 = sysvar(0)
value = 52