actor CamRL : Weapon
{
  Weapon.AmmoUse 1 
  Weapon.AmmoGive1 0
  Weapon.AmmoGive2 2
  Weapon.AmmoType1 "CamRocketPack" 
  Weapon.AmmoType2 "CamRocketAmmo"
  Obituary "%o was blown up by %k."
  Inventory.RestrictedTo "CameronClass"
  +AMMO_OPTIONAL
  +WEAPON.NOALERT //Made so the alt fire doesn't alert monsters
  Inventory.Pickupmessage "$GOTLAUNCHER"
  Tag "Napalm Rocket Launcher"
  States
  {    
  Spawn:
    CMSW A -1
    Stop
  Ready:
    CMIS A 1 A_WeaponReady(WRF_ALLOWRELOAD)
    loop
  Deselect:
    CMIS A 1 A_Lower
	TNT1 A 0 A_Lower
	TNT1 A 0 A_Lower
    loop
  Select:
    CMIS A 1 A_Raise
	TNT1 A 0 A_Raise
	TNT1 A 0 A_Raise
    loop
  Fire:    
	TNT1 A 0 A_JumpIfNoAmmo("Empty")
    CMIS B 0 A_AlertMonsters 
    CMIS B 3 A_GunFlash
	CMIS A 0 A_Recoil (2)
    CMIS C 3 A_FireCustomMissile ("CamRocket", 0, 1, 4, -3, 0)
    CMIS D 3 
    CMIS E 5
    CMIS F 5 
    CMIS A 0 A_ReFire
    goto Ready
  Empty:
    CMIS A 0
	Goto Reload
  Reload:
	CMIS A 0 A_JumpIfInventory("CamRocketPack", 5, "Ready") //Have full ammo? Go to ready!
	CMIS A 0 A_JumpIfInventory("CamRocketAmmo", 1, "ReloadStart")
	CMIS A 1 A_WeaponReady(WRF_NOFIRE)
	Goto Ready
  ReloadStart:
    CMIS A 6
    CMIS GH 6
	Goto ReloadWork
  ReloadWork:
	CMIS H 0 A_TakeInventory("CamRocketAmmo",1)
    CMIS H 0 A_GiveInventory("CamRocketPack",1)
	CMIS H 0 A_JumpIfInventory("CamRocketPack",5,"ReloadFinish")
    CMIS H 0 A_JumpifInventory("CamRocketAmmo",1,"ReloadWork") 
  ReloadFinish:
    CMIS H 0 A_PlayWeaponSound("Weapons/camrlrld")
    CMIS I 6
    CMIS J 10
	CMIS K 6
	Goto Ready
  Flash:
    CMIF A 3 bright A_Light2
    CMIF B 3 bright A_Light1
    CMIF C 3 bright A_Light2
    CMIF D 3 bright A_Light0
    stop
  }
}

actor CamRocketPack : Ammo
{
	+IGNORESKILL // Make sure you add this so you don't get double ammo on lower difficulties
     Inventory.MaxAmount 5
}

ACTOR CamRocketAmmo : Ammo
{
  Inventory.PickupMessage "$GOTROCKET"
  Inventory.Amount 1
  Inventory.MaxAmount 50
  Ammo.BackpackAmount 1
  Ammo.BackpackMaxAmount 100
  Inventory.Icon "ROCKA0"
  States
  {
  Spawn:
    CROK A -1
    Stop
  }
}

ACTOR CamRocket
{
  Radius 11
  Height 8
  Speed 25
  Damage 20
  Projectile
  +RANDOMIZE
  +DEHEXPLOSION
  +ROCKETTRAIL
  +GRENADETRAIL
  +FORCERADIUSDMG
  +POISONALWAYS
  +ADDITIVEPOISONDAMAGE
  +ADDITIVEPOISONDURATION
  Obituary "%o suffered major burns from %k's napalm rocket."
  DamageType "Fire"
  PoisonDamageType "Fire"
  PoisonDamage 20,20,20
  Species "Player"
  SeeSound "weapons/camrlfire"
  DeathSound "weapons/camrlexp"
  States
  {
  Spawn:
    CMSL A 1 Bright
    Loop
  Death:
    TNT1 A 0 Bright A_Explode(150,150)
    TNT1 A 0 Bright A_SpawnItemEx ("CamExplosion", 0, 0, 0, 0, 0, 0, 0, 0)
    TNT1 A -1
    Stop
  }
}

actor CamExplosion
{
  Renderstyle Add
  Alpha 1
  Damage 0
  PROJECTILE
  +RANDOMIZE
  states
  {
  Spawn:
    MISL B 0 Bright
    MISL B 0 Bright 
    MISL B 8 Bright A_PlaySoundEx ("weapons/camrlexp", "Body")
    MISL C 6 Bright 
    MISL D 4 Bright
    MISL E 3 Bright
    MISL F 3 Bright
    stop
  }
}