actor JunkShieldBoss : BaseMM8BDMWep_CBM
{
tag "$TAGC_7B"
dropitem "JunkShieldWepCDropped"
Weapon.AmmoUse 300//60
Weapon.AmmoGive 28
Obituary "$OB_JUNKSHIELD"
weapon.ammotype "TrunkAmmo"
States
{
Spawn:
C_07 B 1
loop
Ready:
JCLA A 0 ACS_ExecuteAlways(998,0,DYE_JUNKMAN)
JCLA A 0 A_GunFlash("Flash.Idle")
JCLA A 0 A_GiveInventory("SpawningMisfire",1)
goto Ready0
Ready0:
JCLA DCB 3 A_WeaponReady
JCLA A 0 A_TakeInventory("SpawningMisfire",1)
Goto Ready1

Ready1:
JCLA A 0 A_JumpIfInventory("TrunkAmmo",300,"Ready2")//60
JCLA A 2 A_WeaponReady(4)
JCLA A 0 A_GiveInventory("TrunkAmmo",3)
loop
Ready2:
JCLA A 0 A_JumpIfInventory("UseJunkmanShield_F",1,"JunkShield")
JCLA A 2 A_WeaponReady
JCLA A 0 A_GiveInventory("TrunkAmmo",3)
loop

Deselect:
JCLA A 0
JCLA AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
JCLA A 1 A_Lower
goto Deselect+1
Select:
JCLA AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
JCLA A 1 A_Raise
Loop

SpawnProtect:
JCLA A 1
Goto Ready0

Fire:
JCLA A 0 A_JumpIfInventory("SpawningMisfire",1,"SpawnProtect")
JCLA A 0 A_GiveInventory("VivifyDelay4",1)
JCLA A 0 A_Refire(1)
JCLA A 0 A_GunFlash("Flash.Fire",GFF_NOEXTCHANGE)
JCLA BCDEFA 2 A_TakeInventory("TrunkAmmo",50,1)//
JCLA G 0 A_SpawnItemEx("JunkmanCube",64,0,-(ceilingz-z<64)*(64-(ceilingz-z)),0,0,0,0,1)
JCLA G 0 A_JumpIfInventory("PowerSpread_ST",1,"FireSpread")
goto FireEnd
FireSpread:
JCLA G 0 A_SpawnItemEx("JunkmanCube",64,-40,-(ceilingz-z<64)*(64-(ceilingz-z)),0,0,0,45,1)
JCLA G 0 A_SpawnItemEx("JunkmanCube",64,40,-(ceilingz-z<64)*(64-(ceilingz-z)),0,0,0,-45,1)
goto FireEnd
FireEnd:
JCLA G 19 A_PlaySoundEx("weapon/thunderbolt","Weapon")
JCLA AFEDCB 3
JCLA A 1
JCLA A 0 A_TakeInventory("UseJunkmanShield_F",999)
goto Ready1

Flash.Idle:
JCLA K 1 A_JumpIfInventory("IsDead",1,"NoFlash")
loop
Flash.Fire:
JCLA LMMMMMMMMMMMMM 2 A_JumpIfInventory("IsDead",1,"NoFlash")
JCLA MMMMMML 3 A_JumpIfInventory("IsDead",1,"NoFlash")
goto Flash.Idle
Flash.Punch:
JCLA OPPPPPQQOO 2 A_JumpIfInventory("IsDead",1,"NoFlash")
goto Flash.Idle
Flash.Shield:
JCLA STUVW 2
TNT1 A 2
JCLA NML 2
goto Flash.Idle

Altfire:
JCLA H 0 A_GunFlash("Flash.Punch",GFF_NOEXTCHANGE)
JCLA H 0 A_GiveInventory("JunkmanAlt_CI",1)
JCLA H 0 A_GiveInventory("JunkmanPunchFlag")
JCLA H 0 A_PlaySoundEx("Weapon/napalm","Weapon")
JCLA H 2 A_GiveInventory("TrunkAmmo",1)
JCLA I 1 A_GiveInventory("JunkPunchShot_P",1)
JCLA I 2
JCLA I 5 A_GiveInventory("TrunkAmmo",1)
JCLA I 0 //A_TakeInventory("JunkmanPunchFlag")
JCLA IIIIIH 2 A_GiveInventory("TrunkAmmo",1)
JCLA H 0 A_TakeInventory("UseJunkmanShield_F",999)
Goto Ready1

JunkShield:
JCLA A 0 A_JumpIfInventory("TrunkAmmo",300,"ShieldUp1")//45
JCLA A 0 A_TakeInventory("UseJunkmanShield_F",999)
Goto Ready1
ShieldUp1:
JCLA H 0 A_PlaySoundEx("item/JunkArmor","SoundSlot7")
JCLA H 0 A_GunFlash("Flash.Shield")
JCLA H 0 A_TakeInventory("JunkM_ResetShield",99)
JCLA H 0 A_TakeInventory("TrunkAmmo",300,1)
JCLA H 0 A_JumpIfInventory("ShieldCheck",1,"ShieldUp2")
JCLA H 2
JCLA I 0 A_JumpIf(1,1)
JCLA IIII 2
goto ShieldUpEnd
ShieldUp2:
JCLA I 0 A_PlaySoundEx("item/JunkArmorTrash","SoundSlot7")
JCLA H 0 A_GiveInventory("JunkM_ResetShield",1)
JCLA H 2
JCLA I 0 A_JumpIf(1,1)
JCLA II 2
JCLA I 0 A_TakeInventory("JunkM_ResetShield",1)
//JCLA I 0 A_PlaySoundEx("weapon/junkshield","Weapon")
JCLA I 2 A_GiveInventory("JunkmanOther1_CI",1)
JCLA I 2 A_GiveInventory("JunkmanOther2_CI",1)
goto ShieldUpEnd
ShieldUpEnd:
JCLA I 0 A_TakeInventory("BasicArmor")
JCLA I 0 A_GiveInventory("JunkM_BasicArmor_P",1)
JCLA I 0 A_GiveInventory("SetDynamicArmorDosage_P")
JCLA I 0 A_GiveInventory("ShieldCheck",1)
JCLA I 0 A_SpawnItemEx("JunkmanShieldWatcher_H")
JCLA IIIH 2
JCLA A 0 A_TakeInventory("UseJunkmanShield_F",999)
Goto Ready1

}
}

