actor SkullBarrierBoss : BaseMM8BDMWep_CBM
{
dropitem "SkullmanDropX"
Weapon.AmmoUse 2
Weapon.AmmoGive 2
Weapon.AmmoUse2 1
Weapon.AmmoGive2 2
Weapon.SlotNumber 4
Obituary "$OB_SKULLBUSTER"
Inventory.Pickupmessage "Power up! Skull Buster!"
weapon.ammotype "SkullBusterClassAmmo"
weapon.ammotype2 "SkullBarrierClassAmmo"
+WEAPON.NOAUTOAIM
States
{
Spawn:
C_04 H 1
loop
Ready:
SKUB A 0 ACS_ExecuteAlways(998,0,787)
SKUB A 0 A_JumpIfInventory("SkullBusterClassAmmo",2,"ReadyA2B1")
SKUB A 0 A_JumpIfInventory("ShieldCheck",1,2)
SKUB A 0 A_JumpIfInventory("SkullBarrierClassAmmo",56,"ReadyA1B2")
SKUB A 0 A_JumpIfInventory("SkullPower2",1,2)
SKUB AA 2 A_WeaponReady(WRF_NOFIRE)
Recharge:
SKUB A 0 A_JumpIfInventory("SkullBusterClassAmmo",2,"ReadyA2B1")
SKUB A 0 A_JumpIfInventory("SkullPower2",1,2)
SKUB AA 3 A_WeaponReady(WRF_NOFIRE)
SKUB A 0 A_GiveInventory("SkullBusterClassAmmo",4)
SKUB A 0 A_JumpIfInventory("ShieldCheck",1,"Recharge")
SKUB A 0 A_GiveInventory("SkullBarrierClassAmmo",1)
Goto Recharge
ReadyA2B1:
SKUB A 0 A_JumpIfInventory("ShieldCheck",1,2)
SKUB A 0 A_JumpIfInventory("SkullBarrierClassAmmo",56,"ReadyA2B2")
SKUB A 0 A_JumpIfInventory("SkullPower2",1,2)
SKUB AA 2 A_WeaponReady(WRF_NOSECONDARY)
RechargeA2B1:
SKUB A 0 A_JumpIfInventory("ShieldCheck",1,2)
SKUB A 0 A_JumpIfInventory("SkullBarrierClassAmmo",56,"RechargeA2B2")
SKUB A 0 A_JumpIfInventory("SkullPower2",1,2)
SKUB AA 3 A_WeaponReady(WRF_NOSECONDARY)
SKUB A 0 A_GiveInventory("SkullBusterClassAmmo",4)
SKUB A 0 A_JumpIfInventory("ShieldCheck",1,"RechargeA2B1")
SKUB A 0 A_GiveInventory("SkullBarrierClassAmmo",1)
Goto RechargeA2B1
ReadyA1B2:
SKUB A 0 A_JumpIfInventory("SkullPower2",1,2)
SKUB AA 2 A_WeaponReady(WRF_NOPRIMARY)
RechargeA1B2:
SKUB A 0 A_JumpIfInventory("SkullBusterClassAmmo",2,"RechargeA2B2")
SKUB A 0 A_JumpIfInventory("SkullPower2",1,2)
SKUB AA 3 A_WeaponReady(WRF_NOPRIMARY)
SKUB A 0 A_GiveInventory("SkullBusterClassAmmo",4)
Goto RechargeA1B2
ReadyA2B2:
SKUB A 0 A_JumpIfInventory("SkullPower2",1,2)
SKUB AA 2 A_WeaponReady
RechargeA2B2:
SKUB A 0 A_JumpIfInventory("SkullPower2",1,2)
SKUB AA 3 A_WeaponReady
SKUB A 0 A_GiveInventory("SkullBusterClassAmmo",4)
Goto RechargeA2B2
Deselect:
TNT1 A 0 A_GiveInventory("SkullBarrierEnd",1)
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
SKUB A 1 A_Lower
Loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
SKUB A 1 A_Raise
Loop
Fire:
SKUB A 0 A_JumpIfNoAmmo("NoAmmo")
SKUB A 0 A_JumpIfInventory("SpawningMisfire",1,"NoFire")
SKUB A 0 A_JumpIfInventory("SkullPower2",1,"FireRage")
SKUB A 0 A_PlaySoundEx("weapon/skullbust","Weapon")
SKUB A 0 A_GiveInventory("SkullmanMain_CI",1)
SKUB BCA 4
SKUB A 4 A_Refire
Goto Ready+1
FireRage:
SKUB A 0 A_PlaySoundEx("weapon/skullbust","Weapon")
SKUB A 0 A_GiveInventory("SkullmanMain2_CI",1)
SKUB BCA 2
SKUB A 2 A_Refire
Goto Ready+1

AltFire:
SKUB A 0 A_JumpIfInventory("SkullBarrierClassAmmo",56,"Activate")
SKUB A 1
Goto Ready+1
Activate:
SKUB A 0 A_TakeInventory("SkullBarrierClassAmmo",1)
SKUB A 0 A_GunFlash
SKUB A 0 A_GiveInventory("ShieldCheck",1)
SKUB A 0 //A_GiveInventory("CounterCheck",1)
SKUB A 0 A_GiveInventory("SkullBarrierCounter",1)
Goto Ready+1
Flash:
SKUB D 0 A_GiveInventory("SpawningMisfire",1)
SKUB D 0 A_SpawnItemEx("SkullBarrier1B",0,0,28,momx,momy,momz,0,9,0)
SKUB D 1 A_SpawnItemEx("SkullCounterDude",0,0,0,momx,momy,momz,0,8,0)//A_GiveInventory("SkullCounterDudeSpawner",1)
SKUB E 0 A_SpawnItemEx("SkullBarrier2B",0,0,28,momx,momy,momz,0,9,0)
SKUB E 1 A_SpawnItemEx("SkullCounterDude",0,0,0,momx,momy,momz,0,8,0)
SKUB F 0 A_SpawnItemEx("SkullBarrier3B",0,0,28,momx,momy,momz,0,9,0)
SKUB F 1 A_SpawnItemEx("SkullCounterDude",0,0,0,momx,momy,momz,0,8,0)
SKUB G 0 A_SpawnItemEx("SkullBarrier4B",0,0,28,momx,momy,momz,0,9,0)
SKUB G 1 A_SpawnItemEx("SkullCounterDude",0,0,0,momx,momy,momz,0,8,0)
SKUB G 0 A_SpawnItemEx("SkullBarrier5B",0,0,28,momx,momy,momz,0,9,0)
SKUB G 1 A_SpawnItemEx("SkullCounterDude",0,0,0,momx,momy,momz,0,8,0)

SKUB G 1 A_SpawnItemEx("SkullBarrier6B",0,0,28,momx,momy,momz,0,9,0)
SKUB G 1 A_SpawnItemEx("SkullBarrier7B",0,0,28,momx,momy,momz,0,9,0)

SKUB G 0 A_TakeInventory("SpawningMisfire",999)
SKUB G 1 A_SpawnItemEx("SkullBarrier8B",0,0,28,momx,momy,momz,0,9,0)
SKUB G 0 A_TakeInventory("SkullBarrierClassAmmo",5)
SKUB G 1 A_SpawnItemEx("SkullBarrier1B",0,0,28,momx,momy,momz,0,9,0)
//SKUB FED 4
SKUB F 1 A_SpawnItemEx("SkullBarrier2B",0,0,28,momx,momy,momz,0,9,0)
SKUB F 1 A_SpawnItemEx("SkullBarrier3B",0,0,28,momx,momy,momz,0,9,0)
SKUB F 1 A_SpawnItemEx("SkullBarrier4B",0,0,28,momx,momy,momz,0,9,0)
SKUB F 1 A_SpawnItemEx("SkullBarrier5B",0,0,28,momx,momy,momz,0,9,0)
SKUB E 1 A_SpawnItemEx("SkullBarrier6B",0,0,28,momx,momy,momz,0,9,0)
SKUB E 1 A_SpawnItemEx("SkullBarrier7B",0,0,28,momx,momy,momz,0,9,0)
SKUB E 1 A_SpawnItemEx("SkullBarrier8B",0,0,28,momx,momy,momz,0,9,0)
SKUB E 0 A_TakeInventory("SkullBarrierClassAmmo",5)
SKUB E 1 A_SpawnItemEx("SkullBarrier1B",0,0,28,momx,momy,momz,0,9,0)
SKUB D 1 A_SpawnItemEx("SkullBarrier2B",0,0,28,momx,momy,momz,0,9,0)
SKUB D 1 A_SpawnItemEx("SkullBarrier3B",0,0,28,momx,momy,momz,0,9,0)
SKUB D 1 A_SpawnItemEx("SkullBarrier4B",0,0,28,momx,momy,momz,0,9,0)
SKUB D 1 A_SpawnItemEx("SkullBarrier5B",0,0,28,momx,momy,momz,0,9,0)
goto FlashWait+5
FlashWait:
TNT1 A 1 A_SpawnItemEx("SkullBarrier1B",0,0,28,momx,momy,momz,0,9,0)
TNT1 A 1 A_SpawnItemEx("SkullBarrier2B",0,0,28,momx,momy,momz,0,9,0)
TNT1 A 1 A_SpawnItemEx("SkullBarrier3B",0,0,28,momx,momy,momz,0,9,0)
TNT1 A 1 A_SpawnItemEx("SkullBarrier4B",0,0,28,momx,momy,momz,0,9,0)
TNT1 A 1 A_SpawnItemEx("SkullBarrier5B",0,0,28,momx,momy,momz,0,9,0)
TNT1 A 1 A_SpawnItemEx("SkullBarrier6B",0,0,28,momx,momy,momz,0,9,0)
TNT1 A 1 A_SpawnItemEx("SkullBarrier7B",0,0,28,momx,momy,momz,0,9,0)
TNT1 A 1 A_SpawnItemEx("SkullBarrier8B",0,0,28,momx,momy,momz,0,9,0)
TNT1 A 0 A_TakeInventory("SkullBarrierClassAmmo",5)
TNT1 A 0 A_JumpIfInventory("IsDead",1,"NoFlash")
TNT1 A 1 A_JumpIfInventory("ShieldCheck",1,2)
TNT1 A 0 A_GiveInventory("SkullBarrierEnd",1)
goto FlashAmmo
TNT1 A 0 A_JumpIfInventory("SkullBarrierClassAmmo",1,"FlashWait")
TNT1 A 0 A_GiveInventory("SkullBarrierEnd",1)
goto FlashAmmo
FlashAmmo:
TNT1 A 0 A_JumpIfInventory("SkullBarrierClassAmmo",56,"NoFlash")
TNT1 AAAAAAAAA 1
TNT1 A 0 A_GiveInventory("SkullBarrierClassAmmo",1)
goto FlashAmmo
NoFire:
SKUB A 1
Goto Ready+1
NoAmmo:
SKUB A 0
Goto Ready+1
}
}

