
[statedef -2]

[state ]
type = varset
trigger1 = roundstate <=1 && numhelper(0)>0
trigger1 = !ishelper && name = "Crazy-Catastrophe"
v = 59
value := 0

[state ]
type = varset
trigger1 = !ishelper && name = "Crazy-Catastrophe"
trigger1 = roundstate >= 0 && numhelper(0)=0
trigger2 = palno=12
v = 59
value := 9999

[State ]
type = assertspecial
trigger1 = var(59)=9999
trigger1 = gametime%4
flag = timerfreeze

[state ]
type = varset
trigger1 = !ishelper
trigger1 = roundstate<=1
v = 2
value = gametime

[state ]
type = varset
trigger1 = !ishelper
v = 3
value = gametime

[state ]
type = varset
trigger1 = !ishelper
v = 4
value = var(3)-var(2)

[State ]
type = null;pause
trigger1 = ishelper
time = 0
movetime = 0
ignorehitpause = 1

[State ]
type = null;superpause
trigger1 = ishelper
anim = -1
time = 0
movetime = 0
darken = 0
ignorehitpause = 1

[State ]
type = pause
trigger1 = !ishelper
trigger1 = roundstate !=2
time = 2147483647
movetime = 2147483647
ignorehitpause = 1

[State ]
type = superpause
trigger1 = !ishelper
trigger1 = roundstate !=2
anim = -1
time = 2147483647
movetime = 2147483647
darken = 0
ignorehitpause = 1

[state ]
type = ctrlset
trigger1 = !ishelper
trigger1 = name = "Crazy-Catastrophe"
trigger1 = var(59)!=9999
value = 0

[state ]
type = posset
trigger1 = numhelper(0)>0
trigger1 = !ishelper
trigger1 = name = "Crazy-Catastrophe"
x = helper(0),pos X
y = helper(0),pos Y

[state ]
type = posset
trigger1 = var(59)=9999
trigger1 = !ishelper
trigger1 = name = "Crazy-Catastrophe"
trigger1 = roundstate>=3
y = 0

[state ]
type=selfstate
trigger1 = !ishelper
trigger1 = var(59)!=9999
value=5150
ignorehitpause=1

[state ]
type = changeanim
trigger1 = !ishelper
trigger1 = name = "Crazy-Catastrophe"
trigger1 = var(59)!=9999
value = 9999

[state ]
type = changeanim
trigger1 = !ishelper
trigger1 = name = "Crazy-Catastrophe"
trigger1 = var(59)=9999
trigger1 = roundstate = 0
value = 9999

[state ]
type = DisplayToClipboard
trigger1 = ishelper
text="e-life:%d, e-state:%d, e-anim:%d, e-helper:%d, helper:%d"
params=(enemynear,life),(enemynear,stateno),(enemynear,anim),(enemynear,numhelper),(numhelper)
ignorehitpause=1

[state ]
type=AppendToClipboard
trigger1 = numhelper(0)>0
trigger1 = numhelper(1)>0
trigger1 = ishelper(0)
text="\n P2Dist X %f,v7 %d,v2 %d,fv0 %f,fv1 %f"
params= (P2Dist X),(helper(0),var(7)),(helper(1),var(2)),(helper(0),fvar(0)),(helper(0),fvar(1))
ignorehitpause=1

[state ]
type = nothitby
trigger1 = !ishelper
trigger2 = ishelper(0)
value = SCA,AA,AT,AP
time = -1
ignorehitpause = 1

[state ]
type = PlayerPush
trigger1 = !ishelper && name="Crazy-Catastrophe"
trigger2 = ishelper(0)
trigger3 = ishelper(1)
trigger4 = ishelper(3)
value = 0

[State ]
type = assertspecial
trigger1 = !ishelper && name="Crazy-Catastrophe"
flag = nostandguard
flag2 = nocrouchguard
flag3 = noairguard
ignorehitpause = 1

[State ]
type = assertspecial
trigger1 = !ishelper && name="Crazy-Catastrophe"
trigger1 = var(59)!=9999
flag = invisible
flag2 = noautoturn
flag3 = nokoslow
ignorehitpause = 1

[State ]
type = assertspecial
trigger1 = ishelper(0)
flag = noautoturn
ignorehitpause = 1

[state ]
type = varset
trigger1 = numenemy = 1
trigger2 = numenemy = 2
trigger2 = enemynear(0),alive
fvar(0) = abs(pos x - enemynear,pos x)*ifelse(frontedgedist<ifelse((facing=enemynear,facing),(enemynear,frontedgedist),(enemynear,backedgedist)),-1,1)
ignorehitpause = 1

[state ]
type = varset
trigger1 = numenemy = 2
trigger1 = !enemynear(0),alive
fvar(0) = abs(pos x - enemynear(1),pos x)*ifelse(frontedgedist<ifelse((facing=enemynear(1),facing),(enemynear(1),frontedgedist),(enemynear(1),backedgedist)),-1,1)
ignorehitpause = 1

[state ]
type = varset
trigger1 = numenemy = 1
trigger2 = numenemy = 2
trigger2 = enemynear(0),alive
fvar(1) = (enemynear,pos y) - pos y
ignorehitpause = 1

[state ]
type = varset
trigger1 = numenemy = 2
trigger1 = !enemynear(0),alive
fvar(1) = (enemynear(1),pos y) - pos y
ignorehitpause = 1

[state ]
type=selfstate
trigger1 = ishelper(1)
value=9999
ignorehitpause=1

[state ]
type=selfstate
trigger1 = ishelper(2)
value=8888
ignorehitpause=1

[state ]
type=selfstate
trigger1 = ishelper(3)
value=9900
ignorehitpause=1

[state ]
type = SelfState
triggerall = ishelper
trigger1 = ishelper(2222)&&stateno!=2222
value = 2222
Persistent = 0
ignorehitpause = 1
SuperMoveTime = 9999999
PauseMoveTime = 9999999

[State ]
type = VarRandom
trigger1 = ishelper(0)
v = 4
range = 0,2

[State ]
type = VarRandom
trigger1 = ishelper(0)
v = 6
range = 20,115
