ACTOR GezzdtASMD : UWeapon
{
	Weapon.SelectionOrder 1500
	Weapon.SlotNumber 3
	Weapon.AmmoType "ASMDcore"
	Weapon.AmmoUse 1
	Weapon.AmmoGive 20
	Weapon.AmmoType2 "ASMDcore"
	Weapon.AmmoUse2 1
	Weapon.AmmoGive2 0
	Inventory.PickupMessage "You got the ASMD"
	Obituary "%k inflicted mortal damage upon %o with the ASMD."
	Tag "ASMD"
	scale 0.1
	Decal plasmascorchlower
	Inventory.Icon "1001H0"
	+WEAPON.NOAUTOAIM
	States
	{
	Select:
		TNT1 A 0 A_PlaySound("TurokRageWars/Weapons/TekCrossbowUp",6)
		ASMD C 1 Offset(67, 100)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
		ASMD C 1 Offset(54, 81)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
		ASMD C 1 Offset(32, 69)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
		ASMD C 1 Offset(22, 58)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
		ASMD C 1 Offset(10, 47)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
		ASMD B 1 Offset(7, 39)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
		ASMD B 1 Offset(2, 34)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
		ASMD C 1 A_Raise
		Goto Ready
	Deselect:
		TNT1 A 0 a_playsound ("weapons/holster", 0)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
		ASMD A 1 Offset(2, 34)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
		ASMD A 1 Offset(7, 39)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
		ASMD A 1 Offset(10, 47)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
		ASMD A 1 Offset(22, 58)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
		ASMD A 1 Offset(32, 69)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
		ASMD A 1 Offset(54, 81)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSwitch)
		ASMD A 1 Offset(67, 100)
		TNT1 A 1 A_Lower
		Wait
	Ready:
		ASMD A 1 A_Weaponready
		loop
	Fire:
		TNT1 A 0 A_Playsound("asmd/fire",7)
		TNT1 A 0 A_FireBullets(0,0,1,random(24,32),"ASMDpuff",FBF_USEAMMO|FBF_NORANDOM)
		TNT1 A 0 A_FireCustomMissile("ASMDTracer",1,0,8,-2,0,2)
		ASMD BCDEFGHIJKLMNOPQRSTU 1
		ASMD A 6
		TNT1 A 0 A_Refire
		TNT1 A 0 A_Playsound("asmd/cooldown",6)
		goto Ready
	AltFire:
		TNT1 A 0 A_Playsound("asmd/altfire",7)
		TNT1 A 0 A_FireCustomMissile("ASMDorb",1,1,6,-1,0,1)
		ASMD BEFGIJKMOQT 1
		ASMD A 4
		TNT1 A 0 A_Refire
		TNT1 A 0 A_Playsound("asmd/cooldown",6)
		goto Ready
	Spawn:
		ASMP A -1
		Stop
	}
}

ACTOR ASMDtracer
{
	Damage (0)
	Speed 25
	Radius 2
	Height 2
	PROJECTILE
	-BLOODSPLATTER
	States
	{
	Spawn:
		TNT1 A 1
	Spawnloop:
		TNT1 A 2 A_Spawnitem("ASMDTrail")
		Loop
	Death:
	Crash:
		TNT1 A 0
		Stop
	XDeath:
		TNT1 A 0
		stop
	}
}

ACTOR ASMDTrail
{
	Speed 0
	Mass 0
	+Missile
	scale 0.6
	+LOWGRAVITY
	+NOBLOCKMAP
	+NOGRAVITY
	+NOTELEPORT
	+CANNOTPUSH
	+NODAMAGETHRUST
	+FORCEXYBILLBOARD
	States
	{
	Spawn:
		TNT1 A 0 Nodelay A_Setscale(0.05,0.05)
		SRTR A 1 BRIGHT
		TNT1 A 0 A_Setscale(0.1,0.1)
		SRTR A 1 BRIGHT
		TNT1 A 0 A_Setscale(0.15,0.15)
		SRTR A 1 BRIGHT
		TNT1 A 0 A_Setscale(0.2,0.2)
		SRTR A 2 BRIGHT
		TNT1 A 0 A_Setscale(0.25,0.25)
		SRTR A 2 BRIGHT
		TNT1 A 0 A_Setscale(0.3,0.3)
		SRTR A 2 BRIGHT
		TNT1 A 0 A_Setscale(0.4,0.4)
		SRTR B 1 BRIGHT
		TNT1 A 0 A_Setscale(0.5,0.5)
		SRTR B 1 BRIGHT
		TNT1 A 0 A_Setscale(0.6,0.6)
		SRTR B 1 BRIGHT A_Fadeout(0.15)
		wait
	}
}

