

//Since 'Player.StartItem' can't be inherited, this is given via ACS
//This WAS given through ACS, but found to be slightly slower
//So now every class has this in their StartItem
actor CBM_BaseFlagPack : CustomInventory
{
States
{
Pickup:
//Core Inventory
TNT1 A 0 A_GiveInventory("BaseFlagPack",1)

//CBM Inventory
//TNT1 A 0 A_GiveInventory("CBM_BaseFlagPack",1)
stop
}
}

actor CopyNerfGiver_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 ACS_NamedExecuteWithResult("cbm_GiveDefinedCopyNerf")
stop
}
}

actor CBM_ClassDeath_P : CustomInventory
{
States
{
Pickup:

//Core Flags
TNT1 A 0 SetPlayerProperty(0,0,4)
TNT1 A 0 ACS_NamedExecuteWithResult("core_stopplayer", 0, true)
TNT1 A 0 A_NoBlocking
TNT1 A 0 //A_Stop
//TNT1 A 0 A_GiveInventory("DeathFlagPack",1)//Flags below

TNT1 A 0 A_TakeInventory("WeaponCharge")
TNT1 A 0 A_TakeInventory("ConcreteTime")
TNT1 A 0 A_GiveInventory("CutterFlag",999)
TNT1 A 0 A_GiveInventory("IsDead",1)
TNT1 A 0 A_GiveToTarget("KilledMeStock",1)
TNT1 A 0 A_GiveToTarget("KilledMe",1)


//CBM Stuff
TNT1 A 0 A_TakeInventory("ShieldCheck")

TNT1 A 0 A_GiveInventory("EternalPainFlag",1)

TNT1 A 0 A_TakeInventory("WilyBurnTimer",999)

TNT1 A 0 A_JumpIfInventory("SpawnTeleFragFlag",1,4)
TNT1 A 0 A_SpawnItemEx("ScrewBoltSpewer_H",0,0,0,0,0,0,0,1)
TNT1 A 0 A_GiveInventory("TrioExodiaDropper_P",1)//EvilRobot actor
TNT1 A 0 A_GiveInventory("RaThorSinistarDropper_P",1)//RaThor actor

TNT1 A 0
TNT1 A 0 A_ChangeFlag("THRUACTORS",1)
//TNT1 A 0 A_ChangeFlag("SOLID",0)
goto SpecialDrops

SpecialDrops:
TNT1 A 0 A_JumpIfInventory("JoeHitFlag",1,"ScoreBall")
TNT1 A 0 A_JumpIfInventory("RaThorHitFlag",1,"RaThorSoul")
TNT1 A 0 A_JumpIfInventory("JunkDeathDropFlag",1,"JunkDrop")
TNT1 A 0
goto FinalCheck

ScoreBall:
TNT1 A 0 A_SpawnItemEx("ScoreBallPickUp",0,0,32,random(1,3),0,10,random(0,359),1)
goto SpecialDrops+1
RaThorSoul:
TNT1 A 0 A_SpawnItemEX("ThorSoul",0,0,0,random(-4,4),random(-4,4),frandom(2,3),random(0,359),1)
goto SpecialDrops+2
JunkDrop:
TNT1 AAA 0 A_SpawnItemEx("ClassJunkMetalBit",0,0,0,random(1,10),0,random(3,12),random(0,359),1)
goto SpecialDrops+3

FinalCheck:
TNT1 A 0 //A_JumpIfInventory("RiseDeathFlag",1,"Rising")
TNT1 A 0 //A_JumpIfInventory("InstagibFlag",1,"Instagib")
TNT1 A 0 //A_JumpIfInventory("FallingDeathFlag",1,"Falling")
stop
Rising:
TNT1 A 0 //A_Stop
TNT1 A 0 A_ChangeFlag("NOGRAVITY",1)
stop
Instagib:
Falling:
TNT1 A 0
stop
}
}

actor CBM_CritDeathCheck_P : CustomInventory
{//ClassBase_CBM1
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("CriticalDeath",1,1)
stop
TNT1 A 0 A_GiveInventory("CriticalDeathGiver")
stop
}
}
actor CBM_CritDeathCheck_Snd_P : CustomInventory
{//ClassBase_CBM1 Grenademan BBA
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("CriticalDeath",1,2)
TNT1 A 0 A_PlaySoundEx("*death","Voice")
stop
TNT1 A 0 A_GiveInventory("CriticalDeathGiver")
stop
}
}


//Specific states for deaths on the following classes
//BBA, Alien, Grenade, Galaxy, Fake

actor CBM_FinalDeathState_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIf(CheckClass("LightRyu"),"DrLight")
TNT1 A 0 A_JumpIf(CheckClass("DrWily"),"DrWily")
//TNT1 A 0 A_JumpIf(CheckClass("Alien"),"Alien")
TNT1 A 0 A_JumpIf(CheckClass("Trio"),"EvilRobot")
TNT1 A 0 A_JumpIf(CheckClass("RaThor"),"RaThor")
stop

DrLight:
TNT1 A 0 A_SpawnItemEx("LightRyuDemiseCorpse",0,0,0,0,0,0,0,1)
stop

