actor Auto_W1 : BaseMM8BDMWep_CBM
{
tag "$TAGC_0G"
dropitem "EddieSummon"
Weapon.AmmoUse 0
Weapon.AmmoGive 0
Obituary "$OB_AUTOFIREWORK"
Inventory.Pickupmessage "You got the Auto Arm... wait where did you-"
weapon.ammotype "AutoIsRightAmmo"
weapon.ammotype2 "ScrewYouBuySomeAmmo"
inventory.icon "AutoIco1"
States
{
Spawn:
C_00 G 1
loop

Deselect:
0G_H A 0
goto DeselectSwap
Select:
0G_H A 0
goto SelectSwap

Ready:
0G_H A 0 ACS_NamedExecuteWithResult("core_weaponcolor",DYE_AUTO,0,CBM_TCLR_DEFAULT)
0G_H A 0 A_GunFlash("Flash.Ammo")
Ready7:
0G_H A 1 A_WeaponReady
wait

Fire:
0G_H A 0 A_GiveInventory("VivifyDelay5",1)
0G_H A 0 A_Refire(1)
0G_H A 0 A_PlaySoundEx("weapon/AutoFirework","Weapon")
0G_H A 0 A_FireCustomMissile("AutoFireworkShot",0,0,-8,0)
0G_H B 2 Offset(4,28)
0G_H C 2 Offset(8,24)
0G_H B 2 Offset(4,28)
0G_H A 10 A_WeaponReady(14)
0G_H D 10 A_PlaySound("weapon/AutoReload1",4,1.0)
0G_H D 0 A_PlaySound("weapon/AutoReload2",1,0.75)
0G_H D 2 Offset(-6,44)
0G_H D 2 Offset(-6,44)
0G_H D 6 A_WeaponReady(14)
0G_H A 8 A_PlaySound("weapon/AutoReload3",1,0.75)
goto Ready7

Altfire:
0G_H A 0 A_GiveInventory("VivifyFlag1",1)
0G_H A 0 A_Refire(1)
0G_H A 2 Offset(-20,72)
0G_H A 2 Offset(-40,112)
0G_H A 0 A_Refire(1)
0G_H T 2 Offset(30,102)A_PlaySoundEx("weapon/RockThumbsUp","Weapon")
0G_H T 0 A_Refire(1)
0G_H T 2 Offset(15,67)
0G_H T 0 A_Refire(1)
0G_H T 2 Offset(1,31)
goto AltfireH
AltfireH:
0G_H T 1 Offset(1,31)A_RailWait
0G_H T 0 A_Refire("AltfireH")
goto AltfireEnd
AltfireEnd:
0G_H T 2 Offset(15,67)
0G_H T 2 Offset(30,102)A_TakeInventory("VivifyFlag1")
0G_H A 2 Offset(-40,112)
0G_H A 2 Offset(-20,72)
goto Ready7
/*
Altfire2:
0G_H D 2 Offset(14,47)A_GiveInventory("AutoScrewFire_P",1)
0G_H C 2 Offset(7,41)
0G_H B 2 Offset(3,36)
0G_H A 2 A_WeaponReady(14)
goto Ready7
*/
Flash.Ammo:
TNT1 A 1
TNT1 A 0 A_GiveInventory("AutoAmmoRegenDelay_P",1)
loop
}
}