actor TrunkAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 600
+INVENTORY.IGNORESKILL
}

actor JunkLeakStock : Inventory
{
inventory.amount 1
inventory.maxamount 30000
}

actor UseJunkmanShield_F : OnceC {}
actor JunkM_ResetShield : OnceC {}

actor JunkmanPunchFlag : Powerup
{
Powerup.Duration 10
}

actor JunkBlockWasPushed_F : Powerup
{
Powerup.Duration 11
}

actor JunkShieldUseItem : BasicClassItem
{
inventory.icon "JunIcon"
inventory.pickupmessage "I love the smell of trash in the morning."
Tag "Junk Shield Trigger"
states
{
Spawn:
WEA3 N 1
loop
Use:
TNT1 A 0 A_JumpIfInventory("UseJunkmanShield_F",1,"No")
TNT1 A 0 A_JumpIfInventory("TrunkAmmo",300,"Success")
fail
Success:
TNT1 A 0 A_GiveInventory("UseJunkmanShield_F",1)
fail
}
}

actor JunkmanSpawnStart_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_SpawnItemEx("JunkmanLeakGiver_H")
stop
}
}

actor JunkmanLeakGiver_H : BasicHelper
{
States
{
Spawn:
TNT1 A 0
TNT1 A 5
SpawnL:
TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(C_CHECK_TARGET_OOC)==0,"Death")
TNT1 A 0 A_JumpIfInTargetInventory("JunkShieldBoss",1,1)
stop
TNT1 A 1 A_GiveToTarget("JunkmanLeak_P",1)
loop
}
}

actor JunkmanLeak_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 ACS_NamedExecuteAlways("cbm_HealthDamageRage",0,13)
TNT1 A 0 A_JumpIfInventory("JunkLeakStock",100,"Pickup2") 
stop
Pickup2:
TNT1 A 0 A_TakeInventory("JunkLeakStock",100)
TNT1 A 0 A_SpawnItemEx("JunkLeakBitsX",40,0,8,random(9,11),0,random(11,14),random(0,359),1)
goto Pickup+1
}
}

actor JunkmanShieldWatcher_H : BasicHelper
{
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_GiveToTarget("JunkmanShieldLoopSnd_P",1)
Spawn2:
TNT1 A 0 A_JumpIfInTargetInventory("IsDead",1,"Death")
TNT1 A 0 A_JumpIfInTargetInventory("PowerRage_ST",1,2)
TNT1 AA 1 A_JumpIfInTargetInventory("JunkM_ResetShield",1,"Death")

TNT1 A 0 A_JumpIfInTargetInventory("IsDead",1,"Death")
TNT1 A 0 A_JumpIfInTargetInventory("PowerRage_ST",1,2)
TNT1 AA 1 A_JumpIfInTargetInventory("JunkM_ResetShield",1,"Death")

TNT1 A 0 A_JumpIfInTargetInventory("IsDead",1,"Death")
TNT1 A 0 A_JumpIfInTargetInventory("PowerRage_ST",1,2)
TNT1 AA 1 A_JumpIfInTargetInventory("JunkM_ResetShield",1,"Death")

TNT1 A 0 A_JumpIfInTargetInventory("IsDead",1,"Death")
TNT1 A 0 A_JumpIfInTargetInventory("PowerRage_ST",1,2)
TNT1 AA 1 A_JumpIfInTargetInventory("JunkM_ResetShield",1,"Death")

TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("core_targetexists")==0,"SuperDeath")