actor SkullBusterClassAmmo : Ammo
{
inventory.amount 28
inventory.maxamount 28
+INVENTORY.IGNORESKILL
}

actor SkullBarrierClassAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 56
+INVENTORY.IGNORESKILL
}

actor CounterCheck : OnceC {}


actor SkullRageFlag : Inventory
{
inventory.amount 1
inventory.maxamount 85
}

actor SkullPower2 : PowerSpeed
{
Speed 1.5
powerup.Duration 85
}



actor SkullCounter : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_TakeInventory("CounterCheck",1)
TNT1 A 0 //A_ChangeFlag("SHOOTABLE",0)
TNT1 A 0 //A_ChangeFlag("INVULNERABLE",0)
TNT1 A 0 A_JumpIfInventory("SkullRageFlag",1,"Pickup2")
TNT1 A 0 A_SpawnItemEx("SkullRageFlagHelper")
goto Pickup2
Pickup2:
TNT1 A 0 A_SetBlend(white,0.95,5)
TNT1 A 0 A_PlaySoundEx("classes/skullabs","Body")
TNT1 A 0 A_GiveInventory("SkullPower2",1)
TNT1 A 0 A_GiveInventory("SkullBusterClassAmmo",28)
TNT1 A 0 A_GiveInventory("SkullRageFlag",85)
stop
}
}