actor Auto_W2 : Auto_W1
{
tag "$TAGC_0G2"
Obituary "$OB_AUTOSHOPPER"
inventory.icon "AutoIco2"
States
{
Deselect:
0G_G K 0 A_JumpIfHealthLower(1,"DeselectDeath")
0G_G K 0 A_JumpIfInventory("AutoAltHudFlag",1,"Deselect_Alt")
0G_G KLMNKLMNKLMNKLMNKLMNOO 0 A_Lower
0G_G O 1 A_Lower
goto Deselect+2
Deselect_Alt:
0G_F KLMNKLMNKLMNKLMNKLMNOO 0 A_Lower
0G_F O 1 A_Lower
Loop
Select:
0G_G K 0 A_GunFlash("Flash.Idle")
0G_G K 0 A_JumpIfInventory("AutoAltHudFlag",1,"Select_Alt")
0G_G KLMNKLMNKLMNKLMNKLMNOO 0 A_Raise
0G_G O 1 A_Raise
goto Select+2
Select_Alt:
0G_F KLMNKLMNKLMNKLMNKLMNOO 0 A_Raise
0G_F O 1 A_Raise
Loop


Ready://0G_H E
0G_G O 0 ACS_NamedExecuteWithResult("core_weaponcolor",DYE_AUTO,0,CBM_TCLR_DEFAULT)
0G_G O 0 A_GiveInventory("AutoHudCvar_P",1)
0G_G O 0 A_GunFlash("Flash.Idle")
ReadyAuto:
0G_G O 0 A_JumpIfInventory("AutoAltHudFlag",1,"Ready0a")
goto Ready0

Ready0:
0G_G O 0 A_JumpIfInventory("AutoItemTypeFlag",8,"Ready8")
0G_G O 0 A_JumpIfInventory("AutoItemTypeFlag",7,"Ready7")
0G_G O 0 A_JumpIfInventory("AutoItemTypeFlag",6,"Ready6")
0G_G O 0 A_JumpIfInventory("AutoItemTypeFlag",5,"Ready5")
0G_G O 0 A_JumpIfInventory("AutoItemTypeFlag",4,"Ready4")
0G_G O 0 A_JumpIfInventory("AutoItemTypeFlag",3,"Ready3")
0G_G O 0 A_JumpIfInventory("AutoItemTypeFlag",2,"Ready2")
0G_G O 0 A_JumpIfInventory("AutoItemTypeFlag",1,"Ready1")
Ready1:
0G_G A 0 A_JumpIfInventory("ScrewYouBuySomeAmmo",130,2)
0G_G A 1 A_WeaponReady(4)
loop
0G_G A 1 A_WeaponReady
wait
Ready2:
0G_G B 0 A_JumpIfInventory("AutoIsRightAmmo",42,2)//ScrewYouBuySomeAmmo",100
0G_G B 1 A_WeaponReady(4)
loop
0G_G B 1 A_WeaponReady
wait
Ready3:
0G_G C 0 A_JumpIfInventory("ScrewYouBuySomeAmmo",30,2)
0G_G C 1 A_WeaponReady(4)
loop
0G_G C 1 A_WeaponReady
wait
Ready4:
0G_G D 0 A_JumpIfInventory("ScrewYouBuySomeAmmo",50,2)
0G_G D 1 A_WeaponReady(4)
loop
0G_G D 1 A_WeaponReady
wait
Ready5:
0G_G E 0 A_JumpIfInventory("ScrewYouBuySomeAmmo",70,2)
0G_G E 1 A_WeaponReady(4)
loop
0G_G E 1 A_WeaponReady
wait
Ready6:
0G_G F 0 A_JumpIfInventory("ScrewYouBuySomeAmmo",60,2)
0G_G F 1 A_WeaponReady(4)
loop
0G_G F 1 A_WeaponReady
wait
Ready7:
0G_G G 0 A_JumpIfInventory("AutoIsRightAmmo",42,2)
0G_G G 1 A_WeaponReady(4)
loop
0G_G G 1 A_WeaponReady
wait
Ready8:
0G_G H 0 A_JumpIfInventory("ScrewYouBuySomeAmmo",100,2)
0G_G H 1 A_WeaponReady(4)
loop
0G_G H 1 A_WeaponReady
wait

Ready0a:
0G_F O 0 A_JumpIfInventory("AutoItemTypeFlag",8,"Ready8a")
0G_F O 0 A_JumpIfInventory("AutoItemTypeFlag",7,"Ready7a")
0G_F O 0 A_JumpIfInventory("AutoItemTypeFlag",6,"Ready6a")
0G_F O 0 A_JumpIfInventory("AutoItemTypeFlag",5,"Ready5a")
0G_F O 0 A_JumpIfInventory("AutoItemTypeFlag",4,"Ready4a")
0G_F O 0 A_JumpIfInventory("AutoItemTypeFlag",3,"Ready3a")
0G_F O 0 A_JumpIfInventory("AutoItemTypeFlag",2,"Ready2a")
0G_F O 0 A_JumpIfInventory("AutoItemTypeFlag",1,"Ready1a")
Ready1a:
0G_F A 0 A_JumpIfInventory("ScrewYouBuySomeAmmo",130,2)
0G_F A 1 A_WeaponReady(4)
loop
0G_F A 1 A_WeaponReady
wait
Ready2a:
0G_F B 0 A_JumpIfInventory("AutoIsRightAmmo",42,2)//ScrewYouBuySomeAmmo",100
0G_F B 1 A_WeaponReady(4)
loop
0G_F B 1 A_WeaponReady
wait
Ready3a:
0G_F C 0 A_JumpIfInventory("ScrewYouBuySomeAmmo",30,2)
0G_F C 1 A_WeaponReady(4)
loop
0G_F C 1 A_WeaponReady
wait
Ready4a:
0G_F D 0 A_JumpIfInventory("ScrewYouBuySomeAmmo",50,2)
0G_F D 1 A_WeaponReady(4)
loop
0G_F D 1 A_WeaponReady
wait
Ready5a:
0G_F E 0 A_JumpIfInventory("ScrewYouBuySomeAmmo",70,2)
0G_F E 1 A_WeaponReady(4)
loop
0G_F E 1 A_WeaponReady
wait
Ready6a:
0G_F F 0 A_JumpIfInventory("ScrewYouBuySomeAmmo",60,2)
0G_F F 1 A_WeaponReady(4)
loop
0G_F F 1 A_WeaponReady
wait
Ready7a:
0G_F G 0 A_JumpIfInventory("AutoIsRightAmmo",42,2)
0G_F G 1 A_WeaponReady(4)
loop
0G_F G 1 A_WeaponReady
wait
Ready8a:
0G_F H 0 A_JumpIfInventory("ScrewYouBuySomeAmmo",100,2)
0G_F H 1 A_WeaponReady(4)
loop
0G_F H 1 A_WeaponReady
wait

Flash.Idle:
TNT1 A 1 A_RailWait
TNT1 A 0 A_GiveInventory("AutoAmmoRegenDelay_P",1)
loop
Flash.Tada:
0G_G VVVWWWXXX 1 A_RailWait
goto Flash.Idle


Fire:
0G_H Q 0 A_JumpIfInventory("AutoItemTypeFlag",8,"FireCheck8")
0G_H Q 0 A_JumpIfInventory("AutoItemTypeFlag",7,"FireCheck7")
0G_H Q 0 A_JumpIfInventory("AutoItemTypeFlag",6,"FireCheck6")
0G_H Q 0 A_JumpIfInventory("AutoItemTypeFlag",5,"FireCheck5")
0G_H Q 0 A_JumpIfInventory("AutoItemTypeFlag",4,"FireCheck4")
0G_H Q 0 A_JumpIfInventory("AutoItemTypeFlag",3,"FireCheck3")
0G_H Q 0 A_JumpIfInventory("AutoItemTypeFlag",2,"FireCheck2")
0G_H Q 0 A_JumpIfInventory("AutoItemTypeFlag",1,"FireCheck1")
0G_H Q 0
goto Ready0
FireCheck1:
0G_H Q 0 A_JumpIfInventory("ScrewYouBuySomeAmmo",130,"FireL")
goto Ready0
FireCheck2:
0G_H Q 0 A_JumpIfInventory("AutoIsRightAmmo",42,"FireL")//ScrewYouBuySomeAmmo",100
goto Ready0
FireCheck3:
0G_H Q 0 A_JumpIfInventory("ScrewYouBuySomeAmmo",30,"FireL")
goto Ready0
FireCheck4:
0G_H Q 0 A_JumpIfInventory("ScrewYouBuySomeAmmo",50,"FireL")
goto Ready0
FireCheck5:
0G_H Q 0 A_JumpIfInventory("ScrewYouBuySomeAmmo",70,"FireL")
goto Ready0
FireCheck6:
0G_H Q 0 A_JumpIfInventory("ScrewYouBuySomeAmmo",60,"FireL")
goto Ready0
FireCheck7:
0G_H Q 0 A_JumpIfInventory("AutoIsRightAmmo",42,"FireL")
goto Ready0
FireCheck8:
0G_H Q 0 A_JumpIfInventory("ScrewYouBuySomeAmmo",100,"FireL")
goto Ready0

FireL:
0G_H Q 0 A_TakeInventory("AutoCreateSndDelay",99)
0G_H Q 0 A_Refire(1)
FireL0:
0G_H O 1 A_GiveInventory("AutoCreateSnd_P",1)
0G_H Q 0 A_Refire(1)
goto FireEnd
0G_G O 0 A_Jump(256,"FireL1","FireL2","FireL3","FireL4")
FireL1:
0G_H P 1 A_GiveInventory("AutoCreateSnd_P",1)
0G_H P 0 A_Refire("FireL0")
goto FireEnd
FireL2:
0G_H Q 1 A_GiveInventory("AutoCreateSnd_P",1)
0G_H Q 0 A_Refire("FireL0")
goto FireEnd
FireL3:
0G_H R 1 A_GiveInventory("AutoCreateSnd_P",1)
0G_H R 0 A_Refire("FireL0")
goto FireEnd
FireL4:
0G_H S 1 A_GiveInventory("AutoCreateSnd_P",1)
0G_H S 0 A_Refire("FireL0")
goto FireEnd

FireEnd:
0G_H E 0 A_JumpIfInventory("AutoCreationFlag",56,"FireCreate")
0G_H E 0 A_StopSound(1)
0G_H E 0 A_JumpIfInventory("AutoAltHudFlag",1,"FireEnda")
0G_G O 2
0G_G P 2 A_TakeInventory("AutoCreationFlag",99)
goto Ready0
FireEnda:
0G_F O 2
0G_F P 2 A_TakeInventory("AutoCreationFlag",99)
goto Ready0a

FireCreate:
0G_I O 0 A_GunFlash("Flash.Tada")
0G_I O 0 A_StopSound(1)
0G_I O 0 A_PlaySoundEx("weapon/AutoTada","SoundSlot7")
0G_I O 0 A_JumpIfInventory("AutoItemTypeFlag",8,"FireCreate8")
0G_I O 0 A_JumpIfInventory("AutoItemTypeFlag",7,"FireCreate7")
0G_I O 0 A_JumpIfInventory("AutoItemTypeFlag",6,"FireCreate6")
0G_I O 0 A_JumpIfInventory("AutoItemTypeFlag",5,"FireCreate5")
0G_I O 0 A_JumpIfInventory("AutoItemTypeFlag",4,"FireCreate4")
0G_I O 0 A_JumpIfInventory("AutoItemTypeFlag",3,"FireCreate3")
0G_I O 0 A_JumpIfInventory("AutoItemTypeFlag",2,"FireCreate2")
0G_I O 0 A_JumpIfInventory("AutoItemTypeFlag",1,"FireCreate1")
0G_I O 0
goto FireCreateEnd
FireCreate1:
0G_I A 0
goto FireCreateEnd
FireCreate2:
0G_I B 0
goto FireCreateEnd
FireCreate3:
0G_I C 0
goto FireCreateEnd
FireCreate4:
0G_I D 0
goto FireCreateEnd
FireCreate5:
0G_I E 0
goto FireCreateEnd
FireCreate6:
0G_I F 0
goto FireCreateEnd
FireCreate7:
0G_I G 0
goto FireCreateEnd
FireCreate8:
0G_I H 0
goto FireCreateEnd

FireCreateEnd:
0G_I "#" 0 A_GiveInventory("VivifyDelay6",1)
0G_I "#" 2 A_GiveInventory("AutoCreatesItem_P",1)
0G_I "#" 2 A_TakeInventory("AutoCreationFlag")
0G_I "#" 16
goto ReadyAuto

Altfire:
"####" "#" 0 A_PlaySoundEx("weapon/AutoSwap","Weapon")
"####" "#" 0 //A_GiveInventory("AutoAmmoRegenDelay",3)
"####" "#" 0 A_GiveInventory("AutoItemTypeFlag_P",1)
"####" "#" 0 A_Jump(256,"AltK_1","AltL_1","AltM_1","AltN_1")
AltK_1:
"####" K 1
"####" K 0 A_Jump(256,"AltL_2","AltM_2","AltN_2")
goto AltK_2
AltL_1:
"####" L 1
"####" L 0 A_Jump(256,"AltK_2","AltM_2","AltN_2")
goto AltL_2
AltM_1:
"####" M 1
"####" M 0 A_Jump(256,"AltK_2","AltL_2","AltN_2")
goto AltM_2
AltN_1:
"####" N 1
"####" N 0 A_Jump(256,"AltK_2","AltL_2","AltM_2")
goto AltN_2

AltK_2:
"####" K 1
"####" K 0 A_Jump(256,"AltL_3","AltM_3","AltN_3")
goto AltK_3
AltL_2:
"####" L 1
"####" L 0 A_Jump(256,"AltK_3","AltM_3","AltN_3")
goto AltL_3
AltM_2:
"####" M 1
"####" M 0 A_Jump(256,"AltK_3","AltL_3","AltN_3")
goto AltM_3
AltN_2:
"####" N 1
"####" N 0 A_Jump(256,"AltK_3","AltL_3","AltM_3")
goto AltN_3

AltK_3:
"####" K 1
"####" K 0 A_Jump(256,"AltL_4","AltM_4","AltN_4")
goto AltK_4
AltL_3:
"####" L 1
"####" L 0 A_Jump(256,"AltK_4","AltM_4","AltN_4")
goto AltL_4
AltM_3:
"####" M 1
"####" M 0 A_Jump(256,"AltK_4","AltL_4","AltN_4")
goto AltM_4
AltN_3:
"####" N 1
"####" N 0 A_Jump(256,"AltK_4","AltL_4","AltM_4")
goto AltN_4

AltK_4:
"####" K 1
"####" K 0 A_Jump(256,"AltL_5","AltM_5","AltN_5")
goto AltK_5
AltL_4:
"####" L 1
"####" L 0 A_Jump(256,"AltK_5","AltM_5","AltN_5")
goto AltL_5
AltM_4:
"####" M 1
"####" M 0 A_Jump(256,"AltK_5","AltL_5","AltN_5")
goto AltM_5
AltN_4:
"####" N 1
"####" N 0 A_Jump(256,"AltK_5","AltL_5","AltM_5")
goto AltN_5

AltK_5:
"####" K 1
"####" K 0 A_Jump(256,"AltL_6","AltM_6","AltN_6")
goto AltK_6
AltL_5:
"####" L 1
"####" L 0 A_Jump(256,"AltK_6","AltM_6","AltN_6")
goto AltL_6
AltM_5:
"####" M 1
"####" M 0 A_Jump(256,"AltK_6","AltL_6","AltN_6")
goto AltM_6
AltN_5:
"####" N 1
"####" N 0 A_Jump(256,"AltK_6","AltL_6","AltM_6")
goto AltN_6

AltK_6:
"####" K 1
goto ReadyAuto
AltL_6:
"####" L 1
goto ReadyAuto
AltM_6:
"####" M 1
goto ReadyAuto
AltN_6:
"####" N 1
goto ReadyAuto


}
}

