/*
CREDITS:
Ramjet/FireAdd - Tremulous (Black Legion Development)
Sound mix - Those are modified ones from NeoCore. Ripped by Sangelothi, mixed with a bit of sounds from Bulletstorm. (People can Fly, Epic Games)
Gun graphics source - Bulletstorm (People can Fly, Epic Games)
Gun graphics & sounds rip - Folks from AEoD, you save the day again, and I owe you huge thanks for that!
Ammo & Weapon Pickups - Zrrion the Insect
*/

ACTOR Ramjet : Weapon 24539
{
   //$Category Weapons
   //$Title Ramjet
   //$Sprite RAMGX0
   Inventory.PickupSound "misc/w_pkup"
   Inventory.PickupMessage "Obtained a ''Ramjet'' dark matter mach VII rifle! Sniping and camping has never been so much fun! (7)\nWant to get yourself off the remote rifle? Press reload button!"
   Obituary "%k didn't need no steenkin' aim to kill %o."
   Weapon.UpSound "Ramjet/Up" 
   Weapon.SelectionOrder 2
   Weapon.AmmoGive 20
   Weapon.AmmoType "VoidAmmo"
   Weapon.AmmoUse 5
   Weapon.AmmoType2 "VoidAmmo"
   Weapon.AmmoUse2 50
   Weapon.Kickback 50
   Weapon.SlotNumber 7
   +NOAUTOAIM
   +NOAUTOFIRE
   +NOALERT
   States
   {
   Spawn:
      RAMG X -1
      Stop
   Ready:
      RAMG A 0 A_JumpIfInventory("Zoomed",1,"ZoomedReady")
      RAMG A 1 A_WeaponReady
	  TNT1 A 0 A_JumpIfInventory("RO_GotoZoom", 1, "Zoom")
      Loop
   Deselect:
      RAMG A 0 A_JumpIfInventory("Zoomed",1,"ZoomedDeselect")
      RAMG A 0 A_ZoomFactor(1)
      RAMG A 0 A_SetTranslucent(1,0)
      RAMG A 0 A_StopSoundEx("SoundSlot5")
      RAMG A 1 A_Lower
      RAMG A 0 A_Lower
      Loop
   Select:
      RAMG A 1 A_Raise
      RAMG A 0 A_Raise
      Loop
   Fire:
      RAMF A 0 A_JumpIfInventory("Zoomed",1,"ZoomedFire")
      RAMF A 0 A_PlaySound("Ramjet/Fire",1)
      RAMF A 0 A_PlaySound("Ramjet/Add",5,0.6)
      RAMF A 0 A_SetBlend("Purple",0.1,12)
      RAMF A 0 A_Recoil(28)
      RAMF A 0 A_AlertMonsters
      RAMF A 0 A_Quake (4, 12, 0, 3, none)
      RAMF A 0 A_FireCustomMissile("RamjetBullet",0,1,24-12,0)
      RAMF A 0 A_FireCustomMissile("RamjetTrailer1",0,0,24-12,-18)
      RAMF A 0 A_FireCustomMissile("RamjetTrailer2",0,0,24-12,14)
      RAMF A 0 A_FireCustomMissile("RamjetTrailer3",0,0,8-12,-2)
      RAMF A 0 A_FireCustomMissile("RamjetTrailer4",0,0,40-12,-2)
      RAMF A 0 A_SetPitch(pitch-8.5)
      RAMF A 0 A_SetAngle(angle-6.5)
      RAMF A 1 Bright Offset(0,32) A_ZoomFactor(0.995)
      RAMF A 1 Bright Offset(10,38) A_ZoomFactor(0.99) //Sheesh.
      RAMF B 1 Bright Offset(-4,105) A_ZoomFactor(0.975)
      RAMF B 1 Bright Offset(-3,88) A_ZoomFactor(0.96)
      RAMF B 1 Bright Offset(-2,68) A_ZoomFactor(0.95)
      RAMF B 1 Bright Offset(-1,51) A_ZoomFactor(0.945)
      RAMF B 1 Bright Offset(0,32) A_ZoomFactor(0.94)
      RAMF C 1 Bright Offset(10,23) A_ZoomFactor(0.9325)
      RAMF C 1 Bright Offset(3,27) A_ZoomFactor(0.93)
      RAMF C 1 Bright Offset(0,32) A_ZoomFactor(0.9325)
      RAMF C 1 Bright Offset(-1,40) A_ZoomFactor(0.935)
      RAMF C 0 A_PlaySound("Ramjet/Reload",6,0.4)
      RAMF D 1 Bright Offset(-1,44) A_ZoomFactor(0.94)
      RAMF D 1 Bright Offset(-1,27) A_ZoomFactor(0.945)
      RAMF D 1 Bright Offset(0,32) A_ZoomFactor(0.95)
      RAMF D 1 Bright Offset(1,38) A_ZoomFactor(0.955)
      RAMF E 1 Bright Offset(-1,26) A_ZoomFactor(0.96)
      RAMF E 1 Bright Offset(0,32) A_ZoomFactor(0.965)
      RAMF E 1 Bright Offset(-3,30) A_ZoomFactor(0.97)
      RAMF E 1 Bright Offset(1,30) A_ZoomFactor(0.975)
      RAMF F 1 Bright Offset(0,32) A_ZoomFactor(0.98)
      RAMF F 1 Bright Offset(5,26) A_ZoomFactor(0.985)
      RAMF G 1 Offset(0,32) A_ZoomFactor(0.9875)
      RAMF G 1 Offset(-4,30) A_ZoomFactor(0.99)
      RAMF H 1 Offset(0,32) A_ZoomFactor(0.9925)
      RAMF H 1 Offset(-4,30) A_ZoomFactor(0.995)
      RAMF I 1 Offset(0,32) A_ZoomFactor(0.9975)
      RAMF I 1 Offset(-2,38) A_ZoomFactor(1)
      RAMF I 1 Offset(-4,44)
      RAMF I 1 Offset(-6,50)
      RAMF J 1 Offset(0,32)
      RAMF J 1 Offset(-2,38)
      RAMF J 1 Offset(-4,44)
      RAMF J 1 Offset(-2,50)
      RAMG A 1 Offset(-6,38)
      RAMG A 1 Offset(-4,36)
      RAMG A 1 Offset(-2,34)
      RAMG A 1 Offset(-1,33)
      RAMG A 3 Offset(0,32)
      Goto Ready
   Zoom: //ZoomIn
      RAMZ A 0 A_JumpIfInventory("Zoomed",1,"UnZoom")

      RAMZ A 0 A_GiveInventory("Zoomed",1)
      RAMZ A 0 A_PlaySound("Ramjet/Zoom/In",6,0.5)

      RAMG A 1 A_SetBlend("Black",0.1,3)
      RAMG A 1 A_SetBlend("Black",0.15,3)
      RAMG A 1 A_SetBlend("Black",0.25,3)
      RAMG A 1 A_SetBlend("Black",0.5,3)
      RAMG A 1 A_SetBlend("Black",0.75,3)
      RAMG A 1 A_SetBlend("Black",0.9,3)

      RAMG AAA 1 A_SetBlend("Black",1,11)
      
      RAMZ A 0 A_ZoomFactor(3.00)
      RAMZ A 0 A_SetTranslucent(0.98,0)
      RAMZ A 1 A_SetBlend("Black",0.9,3)
      
      RAMZ A 0 A_SetTranslucent(0.96,0)
      RAMZ A 1 A_SetBlend("Black",0.85,3)
      
      RAMZ A 0 A_SetTranslucent(0.84,0)
      RAMZ A 1 A_SetBlend("Black",0.75,3)
      
      RAMZ A 0 A_SetTranslucent(0.82,0)
      RAMZ A 1 A_SetBlend("Black",0.65,3)
      
      RAMZ A 0 A_SetTranslucent(0.81,0)
      RAMZ A 1 A_SetBlend("Black",0.55,3)
      
      RAMZ A 0 A_SetTranslucent(0.8,0)
      RAMZ A 1 A_SetBlend("Black",0.45,3)
      
      RAMZ A 1 A_SetBlend("Black",0.4,3)
      RAMZ A 1 A_SetBlend("Black",0.36,3)
      RAMZ A 1 A_SetBlend("Black",0.34,3)
      RAMZ A 1 A_SetBlend("Black",0.33,3)
      RAMZ A 1 A_SetBlend("Black",0.32,3)
      RAMZ A 1 A_SetBlend("Black",0.31,3)
      RAMZ AAAAA 1 A_SetBlend("Blue",0.1,3)
      Goto ZoomedReady
   ZoomedReady:
      RAMZ A 0 A_SetBlend("Blue",0.1,3)
	  TNT1 A 0 A_JumpIfInventory("RO_GotoZoom", 1, "Zoom")
      RAMZ A 1 A_WeaponReady(WRF_NOBOB)
      Goto Ready
   UnZoom:
      RAMZ A 0 A_PlaySound("Ramjet/Zoom/Out",6)
      RAMZ A 0 A_TakeInventory("Zoomed",999)

      RAMZ A 0 A_SetTranslucent(0.9,0)
      RAMZ A 1 A_SetBlend("Black",0.35,3) 
      
      RAMZ A 0 A_SetTranslucent(0.92,0)
      RAMZ A 1 A_SetBlend("Black",0.4,3)
      
      RAMZ A 0 A_SetTranslucent(0.94,0)
      RAMZ A 1 A_SetBlend("Black",0.45,3)
      RAMZ A 0 A_ZoomFactor(1.00)
      
      RAMZ A 0 A_SetTranslucent(0.96,0)
      RAMZ A 1 A_SetBlend("Black",0.6,3)
      
      RAMZ A 0 A_SetTranslucent(0.98,0)
      RAMZ A 1 A_SetBlend("Black",0.75,3)
      
      RAMZ A 0 A_SetTranslucent(1,0)
      RAMZ A 1 A_SetBlend("Black",0.9,3)
      
      RAMG A 12 A_SetBlend("Black",1.1,18)
      Goto Ready
  ZoomedDeselect:
      RAMZ A 0 A_PlaySound("Ramjet/Zoom/Out",6)
      RAMZ A 0 A_TakeInventory("Zoomed",999)

      RAMZ A 0 A_SetTranslucent(0.9,0)
      RAMZ A 1 A_SetBlend("Black",0.35,3) 
      
      RAMZ A 0 A_SetTranslucent(0.92,0)
      RAMZ A 1 A_SetBlend("Black",0.4,3)
      
      RAMZ A 0 A_SetTranslucent(0.94,0)
      RAMZ A 1 A_SetBlend("Black",0.45,3)
      RAMZ A 0 A_ZoomFactor(1.00)
      
      RAMZ A 0 A_SetTranslucent(0.96,0)
      RAMZ A 1 A_SetBlend("Black",0.6,3)
      
      RAMZ A 0 A_SetTranslucent(0.98,0)
      RAMZ A 1 A_SetBlend("Black",0.75,3)
      
      RAMZ A 0 A_SetTranslucent(1,0)
      RAMZ A 1 A_SetBlend("Black",0.9,3)
      
      RAMG A 12 A_SetBlend("Black",1.0,18)
  ZoomedDeselectMain:
      RAMG A 1 A_Lower
      RAMG A 0 A_Lower
      Loop

   ZoomedFire:
      RAMZ B 0 A_SetBlend("Purple",0.4,20)
      RAMF A 0 A_PlaySound("Ramjet/Fire",1)
      RAMF A 0 A_PlaySound("Ramjet/Add",5,0.6)
      RAMF A 0 A_Recoil(8)
      RAMF A 0 A_AlertMonsters
      RAMF A 0 A_Quake (8, 12, 0, 3, none)
      RAMF A 0 A_FireCustomMissile("RamjetBullet",0,1,24-24,0)
      RAMF A 0 A_FireCustomMissile("RamjetTrailer1",0,0,24-24,-18+2)
      RAMF A 0 A_FireCustomMissile("RamjetTrailer2",0,0,24-24,14+2)
      RAMF A 0 A_FireCustomMissile("RamjetTrailer3",0,0,8-24,-2+2)
      RAMF A 0 A_FireCustomMissile("RamjetTrailer4",0,0,40-24,-2+2)
      RAMZ B 1 A_SetPitch(pitch-0.5)
      RAMZ B 1 A_SetPitch(pitch-1.0)
      RAMZ B 1 A_SetPitch(pitch-0.5)
      RAMZ B 1 A_SetPitch(pitch-0.25)
      RAMZ B 1 A_SetPitch(pitch-0.15)
      RAMZ B 1 A_SetPitch(pitch-0.05)
      RAMZ B 1 A_SetPitch(pitch-0.025)
      RAMZ B 1
      RAMZ B 1 A_SetPitch(pitch+0.025)
      RAMZ B 1 A_SetPitch(pitch+0.05)
      RAMZ B 1 A_SetPitch(pitch+0.15)
      RAMF B 0 A_PlaySound("Ramjet/Reload",6,0.4)
      RAMZ B 1 A_SetPitch(pitch+0.25)
      RAMZ B 1 A_ZoomFactor(2.99)
      RAMZ B 0 A_SetPitch(pitch+0.5)
      RAMZ B 1 A_ZoomFactor(2.95) //14
      RAMZ B 0 A_SetPitch(pitch+0.5)
      RAMZ B 1 A_ZoomFactor(2.92)
      RAMZ B 0 A_SetPitch(pitch+0.5)
      RAMZ B 0 A_SetBlend("Blue",0.1,3)
      RAMZ B 1 A_ZoomFactor(2.9)
      RAMZ B 0 A_SetPitch(pitch+0.25)
      RAMZ B 0 A_SetBlend("Blue",0.1,3)
      RAMZ B 1 A_ZoomFactor(2.88)
      RAMZ B 0 A_SetPitch(pitch+0.25)
      RAMZ B 0 A_SetBlend("Blue",0.1,3)
      RAMZ B 1 A_ZoomFactor(2.9)
      RAMZ B 0 A_SetBlend("Blue",0.1,3)
      RAMZ B 1 A_ZoomFactor(2.92)
      RAMZ B 0 A_SetBlend("Blue",0.1,3)
      RAMZ B 1 A_ZoomFactor(2.95)
      RAMZ B 0 A_SetBlend("Blue",0.1,3)
      RAMZ B 1 A_ZoomFactor(3)
      RAMZ B 0 A_SetBlend("Blue",0.1,3)
      RAMZ BBBBBBBBBBBBBBBBBBB 1 A_SetBlend("Blue",0.1,3)
      Goto Ready
	  AltFire:
      RAMF A 0 A_AlertMonsters
      RAMF A 0 A_FireCustomMissile("Ramjet_RemoteRifle",0,1,24-12,0)
	  RAMG A 15
	  Goto Ready
   }
}

