actor SkullBarrierBoss : MegaBuster
{
Weapon.AmmoUse 2
Weapon.AmmoGive 2
Weapon.AmmoUse2 1
Weapon.AmmoGive2 2
Weapon.SlotNumber 4
Obituary "%o was defeated by %k's Skull Buster."
Inventory.Pickupmessage "Power up! Skull Buster!"
weapon.ammotype "SkullBusterClassAmmo"
weapon.ammotype2 "SkullBarrierAmmo"
inventory.pickupsound "weapon/weaponup"
+WEAPON.AMMO_OPTIONAL
+WEAPON.ALT_AMMO_OPTIONAL
//inventory.icon "RINGSI"
Scale 2.0
States
{
Spawn:
WEA2 H 1
loop
Ready:
SKUB A 0 ACS_ExecuteAlways(998,0,1)
SKUB A 0 A_JumpIfInventory("SkullBusterClassAmmo",2,"ReadyA2B1")
SKUB A 0 A_JumpIfInventory("ShieldCheck",1,2)
SKUB A 0 A_JumpIfInventory("SkullBarrierAmmo",28,"ReadyA1B2")
SKUB A 4 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
Recharge:
SKUB A 0 A_JumpIfInventory("SkullBusterClassAmmo",2,"ReadyA2B1")
SKUB A 5 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
SKUB A 0 A_GiveInventory("SkullBusterClassAmmo",2)
SKUB A 0 A_JumpIfInventory("ShieldCheck",1,"Recharge")
SKUB A 0 A_GiveInventory("SkullBarrierAmmo",1)
Goto Recharge
ReadyA2B1:
SKUB A 0 A_JumpIfInventory("ShieldCheck",1,2)
SKUB A 0 A_JumpIfInventory("SkullBarrierAmmo",28,"ReadyA2B2")
SKUB A 4 A_WeaponReady(WRF_NOSECONDARY|WRF_NOSWITCH)
RechargeA2B1:
SKUB A 0 A_JumpIfInventory("ShieldCheck",1,2)
SKUB A 0 A_JumpIfInventory("SkullBarrierAmmo",28,"RechargeA2B2")
SKUB A 5 A_WeaponReady(WRF_NOSECONDARY|WRF_NOSWITCH)
SKUB A 0 A_GiveInventory("SkullBusterClassAmmo",2)
SKUB A 0 A_JumpIfInventory("ShieldCheck",1,"RechargeA2B1")
SKUB A 0 A_GiveInventory("SkullBarrierAmmo",1)
Goto RechargeA2B1
ReadyA1B2:
SKUB A 4 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSWITCH)
RechargeA1B2:
SKUB A 0 A_JumpIfInventory("SkullBusterClassAmmo",2,"RechargeA2B2")
SKUB A 5 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSWITCH)
SKUB A 0 A_GiveInventory("SkullBusterClassAmmo",2)
Goto RechargeA1B2
ReadyA2B2:
SKUB A 4 A_WeaponReady(WRF_NOSWITCH)
RechargeA2B2:
SKUB A 5 A_WeaponReady(WRF_NOSWITCH)
SKUB A 0 A_GiveInventory("SkullBusterClassAmmo",2)
Goto RechargeA2B2
Deselect:
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_PlaySoundEx("weapon/mbuster","Weapon")
SKUB A 0 A_PlaySoundEx("weapon/skullbust","Weapon")
SKUB A 0 A_FireCustomMissile("SkullShot",0,1,8,0)
SKUB BCA 4 //A_WeaponReady
SKUB A 0 A_JumpIfInventory("ShieldCheck",1,"Pass")
SKUB A 0 A_GiveInventory("SkullBarrierAmmo",1)
SKUB A 4 A_Refire
Goto Ready+1
Pass:
SKUB A 4 A_Refire
Goto Ready+1
AltFire:
SKUB A 0 A_JumpIfInventory("SkullBarrierAmmo",28,"Activate")
SKUB A 1
Goto Ready+1
Activate:
SKUB A 0 A_TakeInventory("SkullBarrierAmmo",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 DEFGG 1 A_SpawnItemEx("SkullCounterDude")
SKUB G 2
SKUB G 2 A_TakeInventory("SpawningMisfire",999)
SKUB FED 4
stop
NoFire:
SKUB A 1
Goto Ready+1
NoAmmo:
SKUB A 0
//SKUB A 1 ACS_Execute(979,0)
Goto Ready+1
}
}

actor SkullCounterDude
{
height 56
renderstyle "none"
radius 40
scale 2.5
painchance 256
health 99999
//DamageFactor "Skull", 0.0
+SHOOTABLE
+NOTARGETSWITCH
-SOLID
+DONTRIP
States
{
Spawn:
PLAY A 2
stop
Pain:
PLAY A 2 A_GiveToTarget("SkullCounter",1)
stop
}
}