TNT1 A 0 A_GiveToTarget("JunkmanShieldSpawn_P",1)
TNT1 A 0 A_JumpIfInTargetInventory("BasicArmor",1,"Spawn2")
goto Death

Death:
TNT1 A 0 A_JumpIfInTargetInventory("IsDead",1,"SuperDeath")
TNT1 A 1 A_GiveToTarget("JunkmanShieldEndSnd_P",1)
TNT1 A 0 A_TakeFromTarget("DynamicArmorDosage_F")
TNT1 A 1 A_TakeFromTarget("ShieldCheck",1)
TNT1 A 0 A_TakeFromTarget("BasicArmor")
TNT1 A 0 A_TakeFromTarget("JunkM_ResetShield",100)
stop
SuperDeath:
TNT1 A 1 A_GiveToTarget("StopSnd_P7",1)
stop
}
}

actor JunkmanShieldLoopSnd_P  : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_PlaySound("weapon/JunkM_ShieldLoop",4,0.85,1)
stop
}
}

actor JunkmanShieldEndSnd_P  : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_PlaySound("weapon/JunkBreaker",4)
stop
}
}

actor JunkmanShieldSpawn_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_SpawnItemEx("JunkmanShieldBit_H",0,0,32,momx,momy,momz,0,9)
TNT1 A 0 A_SpawnItemEx("JunkmanShieldBoom",0,0,32,momx,momy,momz,0,9)
TNT1 A 0 A_JumpIfInventory("PowerSpread_ST",1,"PickupS")
stop
PickupS:
TNT1 AA 0 A_SpawnItemEx("JunkmanShieldBoom",0,0,32,momx,momy,momz,0,9)
stop
}
}

actor JunkPunch : GutPunch
{
Obituary "$OB_JUNKPUNCH"
damagetype "JunkM_Punch"
damage (250)
States
{
Death:
UMFX J 0 A_Explode(250,40,0)
goto XDeath
}
}

actor JunkPunchB : JunkPunch{translation "202:202=205:205"}
actor JunkPunchR : JunkPunch{translation "202:202=171:171"}
actor JunkPunchO : JunkPunch{translation "202:202=104:104"}
actor JunkPunchP : JunkPunch{translation "202:202=229:229"}

actor JunkCubeAmmoDelay : Powerup
{
Powerup.Duration 3
}
actor JunkCubeAmmoGive_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("JunkCubeAmmoDelay",1,3)
TNT1 A 0 A_JumpIfInventory("DustCrusherBoss",1,"PickupDust")
TNT1 A 0 A_JumpIfInventory("JunkShieldBoss",1,"PickupJunk")
TNT1 A 0
stop
PickupDust:
TNT1 A 0 A_GiveInventory("CrushEmAmmo",1)
goto GaveAmmo
PickupJunk:
TNT1 A 0 A_GiveInventory("TrunkAmmo",3)
goto GaveAmmo
GaveAmmo:
TNT1 A 0 A_GiveInventory("JunkCubeAmmoDelay",1)
stop
}
}

actor JunkM_CubeProtect : PowerProtection
{
Powerup.Duration 4
damagefactor "JunkM_Cube", 0.0
}