Actor RamjetBullet : FastProjectile
{
  Radius 10
  Height 8
  Speed 100
  Damage 220
  PROJECTILE
  +RIPPER
  MissileType "RamjetTrailSpawnerMain"
  States
  {
  Spawn:
    TNT1 A 1
    Loop
  Death:
    TNT1 A 0 A_PlaySound("Weapons/MinibeliskDead",5)
    TNT1 A 0 A_Explode(4000,64,0)
    TNT1 A 0 A_Quake (4, 27, 0, 256, none)
    TNT1 A 0 A_Quake (1, 27, 0, 384, none)
    TNT1 A 0 A_SpawnItemEx("BorschChunkWaver")
    TNT1 A 0 A_SpawnItemEx("RamjetImpactFlareSpawner")
    TNT1 AAAAAAAAA 0 A_SpawnItemEx("BorschSmokeTrailNormal",random(6,-6),random(6,-6),random(6,-6),frandom(1.0,0.05),frandom(1.0,0.05),frandom(1.0,0.05),random(0,359))
    TNT1 AAAAAAAAAAAAAAA 0 A_SpawnItemEx("BorschSmokeTrailDark",random(6,-6),random(6,-6),random(6,-6),frandom(1.0,0.05),frandom(1.0,0.05),frandom(1.0,0.05),random(0,359))
    TNT1 A 0 A_SpawnItemEx("BorschChunkWaver")
    VORX ABCD 1
    TNT1 AAAAAAAA 0 A_SpawnItemEx("BorschSmokeTrailNormal",random(6,-6),random(6,-6),random(6,-6),frandom(1.0,0.05),frandom(1.0,0.05),frandom(1.0,0.05),random(0,359))
    TNT1 AAAAAAAAAAAA 0 A_SpawnItemEx("BorschSmokeTrailDark",random(6,-6),random(6,-6),random(6,-6),frandom(1.0,0.05),frandom(1.0,0.05),frandom(1.0,0.05),random(0,359))
    TNT1 A 0 A_SpawnItemEx("BorschChunkWaver")
    VORX EFGH 1
    TNT1 AAAAAA 0 A_SpawnItemEx("BorschSmokeTrailNormal",random(6,-6),random(6,-6),random(6,-6),frandom(1.0,0.05),frandom(1.0,0.05),frandom(1.0,0.05),random(0,359))
    TNT1 AAAAAAAAA 0 A_SpawnItemEx("BorschSmokeTrailDark",random(6,-6),random(6,-6),random(6,-6),frandom(1.0,0.05),frandom(1.0,0.05),frandom(1.0,0.05),random(0,359))
    TNT1 A 0 A_SpawnItemEx("BorschChunkWaver")
    VORX IJKL 1
    TNT1 AAAA 0 A_SpawnItemEx("BorschSmokeTrailNormal",random(6,-6),random(6,-6),random(6,-6),frandom(1.0,0.05),frandom(1.0,0.05),frandom(1.0,0.05),random(0,359))
    TNT1 AAAAAA 0 A_SpawnItemEx("BorschSmokeTrailDark",random(6,-6),random(6,-6),random(6,-6),frandom(1.0,0.05),frandom(1.0,0.05),frandom(1.0,0.05),random(0,359))
    TNT1 A 0 A_SpawnItemEx("BorschChunkWaver")
    TNT1 B 30
    Stop
  }
}