actor SkullCounter : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
States
{
Spawn:
TNT1 A 0
stop
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 ACS_ExecuteAlways(976,0)
TNT1 A 0 A_PlaySoundEx("classes/skullabs","Voice")
TNT1 A 0 A_GiveInventory("SkullPower1",1)
TNT1 A 0 A_GiveInventory("SkullPower2",1)
TNT1 A 0 A_GiveInventory("RageRune",1)
TNT1 A 0 A_GiveInventory("SkullBusterClassAmmo",28)
stop
}
}

actor SkullWatcher
{
Height 0
Radius 0
+NOINTERACTION
-SOLID
+NOGRAVITY
+MISSILE
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_GiveToTarget("SkullBarrier1FX",1)
TNT1 A 1 A_JumpIfInTargetInventory("CutterFlag",998,"Death")
TNT1 A 1 A_GiveToTarget("SkullBarrier2FX",1)
TNT1 A 1 A_JumpIfInTargetInventory("CutterFlag",998,"Death")
TNT1 A 1 A_GiveToTarget("SkullBarrier3FX",1)
TNT1 A 1 A_JumpIfInTargetInventory("CutterFlag",998,"Death")
TNT1 A 1 A_GiveToTarget("SkullBarrier4FX",1)
TNT1 A 1 A_JumpIfInTargetInventory("CutterFlag",998,"Death")
TNT1 A 1 A_GiveToTarget("SkullBarrier5FX",1)
TNT1 A 1 A_JumpIfInTargetInventory("CutterFlag",998,"Death")
TNT1 A 1 A_GiveToTarget("SkullBarrier6FX",1)
TNT1 A 1 A_TakeFromTarget("SkullBarrierAmmo",7)
TNT1 A 1 A_JumpIfInTargetInventory("SkullBarrierAmmo",1,"Spawn")
goto Death
Death:
TNT1 A 1 A_GiveToTarget("SkullBarrierEnd",1)
stop
}
}



actor SkullPower1 : PowerDamage
{
damagefactor "Skull", 3.0
powerup.Duration 80
}

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



actor CounterCheck : Inventory
{
inventory.amount 1
inventory.maxamount 1
States
{
Spawn:
TNT1 A 0
stop
}
}

actor SkullBarrierCounter : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
States
{
Spawn:
TNT1 A 0
stop
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_SpawnItemEx("SkullWatcher")
stop
}
}

actor SkullBarrierEnd : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
States
{
Spawn:
TNT1 A 0
stop
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("ShieldCheck",1)
TNT1 A 0 A_GiveInventory("StrengthRune",1)
stop
}
}

actor SkullShot : FastProjectile
{
PROJECTILE
+SKYEXPLODE
+DONTBLAST
damagetype "Skull"
//seesound "weapon/mbuster"
Speed 150
Damage (5) // Actually does twice as much damage due to strength rune
radius 5
height 5
scale 2.5
States
{
Spawn:
TNT1 A 1
BASB A 1
Goto Spawn+1
Death:
TNT1 A 1
stop
}
}

actor SkullBusterClassAmmo : Ammo
{
inventory.amount 28
inventory.maxamount 28
}

actor SkullBarrier1FX : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
States
{
Spawn:
TNT1 A 0
stop
Pickup:
TNT1 A 0 A_SpawnItemEx("SkullBarrier1B")
stop
}
}
actor SkullBarrier2FX : SkullBarrier1FX
{
States
{
Pickup:
TNT1 A 0 A_SpawnItemEx("SkullBarrier2B")
stop
}
}
actor SkullBarrier3FX : SkullBarrier1FX
{
States
{
Pickup:
TNT1 A 0 A_SpawnItemEx("SkullBarrier3B")
stop
}
}
actor SkullBarrier4FX : SkullBarrier1FX
{
States
{
Pickup:
TNT1 A 0 A_SpawnItemEx("SkullBarrier4B")
stop
}
}
actor SkullBarrier5FX : SkullBarrier1FX
{
States
{
Pickup:
TNT1 A 0 A_SpawnItemEx("SkullBarrier5B")
stop
}
}
actor SkullBarrier6FX : SkullBarrier1FX
{
States
{
Pickup:
TNT1 A 0 A_SpawnItemEx("SkullBarrier6B")
stop
}
}

actor SkullBarrier1B : SkullBarrier1
{
translation "192:192=4:4", "193:200=96:96"
}
actor SkullBarrier2B : SkullBarrier2
{
translation "192:192=4:4", "193:200=96:96"
}
actor SkullBarrier3B : SkullBarrier3
{
translation "192:192=4:4", "193:200=96:96"
}
actor SkullBarrier4B : SkullBarrier4
{
translation "192:192=4:4", "193:200=96:96"
}
actor SkullBarrier5B : SkullBarrier5
{
translation "192:192=4:4", "193:200=96:96"
}
actor SkullBarrier6B : SkullBarrier6
{
translation "192:192=4:4", "193:200=96:96"
}