actor JunkmanCube
{
var int user_P;
//Translation "192:192=4:4", "198:198=94:94"
Obituary "$OB_JUNKCUBE"
damagetype "JunkM_Cube"
+MISSILE//PROJECTILE//-NOBLOCKMAP
+CANTSEEK
+DONTBLAST
+DONTDRAIN
+DONTREFLECT
+DONTRIP
+DONTSPLASH
+NOBLOOD
+NOEXPLODEFLOOR
+NOGRAVITY
+NOPAIN
+NOTARGETSWITCH
+RIPPER
+SHOOTABLE

+STEPMISSILE
maxstepheight 32
+BOUNCEONCEILINGS
BounceFactor 0.00
WallBounceFactor 0.95
BounceCount -1
Species "JunkCubeThing"

mass 999999
Health 2500
damagefactor "JunkShield", 0.0
damagefactor "JunkM_Shield", 0.0
damagefactor "JunkM_Shot", 0.0
damagefactor "JunkM_Shock", 0.0
damagefactor "JunkM_Punch", 0.0
damagefactor "JunkM_Cube", 0.0
damagefactor "Fire", 0.1 //MageStaff

DamageFactor "ColdM_WallFloor", 0.125
DamageFactor "ColdM_WallAir", 0.125
DamageFactor "ConcreteM_Bash", 0.04


Args 0,0,29,0,0
ReactionTime 1
Damage (20+user_P*10)
Radius 30
Height 64
Speed 0
Scale 2.5

states
{
Spawn:
JUCT A 0
JUCT A 3// A_Stop
JUCT BCDE 3 A_SetUserVar("user_P",user_P+2)
JUCT F 0 A_ChangeFlag("NOGRAVITY",0)
JUCT F 0 //A_SetArg(2,29)
JUCT FG 3 A_SetUserVar("user_P",user_P+2)
JUCT E 0 //A_ChangeFlag("FLOORHUGGER",1)
goto SpawnSit
SpawnSit:
JUCT D 0 A_JumpIf(ACS_NamedExecuteWithResult("core_targetexists")==0,"Death")
JUCT D 0 A_RadiusGive("JunkCubeAmmoGive_P",196,512+2)
JUCT DDD 1 A_JumpIfInTargetInventory("JunkmanPunchFlag",1,"LaunchCheck")
JUCT D 0 A_RadiusGive("JunkCubeAmmoGive_P",196,514)
JUCT DDD 1 A_JumpIfInTargetInventory("JunkmanPunchFlag",1,"LaunchCheck")
JUCT D 0 A_RadiusGive("JunkCubeAmmoGive_P",196,514)
JUCT DDD 1 A_JumpIfInTargetInventory("JunkmanPunchFlag",1,"LaunchCheck")
JUCT D 0 A_RadiusGive("JunkCubeAmmoGive_P",196,514)
JUCT DDD 1 A_JumpIfInTargetInventory("JunkmanPunchFlag",1,"LaunchCheck")
JUCT D 0 A_CountDownArg(2)//DamageThing(7)
loop
LaunchCheck:
JUCT D 0 A_RadiusGive("JunkCubeAmmoGive_P",196,514)
JUCT DDD 1 A_JumpIfCloser(150,"Launched")
JUCT D 0 A_RadiusGive("JunkCubeAmmoGive_P",196,514)
JUCT DDD 1 A_JumpIfCloser(150,"Launched")
JUCT D 0 A_RadiusGive("JunkCubeAmmoGive_P",196,514)
JUCT DDD 1 A_JumpIfCloser(150,"Launched")
JUCT D 0 A_RadiusGive("JunkCubeAmmoGive_P",196,514)
JUCT DDD 1 A_JumpIfCloser(150,"Launched")
JUCT D 0 A_CountDownArg(2)
goto SpawnSit
Launched:
JUCT F 0 A_SetArg(2,Args[2]+29)
JUCT F 0 A_SetArg(1,health)
JUCT D 0 A_GiveToTarget("JunkBlockWasPushed_F",1)
JUCT D 0 A_ChangeFlag("NOGRAVITY",1)
JUCT D 0 A_Stop
JUCT D 1 ACS_ExecuteAlways(259,0,2)
JUCT D 0 A_SpawnItemEx("JunkmanCubePushed",0,0,0,8,0,momz,0,1+32768)
stop

Death:
TNT1 A 0 A_PlaySoundEx("weapon/JunkBreaker","Weapon")
TNT1 AAAAAAAA 0 A_SpawnItemEx("JunkMetalBitsX",0,0,0,random(8,12),0,random(11,16),random(0,359),1)
TNT1 A 1
stop
}
}

