actor ScrewCrusherBoss : BaseMM8BDMWep_CBM 
{
tag "$TAGC_KB"
dropitem "ScrewCrusherWepCDropped"
Weapon.AmmoUse 1
Weapon.AmmoGive 0
Obituary "$OB_SCREWCRUSHER"
Inventory.Pickupmessage "Power up! Screw Crusher!"
weapon.ammotype "ScrewCrushAmmo"
inventory.icon "PunkIco2"
States
{
Spawn:
C_0K B 1
loop
Ready:
PNKA A 0 ACS_ExecuteAlways(998,0,DYE_PUNK)
goto Ready1
Ready1:
PNKA A 0 A_JumpIfInventory("ScrewCrushAmmo",28,"Ready2")
PNKA A 7 A_WeaponReady(8)
PNKA A 0 A_GiveInventory("ScrewCrushAmmo",2)
loop
Ready2:
PNKA A 1 A_WeaponReady
loop
Deselect:
PNKA AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
PNKA A 1 A_Lower
Loop
Select:
PNKA AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
PNKA A 1 A_Raise
Loop
Fire:
PNKA A 0 A_JumpIfInventory("IsBot",1,"BotFire")
//PNKA A 0 A_JumpIfInventory("WepToggleFlag",1,"Fire2")
PNKA A 0 A_GiveInventory("VivifyDelay4",1)
PNKA A 0 A_Refire(1)
PNKA A 2 OffSet(-19,58)
PNKA A 2 OffSet(-43,88)
PNKA D 2 OffSet(-48,70)
PNKA D 0 A_PlaySoundEx("weapon/screwcrusher","Weapon")
PNKA D 0 A_GiveInventory("PunkMain_CI",1)
PNKA D 2 OffSet(-28,51)
PNKA D 2 OffSet(-2,27)
PNKA C 2 OffSet(-114,86)
PNKA C 2 OffSet(-59,45)
PNKA C 2 OffSet(1,3)
PNKA A 2 OffSet(90,24)
PNKA A 2 OffSet(40,29)A_GiveInventory("ScrewCrushAmmo",2)
goto Ready1
Fire2:
PNKA A 0 A_JumpIfInventory("IsBot",1,"BotFire2")
PNKA C 2 Offset(-1,32)
PNKA C 2 Offset(-70,74)
PNKA C 0 A_PlaySoundEx("weapon/screwcrusher","Weapon")
PNKA C 0 A_GiveInventory("PunkMain2_CI",1)
PNKA C 2 Offset(-121,114)
PNKA D 2 Offset(1,32)
PNKA D 2 Offset(-21,56)A_Refire
PNKA D 2 Offset(-33,84)A_Refire
PNKA A 2 Offset(-9,92)A_Refire
PNKA A 2 Offset(-6,72)A_Refire
PNKA A 2 Offset(-3,52)A_Refire
Goto Ready1

BotFire:
PNKA A 0 A_JumpIfInventory("ScrewCrushAmmo",28,"BotFire3")
PNKA A 0 A_Jump(32,1)
goto Fire+1
PNKA A 0
goto Fire2+1
BotFire2:
PNKA A 0 A_Jump(225,1)
goto Fire+1
PNKA A 0
goto Fire2+1
BotFire3:
PNKA A 0 A_JumpIfCloser(500,"SpinAttack")
PNKA A 0 A_Jump(64,"SpinAttack")
goto Fire+1

Flash:
TNT1 A 1
stop

AltFire:
PNKA A 0 A_JumpIfInventory("PunkIsABall_F",1,"StopSpin")
PNKA A 0 A_JumpIfInventory("ScrewCrushAmmo",28,"SpinAttack")
goto Ready1
SpinAttack:
PNKA B 0 A_GiveInventory("InvulnerableOn_Pickup",1)
PNKA B 0 SetPlayerProperty(0,1,0)
PNKA B 0 A_ChangeFlag("NOGRAVITY",1)
PNKA B 0 A_GiveInventory("PunkIsABall_F",1)
PNKA B 0 ThrustThingZ(0,8,0,1)
PNKA B 0 A_Refire(1)

PNKA B 2 Offset(0,52)A_GiveInventory("PunkAltTakeStop_P",1)
PNKA B 2 Offset(0,72)A_GiveInventory("PunkAltTakeStop_P",1)
PNKA B 2 Offset(0,92)A_GiveInventory("PunkAltTakeStop_P",1)

TNT1 AA 2 A_GiveInventory("PunkAltTakeStop_P",1)

TNT1 A 0 A_GiveInventory("PunkAltTakeStop_P",1)
TNT1 A 2 A_WeaponReady(6)
TNT1 A 0 A_GiveInventory("PunkAltTakeStop_P",1)
TNT1 A 2 A_WeaponReady(6)
TNT1 A 0 A_GiveInventory("PunkAltTakeStop_P",1)
TNT1 A 2 A_WeaponReady(6)
TNT1 A 0 A_GiveInventory("PunkAltTakeStop_P",1)
TNT1 A 2 A_WeaponReady(6)
TNT1 A 0 A_GiveInventory("PunkAltTakeStop_P",1)
TNT1 A 2 A_WeaponReady(6)
TNT1 A 0 A_GiveInventory("PunkAltTakeStop_P",1)
TNT1 A 2 A_WeaponReady(6)
TNT1 A 0 A_GiveInventory("PunkAltTakeStop_P",1)
TNT1 A 2 A_WeaponReady(6)
TNT1 A 0 A_GiveInventory("PunkAltTakeStop_P",1)
TNT1 A 2 A_WeaponReady(6)
TNT1 A 0 A_GiveInventory("PunkAltTakeStop_P",1)
TNT1 A 2 A_WeaponReady(6)
TNT1 A 0 A_GiveInventory("PunkAltTakeStop_P",1)
TNT1 A 2 A_WeaponReady(6)
TNT1 A 0 A_GiveInventory("PunkAltTakeStop_P",1)
TNT1 A 2 A_WeaponReady(6)
TNT1 A 0 A_GiveInventory("PunkAltTakeStop_P",1)
TNT1 A 2 A_WeaponReady(6)
TNT1 A 0 A_GiveInventory("PunkAltTakeStop_P",1)
TNT1 A 2 A_WeaponReady(6)
TNT1 A 0 A_GiveInventory("PunkAltTakeStop_P",1)
TNT1 A 2 A_WeaponReady(6)
TNT1 A 0 A_GiveInventory("PunkAltTakeStop_P",1)
TNT1 A 2 A_WeaponReady(6)
TNT1 A 0 A_GiveInventory("PunkAltTakeStop_P",1)
TNT1 A 2 A_WeaponReady(6)
TNT1 A 0 A_GiveInventory("PunkAltTakeStop_P",1)
TNT1 A 2 A_WeaponReady(6)
TNT1 A 0 A_GiveInventory("PunkAltTakeStop_P",1)
TNT1 A 2 A_WeaponReady(6)

TNT1 A 0 //A_Stop
TNT1 A 0 A_GiveInventory("StunArmor",1)
TNT1 A 0 A_TakeInventory("UnSolid",1)
TNT1 A 0 A_ChangeFlag("SOLID",0)
TNT1 A 0 A_ChangeFlag("THRUSPECIES",1)
TNT1 A 0 ACS_ExecuteAlways(CORE_ACS_191,0,APROP_JumpZ,0,1)
TNT1 A 0 //ThrustThingZ(0,100,0,1)
TNT1 A 0 //A_Stop

TNT1 A 0 A_ChangeVelocity(Cos(pitch)*100,0,-sin(pitch)*100,3)//A_Recoil(-100)
TNT1 A 0 A_PlaySoundEx("weapon/GameBoyPunkRam","Weapon")
TNT1 A 0 A_GiveInventory("InvulnerableOff_Pickup",1)
TNT1 A 0 A_ChangeFlag("NOGRAVITY",1)
TNT1 A 0 A_TakeInventory("ScrewCrushAmmo",2)
TNT1 AA 1 A_SpawnItemEx("PunkMeleeC",0,0,28,momx,momy,momz,0,8)
TNT1 A 0 A_TakeInventory("ScrewCrushAmmo",2)
TNT1 AA 1 A_SpawnItemEx("PunkMeleeC",0,0,28,momx,momy,momz,0,8)
TNT1 A 0 A_TakeInventory("ScrewCrushAmmo",2)
TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAA 1 A_SpawnItemEx("PunkMeleeC",0,0,28,momx,momy,momz,0,8)
TNT1 A 0 A_TakeInventory("StunArmor",999)
TNT1 A 0 A_TakeInventory("ScrewCrushAmmo",28,1)
StopSpin:
PNKA B 0 A_ChangeFlag("THRUSPECIES",0)
PNKA B 0 A_SpawnItemEx("ResolidifyPlayer_H")
PNKA B 0 A_TakeInventory("ScrewCrushAmmo",5)
PNKA B 0 A_TakeInventory("PunkIsABall_F",999)
PNKA B 0 A_GiveInventory("InvulnerableOff_Pickup",1)
PNKA B 0 A_GunFlash
PNKA B 0 A_Jump(256,"StopSpin2")
StopSpin2:
PNKA B 2 Offset(0,92)
PNKA B 2 Offset(0,72)
PNKA B 2 Offset(0,52)
PNKA A 2 A_WeaponReady(14)
PNKA A 0 A_ChangeFlag("NOGRAVITY",0)
PNKA A 0 SetPlayerProperty(0,0,0)
PNKA A 0 //A_GiveInventory("SelfTotallyUnfrozen",1)
PNKA A 0 ACS_ExecuteAlways(CORE_ACS_191,0,APROP_JumpZ,10,1)
Goto Ready1
}
}

