/*Actor TechErasusGiver : CustomInventory
{
  Scale 0.9
  Inventory.Amount 1
  Inventory.MaxAmount 0
  Inventory.InterHubAmount 0
	Inventory.PickupMessage "Tech Erasus"
	Obituary "%o stood in shock of %k's Tech Erasus"
	Inventory.PickupSound "erasus/up"
  Tag "Tech Erasus"
  States
  {
  Spawn:
	ERGG Z 0 NoDelay ACS_NamedExecuteWithResult("WeaponListCheck",6,0)
  SpawnLoop:
	ERGG Z -1
	Loop
  Pickup:
	TNT1 A 0 A_JumpIfInventory("Tech Erasus",1,"JustAmmo")
  All:
	TNT1 A 0 A_GiveInventory("Tech Erasus",1)
	TNT1 A 0 A_JumpIfInventory("TechErasusGiverCheck",1,"HoldAndDestroy")
	TNT1 A 0 A_GiveInventory("TechErasusGiverCheck",1)
	TNT1 A 0 A_GiveInventory("DemonAmmo",40)
	Stop
  JustAmmo:
    TNT1 A 0 A_JumpIfInventory("TechErasusGiverCheck",1,"Null")
	TNT1 A 0 A_GiveInventory("TechErasusGiverCheck",1)
	TNT1 A 0 A_GiveInventory("DemonAmmo",40)
	TNT1 A 0 A_SpawnItemEx("Tech Erasus")
	Stop
  }
}

Actor TechErasusSpawnerGiver : TechErasusGiver
{
  States
  {
  JustAmmo:
    TNT1 A 0 A_JumpIfInventory("TechErasusGiverCheck",1,"Null")
	TNT1 A 0 A_GiveInventory("TechErasusGiverCheck",1)
	TNT1 A 0 A_GiveInventory("DemonAmmo",40)
	Stop
  }
}

Actor TechErasusGiverCheck : Inventory { Inventory.Amount 1 Inventory.MaxAmount 1 Inventory.InterHubAmount 0 }



ACTOR "Tech Erasus" : Weapon
{
 Tag "Tech Erasus"	
 Weapon.AmmoUse 10
 Weapon.AmmoType "DemonAmmo"
 Weapon.AmmoGive 100
 Weapon.SlotNumber 0
 Weapon.SlotPriority 0.1
 Weapon.PreferredSkin "DemonTechRifle-Marine"
 Inventory.PickupMessage "Tech Erasus"
 Obituary "%o stood in shock of %k's Tech Erasus"
 Inventory.PickupSound "erasus/up"
 Weapon.Upsound "erasus/up"
 Decal DoomImpScorch
 Scale 0.9
 +WEAPON.NOAUTOAIM
 States
 {
  Ready:
	ERGG A 1 A_WeaponReady
	Loop
  Deselect:
	TNT1 A 0 A_PlayWeaponSound("weapons/weapondown")
	ERGG A 1 A_Lower
	Goto Deselect+1
  Select:
	ERGG A 1 A_Raise
	Wait
  Fire:
	ERGL A 0 A_Quake(3,25,0,128,"none")
	ERGL A 0 A_PlayWeaponSound("erasus/fire")
	ERGL A 0 A_AlertMonsters
	ERGL A 0 A_Recoil(6)
	ERGL A 0 A_GunFlash
	ERGL A 0 A_FireCustomMissile("ErasusProj",0,1,4,-5)
	ERGF A 1 Bright Offset(4,36) A_ZoomFactor(0.995)
	ERGF B 1 Bright Offset(8,40) A_ZoomFactor(0.98)
	ERGF C 1 Offset(12,44) A_ZoomFactor(0.97)
	ERGF D 1 Offset(15,47) A_ZoomFactor(0.965)
	ERGF D 1 Offset(18,50) A_ZoomFactor(0.96)
	ERGF E 1 Offset(20,51) A_ZoomFactor(0.97)
	ERGF E 1 Offset(21,52) A_ZoomFactor(0.98)
	ERGF F 1 Offset(22,53) A_ZoomFactor(0.985)
	ERGF F 1 Offset(23,54) A_ZoomFactor(0.99)
	ERGF G 1 A_ZoomFactor(0.995)
	ERGF G 1 A_ZoomFactor(1)
	ERGF H 6
	ERGF I 4
	ERGF I 1 Offset(22,53)
	ERGF I 1 Offset(21,52)
	ERGF J 1 Offset(20,51)
	ERGF J 1 Offset(19,50)
	ERGF K 1 Offset(17,48)
	ERGF K 1 Offset(15,46)
	ERGF L 1 Offset(13,44)
	ERGF L 1 Offset(10,41)
	ERGF M 1 Offset(8,39)
	ERGF M 1 Offset(6,37)
	ERGF N 1 Offset(4,35)
	ERGF N 1 Offset(2,33)
	ERGL A 0 A_PlayWeaponSound("erasus/load")
	ERGL A 0 A_Quake(2,24,0,32,"none")
	ERGL A 0 A_SetBlend("Red",0.1,22)
	ERGL ABCDEFGHI 4
	ERGL J 4 A_ReFire
	ERGL K 4
	ERGG B 3
	Goto Ready
  Flash:
	TNT1 A 3
	TNT1 A 3
	TNT1 A 1
	Stop
  Spawn:
	ERGG Z 0 NoDelay ACS_NamedExecuteWithResult("WeaponListCheck",6,0)
  SpawnLoop:
	ERGG Z -1
	Stop
 }
}
I fucking hate this shit, these stupid unused actors left everywhere and the ass logic
*/

