//Sergeant Mark IV's vehicles.
//If you want to modify and reuse this on your wad, please ask me first.





ACTOR HeavyMachinegun: SwitchableDecoration 5462
{
    Radius 24
	Height 64
	+SOLID
	+USESPECIAL
	MONSTER
	-COUNTKILL
	-SHOOTABLE
	+THRUACTORS
	+LOOKALLAROUND
	-COUNTKILL
	 //$category "Weapons"
	Activation THINGSPEC_Activate | THINGSPEC_ThingTargets | THINGSPEC_NoDeathSpecial
	Mass 999999
	Speed 0
	damagefactor "Head", 0.0	damagefactor "FriendBullet", 0.0    damagefactor "Taunt", 0.0    damagefactor "KillMe", 0.0
	damagefactor "Shotgun", 0.7    damagefactor "Shrapnel", 0.0    damagefactor "Blood", 0.0    damagefactor "BlueBlood", 0.0
	damagefactor "GreenBlood", 0.0    damagefactor "MinorHead", 0.0    damagefactor "Decaptate", 0.0	damagefactor "MonsterKnocked", 0.0
    damagefactor "CancelTeleportFog", 0.0	damagefactor "BHFTOnBarrel", 0.0	damagefactor "GibRemoving", 0.0	damagefactor "SuperPunch", 5.0
	damagefactor "HelperMarineFatallity", 0.0	damagefactor "Leg", 0.0	damagefactor "SpawnMarine", 0.0	damagefactor "TeleportRemover", 0.0
	DamageFactor "CauseObjectsToSplash", 0.0 DamageFactor "Trample", 0.0
    States
    {
    Spawn:
	    TTR1 A 1
		TNT1 A 0 Thing_ChangeTID(0, 261)
		TTR1 A 1 A_ChangeFlag("FRIENDLY", 0)
		TTR1 A 3 
		TNT1 A 0 Thing_ChangeTID(0, 0)
		TTR1 A 0 A_ChangeFlag("THRUACTORS", 0)
		TTR1 A -1
		Stop
	Active:
		TNT1 A 0 
		TNT1 A 0 A_TakeFromTarget("PowerInvulnerable", 1)
		TNT1 A 0 A_GiveToTarget("CeaseMorph", 1)
		TTR1 A 0 A_ChangeFlag("FRIENDLY", 0)
		
	See:	
		//TNT1 A 0 A_Chase("","",CHF_DONTMOVE )
		TNT1 A 0 A_GiveToTarget("CheckingMorphingPlayerHealth", 1)
		TTR1 A 3
		TNT1 A 0 A_GiveToTarget("HeavyMachinegunMorpher", 1)
		TNT1 A 0 A_GiveToTarget("HeavyMachinegunAmmo", 200)
		TNT1 A 0 Thing_ChangeTID(0, 261)
		TNT1 A 0 A_NoBlocking
		TNT1 A 1
		TNT1 A 0 A_ChangeFlag("USESPECIAL", 0)
		TNT1 A 10
		TNT1 A 0 Thing_ChangeTID(0, 0)
		TNT1 A 1
		Stop
	}
}



ACTOR HeavyMachinegunUsed: HeavyMachinegun
{
    States
    {
	Active:
		TNT1 A 0 
		TNT1 A 0 A_TakeFromTarget("PowerInvulnerable", 1)
		TNT1 A 0 A_GiveToTarget("CeaseMorph", 1)
		TTR1 A 0 A_ChangeFlag("FRIENDLY", 0)
	See:	
		//TNT1 A 0 A_Chase("","",CHF_DONTMOVE )
		TNT1 A 0 A_GiveToTarget("CheckingMorphingPlayerHealth", 1)
		TTR1 A 3
		TNT1 A 0 A_GiveToTarget("HeavyMachinegunMorpher", 1)
		TNT1 A 0 Thing_ChangeTID(0, 261)
		TNT1 A 0 A_NoBlocking
		TNT1 A 1
		TNT1 A 0 A_ChangeFlag("USESPECIAL", 0)
		TNT1 A 10
		TNT1 A 0 Thing_ChangeTID(0, 0)
		Stop
	}
}