Actor RamjetImpactFlareSpawner
{
  +NOINTERACTION
  +NOGRAVITY
  +CLIENTSIDEONLY
  States
  {
  Spawn:
  TNT1 A 0
  TNT1 AAAA 3 A_SpawnItemEx("RamjetImpactFlare")
  Stop
  }
}

Actor RamjetImpactFlare
{
  +NOINTERACTION
  +NOTARGET
  +CLIENTSIDEONLY
  Renderstyle Shaded
  Scale 0.2
  States
  {
  Spawn:
  TNT1 A 0
  TNT1 A 0 //A_SetScale(ScaleX+0.03,ScaleY+0.03)
  RAMD B 1 A_FadeOut(0.03)
  Loop
  }
}

Actor RamjetTrailSpawnerMain
{
  +NOINTERACTION
  +NOGRAVITY
  +CLIENTSIDEONLY
  States
  {
  Spawn:
  TNT1 A 0
  TNT1 A 0 A_SpawnItemEx("RamjetRingTrail")
  TNT1 A 1 A_SpawnItemEx("RamjetTrailMain")
  Stop
  }
}

Actor RamjetTrailMain
{
  +NOINTERACTION
  +NOTARGET
  +CLIENTSIDEONLY
  Renderstyle Shaded
  Scale 0.02
  States
  {
  Spawn:
  TNT1 A 0
  TNT1 A 0 //A_SetScale(ScaleX+0.001,ScaleY+0.001)
  RAMD B 1 A_FadeOut(0.06)
  Loop
  }
}
  