actor Auto_W3 : Auto_W1
{
weapon.preferredskin "Auto-Met"
+WEAPON.CHEATNOTWEAPON
}
actor Auto_W4 : Auto_W2
{
weapon.preferredskin "Auto-Met"
+WEAPON.CHEATNOTWEAPON
States
{
Select:
0G_H E 0 A_JumpIfInventory("AutoEquippedHisHelmet",1,"SelectSwap")
0G_H E 0 A_GiveInventory("AutoEquippedHisHelmet",1)
0G_H E 0 A_GiveInventory("AutoItemTypeFlag",1)
0G_H E 0 A_TakeInventory("Auto_W1",1)
0G_H E 0 A_TakeInventory("Auto_W2",1)
goto SelectSwap
}
}

actor AutoIsRightAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 84
+INVENTORY.IGNORESKILL
}
actor ScrewYouBuySomeAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 200
+INVENTORY.IGNORESKILL
}

actor AutoAmmoRegenDelay : Inventory
{
inventory.amount 1
inventory.maxamount 105
}
actor PowerAutoAmmoRegen : Powerup
{
Powerup.Duration 8
}

//actor AutoFlag : OnceC{}

actor AutoEyebrowFlag : Inventory
{
inventory.amount 1
inventory.maxamount 6
}