actor BounceCrusherBoss : ScrewCrusherBoss 
{
tag "$TAGC_KB2"
inventory.icon "PunkIcon"
States
{
Ready:
PNKA B 0 ACS_ExecuteAlways(998,0,DYE_PUNK)
goto Ready1
Ready1:
PNKA B 0 A_JumpIfInventory("ScrewCrushAmmo",28,"Ready2")
PNKA B 7 A_WeaponReady(8)
PNKA B 0 A_GiveInventory("ScrewCrushAmmo",2)
loop
Ready2:
PNKA B 1 A_WeaponReady
loop

Deselect:
PNKA BBBBBBBBBBBBBBBBBBBBBB 0 A_Lower
PNKA B 1 A_Lower
Loop
Select:
PNKA BBBBBBBBBBBBBBBBBBBBBB 0 A_Raise
PNKA B 1 A_Raise
Loop

Fire:
PNKA C 2 Offset(-1,32)
PNKA C 2 Offset(-70,74)
PNKA C 0 A_PlaySoundEx("weapon/screwcrusher","Weapon")
PNKA C 0 A_GiveInventory("PunkMain2_CI",1)
PNKA C 2 Offset(-121,114)
PNKA D 2 Offset(1,32)
PNKA D 2 Offset(-21,56)A_Refire
PNKA D 2 Offset(-33,84)A_Refire
PNKA B 2 Offset(-9,92)A_Refire
PNKA B 2 Offset(-6,72)A_Refire
PNKA B 2 Offset(-3,52)A_Refire
Goto Ready1

StopSpin2:
PNKA B 2 Offset(0,92)
PNKA B 2 Offset(0,72)
PNKA B 2 Offset(0,52)
PNKA B 2 A_WeaponReady(14)
PNKA B 0 A_ChangeFlag("NOGRAVITY",0)
PNKA B 0 SetPlayerProperty(0,0,0)
PNKA B 0 ACS_ExecuteAlways(CORE_ACS_191,0,APROP_JumpZ,10,1)
Goto Ready1
}
}

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

