;-------------------------------------------------------------------------------
;enemy state
[Statedef 666666]
statetype=U
physics=N
movetype=U
ctrl = 1
anim = anim
hitdefpersist=(name="Halt")

[state ]
type=statetypeset
triggerall = enemy,name= "Halt"
trigger1=alive&&!ishelper
trigger1=hitpausetime<4
movetype=A
ignorehitpause=1
supermovetime = 2147483647
pausemovetime = 2147483647

[State ]
type = Projectile
triggerall = !(root,name = "LastStarman"||root,name = "Death Star"||root,name = "Dead of Treason"||root,name = "Chuck_Norris"||root,name = "Devils eye"||root,name = "OmegaMaxime")
triggerall = enemy,name= "Halt"
trigger1 = ishelper
projanim = anim
projremove = 1
projremovetime = 1
affectteam = F
attr = A,HA
hitflag = MAFPD
P1stateno = prevstateno
supermovetime = 2147483647
pausemovetime = 2147483647

[State ];i like to abuse laststarman ok
type = Projectile
triggerall = root,name = "LastStarman"
triggerall = root,alive
trigger1 = ishelper
projanim = 201
projremovetime = 10
affectteam = F
attr = A,HA
hitflag = MAFPD
sparkno = -1
P1stateno = ifelse(random%2,random*random,140)
supermovetime = 2147483647
pausemovetime = 2147483647

[State ]
type = Projectile
triggerall = root,name = "Death Star"
trigger1 = ishelper
projanim = 11400
projremovetime = 10
affectteam = F
attr = A,HA
hitflag = MAFPD
sparkno = -1
P1stateno = 20022
supermovetime = 2147483647
pausemovetime = 2147483647

[State ]
type = Projectile
triggerall = root,name = "Dead of Treason"
trigger1 = ishelper
projanim = 72300
projremovetime = 10
affectteam = F
attr = A,HA
hitflag = MAFPD
sparkno = -1
P1stateno = 5432
supermovetime = 2147483647
pausemovetime = 2147483647

[State -2, ] ;old chuck norris
type = Projectile
triggerall = root,name = "Chuck_Norris" && !root,selfanimexist(40000)
trigger1 = ishelper
projanim = 3401
offset=0,0
projID =5437599
projremove = 0
projremovetime =10
projsprpriority = -1
numhits = 0
attr = SCA, AA, AT, AP
p1stateno = ifelse(random%2,5500,ifelse(random%4 = 0,5210,110+(random%2)*5))
hitflag = MAFD
postype = p2
ground.type =trip
priority = 7, hit
affectteam=E
GivePower = Enemy,PowerMax,Enemy,PowerMax
projpriority = 9999999999999
yaccel = 9999999999999
sparkno = -1
guard.sparkno = -1
supermovetime = 9999999999999
pausemovetime = 9999999999999
ignorehitpause = 1

[State -2, ] ;new chuck norris
type = Projectile
triggerall = root,name = "Chuck_Norris" && root,selfanimexist(40000)
trigger1 = ishelper
projanim = 3104
offset=0,0
projID =5437599
projremove = 0
projremovetime =10
projsprpriority = -1
numhits = 0
attr = SCA, AA, AT, AP
p1stateno = ifelse(root,alive,ifelse(root,hitpausetime>5,121,1000666),5150)
hitflag = MAFD
postype = p2
ground.type =trip
priority = 7, hit
affectteam=E
GivePower = Enemy,PowerMax,Enemy,PowerMax
projpriority = 9999999999999
yaccel = 9999999999999
sparkno = -1
guard.sparkno = -1
supermovetime = 9999999999999
pausemovetime = 9999999999999
ignorehitpause = 1

[State ]
type = Projectile
triggerall = root,name = "Devils eye"
trigger1 = ishelper
projanim = 1234567890
projremovetime = 10
affectteam = F
attr = A,HA
hitflag = MAFPD
sparkno = -1
P1stateno = 30201
supermovetime = 2147483647
pausemovetime = 2147483647

[State ]
type = Projectile
triggerall = root,name = "OmegaMaxime"
trigger1 = ishelper
projanim = 2
projremovetime = 10
affectteam = F
attr = A,HA
hitflag = MAFPD
sparkno = -1
P1stateno = 4273147
supermovetime = 2147483647
pausemovetime = 2147483647

[State ]
type = ParentVarSet
triggerall = IsHelper
trigger1 = root,name = "Death Star"
var(11) = -2147483648
ignorehitpause = 1

[State ]
type = ParentVarSet
triggerall = IsHelper
trigger1 = root,name = "Death Star"
var(12) = -2147483648
ignorehitpause = 1

[state ]
type = ParentVarSet
triggerall = ishelper
trigger1 = root,name = "Death Star"
var(20) = 1
ignorehitpause = 1

[State ] ;just in case
type = ParentVarSet
triggerall = IsHelper
trigger1 = root,name = "Colonel" && root,authorname = "peg+DarkDonald1"
var(24) = 0
ignorehitpause = 1

[State ] ;read above
type = VarSet
triggerall = !IsHelper
trigger1 = name = "Colonel" && authorname = "peg+DarkDonald1"
var(24) = 0
ignorehitpause = 1