actor AutoEquippedHisHelmet : OnceC{}

actor AutoAltHudFlag : OnceC{}

actor AutoFireworkStacker : Inventory
{
inventory.amount 1
inventory.maxamount 50
}

actor AutoItemTypeFlag : Inventory
{
inventory.amount 1
inventory.maxamount 8
}

actor AutoCreationFlag : Inventory
{
inventory.amount 1
inventory.maxamount 56
}

actor AutoCreateSndDelay : Powerup
{
Powerup.Duration 74
}

actor Auto_ScrewBoltBigPickup : ScrewBoltBigPickup
{
inventory.pickupmessage "Picked up Auto's Big Screw!"
ReactionTime 45
Scale 1.5
States
{
Spawn:
X_0G S 0
X_0G S 0 A_Jump(256,"Spawn1","Spawn2")
Spawn1:
X_0G T 0 A_Jump(256,1,2,3,4,5,6,7,8)
X_0G "TUVWXYZ[" 3
X_0G T 0 A_CountDown
goto Spawn1+1
Spawn2:
X_0G "[" 0 A_Jump(256,1,2,3,4,5,6,7,8)
X_0G "[ZYXWVUT" 3
X_0G "[" 0 A_CountDown
goto Spawn2+1
}
}


actor AutoHudCvar_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIf(CallACS("cbm_AutoAltHud"),"Pickup1")
goto Pickup0
Pickup0:
TNT1 A 0 A_TakeInventory("AutoAltHudFlag",99)
stop
Pickup1:
TNT1 A 0 A_GiveInventory("AutoAltHudFlag",1)
stop
}
}