actor JunkmanCubePushed
{
damagetype "JunkM_Cube"
Obituary "$OB_JUNKCUBE"
+MISSILE
+BOUNCEONCEILINGS
+CANTSEEK
+DONTBLAST
+DONTDRAIN
+DONTREFLECT
+DONTRIP
+DONTSPLASH
//+INVULNERABLE
+NOBLOOD
+NOEXPLODEFLOOR
+NOPAIN
//+NORADIUSDMG
+NOTARGETSWITCH
+RIPPER
+SHOOTABLE
+STEPMISSILE
MaxStepHeight 24
+THRUSPECIES
Species "JunkCubeThing"
BounceFactor 1.0

mass 9999999
Health 2500
damagefactor "JunkShield", 0.0
damagefactor "JunkM_Shield", 0.0
damagefactor "JunkM_Shot", 0.0
damagefactor "JunkM_Shock", 0.0
damagefactor "JunkM_Punch", 0.0
damagefactor "JunkM_Cube", 0.0
damagefactor "Fire", 0.1 //MageStaff

DamageFactor "ColdM_WallFloor", 0.125
DamageFactor "ColdM_WallAir", 0.125
DamageFactor "ConcreteM_Bash", 0.04


ReactionTime 62
Damage (160)
Radius 30
Height 64
Speed 8
Scale 2.5
states
{
Spawn:
JUCT E 0
JUCT E 0 ACS_NamedExecuteWithResult("cbm_Re_SetThingSpecial",0,Args[1],Args[2],0)
JUCT E 0 DamageThing((health+1)-Args[1])
JUCT E 0 A_RadiusGive("JunkCubeAmmoGive_P",150,514)
JUCT E 3 A_PlaySoundEx("weapon/ClownBall","Weapon")
JUCT F 0 A_RadiusGive("JunkCubeAmmoGive_P",150,514)
JUCT F 3 A_PlaySoundEx("weapon/ClownBall","Weapon")
JUCT G 0 A_RadiusGive("JunkCubeAmmoGive_P",150,514)
JUCT G 3 A_PlaySoundEx("weapon/ClownBall","Weapon")
JUCT D 0 A_RadiusGive("JunkCubeAmmoGive_P",150,514)
JUCT D 3 A_PlaySoundEx("weapon/ClownBall","Weapon")
JUCT E 0 A_CountDownArg(2)
SpawnL:
JUCT E 0 A_RadiusGive("JunkCubeAmmoGive_P",150,514)
JUCT E 0 A_PlaySoundEx("weapon/ClownBall","Weapon")
JUCT EEE 1 A_JumpIfInTargetInventory("JunkmanPunchFlag",1,"SpawnLCheck")
JUCT F 0 A_RadiusGive("JunkCubeAmmoGive_P",150,514)
JUCT F 0 A_PlaySoundEx("weapon/ClownBall","Weapon")
JUCT FFF 1 A_JumpIfInTargetInventory("JunkmanPunchFlag",1,"SpawnLCheck")
JUCT G 0 A_RadiusGive("JunkCubeAmmoGive_P",150,514)
JUCT G 0 A_PlaySoundEx("weapon/ClownBall","Weapon")
JUCT GGG 1 A_JumpIfInTargetInventory("JunkmanPunchFlag",1,"SpawnLCheck")
JUCT D 0 A_RadiusGive("JunkCubeAmmoGive_P",150,514)
JUCT D 0 A_PlaySoundEx("weapon/ClownBall","Weapon")
JUCT DDD 1 A_JumpIfInTargetInventory("JunkmanPunchFlag",1,"SpawnLCheck")
JUCT E 0 A_CountDownArg(2)
loop
SpawnLCheck:
JUCT E 0 A_RadiusGive("JunkCubeAmmoGive_P",150,514)
JUCT E 0 A_PlaySoundEx("weapon/ClownBall","Weapon")
JUCT EEE 1 A_JumpIfCloser(150,"Launched")
JUCT F 0 A_RadiusGive("JunkCubeAmmoGive_P",150,514)
JUCT F 0 A_PlaySoundEx("weapon/ClownBall","Weapon")
JUCT FFF 1 A_JumpIfCloser(150,"Launched")
JUCT G 0 A_RadiusGive("JunkCubeAmmoGive_P",150,514)
JUCT G 0 A_PlaySoundEx("weapon/ClownBall","Weapon")
JUCT GGG 1 A_JumpIfCloser(150,"Launched")
JUCT D 0 A_RadiusGive("JunkCubeAmmoGive_P",150,514)
JUCT D 0 A_PlaySoundEx("weapon/ClownBall","Weapon")
JUCT DDD 1 A_JumpIfCloser(150,"Launched")
JUCT E 0 A_CountDownArg(2)
goto SpawnL
Launched:
JUCT D 0 A_SetArg(1,health)
JUCT D 0 A_GiveToTarget("JunkBlockWasPushed_F",1)
JUCT D 0 A_ChangeFlag("NOGRAVITY",1)
JUCT D 0 //A_Stop
JUCT D 1 ACS_ExecuteAlways(259,0,2)
JUCT D 0 A_SpawnItemEx("JunkmanCubePushed2",0,0,0,26,0,momz,0,1+32768)
stop

Death:
TNT1 A 0 A_PlaySoundEx("weapon/JunkBreaker","Weapon")
TNT1 AAAAAAAA 0 A_SpawnItemEx("JunkMetalBitsX",0,0,0,random(8,12),0,random(11,16),random(0,359),1)
TNT1 A 1
stop
}
}