Actor RamjetRingTrail
{
  +NOINTERACTION
  +NOTARGET
  Renderstyle Stencil
  StencilColor Black
  +CLIENTSIDEONLY
  Scale 0.02
  States
  {
  Spawn:
  TNT1 A 0
  TNT1 A 0 //A_SetScale(ScaleX+0.01,ScaleY+0.01)
  VSHK A 1 A_FadeOut(0.06)
  TNT1 A 0 A_JumpIf(Alpha<=0.6,"ScaleDown")
  Loop
  ScaleDown:
  TNT1 A 0
  TNT1 A 0 //A_SetScale(ScaleX-0.008,ScaleY-0.008)
  VSHK A 1 A_FadeOut(0.06)
  Loop
  }
}

Actor RamjetTrailer1 : FastProjectile
{
  Speed 100
  Projectile
  +NOCLIP
  -ACTIVATEIMPACT
  +CLIENTSIDEONLY
  WeaveIndexXY 0
  WeaveIndexZ 48
  MissileType "RamjetTrailSpawner"
  States
  {
  Spawn:
    TNT1 AA 0 A_Weave(1,1,2,2)
    TNT1 A 1
    Loop
  }
}

Actor RamjetTrailer2 : RamjetTrailer1
{
  WeaveIndexXY 32
  WeaveIndexZ 16
}