actor AutoCreateSnd_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_GiveInventory("AutoCreationFlag",1+CallACS("core_checkrune",RUNE_RAGE))
TNT1 A 0 A_JumpIfInventory("AutoCreateSndDelay",1,3)
TNT1 A 0 A_PlaySoundEx("weapon/AutoCreate","Weapon")
TNT1 A 0 A_GiveInventory("AutoCreateSndDelay",1)
TNT1 A 0
stop
}
}

actor AutoAmmoRegenDelay_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("AutoAmmoRegenDelay",100,"Give")
TNT1 A 0 A_GiveInventory("AutoAmmoRegenDelay",1+CallACS("core_checkrune",RUNE_RAGE))
stop
Give:
TNT1 A 0 A_GiveInventory("AutoIsRightAmmo",3)
TNT1 A 0 A_GiveInventory("ScrewYouBuySomeAmmo",10)
TNT1 A 0 A_GiveInventory("PowerAutoAmmoRegen",1)
TNT1 A 0 A_TakeInventory("AutoAmmoRegenDelay",105)
stop
}
}


actor AutoItemTypeFlag_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("Auto_W3",1,"Pickup2")
TNT1 A 0 A_JumpIfInventory("AutoItemTypeFlag",8-(CallACS("core_checkmode",1)==0),"Reset")
TNT1 A 0 A_GiveInventory("AutoItemTypeFlag",1)
stop
Pickup2:
TNT1 A 0 A_JumpIfInventory("AutoItemTypeFlag",2,2)
TNT1 A 0 A_GiveInventory("AutoItemTypeFlag",2)
stop
TNT1 A 0
goto Pickup+1

Reset://CountInv would be useful here
TNT1 A 0 A_JumpIf(CallACS("core_checkmode",1)==0,"ResetDM")
TNT1 A 0 A_JumpIfInventory("AutoFireworkStacker",3,2)
TNT1 A 0 A_TakeInventory("AutoItemTypeFlag",7)
stop
TNT1 A 0 A_JumpIfInventory("Auto_W3",1,2)
TNT1 A 0 A_TakeInventory("AutoItemTypeFlag",6)
stop
TNT1 A 0 A_TakeInventory("AutoItemTypeFlag",5)
stop

ResetDM:
TNT1 A 0 A_JumpIfInventory("AutoFireworkStacker",3,2)
TNT1 A 0 A_TakeInventory("AutoItemTypeFlag",6)
stop
TNT1 A 0 A_JumpIfInventory("Auto_W3",1,2)
TNT1 A 0 A_TakeInventory("AutoItemTypeFlag",5)
stop
TNT1 A 0 A_TakeInventory("AutoItemTypeFlag",4)
stop
}
}

actor AutoCreatesItem_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_TakeInventory("AutoCreationFlag",99)
TNT1 A 0 A_JumpIfInventory("AutoItemTypeFlag",8,"Item8")
TNT1 A 0 A_JumpIfInventory("AutoItemTypeFlag",7,"Item7")
TNT1 A 0 A_JumpIfInventory("AutoItemTypeFlag",6,"Item6")
TNT1 A 0 A_JumpIfInventory("AutoItemTypeFlag",5,"Item5")
TNT1 A 0 A_JumpIfInventory("AutoItemTypeFlag",4,"Item4")
TNT1 A 0 A_JumpIfInventory("AutoItemTypeFlag",3,"Item3")
TNT1 A 0 A_JumpIfInventory("AutoItemTypeFlag",2,"Item2")
TNT1 A 0 A_JumpIfInventory("AutoItemTypeFlag",1,"Item1")

Item1://Upgrade Firework
TNT1 A 0 A_TakeInventory("ScrewYouBuySomeAmmo",60)
TNT1 A 0 A_TakeInventory("ScrewYouBuySomeAmmo",70,1)
TNT1 A 0 A_GiveInventory("AutoFireworkStacker",1)
TNT1 A 0 A_JumpIfInventory("AutoFireworkStacker",3,"Item1_1")
stop
Item1_1:
TNT1 A 0 A_JumpIfInventory("AutoEquippedHisHelmet",1,"Item1_2")
TNT1 A 0 A_GiveInventory("AutoItemTypeFlag",1)
stop
Item1_2:
TNT1 A 0 A_GiveInventory("AutoItemTypeFlag",2)
stop