actor JunkmanCubePushed2 : JunkmanCubePushed
{
Speed 26//2
States
{
Launched:
JUCT D 0 A_SetArg(1,health)
JUCT D 0 A_GiveToTarget("JunkBlockWasPushed_F",1)
JUCT D 0 A_ChangeFlag("NOGRAVITY",1)
JUCT D 0 //A_Stop
JUCT D 1 ACS_ExecuteAlways(259,0,2)
JUCT D 0 A_SpawnItemEx("JunkmanCubePushed2",0,0,0,26+sqrt(momx*momx+momy*momy)/4,0,momz,0,1+32768)
//JUCT D 0 A_SpawnItemEx("JunkmanCubePushed2",0,0,0,sqrt(momx*momx+momy*momy),momz,0,0,1+8192)
stop
}
}

actor JunkMetalBits1 : ScrapMetalBase
{
+INVENTORY.QUIET
States
{
Spawn2:
JUCT H 500
stop
}
}

actor JunkMetalBits2 : JunkMetalBits1
{
States
{
Spawn2:
JUCT I 500
stop
}
}

actor JunkMetalBits3 : JunkMetalBits1
{
States
{
Spawn2:
JUCT J 500
stop
}
}

actor JunkMetalBits4 : JunkMetalBits1
{
States
{
Spawn2:
JUCT K 500
stop
}
}

actor JunkMetalBits5 : JunkMetalBits1
{
States
{
Spawn2:
JUCT L 500
stop
}
}

actor JunkMetalBits6 : JunkMetalBits1
{
States
{
Spawn2:
JUCT M 500
stop
}
}

actor JunkMetalBits7 : JunkMetalBits1
{
States
{
Spawn2:
JUCT N 500
stop
}
}

actor JunkMetalBits8 : JunkMetalBits1
{
States
{
Spawn2:
JUCT O 500
stop
}
}

actor JunkMetalBits9 : JunkMetalBits1
{
States
{
Spawn2:
JUCT P 500
stop
}
}

actor JunkMetalBitsX : JunkMetalBits1
{
States
{
Spawn2:
TNT1 A 0 A_Jump(256,"S_1","S_2","S_3","S_4","S_5","S_6","S_7","S_8","S_9")
TNT1 A 1
loop
S_1:
JUCT H 500
stop
S_2:
JUCT I 500
stop
S_3:
JUCT J 500
stop
S_4:
JUCT K 500
stop
S_5:
JUCT L 500
stop
S_6:
JUCT M 500
stop
S_7:
JUCT N 500
stop
S_8:
JUCT O 500
stop
S_9:
JUCT P 500
stop
}
}

actor JunkLeakBitsX : JunkMetalBitsX
{
States
{
Spawn2:
TNT1 A 0 A_Jump(256,"S_2","S_3","S_4","S_5","S_6","S_7","S_8","S_9")
TNT1 A 1
loop
}
}

actor ClassJunkMetalBit : JunkMetalBitsX
{
States
{
Spawn2:
TNT1 A 0 A_Jump(256,"S_3","S_4","S_5","S_6","S_7","S_8","S_9")
TNT1 A 1
loop
}
}


actor JunkPunchShot_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("JunkBlockWasPushed_F",1,"PunchEnd")
TNT1 A 0 A_JumpIfInventory("TrunkAmmo",40,"ThrowJunk")
stop
PunchEnd:
TNT1 A 0
stop
ThrowJunk:
TNT1 A 0 A_TakeInventory("TrunkAmmo",80,1)
TNT1 A 0 A_GiveInventory("JunkmanAlt2_CI",1)
stop
}
}