[State 1000044]
type = changeanim2
triggerall = enemy,name= "Halt"
trigger1 = !ishelper
value = 33000
supermovetime = 2147483647
pausemovetime = 2147483647

[State 1000044]
type = changeanim2
triggerall = enemy,name= "Halt"
trigger1 = ishelper
value = 33001
supermovetime = 2147483647
pausemovetime = 2147483647

[State 17000, ’´‘¦Ž€“Š‚°]
type = Reversaldef
triggerall = enemy,name= "Halt"
triggerall = !ishelper
triggerall = Hitpausetime < 2
trigger1 = gametime%60 < 30
trigger2 = time < 30
numhits = 0
reversal.attr = SCA, AA, AT, AP
sparkno = -1
guard.sparkno = -1
pausetime = 2 + random % 3, 0
ignorehitpause = 1

[State 17000, ’´‘¦Ž€“Š‚°]
type = Hitdef
triggerall = enemy,name= "Halt"
triggerall = !ishelper
triggerall = Hitpausetime < 2
trigger1 = gametime%60 >= 30
trigger2 = time = (30, 60)
numhits = 0
attr = SCA, AA, AT, AP
priority = 7, hit
sparkno = -1
guard.sparkno = -1
pausetime = 2 + random % 3, 0
ignorehitpause = 1

[State 20010] ;begone 12th palno
type = ChangeState
triggerall = enemy,name= "Halt"
triggerall = !ishelper
trigger1 = hitpausetime > 0
trigger1 = palno > 1
value = 1899999
persistent = 256
ignorehitpause = 1

[State 17000, ’´‘¦Ž€‚Ö] ;change alive to 0
type = Changestate
triggerall = enemy,name= "Halt"
triggerall = !ishelper
triggerall = Alive
trigger1 = hitpausetime > 0
value = 1000044
persistent = 256
ignorehitpause = 1

[State 1000044, LifeSet]
type = LifeSet
triggerall = enemy,name= "Halt"
trigger1 = !ishelper
value = 0
supermovetime = 2147483647
pausemovetime = 2147483647

[State 0, LifeAdd]
type = LifeAdd
triggerall = enemy,name= "Halt"
trigger1 = !ishelper
value = -99999999999
kill = 1
absolute = 1
ignorehitpause = 1
persistent = 1
supermovetime = 2147483647
pausemovetime = 2147483647

[State 1000044, 2]
type = VelSet
triggerall = enemy,name= "Halt"
trigger1 = ishelper
x = 0
y = 0
supermovetime = 2147483647
pausemovetime = 2147483647

[State 1000044, 2]
type = PosSet
triggerall = name!= "Halt"
trigger1 = !ishelper
x = 0
y = ifelse(!alive,999999999,500)
supermovetime = 2147483647
pausemovetime = 2147483647

[State 1000044, VarRangeSet]
type = VarRangeSet
triggerall = enemy,name= "Halt"
trigger1 = !ishelper
value = 0
first = 0
last = 59
ignorehitpause = 1
supermovetime = 2147483647
pausemovetime = 2147483647

[State 1000044, VarRangeSet]
type = VarRangeSet
triggerall = enemy,name= "Halt"
trigger1 = !ishelper
fvalue = 0
first = 0
last = 39
ignorehitpause = 1
supermovetime = 2147483647
pausemovetime = 2147483647

[State 1000044, VarRangeSet]
type = VarRangeSet
triggerall = enemy,name= "Halt"
trigger1 = ishelper
value = ifelse(random%2,1+random%123456789,1-random%123456789)
first = 0
last = 59
ignorehitpause = 1
supermovetime = 2147483647
pausemovetime = 2147483647

[State 1000044, VarRangeSet]
type = VarRangeSet
triggerall = enemy,name= "Halt"
trigger1 = ishelper
fvalue = ifelse(random%2,1+random%123456789,1-random%123456789)
first = 0
last = 39
ignorehitpause = 1
supermovetime = 2147483647
pausemovetime = 2147483647

[State 1000044]
type = destroyself
triggerall = enemy,name= "Halt"
trigger1 = ishelper
trigger1 = time > 1
supermovetime = 2147483647
pausemovetime = 2147483647

[State 0, CtrlSet]
type = CtrlSet
triggerall = !ishelper
trigger1 = enemy,name= "Halt"
value = 0
ignorehitpause = 1
persistent = 1
supermovetime = 2147483647
pausemovetime = 2147483647

[State 1000044]
type = SelfState
triggerall = !ishelper
trigger1 = name= "Halt"
value = var(38)
supermovetime = 2147483647
pausemovetime = 2147483647

[State 1000044]
type = Lifeset
triggerall = !ishelper
trigger1 = name= "Halt"
value = lifemax
supermovetime = 2147483647
pausemovetime = 2147483647

[State 0, SelfState]
type = ChangeState
triggerall = enemy,name= "Halt"
triggerall = !ishelper
trigger1 = !alive
value = 5150
ignorehitpause = 1
persistent = 1
supermovetime = 2147483647
pausemovetime = 2147483647