Item2://Def Buff
TNT1 A 0 A_TakeInventory("AutoIsRightAmmo",21)
TNT1 A 0 A_TakeInventory("AutoIsRightAmmo",21,1)//ScrewYouBuySomeAmmo",100
TNT1 A 0 ACS_NamedExecuteAlways("CBM_AdjustMaxHealth",0,1550,1)
TNT1 A 0 A_GiveInventory("Auto_W3",1)
TNT1 A 0 A_GiveInventory("Auto_W4",1)
TNT1 A 0 A_SpawnItemEx("AutoDefUpSwap_H")
stop

Item3:
TNT1 A 0 A_TakeInventory("ScrewYouBuySomeAmmo",10)
TNT1 A 0 A_TakeInventory("ScrewYouBuySomeAmmo",20,1)
TNT1 A 0 A_JumpIfInventory("Carry",20,"Item3_20")
TNT1 A 0 A_JumpIfInventory("Carry",19,"Item3_19")
TNT1 A 0 A_JumpIfInventory("Carry",18,"Item3_18")
TNT1 A 0 A_GiveInventory("Carry",3)
TNT1 AAA 0 A_DropInventory("Carry")
stop
Item3_18:
TNT1 A 0 A_GiveInventory("Carry",3)
TNT1 AAA 0 A_DropInventory("Carry")
TNT1 A 0 A_GiveInventory("Carry",1)
stop
Item3_19:
TNT1 A 0 A_GiveInventory("Carry",3)
TNT1 AAA 0 A_DropInventory("Carry")
TNT1 A 0 A_GiveInventory("Carry",2)
stop
Item3_20:
TNT1 A 0 A_GiveInventory("Carry",3)
TNT1 AAA 0 A_DropInventory("Carry")
TNT1 A 0 A_GiveInventory("Carry",3)
stop

Item4:
TNT1 A 0 A_TakeInventory("ScrewYouBuySomeAmmo",20)
TNT1 A 0 A_TakeInventory("ScrewYouBuySomeAmmo",30,1)
TNT1 A 0 A_JumpIfInventory("Item2",2,"Item4_2")
TNT1 A 0 A_JumpIfInventory("Item2",1,"Item4_1")
TNT1 A 0 A_GiveInventory("Item2",2)
TNT1 AA 0 A_DropInventory("Item2")
stop
Item4_1:
TNT1 A 0 A_GiveInventory("Item2",2)
TNT1 AA 0 A_DropInventory("Item2")
TNT1 A 0 A_GiveInventory("Item2",1)
stop
Item4_2:
TNT1 A 0 A_GiveInventory("Item2",2)
TNT1 AA 0 A_DropInventory("Item2")
TNT1 A 0 A_GiveInventory("Item2",2)
stop

Item5:
TNT1 A 0 A_TakeInventory("ScrewYouBuySomeAmmo",30)
TNT1 A 0 A_TakeInventory("ScrewYouBuySomeAmmo",40,1)
TNT1 A 0 A_JumpIfInventory("WireAdaptor",2,"Item5_2")
TNT1 A 0 A_JumpIfInventory("WireAdaptor",1,"Item5_1")
TNT1 A 0 A_GiveInventory("WireAdaptor",2)
TNT1 AA 0 A_DropInventory("WireAdaptor")
stop
Item5_1:
TNT1 A 0 A_GiveInventory("WireAdaptor",2)
TNT1 AA 0 A_DropInventory("WireAdaptor")
TNT1 A 0 A_GiveInventory("WireAdaptor",1)
stop
Item5_2:
TNT1 A 0 A_GiveInventory("WireAdaptor",2)
TNT1 AA 0 A_DropInventory("WireAdaptor")
TNT1 A 0 A_GiveInventory("WireAdaptor",2)
stop

Item6:
TNT1 A 0 A_TakeInventory("ScrewYouBuySomeAmmo",30)
TNT1 A 0 A_TakeInventory("ScrewYouBuySomeAmmo",30,1)

TNT1 A 0 A_SpawnItemEx("AutoBeatBoost_P",0,0,8,momx,momy,momz+1,0,8+32)
//TNT1 A 0 A_JumpIfInventory("BeatBoostItem",1,"Item6_1")
//TNT1 A 0 A_GiveInventory("BeatBoostItem",1)
//TNT1 A 0 A_DropInventory("BeatBoostItem")
stop
Item6_1:
TNT1 A 0 A_DropInventory("BeatBoostItem")
TNT1 A 0 A_GiveInventory("BeatBoostItem",1)
stop

Item7:
TNT1 A 0 A_TakeInventory("AutoIsRightAmmo",21)
TNT1 A 0 A_TakeInventory("AutoIsRightAmmo",21,1)
TNT1 A 0 A_JumpIfInventory("Auto's_ETankLite",1,"Item7_1")
TNT1 A 0 A_GiveInventory("Auto's_ETankLite",1)
TNT1 A 0 A_DropInventory("Auto's_ETankLite")
stop
Item7_1:
TNT1 A 0 A_DropInventory("Auto's_ETankLite")
TNT1 A 0 A_GiveInventory("Auto's_ETankLite",1)
stop

Item8:
TNT1 A 0 A_TakeInventory("ScrewYouBuySomeAmmo",50)
TNT1 A 0 A_TakeInventory("ScrewYouBuySomeAmmo",50,1)
TNT1 A 0 A_JumpIfInventory("EddieSummon",1,"Item8_1")
TNT1 A 0 A_GiveInventory("EddieSummon",1)
TNT1 A 0 A_DropInventory("EddieSummon")
stop
Item8_1:
TNT1 A 0 A_DropInventory("EddieSummon")
TNT1 A 0 A_GiveInventory("EddieSummon",1)
stop

}
}