ACTOR PlayerHeavyMachinegun : PlayerPawn
{
	Speed 0
	Scale 1.0
	Radius 24
	Height 56
	Mass 999999
	PainChance 0
	Health 100
	Speed 0
	Player.MorphWeapon "HeavyMachinegunHUD"
	Player.JumpZ 0
	+NOSKIN
	Player.ColorRange 112, 127
	PainSound "*pain"
	DeathSound "*death"
	
	player.viewheight	52
    player.attackzoffset 20
	
	
	damagefactor "SSG", 5.0
	damagefactor "Cut", 10.0 damagefactor "Saw", 10.0
    damagefactor "Shotgun", 0.9
	damagefactor "MonsterBullet", 0.2
	damagefactor "MonsterShotgunBullet", 0.2
	damagefactor "MonsterMinigun", 0.5
	damagefactor "Burn", 0.5	damagefactor "Plasma", 0.5  damagefactor "Fire", 0.5
	damagefactor "Fatality", 5.0
	damagefactor "Bullet", 0.7 
	damagefactor "Shotgun", 0.9  damagefactor "PussyGrab", 100.9 
	//All of the following are token damages. Due the lack of A_RadiusGive on Zandronum 2.1, I need to use some tricks with
	//A_Explode to make actors "communicate" with each other in an area.
	damagefactor "RevenantHitStomach", 0.0
	
	damagefactor "Blood", 0.5    damagefactor "BlueBlood", 0.5    damagefactor "GreenBlood", 0.5  damagefactor "Water", 0.0
	
	damagefactor "Shrapnel", 0.0 
	damagefactor "Head", 0.0	damagefactor "FriendBullet", 0.0    damagefactor "Taunt", 0.0    damagefactor "KillMe", 0.0
	damagefactor "CancelTeleportFog", 0.0	damagefactor "BHFTOnBarrel", 0.0	damagefactor "GibRemoving", 0.0
	damagefactor "SpawnMarine", 0.0	damagefactor "TeleportRemover", 0.0	damagefactor "MinorHead", 0.0
	damagefactor "Decaptate", 0.0	damagefactor "MonsterKnocked", 0.0
	DamageFactor "CauseSplash", 0.0 DamageFactor "CauseObjectsToSplashSlime", 0.0 DamageFactor "CauseObjectsToSplashNukage", 0.0
	DamageFactor "CauseObjectsToSplashBlood", 0.0 DamageFactor "CauseObjectsToSplashLava", 0.0
	damagefactor "HelperMarineFatallity", 0.0	damagefactor "Leg", 0.0
	DamageFactor "KillMeBot", 0.0
	
	States
	{
	
	Spawn:
	TTR2 A 1
	TTR2 A 4
	TNT2 A 0 A_TakeInventory("PressedUse", 1)
	Spawn2:
	TNT1 A 0 A_JumpIfInventory("PressedUse", 1, "ExitVehicle")
	TTR2 A 1
	Loop
	
	PAIN:
	TTR2 A 1
	TTR2 A 1 A_Pain
	Goto Spawn
	
	ExitVehicle:
	TNT1 A 1
	TNT1 A 0 A_TakeInventory("PressedUse", 1)
	
	TNT1 A 0 A_SpawnItemEx ("TransferPlayerOutOfVehicle", -64, 0, 16)
	TTR2 A 4
	TNT1 A 0 A_JumpIfInventory("CanLeaveVehicle", 1, "CanExit")
	TNT1 A 0 A_Print("Can't leave from this direction", 1)
	Goto Spawn
	
	CanExit:
	TNT1 A 0 A_TakeInventory("PressedUse", 1)
	TNT1 A 0 A_TakeInventory("CanLeaveVehicle", 1)
	TNT1 A 0 A_SpawnItemEx ("HeavyMachinegunUsed", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
	TNT1 A 0 ACS_NamedExecuteAlways("BDLeaveHMG")
	TNT1 A 100
	TNT1 A -1
	Stop
	
	Death:
	TNT1 A 0
	TNT1 A 0 A_Scream
	TNT1 A 0 A_NoBlocking
	TNT1 A 0 A_TakeInventory("HeavyMachinegunHUD", 1)
	TNT1 A 0 A_SpawnItemEx ("HeavyMachinegun", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
	PLAY HIJKLM 4
	PLAY N -1
	Stop
	
	}
}


ACTOR PowerHeavyMachinegunSwitch : PowerMorph {PowerMorph.PlayerClass "PlayerHeavyMachinegun"}



ACTOR HeavyMachinegunMorpher : CustomInventory 
{
  States
  {
  PickUp:
  TNT1 A 1
  TNT1 A 0 ACS_NamedExecuteAlways("BDEnterHMG", 0, 0, 0, 0)//Grab Tripod Gun.
  TNT1 A 0 A_GiveInventory("HeavyMachinegunMorphActivation")
  TNT1 A 0 A_SpawnItem("CancelTeleportFog")
  TNT1 A 1
  Stop
  }
 }
 
ACTOR CheckingMorphingPlayerHealth : CustomInventory 
{
  States
  {
  PickUp:
  TNT1 A 0
  TNT1 A 0 ACS_NamedExecuteAlways("GetVehiclePreviousHealth2", 0, 0, 0, 0)//Grab Tripod Gun.
  Stop
  }
 } 


ACTOR HeavyMachinegunMorphActivation : PowerupGiver
{
  Powerup.Type "PowerHeavyMachinegunSwitch"
  Powerup.Duration 252000
  +INVENTORY.AUTOACTIVATE
  +INVENTORY.ALWAYSPICKUP
  Inventory.MaxAmount 1
  Health 100
  GibHealth 1
  Scale 0.5
  Mass 999999999
  Height 96
  Radius 32
  States
  {
  Spawn:
  TNT1 A 100
  Stop
  
  PickUp:
  TNT1 A 1
  TNT1 A 1
  Stop
  }
 }
 
 

ACTOR HeavyMachinegunHUD : DoomWeapon
{
Game Doom
	Weapon.SelectionOrder 1900
	Weapon.AmmoUse 0
	Weapon.AmmoGive 0
	Weapon.AmmoType "HeavyMachinegunAmmo"
	Obituary "$OB_MPPISTOL"
	//+WEAPON.NOAUTOFIRE
	Inventory.Pickupmessage "$PICKUP_PISTOL_DROPPED"
	Tag "$TAG_PISTOL"
	States
	{
	Ready:
	    TNT1 A 0
		TNT1 A 0 A_ZoomFactor(0.9)
		TNT1 A 0 A_JumpIfInventory("HeavyMachinegunAmmo", 1, 1)
		Goto NoAmmo
		HMGH A 2 A_WeaponReady(1)
     	Loop
		
	NoAmmo:
	    TNT1 A 0
		HMGH H 2
		HMGH H 1 A_WeaponReady(1)
     	Goto Ready	
		
	Deselect:
		TNT1 A 1 A_Lower
		Loop
	Select:
		HMGH A 0 A_Raise
		TNT1 A 1 A_TakeInventory("PressedUse", 1)
		TNT1 A 1 A_TakeInventory("PressedJump", 2)
		HMGH AAAAAAA 1 A_Raise
		HMGH AAAAAAAAAAA 0 A_Raise
		TNT1 A 0
		Goto Ready
	Fire:
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("HeavyMachinegunAmmo", 1, 1)
		Goto NoAmmo
		
		TNT1 A 0 A_ZoomFactor(0.85)
		HMGH B 1 BRIGHT
		TNT1 A 0 A_FireCustomMissile("HeavyMachinegunProjectile", 0, 1, 2, -1)
		TNT1 A 0 A_TakeInventory("HeavyMachinegunAmmo", 1)
		TNT1 AAA 0 A_FireCustomMissile("YellowFlareSpawn",0,0,0,0)
		RIFF AA 0 A_FireCustomMissile("GunFireSmoke", 0, 0, 0, 0, 0, 0)
	    TNT1 A 0 A_PlaySound("TANKMG", 1)
		TNT1 A 0 A_ZoomFactor(0.9)
		HMGH DDG 1
		
		
		TNT1 A 0 A_ZoomFactor(0.85)
		HMGH C 1 BRIGHT
		TNT1 A 0 A_FireCustomMissile("HeavyMachinegunProjectile", 0, 1, -2, -1)
		TNT1 A 0 A_TakeInventory("HeavyMachinegunAmmo", 1)
		TNT1 AAA 0 A_FireCustomMissile("YellowFlareSpawn",0,0,0,0)
		RIFF AA 0 A_FireCustomMissile("GunFireSmoke", 0, 0, 0, 0, 0, 0)
	    TNT1 A 0 A_PlaySound("TANKMG", 1)
		TNT1 A 0 A_ZoomFactor(0.9)
		HMGH EEG 1
		Goto Ready
		
	Spawn:
		LAUN A -1
		Stop
	}
}
 
 
ACTOR HeavyMachinegunProjectile: FastProjectile
{
	Game Doom
	Radius 2
	Height 2
	Speed 300
	Damage (random(40, 40))
	+RANDOMIZE
	+MISSILE
	-NOGRAVITY
	+BLOODSPLATTER
	+NOEXTREMEDEATH
	Gravity 0.1
	RenderStyle Add
	damagetype "Minigun"
	Alpha 1.0
	Decal "BulletChip"
	Scale 1.0
	Obituary "$OB_MPPLASMARIFLE"
	States
	{
	Spawn:
		MG74 A 1 Bright
        TNT1 A 0 A_SpawnItem("HeavyMachinegunHitsProjectiles", 0, 5)
		Loop
	Death:
	    TNT1 A 0 A_SpawnItem("BulletPuff")
		TNT1 A 0 A_NoBlocking
		TNT1 AA 0 A_CustomMissile ("ExplosionParticleVeryFast", 0, 0, random (0, 360), 2, random (0, 40))
		TNT1 A 0 A_CustomMissile ("PlasmaSmoke", 2, 0, random (0, 360), 2, random (0, 360))
		TNT1 A 1
		Stop
	}
}



ACTOR HeavyMachinegunProjectile2: HeavyMachinegunProjectile
{
	Damage 4
}


ACTOR HeavyMachinegunProjectileEnemy: HeavyMachinegunProjectile
{
Speed 180
	damage (random(25, 25))
	+THRUSPECIES
	Species "EnemyTank"
}






ACTOR HeavyMachinegunFlash: FastProjectile
{
	Game Doom
	Radius 2
	Height 2
	Speed 15
	Damage 0
	+RANDOMIZE
	+MISSILE
	-NOGRAVITY
	+BLOODSPLATTER
	Gravity 0.1
	RenderStyle Add
	damagetype "Blast"
	Alpha 0.2
	Scale 0.4
	States
	{
	Spawn:
		TNT1 A 0
		//TNT1 A 0 Radius_Quake(4, 4, 0, 1, 0)
		TNT1 A 1
		TNT1 A 0 A_Stop
		Death:
		TNT1 A 0 A_SpawnItem("YellowFlare")
		HMGH F 2
		Stop
	}
}


	
	
actor HeavyMachinegunHitsProjectiles
{
    Scale 1.0
    +SHOOTABLE
	+NOBLOOD
	MONSTER
	-COUNTKILL
	Radius 6
	Height 8
	Health 2
    States
    {
    Spawn:
        TNT1 A 3
		TNT1 A 0 A_NoBlocking
        stop
	Death:
        TNT1 A 0
		TNT1 A 0 A_NoBlocking
        stop	
    }
}	

actor HeavyMachinegunProjectileTracerTrail
{
    Scale 2.0
    RenderStyle Add
    Alpha 0.9
    +NOINTERACTION
    +CLIENTSIDEONLY
    States
    {
    Spawn:
        MG74 A 4 BRIGHT
        stop
    }
}



actor HeavyMachinegunProjectileTracerTrail2: HeavyMachinegunProjectileTracerTrail {    Alpha 0.85 }
actor HeavyMachinegunProjectileTracerTrail3: HeavyMachinegunProjectileTracerTrail {    Alpha 0.80 }
actor HeavyMachinegunProjectileTracerTrail4: HeavyMachinegunProjectileTracerTrail {    Alpha 0.75 }
actor HeavyMachinegunProjectileTracerTrail5: HeavyMachinegunProjectileTracerTrail {    Alpha 0.70 }
actor HeavyMachinegunProjectileTracerTrail6: HeavyMachinegunProjectileTracerTrail {    Alpha 0.65 }
actor HeavyMachinegunProjectileTracerTrail7: HeavyMachinegunProjectileTracerTrail {    Alpha 0.60 }
actor HeavyMachinegunProjectileTracerTrail8: HeavyMachinegunProjectileTracerTrail {    Alpha 0.55 }
actor HeavyMachinegunProjectileTracerTrail9: HeavyMachinegunProjectileTracerTrail {    Alpha 0.50 }
actor HeavyMachinegunProjectileTracerTrail10: HeavyMachinegunProjectileTracerTrail {    Alpha 0.45 }
actor HeavyMachinegunProjectileTracerTrail11: HeavyMachinegunProjectileTracerTrail {    Alpha 0.40 }
actor HeavyMachinegunProjectileTracerTrail12: HeavyMachinegunProjectileTracerTrail {    Alpha 0.35 }
actor HeavyMachinegunProjectileTracerTrail13: HeavyMachinegunProjectileTracerTrail {    Alpha 0.30 }
actor HeavyMachinegunProjectileTracerTrail14: HeavyMachinegunProjectileTracerTrail {    Alpha 0.25 }
actor HeavyMachinegunProjectileTracerTrail15: HeavyMachinegunProjectileTracerTrail {    Alpha 0.20 }
actor HeavyMachinegunProjectileTracerTrail16: HeavyMachinegunProjectileTracerTrail {    Alpha 0.15 }
actor HeavyMachinegunProjectileTracerTrail17: HeavyMachinegunProjectileTracerTrail {    Alpha 0.10 }
actor HeavyMachinegunProjectileTracerTrail18: HeavyMachinegunProjectileTracerTrail {    Alpha 0.05 }



ACTOR AutoCannonProjectile: HeavyMachinegunProjectile
{
	Damage (random(60, 60))
	Speed 250
	Scale 1.5
	Decal "Scorch"
	States
	{
	Spawn:
		TNT1 A 1 Bright
		TNT1 A 0 A_SpawnItemEx("AutoCannonTracerTrail2", (2 *momx)/-35.0, -(2 *momy)/-35.0, 2+(2 *momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("AutoCannonTracerTrail3", (4 *momx)/-35.0, -(4 *momy)/-35.0, 2+(4 *momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("AutoCannonTracerTrail4", (6 *momx)/-35.0, -(6 *momy)/-35.0, 2+(6 *momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("AutoCannonTracerTrail5", (8 *momx)/-35.0, -(8 *momy)/-35.0, 2+(8 *momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("AutoCannonTracerTrail6", (10*momx)/-35.0, -(10*momy)/-35.0, 2+(10*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
		TNT1 A 0 A_SpawnItemEx("AutoCannonTracerTrail7", (12*momx)/-35.0, -(12*momy)/-35.0, 2+(12*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
		TNT1 A 0 A_SpawnItemEx("AutoCannonTracerTrail8", (14*momx)/-35.0, -(14*momy)/-35.0, 2+(14*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
		TNT1 A 0 A_SpawnItemEx("AutoCannonTracerTrail9", (16*momx)/-35.0, -(16*momy)/-35.0, 2+(16*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
		TNT1 A 0 A_SpawnItemEx("AutoCannonTracerTrail10", (18*momx)/-35.0, -(18*momy)/-35.0, 2+(18*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
		TNT1 A 0 A_SpawnItemEx("AutoCannonTracerTrail11", (20*momx)/-35.0, -(20*momy)/-35.0, 2+(20*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
		TNT1 A 0 A_SpawnItemEx("AutoCannonTracerTrail12", (22*momx)/-35.0, -(22*momy)/-35.0, 2+(22*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItem("HeavyMachinegunHitsProjectiles", 0, 5)
		Loop
	Death:
		TNT1 A 0
		TNT1 A 0 A_SpawnItemEx ("AutocannonPenetrator",cos(-pitch)*42,0,0+(sin(pitch)*42),cos(-pitch)*120,0,sin(pitch)*120,0,SXF_TRANSFERPITCH)
	XDeath:
		TNT1 A 0 A_NoBlocking
		TNT1 A 0 A_Explode(10, 120)
		TNT1 A 0 A_CustomMissile ("BDExplosionparticles", 0, 0, random (0, 360), 2, random (40, 90))
		TNT1 A 0 A_CustomMissile ("BDExplosionparticles2", 0, 0, random (0, 360), 2, random (40, 90))
		TNT1 A 0 A_CustomMissile ("ExplosionSmoke", 2, 0, random (0, 360), 2, random (0, 360))
		
		TNT1 A 0 A_CheckFloor("ExplodeFloor")
		XPAC EFGHIJK 1 BRIGHT A_SpawnItem("RedFlare")
		TNT1 A 1
		Stop
		
	ExplodeFloor:
		TNT1 A 0
		TNT1 A 0 A_SpawnItem("BulletPuff")
		TNT1 A 0 A_Jump(64, "Ricochet")
		XPAC EFGHIJK 1 BRIGHT A_SpawnItem("RedFlare")
		TNT1 A 1
		Stop
		
	Ricochet:
		TNT1 A 0
		TNT1 A 0 A_CustomMissile("AutoCannonProjectile2", 12, 0, random(-15, 15), 2, random(5, 20))
		Stop
		
	}
}

Actor AutoCannonProjectile2
{
Damage (random(30, 30))
+MISSILE
-NOGRAVITY
Speed 100
Gravity 1.0
States
	{
	Spawn:
		TNT1 A 1 Bright
		TNT1 A 0 A_SpawnItemEx("AutoCannonTracerTrail2", (2 *momx)/-35.0, -(2 *momy)/-35.0, 2+(2 *momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("AutoCannonTracerTrail3", (4 *momx)/-35.0, -(4 *momy)/-35.0, 2+(4 *momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("AutoCannonTracerTrail4", (6 *momx)/-35.0, -(6 *momy)/-35.0, 2+(6 *momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("AutoCannonTracerTrail5", (8 *momx)/-35.0, -(8 *momy)/-35.0, 2+(8 *momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("AutoCannonTracerTrail6", (10*momx)/-35.0, -(10*momy)/-35.0, 2+(10*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
		TNT1 A 0 A_SpawnItemEx("AutoCannonTracerTrail7", (12*momx)/-35.0, -(12*momy)/-35.0, 2+(12*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
		TNT1 A 0 A_SpawnItemEx("AutoCannonTracerTrail8", (14*momx)/-35.0, -(14*momy)/-35.0, 2+(14*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
		TNT1 A 0 A_SpawnItemEx("AutoCannonTracerTrail9", (16*momx)/-35.0, -(16*momy)/-35.0, 2+(16*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
		TNT1 A 0 A_SpawnItemEx("AutoCannonTracerTrail10", (18*momx)/-35.0, -(18*momy)/-35.0, 2+(18*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
		TNT1 A 0 A_SpawnItemEx("AutoCannonTracerTrail11", (20*momx)/-35.0, -(20*momy)/-35.0, 2+(20*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
		TNT1 A 0 A_SpawnItemEx("AutoCannonTracerTrail12", (22*momx)/-35.0, -(22*momy)/-35.0, 2+(22*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
		Loop
		
		Death:
		TNT1 A 0 A_Explode(10, 120)
		TNT1 A 0 A_CustomMissile ("BDExplosionparticles", 0, 0, random (0, 360), 2, random (40, 90))
		TNT1 A 0 A_CustomMissile ("BDExplosionparticles2", 0, 0, random (0, 360), 2, random (40, 90))
		TNT1 A 0 A_CustomMissile ("ExplosionSmoke", 2, 0, random (0, 360), 2, random (0, 360))

		XPAC EFGHIJK 1 BRIGHT A_SpawnItem("RedFlare")
		TNT1 A 1
		Stop
		}
}



Actor AutocannonPenetrator: AutoCannonProjectile
{
damage (random(50, 60))
//Decal "BulletDecalNew1"
Decal "Scorch"
DamageType Blast
Radius 4
Height 4
Scale 0.2
+MISSILE
-SKYEXPLODE
States
{
	
Death:
	TNT1 A 0
	TNT1 A 0 A_CheckFloor("Nah")
	TNT1 A 0 A_CheckCeiling("Nah")
	Goto XDeath
	
Nah:
		TNT1 A 0
		Stop
	}
}


actor AutoCannonTracerTrail
{
    Scale 0.8
    RenderStyle Add
    Alpha 0.9
    +NOINTERACTION
    +CLIENTSIDEONLY
    States
    {
    Spawn:
        MG74 C 2 BRIGHT
        stop
    }
}



actor AutoCannonTracerTrail2: AutoCannonTracerTrail {    Alpha 0.85 }
actor AutoCannonTracerTrail3: AutoCannonTracerTrail {    Alpha 0.80 }
actor AutoCannonTracerTrail4: AutoCannonTracerTrail {    Alpha 0.75 }
actor AutoCannonTracerTrail5: AutoCannonTracerTrail {    Alpha 0.70 }
actor AutoCannonTracerTrail6: AutoCannonTracerTrail {    Alpha 0.65 }
actor AutoCannonTracerTrail7: AutoCannonTracerTrail {    Alpha 0.60 }
actor AutoCannonTracerTrail8: AutoCannonTracerTrail {    Alpha 0.55 }
actor AutoCannonTracerTrail9: AutoCannonTracerTrail {    Alpha 0.50 }
actor AutoCannonTracerTrail10: AutoCannonTracerTrail {    Alpha 0.45 }
actor AutoCannonTracerTrail11: AutoCannonTracerTrail {    Alpha 0.40 }
actor AutoCannonTracerTrail12: AutoCannonTracerTrail {    Alpha 0.35 }




ACTOR AutoCannonFlash: HeavyMachinegunFlash
{
	Scale 0.9
	States
	{
	Spawn:
		TNT1 A 0
		//TNT1 A 0 Radius_Quake(4, 4, 0, 1, 0)
		TNT1 A 1
		TNT1 A 0 A_Stop
		Death:
		TNT1 A 0 A_SpawnItem("RedFlare")
		HMGH F 2
		Stop
	}
}


ACTOR heavyplasmaProjectile: FastProjectile
{
	Game Doom
	Radius 2
	Height 0
	Speed 220
	Damage 13
	+RANDOMIZE
	+MISSILE
	-NOGRAVITY
	+BLOODSPLATTER
	Gravity 0.1
	RenderStyle Add
	damagetype "Plasma"
	Alpha 1.0
	Decal "Scorch"
	Scale 1.0
	Obituary "$OB_MPPLASMARIFLE"
	States
	{
	Spawn:
		TNT1 A 1 Bright a_sPAWNITEM("BlueFlareSmall")
		TNT1 A 0 A_SpawnItemEx("heavyplasmaProjectileTracerTrail2", (2 *momx)/-35.0, -(2 *momy)/-35.0, 2+(2 *momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("heavyplasmaProjectileTracerTrail3", (4 *momx)/-35.0, -(4 *momy)/-35.0, 2+(4 *momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("heavyplasmaProjectileTracerTrail4", (6 *momx)/-35.0, -(6 *momy)/-35.0, 2+(6 *momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("heavyplasmaProjectileTracerTrail5", (8 *momx)/-35.0, -(8 *momy)/-35.0, 2+(8 *momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("heavyplasmaProjectileTracerTrail6", (10*momx)/-35.0, -(10*momy)/-35.0, 2+(10*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("heavyplasmaProjectileTracerTrail7", (12*momx)/-35.0, -(12*momy)/-35.0, 2+(12*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("heavyplasmaProjectileTracerTrail8", (14*momx)/-35.0, -(14*momy)/-35.0, 2+(14*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("heavyplasmaProjectileTracerTrail9", (16*momx)/-35.0, -(16*momy)/-35.0, 2+(16*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("heavyplasmaProjectileTracerTrail10", (18*momx)/-35.0, -(18*momy)/-35.0, 2+(18*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("heavyplasmaProjectileTracerTrail11", (20*momx)/-35.0, -(20*momy)/-35.0, 2+(20*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("heavyplasmaProjectileTracerTrail12", (22*momx)/-35.0, -(22*momy)/-35.0, 2+(22*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
		TNT1 A 0 A_SpawnItem("heavyplasmaHitsProjectiles", 0, 5)
		Loop
	Death:
	    TNT1 A 0 A_SpawnItem("BulletPuff")
		TNT1 A 0 A_NoBlocking
		TNT1 AAAA 0 A_SpawnItem("BlueFlare")
		TNT1 AAA 0 A_CustomMissile ("HeavyPlasmaProjectileHit", 0, 0, random (0, 360), 2, random (0, 360))
		TNT1 AAA 0 A_CustomMissile ("ExplosionParticleHeavy", 0, 0, random (0, 360), 2, random (0, 360))
		TNT1 AAA 0 A_CustomMissile ("ExplosionParticleVeryFast", 0, 0, random (0, 360), 2, random (0, 40))
		TNT1 AAA 0 A_CustomMissile ("PlasmaSmoke", 2, 0, random (0, 360), 2, random (0, 360))
		TNT1 A 1
		Stop
	}
}


ACTOR heavyplasmaProjectileEnemy: heavyplasmaProjectile
{
	Speed 100
	Damage 10
}


ACTOR AutoCannonProjectileEnemy: AutoCannonProjectile
{
	Speed 100
	Damage (random(20, 25))
	Speed 60
	Damage (random (190, 200))
	+NOGRAVITY
	+THRUSPECIES
	Species "EnemyTank"
}

ACTOR heavyplasmaFlash: FastProjectile
{
	Game Doom
	Radius 2
	Height 2
	Speed 15
	Damage 0
	+RANDOMIZE
	+MISSILE
	-NOGRAVITY
	+BLOODSPLATTER
	Gravity 0.1
	RenderStyle Add
	damagetype "Plasma"
	Alpha 0.2
	Scale 0.4
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 1
		TNT1 A 0 A_Stop
		Death:
		TNT1 AA 0 A_SpawnItem("BlueFlare")
		HMGH W 2
		Stop
	}
}


	
	
actor heavyplasmaHitsProjectiles
{
    Scale 1.0
    +SHOOTABLE
	+NOBLOOD
	MONSTER
	-COUNTKILL
	Radius 6
	Height 8
	Health 2
    States
    {
    Spawn:
        TNT1 A 3
		TNT1 A 0 A_NoBlocking
        stop
	Death:
        TNT1 A 0
		TNT1 A 0 A_NoBlocking
        stop	
    }
}	

actor heavyplasmaProjectileTracerTrail
{
    Scale 1.0
    RenderStyle Add
    Alpha 0.9
    +NOINTERACTION
    +CLIENTSIDEONLY
    States
    {
    Spawn:
        HPLP A 2 BRIGHT
        stop
    }
}


actor heavyplasmaProjectileHit
{
    Scale 2.1
    RenderStyle Add
    Alpha 0.7
	+MISSILE
    Speed 2
	+NOGRAVITY
	+DOOMBOUNCE
    +CLIENTSIDEONLY
	Radius 1
	Height 1
    States
    {
    Spawn:
	TNT1 A 0
	Goto Death
	Death:
        HPLP BCDEF 3 BRIGHT A_SpawnItem("BlueFlareSmall")
        stop
    }
}



actor heavyplasmaProjectileTracerTrail2: heavyplasmaProjectileTracerTrail {    Alpha 0.85 }
actor heavyplasmaProjectileTracerTrail3: heavyplasmaProjectileTracerTrail {    Alpha 0.80 }
actor heavyplasmaProjectileTracerTrail4: heavyplasmaProjectileTracerTrail {    Alpha 0.75 }
actor heavyplasmaProjectileTracerTrail5: heavyplasmaProjectileTracerTrail {    Alpha 0.70 }
actor heavyplasmaProjectileTracerTrail6: heavyplasmaProjectileTracerTrail {    Alpha 0.65 }
actor heavyplasmaProjectileTracerTrail7: heavyplasmaProjectileTracerTrail {    Alpha 0.60 }
actor heavyplasmaProjectileTracerTrail8: heavyplasmaProjectileTracerTrail {    Alpha 0.55 }
actor heavyplasmaProjectileTracerTrail9: heavyplasmaProjectileTracerTrail {    Alpha 0.50 }
actor heavyplasmaProjectileTracerTrail10: heavyplasmaProjectileTracerTrail {    Alpha 0.45 }
actor heavyplasmaProjectileTracerTrail11: heavyplasmaProjectileTracerTrail {    Alpha 0.40 }
actor heavyplasmaProjectileTracerTrail12: heavyplasmaProjectileTracerTrail {    Alpha 0.35 }
actor heavyplasmaProjectileTracerTrail13: heavyplasmaProjectileTracerTrail {    Alpha 0.30 }
actor heavyplasmaProjectileTracerTrail14: heavyplasmaProjectileTracerTrail {    Alpha 0.25 }
actor heavyplasmaProjectileTracerTrail15: heavyplasmaProjectileTracerTrail {    Alpha 0.20 }
actor heavyplasmaProjectileTracerTrail16: heavyplasmaProjectileTracerTrail {    Alpha 0.15 }
actor heavyplasmaProjectileTracerTrail17: heavyplasmaProjectileTracerTrail {    Alpha 0.10 }
actor heavyplasmaProjectileTracerTrail18: heavyplasmaProjectileTracerTrail {    Alpha 0.05 }