actor PunkIsABall_F :OnceC {}

actor PunkAltTakeStop_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_TakeInventory("ScrewCrushAmmo",1,1)
TNT1 A 0 A_Stop
stop
}
}

actor PunkMeleeC : BasicExplosion
{
damagetype "Punk_Ram"
Obituary "$OB_PUNKRAM"
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_GiveToTarget("PunkMeleeBoostPickup",1)
TNT1 A 3 A_Explode(250,64,0,0,64)
stop
}
}

actor Punk_RamProtect : PowerProtection
{
Powerup.Duration 10
DamageFactor "Punk_Ram", 0.0775
}

actor PunkMeleeBoostPickup : CustomInventory
{
States
{
Pickup:
//TNT1 A 0 A_Recoil(-0.55)//-0.15
TNT1 A 0 A_ChangeVelocity(Cos(pitch)*0.55,0,-sin(pitch)*0.885,1)
stop
}
}

actor ScrewCrusherPunkC
{
Translation "202:202=37:37","198:198=42:42"
PROJECTILE
Obituary "$OB_SCREWCRUSHER"
damagetype "Punk_Shot"
StencilColor "D82800"
damage (160)
Radius 10
Height 12
speed 55
scale 2.5
States
{
Spawn:
PNKA TT 1 //A_SpawnItemEx("ScrewCrusherPunkC_FX1",0,0,0,0,0,0,0,1+131072)
PNKA UU 1 //A_SpawnItemEx("ScrewCrusherPunkC_FX2",0,0,0,0,0,0,0,1+131072)
loop
}
}
actor ScrewCrusherPunkCB : ScrewCrusherPunkC{translation "202:202=205:205", "198:198=74:74" StencilColor "0070E8"}
actor ScrewCrusherPunkCR : ScrewCrusherPunkC{translation "202:202=171:171", "198:198=41:41" StencilColor "E00058"}
actor ScrewCrusherPunkCO : ScrewCrusherPunkC{translation "202:202=104:104", "198:198=128:128" StencilColor "00A800"}
actor ScrewCrusherPunkCP : ScrewCrusherPunkC{translation "202:202=229:229", "198:198=232:232" StencilColor "C07000"}

