// Mini-Bomber

ACTOR MiniBomber : IDMWeapon
{
    Weapon.SelectionOrder 400
    //Weapon.PreferredSkin "MissileMarine"
    Weapon.AmmoUse 1
	Weapon.AmmoGive 6
	Weapon.AmmoType "IDMRocketAmmo"
	Inventory.PickupMessage "Mini-Bomber! (Slot 5)"
	+WEAPON.EXPLOSIVE
	+WEAPON.NOLMS
	Tag "Mini-Bomber"
	States
	{
	Spawn:
	  MMSL A -1 Bright
	  Stop
	Ready:
      MMIS A 1 A_WeaponReady
      Loop
	Deselect:
      TNT1 A 0 A_Lower
      TNT1 A 0 A_Lower
      MMIS A 1 A_Lower
      Loop
	Select:
	  TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
	Sloop:
      TNT1 A 0 A_Raise
      TNT1 A 0 A_Raise
      MMIS A 1 A_Raise
	  Loop
	Fire:
	  TNT1 A 0 A_GunFlash
	  TNT1 A 0 A_Playsound("weapons/minimf",CHAN_WEAPON)
	  TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad")
	  TNT1 A 0 A_JumpIfInventory("PowerIDMWeaponLevel2",1,"Level2")
	  MMIS B 2 Bright A_FireCustomMissile("IDMMinimissile",frandom(-2,2),1)
	  MMIS C 2 Bright
	  MMIS E 2 Bright
	  TNT1 A 0 A_Gunflash
	  TNT1 A 0 A_Playsound("weapons/minimf",CHAN_WEAPON)
	  MMIS B 2 Bright A_FireCustomMissile("IDMMinimissile",frandom(-2,2),0)
	  MMIS D 2 Bright
	  MMIS E 2 Bright
	  MMIS E 1 Bright A_Refire
	  MMIS F 3 Bright
	  MMIS A 5
	  Goto Ready
	Quad:
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	  MMIS B 2 Bright A_FireCustomMissile("ExtremeMinimissile",frandom(-2,2),1)
	  MMIS C 2 Bright
	  MMIS E 2 Bright
	  TNT1 A 0 A_Gunflash
	  TNT1 A 0 A_Playsound("weapons/minimf",CHAN_WEAPON)
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	  MMIS B 2 Bright A_FireCustomMissile("ExtremeMinimissile",frandom(-2,2),0)
	  Goto Fire+10
	Level2:
	  TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"QuadLevel2")
	  MMIS B 2 Bright A_FireCustomMissile("IDMMinimissile",frandom(-4,4),1)
	  TNT1 A 0 A_Playsound("weapons/minimf",CHAN_WEAPON)
	  MMIS C 2 Bright A_FireCustomMissile("IDMMinimissile",frandom(-4,4),0)
	  MMIS E 2 Bright
	  TNT1 A 0 A_Gunflash
	  TNT1 A 0 A_Playsound("weapons/minimf",CHAN_WEAPON)
	  MMIS B 2 Bright A_FireCustomMissile("IDMMinimissile",frandom(-4,4),0)
	  TNT1 A 0 A_Playsound("weapons/minimf",CHAN_WEAPON)
	  MMIS D 2 Bright A_FireCustomMissile("IDMMinimissile",frandom(-4,4),0)
	  Goto Fire+11
	QuadLevel2:
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	  MMIS B 2 Bright A_FireCustomMissile("ExtremeMinimissile",frandom(-4,4),1)
	  TNT1 A 0 A_Playsound("weapons/minimf",CHAN_WEAPON)
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	  MMIS C 2 Bright A_FireCustomMissile("ExtremeMinimissile",frandom(-4,4),0)
	  MMIS E 2 Bright
	  TNT1 A 0 A_Gunflash
	  TNT1 A 0 A_Playsound("weapons/minimf",CHAN_WEAPON)
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	  MMIS B 2 Bright A_FireCustomMissile("ExtremeMinimissile",frandom(-4,4),0)
	  TNT1 A 0 A_Playsound("weapons/minimf",CHAN_WEAPON)
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	  MMIS D 2 Bright A_FireCustomMissile("ExtremeMinimissile",frandom(-4,4),0)
	  Goto Fire+11
	Flash:
	  TNT1 A 3 A_Light1
	  TNT1 A 3 A_Light2
	  Goto LightDone
	}
}

ACTOR IDMMinimissile : IDMRocket
{
	Radius 6
	Height 3
	Speed 56
	Scale 0.75
	Damage (15*random(1,5))
	ProjectileKickback 50
	-ROCKETTRAIL
	SeeSound "weapons/minifly"
	DeathSound "weapons/rocklx"
	Obituary "%o was bombarded by %k's mini-missiles."
	SelfObituary "%o bombed %hself with a mini-missile."
	DamageType "Rocket"
	Decal Scorch
	Decal BigScorch
	States
	{
	Spawn:
	  MICR A 3 Bright 
	  TNT1 A 0 A_Jump(192,"SpawnLoop2","SpawnLoop3","SpawnLoop4")
	SpawnLoop:
	  MICR A 1 Bright A_Weave(frandom(1,5),frandom(1,5),frandom(1,2),frandom(0.5,1.5))
      Loop
	SpawnLoop2:
	  MICR A 1 Bright A_Weave(frandom(1,5),frandom(1,5),frandom(-2,-1),frandom(0.5,1.5))
      Loop
	SpawnLoop3:
	  MICR A 1 Bright A_Weave(frandom(1,5),frandom(1,5),frandom(1,2),frandom(-1.5,-0.5))
      Loop
	SpawnLoop4:
	  MICR A 1 Bright A_Weave(frandom(1,5),frandom(1,5),frandom(-2,-1),frandom(-1.5,-0.5))
      Loop
	Death:
	  TNT1 A 0
      MISL B 6 Bright A_Explode(100,96)
      MISL C 5 Bright
	  MISL D 4 Bright
      Stop
	}
}

ACTOR ExtremeMiniMissile : IDMMinimissile
{
	+EXTREMEDEATH
	States
	{
	XDeath:
	  TNT1 A 0 A_Playsound("misc/crit",CHAN_AUTO)
	  Goto Death
	}
}