actor NanoMagnum : Weapon
{
  Weapon.SelectionOrder 9997
  Weapon.AmmoUse 1
  Weapon.AmmoGive 20
  Weapon.AmmoType "Clip"
  Tag "Magnum"
  Inventory.RestrictedTo "MorseClass"
  Obituary  "%o was blasted apart by %k's Magnum."
  States
  {
  Ready:
	NAPL A 1 A_WeaponReady
    Loop
  Deselect:
	NAPL A 1 A_Lower
	TNT1 A 0 A_Lower
	TNT1 A 0 A_Lower
	Loop
  Select:
	NAPL A 1 A_Raise
	TNT1 A 0 A_Raise
	TNT1 A 0 A_Raise
    Loop
  Fire:
    NAPL A 4
	NAPL A 0 bright A_PlaySound("weapons/magnumfire")
    NAPL B 5 bright A_FireBullets(0.5,0.5,1,35,"NanoPuff",1)
    NAPL C 1 bright A_SpawnItemEx("PisCaseSpawn",30,0,29,0,0,0,0,128)
	NAPL D 1
	NAPL E 1
	NAPL F 1
	NAPL G 1
	NAPL H 1 A_ReFire
    Goto Ready
  Spawn:
    PIST A -1
    Stop
  }
}

actor NanoPuff
{
  +NOBLOCKMAP
  +NOGRAVITY
  +RANDOMIZE
  +NOTELEPORT
  RenderStyle Add
  Alpha 0.5
  Scale 0.25
  Mass 5
  SeeSound "puff/ric"
  States
  {
  Spawn:
    SPKO B 0 bright A_Jump(128,6)
	SPKO B 0 bright A_PlaySound("puff/ric")
	SPKO B 0 bright A_SpawnDebris("NanoSpark")
	SPKO B 2 bright A_SetTranslucent(0.75,1)
	SPKO B 1 bright A_SetTranslucent(0.5,1)
	SPKO B 1 bright A_SetTranslucent(0.25,1)
	Stop
	SPKO D 0 bright A_PlaySound("puff/ric")
	SPKO D 0 bright A_SpawnDebris("NanoSpark")
	SPKO D 2 bright A_SetTranslucent(0.75,1)
	SPKO D 1 bright A_SetTranslucent(0.5,1)
	SPKO D 1 bright A_SetTranslucent(0.25,1)
	Stop
  }
}

ACTOR NanoSpark
{
	Health 8
	radius 3
	height 6
	speed .1
	RenderStyle ADD
	Alpha		1
	Scale		0.05
	Mass		0
	+missile
	+doombounce
	+FLOORCLIP
	+DONTSPLASH
	+NOTELEPORT
	States
	{
		SPKO A 2 Bright A_Jump(128,19)
		SPKO A 2 Bright A_SetTranslucent(.9,1)
		SPKO A 2 Bright A_SetTranslucent(.85,1)
		SPKO A 2 Bright A_SetTranslucent(.8,1)
		SPKO A 2 Bright A_SetTranslucent(.75,1)
		SPKO A 2 Bright A_SetTranslucent(.7,1)
		SPKO A 2 Bright A_SetTranslucent(.65,1)
		SPKO A 2 Bright A_SetTranslucent(.6,1)
		SPKO A 2 Bright A_SetTranslucent(.55,1)
		SPKO A 2 Bright A_SetTranslucent(.5,1)
		SPKO A 2 Bright A_SetTranslucent(.45,1)
		SPKO A 2 Bright A_SetTranslucent(.4,1)
		SPKO A 2 Bright A_SetTranslucent(.35,1)
		SPKO A 2 Bright A_SetTranslucent(.3,1)
		SPKO A 2 Bright A_SetTranslucent(.25,1)
		SPKO A 2 Bright A_SetTranslucent(.2,1)
		SPKO A 2 Bright A_SetTranslucent(.15,1)
		SPKO A 2 Bright A_SetTranslucent(.1,1)
		SPKO A 2 Bright A_SetTranslucent(.05,1)
		Stop
		SPKO C 2 Bright
		SPKO C 2 Bright A_SetTranslucent(.9,1)
		SPKO C 2 Bright A_SetTranslucent(.85,1)
		SPKO C 2 Bright A_SetTranslucent(.8,1)
		SPKO C 2 Bright A_SetTranslucent(.75,1)
		SPKO C 2 Bright A_SetTranslucent(.7,1)
		SPKO C 2 Bright A_SetTranslucent(.65,1)
		SPKO C 2 Bright A_SetTranslucent(.6,1)
		SPKO C 2 Bright A_SetTranslucent(.55,1)
		SPKO C 2 Bright A_SetTranslucent(.5,1)
		SPKO C 2 Bright A_SetTranslucent(.45,1)
		SPKO C 2 Bright A_SetTranslucent(.4,1)
		SPKO C 2 Bright A_SetTranslucent(.35,1)
		SPKO C 2 Bright A_SetTranslucent(.3,1)
		SPKO C 2 Bright A_SetTranslucent(.25,1)
		SPKO C 2 Bright A_SetTranslucent(.2,1)
		SPKO C 2 Bright A_SetTranslucent(.15,1)
		SPKO C 2 Bright A_SetTranslucent(.1,1)
		SPKO C 2 Bright A_SetTranslucent(.05,1)
		Stop
	}
}

ACTOR PisCaseSpawn
{
Speed 20
PROJECTILE
+NOCLIP
States
{
Spawn:
TNT1 AA 1 A_SpawnItemEx("PistolCasing", -7, 0, 0, -4, 0, Random(2, 4), Random(85, 95), 128)
Stop
}
}

ACTOR PistolCasing
{
Height 8
Radius 6
Speed 4
Scale 0.45
BounceFactor 0.4
Mass 1
PROJECTILE
+DOOMBOUNCE
- NOGRAVITY
- NOBLOCKMAP
Seesound "weapons/case1"
States
{
Spawn:
CAS2 A 0 A_Playsound("NULL")
CAS2 ABCD 2
Goto Spawn+1
Death:
CAS2 A 0 A_Jump(64,4)
CAS2 A 0 A_Jump(85,4)
CAS2 A 0 A_Jump(128,4)
CAS2 A 350
Stop
CAS2 B 350
Stop
CAS2 C 350
Stop
CAS2 D 350
Stop
}
}