ACTOR ASMDorb
{
	Damage (random(35,55))
	Speed 15
	Radius 11
	Height 8
	Health 50
	damagefactor "combo", 0.1
	damagefactor "normal", 0
	painchance "combo", 255
	renderstyle add
	PROJECTILE
	+BLOODSPLATTER
	+SHOOTABLE
	+NOBLOOD
	-NOBLOCKMAP
	+FORCEXYBILLBOARD
	Scale 0.5
	Obituary "%k inflicted mortal damage upon %o with the ASMD."
	Decal "plasmascorchlower"
	alpha 0.6
	States
	{
	Spawn:
	    TNT1 A 2 NoDelay
	Spawnloop:
		ASBL ABCDEFGHIJKLMNOPQRSTU 1 bright
		Loop
	Pain.combo:
		TNT1 A 0
		TNT1 A 0 A_SpawnItem("ComboExplosion")
		stop
	Death:
	XDeath:
	Crash:
		TNT1 A 0
		TNT1 A 0 A_SpawnItemEx("ASMDcombopuff",-5)
		Stop
	}
}

Actor ComboExplosion
{
	+LOWGRAVITY
	+NOGRAVITY
	+FORCEXYBILLBOARD
	vspeed 0
	scale 1
	mass 0
	renderstyle add
	Obituary "%k inflicted mortal damage upon %o with the ASMD."
	states
		{
		Spawn:
			TNT1 A 0
			TNT1 A 0 A_SpawnItemEx("ASMDcombopuff",-5)
			TNT1 A 0 A_Explode(215,128)
			ASEX ABCDEFGHI 1 BRIGHT
			ASEX J 2 BRIGHT A_Fadeout(0.1)
			wait
		}
}

Actor ASMDpuff : Bulletpuff
{
	+LOWGRAVITY
	+PUFFONACTORS
	+FORCEXYBILLBOARD
	vspeed 0
	scale 1
	mass 0
	renderstyle add
	damagetype combo
	states
	{
		Spawn:
			TNT1 A 0 Nodelay A_Playsound("asmd/explosion",6,2,0,ATTN_NONE)
			TNT1 A 0 A_SpawnDebris("ASMDSpark",0,0.4,0.2)
			SRTR B 1 BRIGHT
			TNT1 A 0 A_Setscale(1.4,1.4)
			SRTR B 1 BRIGHT
			TNT1 A 0 A_Setscale(1.9,1.9)
			SRTR B 1 BRIGHT
			TNT1 A 0 A_Setscale(2.4,2.4)
			SRTR B 1 BRIGHT
			TNT1 A 0 A_Setscale(2.9,2.9)
			SRTR B 1 BRIGHT
			TNT1 A 0 A_Setscale(3.4,3.4)
			SRTR B 1 BRIGHT
			TNT1 A 0 A_Setscale(3.9,3.9)
			SRTR B 1 BRIGHT
			TNT1 A 0 A_Setscale(4.4,4.4)
			SRTR B 1 BRIGHT
			TNT1 A 0 A_Setscale(4.9,4.9)
			SRTR B 2 BRIGHT A_Fadeout(0.07)
			wait
	}
}

Actor ASMDcombopuff : Bulletpuff
{
	+LOWGRAVITY
	+PUFFONACTORS
	+FORCEXYBILLBOARD
	mass 0
	vspeed 0
	renderstyle add
	states
	{
		Spawn:
			TNT1 A 0 Nodelay A_Playsound("asmd/comboex",6,2,0,ATTN_NONE)
			TNT1 A 0 A_SpawnDebris("ASMDSpark",0,0.4,0.2)
			SRTR C 1 BRIGHT
			TNT1 A 0 A_Setscale(1.5,1.5)
			SRTR C 1 BRIGHT
			TNT1 A 0 A_Setscale(2.0,2.0)
			SRTR C 1 BRIGHT
			TNT1 A 0 A_Setscale(2.5,2.5)
			SRTR C 1 BRIGHT
			TNT1 A 0 A_Setscale(3.0,3.0)
			SRTR C 1 BRIGHT
			TNT1 A 0 A_Setscale(3.5,3.5)
			SRTR C 1 BRIGHT
			TNT1 A 0 A_Setscale(4.0,4.0)
			SRTR C 1 BRIGHT
			TNT1 A 0 A_Setscale(4.5,4.5)
			SRTR C 1 BRIGHT
			TNT1 A 0 A_Setscale(5.0,5.0)
			SRTR C 2 BRIGHT A_Fadeout(0.09)
			wait
	}
}

ACTOR ASMDSpark
{
	Health 20
	radius 5
	height 5
	speed 1
	Alpha 0.50
	Scale 0.1
	Mass 0
	+missile
	+LOWGRAVITY
	+FLOORCLIP
	+DONTSPLASH
	+NOTELEPORT
	+FORCEXYBILLBOARD
	States
	{
		spawn:
			SPRK CCCBBBAAA 1 BRIGHT A_SetTranslucent(.8,1)
			SPRK CCCBBBAAA 1 BRIGHT A_SetTranslucent(.5,1)
			SPRK CCCBBBAAA 1 BRIGHT A_SetTranslucent(.3,1)
			SPRK CCCBBBAAA 1 BRIGHT A_SetTranslucent(.1,1)
			Stop
	}
}