ACTOR ErasusProj
{
Speed 350
Radius 17
Height 10
Damage 75
Renderstyle Add
PROJECTILE
-CANNOTPUSH
+NODAMAGETHRUST
+EXTREMEDEATH
+MTHRUSPECIES
DamageType "Marine"
DeathSound "weapons/StachanovHit"
MissileType "ErasusProjTrail"
Decal Scorch
States
{
  Spawn:
    TNT1 A 0
	YAE4 A 0 A_SpawnItemEx("ErasusProjTrail",5,1.0,1)
    TNT1 A 1 A_PlaySound("erasus/fly",5,1.0,1)
    Loop
  Death:
    TNT1 A 0 A_PlaySound("erasus/explode",5)
    TNT1 AAAAAAAAAA 0 A_SpawnItemEx("ErasusProjTrailSparks",random(19,-19),random(19,-19),random(19,-19),0,0,0,0,128,0)
    TNT1 A 0 A_SpawnItemEx("ErasusExplode",0,0,0,0,0,0,0,128,0)
	TNT1 A 0 A_Explode(512,64,0)
    TNT1 A 0 A_Explode(288,156,0)
    TNT1 BCD 4
    stop
  }
}

ACTOR ErasusProjTrail
{
RenderStyle Add
Scale 0.175
Alpha 1
+NOINTERACTION
+NOGRAVITY
  States
  {
  Spawn:
    TNT1 A 0
    TNT1 A 0 //A_SetScale(ScaleX,ScaleY-0.0875)
    YAE4 A 2 Bright A_SpawnItemEx("ErasusProjTrailSparks",random(4,-4),random(4,-4),random(4,-4),0,0,0,0,128,0)
    YAE4 A 2 Bright
  Fly:
    YAE4 A 0 //A_SetScale(ScaleX-0.01,ScaleY-0.01)
    YAE4 A 1 Bright A_FadeOut(0.295)
    Loop
  }
}

//ClientSideEffect
ACTOR ErasusProjTrailSparks : FastProjectile
{ 
RenderStyle Add
Scale 0.0125
Alpha 0.95
+NOINTERACTION
+NOGRAVITY
+CLIENTSIDEONLY
States
{
  Spawn:
	TNT1 A 0
	TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("CheckVanilla") == 1, "Vanilla")
    YAE4 A 3 Bright A_ChangeVelocity(frandom(-0.8,0.8),frandom(-0.8,0.8),frandom(-0.8,0.8),0)
    YAE4 A 1 Bright A_FadeOut(0.05)
    Loop
	Vanilla:
	TNT1 A 0
    Stop    
}
}

ACTOR ErasusExplode
{
Radius 17
Height 10
Renderstyle Add
Scale 0.5
+CLIENTSIDEONLY
+NOINTERACTION
+NOGRAVITY
States
  {
  Spawn:
    YAE3 ABCDEFGHIJKLMNOPQRS 1 Bright A_FadeOut(0.05)
    Stop
  }
}