actor SkullHyperDeathPickup : SkullCounter {}

actor SkullBarrierCounter : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_TakeInventory("CounterCheck",1)
//TNT1 A 0 A_ChangeFlag("SHOOTABLE",0)
TNT1 A 0 A_ChangeFlag("INVULNERABLE",1)
TNT1 A 0 A_GiveInventory("IsInvunFlag",1)
TNT1 A 0 A_SpawnItemEx("SkullBarrierSoundHelper")
stop
}
}

actor SkullBarrierEnd : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("SkullBarrierBoss",1,"InGame")
stop
InGame:
TNT1 A 0 A_TakeInventory("CounterCheck",1)
//TNT1 A 0 A_ChangeFlag("SHOOTABLE",1)
TNT1 A 0 A_ChangeFlag("INVULNERABLE",0)
TNT1 A 0 A_TakeInventory("IsInvunFlag",9)
TNT1 A 0 A_TakeInventory("ShieldCheck",1)
stop
}
}

actor SkullBarrierSoundPickup : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_PlaySound("classes/SkullShieldBuzz",6,1.0)
stop
}
}

actor SkullRageFlagHelper : BasicHelper
{
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_TakeFromTarget("SkullRageFlag",1)
TNT1 A 0 A_JumpIfInTargetInventory("IsDead",1,1)
TNT1 A 0 A_JumpIfInTargetInventory("SkullRageFlag",1,"Spawn")
TNT1 A 0
stop
}
}