actor ScrewCrusherPunkC_FX1 : BasicClientSide
{
RenderStyle "Stencil"
Alpha 1.0
States
{
Spawn:
TNT1 A 0
TNT1 A 1
PNKA TTT 1 A_FadeOut(0.15)
stop
}
}
actor ScrewCrusherPunkC_FX2 : ScrewCrusherPunkC_FX1
{
States
{
Spawn:
TNT1 A 0
TNT1 A 1
PNKA UUU 1 A_FadeOut(0.15)
stop
}
}

actor BounceCrusherSpawner : BasicHelper
{
Translation "202:202=37:37","198:198=42:42"
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_SpawnItemEx("BounceCrusher",0,0,0,0,0,0,0,1)
stop
}
}

actor BounceCrusherSpawnerB : BounceCrusherSpawner{translation "202:202=205:205", "198:198=74:74"}
actor BounceCrusherSpawnerR : BounceCrusherSpawner{translation "202:202=171:171", "198:198=41:41"}
actor BounceCrusherSpawnerO : BounceCrusherSpawner{translation "202:202=104:104", "198:198=128:128"}
actor BounceCrusherSpawnerP : BounceCrusherSpawner{translation "202:202=229:229", "198:198=232:232"}


actor BounceCrusher
{
PROJECTILE
damagetype "Punk_Rapid"
Obituary "$OB_SCREWCRUSHER"
-NOGRAVITY
+BOUNCEONWALLS
+BOUNCEONFLOORS
+BOUNCEONCEILINGS
+BOUNCEAUTOOFF
+CANBOUNCEWATER
bouncecount 5
bouncefactor 0.8
gravity 1.8
reactiontime 30
Damage (190)
Radius 12
Height 12
Speed 16
scale 2.5

States
{
Spawn:
PNKA T 0
PNKA T 0 A_Recoil(-16)
TNT1 A 1 ThrustThingZ(0,65,0,1)
PNKA TU 3 A_CountDown
Goto Spawn+3
}
}

actor PunkMain_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("ScrewCrusherPunkC",0,0,8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("ScrewCrusherPunkCB",0,0,8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("ScrewCrusherPunkCR",0,0,8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("ScrewCrusherPunkCO",0,0,8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("ScrewCrusherPunkCP",0,0,8,0)
goto Done
}
}

actor PunkMain2_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("BounceCrusherSpawner",0,0,8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("BounceCrusherSpawnerB",0,0,8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("BounceCrusherSpawnerR",0,0,8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("BounceCrusherSpawnerO",0,0,8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("BounceCrusherSpawnerP",0,0,8,0)
goto Done
}
}