actor JunkPunchShot
{
translation "192:192=4:4", "198:198=94:94"
PROJECTILE
damagetype "JunkM_Shot"
Obituary "$OB_JUNKSHOT"
//+DONTBLAST
-NOGRAVITY
+THRUSPECIES
Species "JunkCubeThing"
Damage (150)
Radius 16
Height 16
Speed 50
scale 2.5
States
{
Spawn:
JUCT H 0
JUCT H 0 ThrustThingZ(0,8,0,1)
JUCT H 2
wait
Death:
DUSA A 0 A_Jump(256,"B","C","D","E","F","G")
B:
JUCT A 0 A_SpawnItemEx("JunkMetalBits7",0,0,0,random(2,5),0,random(2,3),random(0,359),1)
JUCT A 0 A_SpawnItemEx("JunkMetalBits8",0,0,0,random(2,5),0,random(3,2),random(0,359),1)
stop
C:
JUCT A 0 A_SpawnItemEx("JunkMetalBits8",0,0,0,random(2,5),0,random(3,2),random(0,359),1)
JUCT A 0 A_SpawnItemEx("JunkMetalBits9",0,0,0,random(2,5),0,random(2,3),random(0,359),1)
stop
D:
JUCT A 0 A_SpawnItemEx("JunkMetalBits7",0,0,0,random(2,5),0,random(2,3),random(0,359),1)
goto C+1
E:
JUCT A 0 A_SpawnItemEx("JunkMetalBits7",0,0,0,random(2,5),0,random(2,3),random(0,359),1)
JUCT A 0 A_SpawnItemEx("JunkMetalBits5",0,0,0,random(2,5),0,random(2,3),random(0,359),1)
stop
F:
JUCT A 0 A_SpawnItemEx("JunkMetalBits5",0,0,0,random(2,5),0,random(2,3),random(0,359),1)
goto B+1
G:
JUCT A 0 A_SpawnItemEx("JunkMetalBits5",0,0,0,random(2,5),0,random(2,3),random(0,359),1)
goto C+1
}
}

actor JunkPunchShotB : JunkPunchShot{translation "192:192=205:205","198:198=74:74"}
actor JunkPunchShotR : JunkPunchShot{translation "192:192=171:171","198:198=41:41"}
actor JunkPunchShotO : JunkPunchShot{translation "192:192=104:104","198:198=128:128"}
actor JunkPunchShotP : JunkPunchShot{translation "192:192=229:229","198:198=232:232"}


actor JunkmanShieldShot
{
Translation "192:192=4:4", "198:198=94:94", "202:202=210:210"
PROJECTILE
Obituary "$OB_JUNKSHIELD"
Damagetype "JunkM_Shock"
Damage (120)
Radius 32
Height 10
Speed 26
scale 2.5
States
{
Spawn:
JUCT I 4
loop
Death:
XMFX S 2
UMFX JKD 2
stop
}
}
actor JunkmanShieldShotB : JunkmanShieldShot{translation "192:192=205:205","198:198=74:74","202:202=205:205"}
actor JunkmanShieldShotR : JunkmanShieldShot{translation "192:192=171:171","198:198=41:41","202:202=171:171"}
actor JunkmanShieldShotO : JunkmanShieldShot{translation "192:192=104:104","198:198=128:128","202:202=104:104"}
actor JunkmanShieldShotP : JunkmanShieldShot{translation "192:192=229:229","198:198=232:232","202:202=229:229"}

actor JunkmanShieldShot2 : JunkmanShieldShot
{
Damage (30)
Speed 26//18
States
{
Spawn:
JUCT M 4
loop
}
}
actor JunkmanShieldShot2B : JunkmanShieldShot2{translation "192:192=205:205","198:198=74:74","202:202=205:205"}
actor JunkmanShieldShot2R : JunkmanShieldShot2{translation "192:192=171:171","198:198=41:41","202:202=171:171"}
actor JunkmanShieldShot2O : JunkmanShieldShot2{translation "192:192=104:104","198:198=128:128","202:202=104:104"}
actor JunkmanShieldShot2P : JunkmanShieldShot2{translation "192:192=229:229","198:198=232:232","202:202=229:229"}

actor JunkmanShieldBoom : BasicExplosion
{
Obituary "$OB_JUNKSHIELDB"
Damagetype "JunkM_Shield"
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_JumpIfInTargetInventory("BasicArmor",CallACS("cbm_Fetch_GetArmorInfo",1,2)*7/10,"Spawn3")
TNT1 A 0 A_JumpIfInTargetInventory("BasicArmor",CallACS("cbm_Fetch_GetArmorInfo",1,2)*7/20,"Spawn2")
goto Spawn1
Spawn3:
TNT1 A 2 A_Explode(50,160,0,0,16)
stop
Spawn2:
TNT1 A 2 A_Explode(40,160,0,0,16)
stop
Spawn1:
TNT1 A 2 A_Explode(30,160,0,0,16)
stop
}
}

actor JunkmanShieldBit_H : BasicHelper
{
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_JumpIfInTargetInventory("BasicArmor",CallACS("cbm_Fetch_GetArmorInfo",1,2)*7/10,"Spawn3")
TNT1 A 0 A_JumpIfInTargetInventory("BasicArmor",CallACS("cbm_Fetch_GetArmorInfo",1,2)*7/20,"Spawn2")
goto Spawn1
Spawn3:
TNT1 A 0 A_SpawnItemEx("JunkmanShieldBitFX",0,0,0,5,0,random(-4,4),random(0,35)*10,129)
Spawn2:
TNT1 A 0 A_SpawnItemEx("JunkmanShieldBitFX",0,0,0,5,0,random(-4,4),random(0,35)*10,129)
Spawn1:
TNT1 A 0 A_SpawnItemEx("JunkmanShieldBitFX",0,0,0,5,0,random(-4,4),random(0,35)*10,129)
stop
}
}