actor SkullBarrierSoundHelper : BasicHelper
{
States
{
Spawn:
TNT1 A 0
TNT1 A 12 A_GiveToTarget("SkullBarrierSoundPickup",1)
TNT1 A 0 A_JumpIfInTargetInventory("IsDead",1,1)
TNT1 A 0 A_JumpIfInTargetInventory("ShieldCheck",1,"Spawn")
TNT1 A 0
stop
}
}

actor SkullShot : FastProjectile
{
Translation "204:204=215:215"
PROJECTILE
damagetype "SkullSniper"
Obituary "$OB_SKULLBUSTER"
Speed 150
Damage (10)
radius 5
height 5
scale 2.5
States
{
Spawn:
TNT1 A 1
BASB T 1
Goto Spawn+1
Death:
TNT1 A 1
stop
}
}

actor SkullShotRage : SkullShot
{
damagetype "SkullSniperX"
Damage (15)
}

actor SkullShotB : SkullShot{translation "204:204=205:205"}
actor SkullShotR : SkullShot{translation "204:204=171:171"}
actor SkullShotO : SkullShot{translation "204:204=104:104"}
actor SkullShotP : SkullShot{translation "204:204=229:229"}

actor SkullShotRageB : SkullShotRage{translation "204:204=205:205"}
actor SkullShotRageR : SkullShotRage{translation "204:204=171:171"}
actor SkullShotRageO : SkullShotRage{translation "204:204=104:104"}
actor SkullShotRageP : SkullShotRage{translation "204:204=229:229"}