actor AutoDefUpSwap_H : BasicHelper
{
States
{
Spawn:
TNT1 A 1
TNT1 A 1 A_GiveToTarget("AutoDefUpSwap_P",1)
stop
}
}
actor AutoDefUpSwap_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_SelectWeapon("Auto_W4")
stop
}
}


actor AutoScrewFire_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("CutterFlag",5,"Pick_Big")
goto Pick_Small
Pick_Small:
TNT1 A 0 A_PlaySoundEx("classes/bladecling","Weapon")
TNT1 A 0 A_FireCustomMissile("AutoScrewShot",0,0,8,0)
TNT1 A 0 A_GiveInventory("CutterFlag",1)
stop
Pick_Big:
TNT1 A 0 A_PlaySoundEx("weapon/commandobomb","Weapon")
TNT1 A 0 A_FireCustomMissile("AutoScrewShot2",0,0,8,0)
TNT1 A 0 A_TakeInventory("CutterFlag",9)
stop
}
}

actor AutoScrewShot : ProjSpawnFuncActor
{
Translation "192:192=208:208","198:198=128:128"
PROJECTILE
damagetype "Auto_Firework"
Obituary "$OB_AUTOSHOPPER"
Damage (100)
radius 10
height 5
Speed 27
scale 2.5
States
{
Spawn:
TNT1 A 0
TNT1 A 1
SCOR E 1
wait
Death:
TNT1 A 2
stop
}
}

actor AutoScrewShot2 : AutoScrewShot
{
Damage (130)
radius 16
height 14
States
{
Spawn:
TNT1 A 0
TNT1 A 1
SCOR F 1
wait
}
}

actor AutoFireworkShot : ProjSpawnFuncActor
{
PROJECTILE
damagetype "Auto_Firework"
Obituary "$OB_AUTOFIREWORK"
+SKYEXPLODE
+EXPLODEONWATER
Damage (50)
radius 12
height 12
Speed 38
scale 2.5
States
{
Spawn:
TNT1 A 0
TNT1 A 1
Spawn2:
0G_P AB 4
loop
Death:
TNT1 A 0 A_SpawnItemEx("AutoFireworkBoom_H")
TNT1 A 4 A_SpawnItemEx("AutoFireworkBoom",0,0,5)
stop
}
}

actor AutoFireworkBoom_H : BasicHelper
{
States
{
Spawn:
TNT1 A 0
TNT1 A 8 A_SetPitch(pitch+1)
TNT1 A 1 A_JumpIfInTargetInventory("AutoFireworkStacker",pitch,"Spawn2")
stop
Spawn2:
TNT1 A 0 A_SpawnItemEx("AutoFireworkBoom2",random(-60,60),random(-60,60),random(-12,12))
goto Spawn
}
}

actor AutoFireworkBoom : BasicExplosion
{
damagetype "Auto_Firework"
Obituary "$OB_AUTOFIREWORK2"
+BRIGHT
Scale 2.0
Args 150
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_PlaySoundEx("weapon/napalm","Auto")
TNT1 A 0 A_Explode(Args[0],96,0,0,16)
TNT1 A 0 A_Jump(256,"FX1","FX2","FX3","FX4")
FX1://Yellow
0G_P CDEFGHIJK 2//4
stop
FX2://Purple
0G_P LMNOPQRST 2
stop
FX3://Green
0G_Q ABCDEFGHI 2
stop
FX4://Blue
0G_Q JKLMNOPQR 2
stop
}
}

actor AutoFireworkBoom2 : AutoFireworkBoom
{
Args 120
}

actor Auto's_ETankLite : CustomInventory
{
Translation"192:192=103:103","198:198=110:110"
inventory.amount 1
inventory.maxamount 1
inventory.pickupmessage "Support Item! Auto's E-Tank Lite"
Tag "$TAG_AUTOETANKLITE"
inventory.icon "AUTOETNK"
Inventory.PickupSound "item/1up"
+INVBAR
scale 2.0
States
{
Spawn:
EBAL E 6
CARY X 6
loop
Use:
EBAL E 0 A_JumpIf(CallACS("core_CanGainHealth"),"Success")
fail
Success:
EBAL E 0 A_PlaySound("item/energyup")
EBAL E 0 A_PlaySoundEx("item/refill","Voice")
EBAL E 0 A_JumpIfInventory("AutoETankLite_Flag",1,"Success2")
EBAL E 0 A_SpawnItemEx("Auto's_ETankLite_H")
goto Success2
Success2:
EBAL E 0 A_GiveInventory("AutoETankLite_Flag",CallACS("core_getmaxhealth")*0.4)
EBAL E 0 A_SpawnItemEx("Auto's_ETankLiteFX",-1,0,36,0,0,2)
stop
}
}
actor Auto's_ETankLiteFX : BasicExplosion
{
Translation"192:192=103:103","198:198=110:110"
RenderStyle Translucent
Alpha 0.85
Scale 2.5
States
{
Spawn:
CARY "X^X^X^X^X^X^X^X" 2
stop
}
}
actor Auto's_ETankLiteHealFX : BasicClientSide
{
Translation"192:192=103:103","198:198=110:110"
RenderStyle Translucent
Alpha 0.85
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Jump(64,"Spawn3")
TNT1 A 0 A_Jump(128,"Spawn2")
Spawn1:
X_0C AAABBB 1 A_FadeOut(0.05)
loop
Spawn2:
X_0C CCCDDD 1 A_FadeOut(0.05)
loop
Spawn3:
X_0C EEEFFF 1 A_FadeOut(0.05)
loop
}
}