DrWily:
TNT1 A 0 A_SpawnItemEx("DrWilyGrovelCorpse",0,0,8,0,0,15,0,1)
stop

Alien:
TNT1 A 0 A_JumpIfInventory("BubbleLeadAmmo",2,1)
stop
TNT1 A 0 A_SpawnItemEx("AlienDeath_MainProp")
stop

EvilRobot:
TNT1 A 0 A_JumpIf(CallACS("cbm_FetchServerCVar",6)==1,1)
stop
TNT1 A 0 A_SpawnItemEx("TrioRareDeathHelper",0,0,0,momx,momy,momz,0,1+8)
stop

RaThor:
TNT1 A 0 A_SpawnItemEx("RaThorRareDeathHelper",0,0,0,momx,momy,momz,0,1+8)
stop
}
}

actor FrozenDeathBitFX : BasicClientSide
{
Translation "192:192=4:4","198:198=201:201","0:0=72:72","247:247=72:72","208:208=4:4","168:168=4:4"
+FORCEXYBILLBOARD
+BRIGHT
Scale 1.25
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Jump(256,"S1","S2","S3","S4","S5","S6")
S1:
ICEC "RRR[SSS[TT" 1
stop
S2:
TNT1 A 0 A_Jump(128,4)
ICEC QPO random(2,3)
stop
ICEC OPQ random(2,3)
stop
S3:
TNT1 A 0 A_Jump(128,4)
ICEC UVW random(2,3)
stop
ICEC UYW random(2,3)
stop
S4:
TNT1 A 0 A_Jump(128,4)
ICEC XYZ random(2,3)
stop
ICEC XVZ random(2,3)
stop
S5:
ICEC "KKK[KKK[KKK" 1
stop
S6:
ICEC LMN 3
stop
}
}

actor ConfettiDeath : Confetti{+THRUGHOST}

actor ConfettiDeathSpawner : ConfettiSpawner{ReactionTime 9 States{
Spawn:
TNT1 AAA 0 A_SpawnItemEx("ConfettiDeath",random(-16, 16),random(-16, 16),Random(8, 16),random(-3,3), random(-3,3), random(1,-1),0)
TNT1 A 1 A_CountDown
Loop}}


actor IsInPain3 : PowerUp
{
Powerup.Duration 3
}

actor DelayPainFX : BasicHelper
{
States
{
Spawn:
TNT1 A 0
TNT1 AAAAAAAAAA 2 A_GiveToTarget("PainFXItem",1)
stop
}
}
actor DelayPainFX5 : BasicHelper
{
States
{
Spawn:
TNT1 A 0
TNT1 AAAAA 2 A_GiveToTarget("PainFXItem",1)
stop
}
}
actor PainFXItem : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_SpawnItemEx("PainFX_CBM",-5,0,3,0,0,0)
stop
}
}


actor NoFallingRespawn_Core : Inventory{+INVENTORY.UNDROPPABLE}//Used for singleplayer ACS
actor NoFallingRespawn_CTF : Inventory{}
actor NoFallingRespawn_F : Inventory{}
actor TempNoFallingRespawn_F : Powerup
{
Powerup.Duration -60
}

actor PowerFallingRespawnSpeed : PowerSpeed
{
powerup.duration 4
Speed 1.01
+POWERSPEED.NOTRAIL
}

actor CBM_ArtiTeleportCheck_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIf(tid!=0,"Yes")
TNT1 A 0 A_JumpIf(1,1)
stop
//This can teleport a voodoo/summon
TNT1 A 0 ACS_NamedExecuteWithResult("core_respawnspot",0,RS_NORM)
stop
Yes:
TNT1 A 0 A_JumpIfInventory("NoFallingRespawn_Core",1,"No")
TNT1 A 0 A_JumpIfInventory("NoFallingRespawn_CTF",1,"No")
TNT1 A 0 A_JumpIfInventory("NoFallingRespawn_F",1,"No")
TNT1 A 0 A_JumpIfInventory("TempNoFallingRespawn_F",1,"No")
TNT1 A 0 A_GiveInventory("TeleportFX_Flag6",1)
TNT1 A 0 A_JumpIfInventory("PowerFallingRespawnSpeed",1,"Trapped")
TNT1 A 0 A_GiveInventory("PowerFallingRespawnSpeed",1)
//If a Voodoo/Summoned player gets the teleport below. Game Crash!
TNT1 A 0 A_GiveInventory("CBM_ArtiTeleport_P",1)
stop
Trapped://Still in a pit?! Attempt to go to any player respawn!
TNT1 A 0 ACS_NamedExecuteWithResult("core_respawnspot",0,RS_NORM)//RS_SAMETEAM//RS_ARTITELEPORT
stop


No:
TNT1 A 0
stop
}
}


//actor SpecialDeathFlag :Inventory{}
actor FlattenDeathFlag :Inventory{}
actor FlingDeathFlag :Inventory{}
actor SpawnTeleFragFlag : Inventory{}

actor DashingStraitjacket_F : Powerup
{
powerup.duration 4
}

actor SpawningMisfire : Inventory{}
actor SpawningMisfired : Inventory{}

actor JunkDeathDropFlag :Inventory{}