Actor RamjetTrailer3 : RamjetTrailer1
{
  WeaveIndexXY 16
  WeaveIndexZ 0
}

Actor RamjetTrailer4 : RamjetTrailer1
{
  WeaveIndexXY 48
  WeaveIndexZ 32
}

Actor RamjetTrailSpawner
{
  +NOINTERACTION
  +CLIENTSIDEONLY
  +NOTARGET
  States
  {
  Spawn:
  TNT1 A 0
  TNT1 A 1 A_SpawnItemEx("RamjetTrail")
  Stop
  }
}

Actor RamjetTrail
{
  +NOINTERACTION
  +CLIENTSIDEONLY
  +NOTARGET
  Renderstyle Add
  Scale 0.1
  States
  {
  Spawn:
  TNT1 A 0
  VOIP ABCDEFGHIJKL 1 A_FadeOut(0.04)
  Loop
  }
}

//Alt-Fire

Actor Ramjet_RemoteRifle
{
	Var Int User_RemoteControl;
	Projectile
	// +SHOOTABLE // Uncomment the commented lines to have it destructible :o
	// +NOBLOOD
	// -NOBLOCKMAP
	// Health 6000 //come on, weapons in RO deal shifu ton of damage; this rifle needs to survive some punches!
	+ACTIVATEMCROSS
	-NOTELEPORT
	+NOBLOCKMONST
	+SKYEXPLODE
	Radius 5
	Height 10
	Gravity 0
	Speed 20
	Damage 0
	CameraHeight 10
	States
	{
		Spawn:				// Just activate the script here
			MISL AA 0 ACS_ExecuteAlways(716, 0)
		    MISL A 0 A_PlaySound("Ramjet/Remote/Start",8)
			MISL A 0 A_PlaySound("Ramjet/Remote/Flight",2,0.7,1)
			Goto Flight
		Death:				// You MUST set User_RemoteControl true here
			// MISL A 0 A_ChangeFlag("NOBLOCKMAP", false)
			// MISL A 0 A_ChangeFlag("SHOOTABLE", true)
			MISL A 0 A_SetUserVar("User_RemoteControl", true)
		Flight:				// Any point where the rifle just flies
			RAMR A 1 A_TakeInventory("RamjetRemoteDelay",1)
			Loop
		Fire:				// Player pressed fire
			MISL A 0 A_JumpIfInTargetInventory("VoidAmmo",5,1)
			Goto Flight
			MISL A 0 A_JumpIfInventory("RamjetRemoteDelay",1,"Flight")
			MISL A 0 A_GiveInventory("RamjetRemoteDelay",40)
			MISL A 0 A_TakeFromTarget("VoidAmmo",5,TIF_NOTAKEINFINITE)
			MISL A 0 A_PlaySound("Ramjet/Fire",1)
			MISL A 0 A_PlaySound("Ramjet/Add",5,0.6)
			MISL A 0 A_PlaySound("Ramjet/Reload2",6,0.4) //Adding delay inside the sound... retarded? Yes. Fixable? Propably. But both me and Keks are too tired of fixing this weapon to think of a better way.
			MISL A 0 A_AlertMonsters
			MISL A 0 A_Quake (4, 12, 0, 3, none)
			MISL A 0 A_SpawnItemEx("RamjetTrailer1", 0, 12-12, -13,
										  Cos(-Pitch) * 100, 0, Sin(-Pitch) * 100, 0,
										  SXF_TRANSFERPOINTERS)
			MISL A 0 A_SpawnItemEx("RamjetTrailer2", 0, 12-12, 19,
										  Cos(-Pitch) * 100, 0, Sin(-Pitch) * 100, 0,
										  SXF_TRANSFERPOINTERS)
			MISL A 0 A_SpawnItemEx("RamjetTrailer3", 0, -4-12, 3,
										  Cos(-Pitch) * 100, 0, Sin(-Pitch) * 100, 0,
										  SXF_TRANSFERPOINTERS)
			MISL A 0 A_SpawnItemEx("RamjetTrailer4", 0, 28-12, 3,
										  Cos(-Pitch) * 100, 0, Sin(-Pitch) * 100, 0,
										  SXF_TRANSFERPOINTERS)
			RAMR A 11 Bright A_SpawnItemEx("RamjetBullet", 0, 0, 5,
										  Cos(-Pitch) * 100, 0, Sin(-Pitch) * 100, 0,
										  SXF_TRANSFERPOINTERS)		  
			Goto Flight
		AltFire:			// Player pressed secondary fire
			MISL A 0
			Goto Flight
		Reload:				// Player pressed reload
			MISL A 0
			Goto Flight
		Zoom:				// Player pressed zoom
			MISL A 0
			Goto Flight
		Retract:				// Player pressed use
			// Player decides to retract the rifle
	//Yeah, it looks ugly, but I am too lazy to fix it, MWAHAHAHA... Sorry.
	TNT1 A 0 A_PlaySound("Ramjet/Remote/End",2,1.0)
	TNT1 A 0 A_PlaySound("Weapons/MinibeliskDead",5)
    TNT1 A 0 A_Explode(4000,64,0)
	TNT1 A 0 A_GiveToTarget("VoidAmmo",50)
    TNT1 A 0 A_Quake (4, 27, 0, 256, none)
    TNT1 A 0 A_Quake (1, 27, 0, 384, none)
    TNT1 A 0 A_SpawnItemEx("BorschChunkWaver")
    TNT1 A 0 A_SpawnItemEx("RamjetImpactFlareSpawner")
    TNT1 AAAAAAAAA 0 A_SpawnItemEx("BorschSmokeTrailNormal",random(6,-6),random(6,-6),random(6,-6),frandom(1.0,0.05),frandom(1.0,0.05),frandom(1.0,0.05),random(0,359))
    TNT1 AAAAAAAAAAAAAAA 0 A_SpawnItemEx("BorschSmokeTrailDark",random(6,-6),random(6,-6),random(6,-6),frandom(1.0,0.05),frandom(1.0,0.05),frandom(1.0,0.05),random(0,359))
    TNT1 A 0 A_SpawnItemEx("BorschChunkWaver")
    VORX ABCD 1
    TNT1 AAAAAAAA 0 A_SpawnItemEx("BorschSmokeTrailNormal",random(6,-6),random(6,-6),random(6,-6),frandom(1.0,0.05),frandom(1.0,0.05),frandom(1.0,0.05),random(0,359))
    TNT1 AAAAAAAAAAAA 0 A_SpawnItemEx("BorschSmokeTrailDark",random(6,-6),random(6,-6),random(6,-6),frandom(1.0,0.05),frandom(1.0,0.05),frandom(1.0,0.05),random(0,359))
    TNT1 A 0 A_SpawnItemEx("BorschChunkWaver")
    VORX EFGH 1
    TNT1 AAAAAA 0 A_SpawnItemEx("BorschSmokeTrailNormal",random(6,-6),random(6,-6),random(6,-6),frandom(1.0,0.05),frandom(1.0,0.05),frandom(1.0,0.05),random(0,359))
    TNT1 AAAAAAAAA 0 A_SpawnItemEx("BorschSmokeTrailDark",random(6,-6),random(6,-6),random(6,-6),frandom(1.0,0.05),frandom(1.0,0.05),frandom(1.0,0.05),random(0,359))
    TNT1 A 0 A_SpawnItemEx("BorschChunkWaver")
    VORX IJKL 1
    TNT1 AAAA 0 A_SpawnItemEx("BorschSmokeTrailNormal",random(6,-6),random(6,-6),random(6,-6),frandom(1.0,0.05),frandom(1.0,0.05),frandom(1.0,0.05),random(0,359))
    TNT1 AAAAAA 0 A_SpawnItemEx("BorschSmokeTrailDark",random(6,-6),random(6,-6),random(6,-6),frandom(1.0,0.05),frandom(1.0,0.05),frandom(1.0,0.05),random(0,359))
    TNT1 A 0 A_SpawnItemEx("BorschChunkWaver")
    TNT1 B 30
    Stop
	}
}

ACTOR RamjetRemoteDelay : Inventory { Inventory.MaxAmount 40 }