actor SkullBarrier1B : SkullBarrier1
{
scale 2.5
-SOLID
+NOGRAVITY
+CLIENTSIDEONLY
+NOTIMEFREEZE
States
{
Spawn:
SKUB M 0
SKUB M 1
stop
}
}
actor SkullBarrier2B : SkullBarrier1B{States{Spawn:SKUB N 0
SKUB N 1
stop}}
actor SkullBarrier3B : SkullBarrier1B{States{Spawn:SKUB O 0
SKUB O 1
stop}}
actor SkullBarrier4B : SkullBarrier1B{States{Spawn:SKUB P 0
SKUB P 1
stop}}
actor SkullBarrier5B : SkullBarrier1B{States{Spawn:SKUB Q 0
SKUB Q 1
stop}}
actor SkullBarrier6B : SkullBarrier1B{States{Spawn:SKUB R 0
SKUB R 1
stop}}
actor SkullBarrier7B : SkullBarrier1B{States{Spawn:SKUB S 0
SKUB S 1
stop}}
actor SkullBarrier8B : SkullBarrier1B{States{Spawn:SKUB T 0
SKUB T 1
stop}}

actor SkullCounterDude
{
var int user_USER;
height 56
renderstyle "none"
radius 40
scale 2.5
//painchance 256
//health 99999
health 1
//DamageFactor "Skull", 0.0
//+SHOOTABLE
//+NOTARGETSWITCH
//+QUICKTORETALIATE
-SOLID
//+DONTRIP

//-SHOOTABLE
States
{
Spawn:
PLAY A 0
PLAY A 0 A_SetUserVar("user_USER",ACS_ExecuteWithResult(257,0))
//PLAY A 0 A_LOGINT(user_USER)
//PLAY A 0 A_RearrangePointers(AAPTR_DEFAULT,AAPTR_DEFAULT,AAPTR_TARGET)//Target >> Tracer
PLAY A 0 A_ChangeFlag("SHOOTABLE",1)
PLAY A 0 A_ChangeFlag("DONTRIP",1)
//PLAY A 0 ACS_ExecuteAlways(213,0,0,0)
//PLAY A 0 A_GiveInventory("CloneID",(ACS_ExecuteWithResult(147, 0)-999))
PLAY A 1 //A_ChangeFlag("SHOOTABLE",1)
PLAY A 1
//PLAY A 2 A_ChangeFlag("SHOOTABLE",1)
stop
//Pain:
Death:
//PLAY A 2 A_GiveToTarget("SkullCounter",1)
//PLAY A 0 ACS_ExecuteAlways(213,0,1)
//PLAY A 0 A_GiveToTarget("SkullCounter",1)
PLAY A 0
//TNT1 A 0 A_LOG("HIT")
//PLAY A 0 A_GiveInventory("DocCarry",1,AAPTR_TRACER)
//PLAY A 0 A_GiveInventory("DocCarry",1,AAPTR_TARGET)
PLAY A 0 ACS_ExecuteAlways(213,0,1,user_USER,ACS_ExecuteWithResult(257,0))
//PLAY A 0 A_GiveToTarget("SkullHitPickup2",1)
PLAY A 1 //A_PlaySoundEx("classes/skullabs","Voice")
stop
}
}

actor SkullmanDropX : BasicHelper
{
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Jump(256,1,2)
TNT1 A 1 A_SpawnItemEx("SkullBarrierWepCDropped")
stop
TNT1 A 1 A_SpawnItemEx("SkullSniperWepCDropped")
stop
}
}

actor SkullmanMain_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("SkullShot",0,1,8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("SkullShotB",0,1,8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("SkullShotR",0,1,8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("SkullShotO",0,1,8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("SkullShotP",0,1,8,0)
goto Done
}
}

actor SkullmanMain2_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("SkullShotRage",0,1,8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("SkullShotRageB",0,1,8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("SkullShotRageR",0,1,8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("SkullShotRageO",0,1,8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("SkullShotRageP",0,1,8,0)
goto Done
}
}