actor Auto's_DeluxeHealFX : BasicClientSide
{
Translation"192:192=103:103","198:198=110:110"
RenderStyle Translucent
Alpha 0.85//1.0
Scale 1.5
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_ScaleVelocity(frandom(0.7,1.3))
TNT1 A 0 A_Jump(256,"FX0","FX1","FX2","FX3")
FX0:
X_0C SVU 3
X_0C X random(3,4)
stop
FX1:
X_0C TUV 3
X_0C W random(3,4)
stop
FX2:
X_0C STUVWX 2
stop
FX3:
X_0C TSVUXW 2
stop
/*
TNT1 A 0 A_Jump(256,"FX0","FX1","FX2","FX3","FX4")
FX0:
X_0C S 3
X_0C T 6
X_0C U 4
stop
FX1:
X_0C S 4 A_SetScale(2.5)//19
X_0C T 3
X_0C U 2
stop
FX2:
X_0C S 7//14
X_0C T 3
X_0C U 2
stop
FX3:
X_0C S 10//20
X_0C STSTSTUUU 1
stop
FX4:
X_0C S 7 A_SetScale(0.5)
X_0C T 3
X_0C U 2
stop
*/
}
}



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

actor Auto's_ETankLite_H : BasicHelper
{
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SetArg(4,1+CallACS("CBM_IsThereBeef")*9)
SpawnL:
TNT1 A 0 A_JumpIf(CallACS("core_targetexists")==0,"Death")
TNT1 A 0 A_TakeFromTarget("AutoETankLite_Flag",Args[4])
TNT1 A 3 A_GiveToTarget("Auto's_ETankLite_P",1)
TNT1 A 4 A_JumpIfInTargetInventory("PlayerPropertyRage",1,1)
TNT1 A 0 A_JumpIfInTargetInventory("AutoETankLite_Flag",1,"SpawnL")
stop
}
}
actor Auto's_ETankLite_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIf(!(health>0),"No")//An undead player?!
TNT1 A 0 A_GiveInventory("CBM_HealThing10_P")
TNT1 AA 0 A_SpawnItemEx("Auto's_DeluxeHealFX",30+random(-2,2)*5,0,random(2,10)*5,momx/4,momy/4,1,random(0,29)*12,8)
TNT1 A 0 A_JumpIf(CallACS("core_CanGainHealth"),"No")
TNT1 A 0 A_TakeInventory("AutoETankLite_Flag")//Take remaining duration if fully healed
stop
No:
TNT1 A 0
stop
}
}


actor AutoBeatBoost_P : CustomInventory
{
+ACTIVATEMCROSS
//+INVENTORY.AUTOACTIVATE
//+FLOORCLIP
inventory.pickupmessage "$PU_BEATCALL"
inventory.pickupsound ""
Scale 2.0
-SPECIAL
+THRUACTORS
+DROPPED
States
{
Spawn:
WEA3 I 0
WEA3 I 0 A_ChangeVelocity(5,0,0,1)
WEA3 I 30
WEA3 I 0 A_ChangeFlag("THRUACTORS",false)
WEA3 I 0 A_ChangeFlag("SPECIAL",true)
WEA3 I 1
wait
Pickup:
TNT1 A 0 A_JumpIfInventory("BeatBoostItem",1,"SnatchCheck2")
TNT1 A 0 A_GiveInventory("BeatBoostItem",1)
TNT1 A 0 A_Jump(6,2)
TNT1 A 0 A_PlaySound("item/1up",3,1.0)
stop
TNT1 A 0 A_PlaySound("item/BirdUp",3,1.0)
stop

SnatchCheck2:
TNT1 A 0 A_JumpIfInventory("CanSnatch_F",1,"TheSnatch2")
fail
TheSnatch2:
TNT1 A 0 A_GiveInventory("SnatchItems_P2",1)
stop
}
}

actor CBM_BeatBoostItem : BeatBoostItem replaces BeatBoostItem
{
Inventory.PickupSound ""
states
{
Pickup:
TNT1 A 0 A_JumpIfInventory("CBM_BeatBoostItem",1,"Failure")
TNT1 A 0 A_JumpIfInventory("BeatBoostItem",1,"Failure")
TNT1 A 0 A_Jump(6,2)
TNT1 A 0 A_PlaySound("item/1up",3,1.0)
stop
TNT1 A 0 A_PlaySound("item/BirdUp",3,1.0)
stop
Failure:
TNT1 A 0
fail
}
}

actor CBM_BeatBoostItem_Respawn : BeatBoostItem_Respawn{}
actor CBM_BeatBoostItem_RespawnShadow : BeatBoostItem_RespawnShadow{}


//actor Auto_W_NormalBar : NormalBar {Args 208,128}
actor Auto_W1_ScriptBar : ScriptBar {}
actor Auto_W2_ScriptBar : ScriptBar {}
actor Auto_W3_ScriptBar : ScriptBar {}
actor Auto_W4_ScriptBar : ScriptBar {}