actor JunkmanShieldBitFX
{
PROJECTILE
+CLIENTSIDEONLY
+NOINTERACTION
-SOLID
+NOGRAVITY
RenderStyle "Translucent"
Alpha 0.5
radius 0
height 0
Speed 15
Scale 2.5
States
{
Spawn:
TNT1 A 0
TNT1 A 3
TNT1 A 0 A_Jump(256,"SpawnJ","SpawnK","SpawnL","SpawnM","SpawnN","SpawnO","SpawnP")
SpawnJ:
JUCT J 1
goto SpawnDone
SpawnK:
JUCT K 1
goto SpawnDone
SpawnL:
JUCT L 1
goto SpawnDone
SpawnM:
JUCT M 1
goto SpawnDone
SpawnN:
JUCT N 1
goto SpawnDone
SpawnO:
JUCT O 1
goto SpawnDone
SpawnP:
JUCT P 1
goto SpawnDone

SpawnDone:
"####" "#" 4
"####" "#" 7 A_ScaleVelocity(-1.0)
stop

}
}


actor JunkmanAlt_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("JunkPunch",0,0,-8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("JunkPunchB",0,0,-8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("JunkPunchR",0,0,-8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("JunkPunchO",0,0,-8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("JunkPunchP",0,0,-8,0)
goto Done
}
}

actor JunkmanAlt2_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("JunkPunchShot",0,0,-8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("JunkPunchShotB",0,0,-8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("JunkPunchShotR",0,0,-8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("JunkPunchShotO",0,0,-8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("JunkPunchShotP",0,0,-8,0)
goto Done
}
}

actor JunkmanOther1_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("JunkmanShieldShot",0,0,0,0)
TNT1 A 0 A_FireCustomMissile("JunkmanShieldShot",120,0,0,0)
TNT1 A 0 A_FireCustomMissile("JunkmanShieldShot",-120,0,0,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("JunkmanShieldShotB",0,0,0,0)
TNT1 A 0 A_FireCustomMissile("JunkmanShieldShotB",120,0,0,0)
TNT1 A 0 A_FireCustomMissile("JunkmanShieldShotB",-120,0,0,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("JunkmanShieldShotR",0,0,0,0)
TNT1 A 0 A_FireCustomMissile("JunkmanShieldShotR",120,0,0,0)
TNT1 A 0 A_FireCustomMissile("JunkmanShieldShotR",-120,0,0,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("JunkmanShieldShotO",0,0,0,0)
TNT1 A 0 A_FireCustomMissile("JunkmanShieldShotO",120,0,0,0)
TNT1 A 0 A_FireCustomMissile("JunkmanShieldShotO",-120,0,0,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("JunkmanShieldShotP",0,0,0,0)
TNT1 A 0 A_FireCustomMissile("JunkmanShieldShotP",120,0,0,0)
TNT1 A 0 A_FireCustomMissile("JunkmanShieldShotP",-120,0,0,0)
goto Done
}
}

actor JunkmanOther2_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("JunkmanShieldShot2",0,0,0,0)
TNT1 A 0 A_FireCustomMissile("JunkmanShieldShot2",120,0,0,0)
TNT1 A 0 A_FireCustomMissile("JunkmanShieldShot2",-120,0,0,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("JunkmanShieldShot2B",0,0,0,0)
TNT1 A 0 A_FireCustomMissile("JunkmanShieldShot2B",120,0,0,0)
TNT1 A 0 A_FireCustomMissile("JunkmanShieldShot2B",-120,0,0,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("JunkmanShieldShot2R",0,0,0,0)
TNT1 A 0 A_FireCustomMissile("JunkmanShieldShot2R",120,0,0,0)
TNT1 A 0 A_FireCustomMissile("JunkmanShieldShot2R",-120,0,0,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("JunkmanShieldShot2O",0,0,0,0)
TNT1 A 0 A_FireCustomMissile("JunkmanShieldShot2O",120,0,0,0)
TNT1 A 0 A_FireCustomMissile("JunkmanShieldShot2O",-120,0,0,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("JunkmanShieldShot2P",0,0,0,0)
TNT1 A 0 A_FireCustomMissile("JunkmanShieldShot2P",120,0,0,0)
TNT1 A 0 A_FireCustomMissile("JunkmanShieldShot2P",-120,0,0,0)
goto Done
}
}