// Meowitzer, AKA the Cataclysm Cannon
// Weapon and base projectile Decorate, sprites and sounds by TheMisterCat
// Other Decorate by Kaapeli47

Actor Meowitzer : IDMWeapon
{
	Weapon.Ammotype "IDMCatAmmo"
	Weapon.AmmoUse 1
	Weapon.Sisterweapon "MeowitzerLevel2"
	Weapon.AmmoGive 20
	Weapon.SelectionOrder 50
	Inventory.PickupMessage "Meowitzer! (Slot 7)"
	Tag "Meowitzer"
	+WEAPON.BFG
	+WEAPON.NOLMS
	States
	{
		Spawn:
		CATG A -1 Bright
		Stop
		Select:
		CCLY A 0 A_PlaySound("cataclysm/select", CHAN_WEAPON, 1.0)
		SelectLoop:
		CCLY A 1 A_Raise
		loop
		Deselect:
		CCLY A 1 A_Lower
		loop
		Ready:
		CCLY A 1 A_WeaponReady
		loop
		Fire:
		TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad")
		TNT1 A 0 A_FireCustomMissile("MeowitzerCat", random(-3, 3), 0, 0, 2, 0, random(-1, 1))
		CCLY B 2 Bright A_FireCustomMissile("MeowitzerCat", random(-3, 3), 1, 0, 2, 0, random(-1, 1))
		CCLY C 3 Bright
		TNT1 A 0 A_ReFire
		goto Ready
		Quad:
		TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
		Goto Fire+1
	}
}

ACTOR MeowitzerLevel2 : Meowitzer
{
	+POWERED_UP
	Weapon.Sisterweapon "Meowitzer"
	Weapon.Ammouse 2
	States
	{
	Fire:
	  TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad")
	  TNT1 A 0 A_FireCustomMissile("ChonkyCat", random(-8, 8), 0, 0, 2, 0, random(-1, 1))
	  CCLY B 2 Bright A_FireCustomMissile("ChonkyCat", random(-8, 8), 0, 0, 2, 0, random(-1, 1))
	  TNT1 A 0 A_FireCustomMissile("ChonkyCat", random(-8, 8), 0, 0, 2, 0, random(-1, 1))
	  CCLY B 2 Bright A_FireCustomMissile("ChonkyCat", random(-8, 8), 0, 0, 2, 0, random(-1, 1))
	  TNT1 A 0 A_FireCustomMissile("ChonkyCat", random(-8, 8), 0, 0, 2, 0, random(-1, 1))
	  CCLY B 3 Bright A_FireCustomMissile("ChonkyCat", random(-8, 8), 1, 0, 2, 0, random(-1, 1))
	  CCLY C 3 Bright
	  CCLY A 10
	  TNT1 A 0 A_Refire
	  Goto Ready
	Quad:
	  TNT1 A 0 A_Playsound("misc/qdmg",CHAN_AUTO)
	  TNT1 A 0 A_FireCustomMissile("ExtremeChonkyCat", random(-8, 8), 0, 0, 2, 0, random(-1, 1))
	  CCLY B 2 Bright A_FireCustomMissile("ExtremeChonkyCat", random(-8, 8), 0, 0, 2, 0, random(-1, 1))
	  TNT1 A 0 A_FireCustomMissile("ExtremeChonkyCat", random(-8, 8), 0, 0, 2, 0, random(-1, 1))
	  CCLY B 2 Bright A_FireCustomMissile("ExtremeChonkyCat", random(-8, 8), 0, 0, 2, 0, random(-1, 1))
	  TNT1 A 0 A_FireCustomMissile("ExtremeChonkyCat", random(-8, 8), 0, 0, 2, 0, random(-1, 1))
	  CCLY B 3 Bright A_FireCustomMissile("ExtremeChonkyCat", random(-8, 8), 1, 0, 2, 0, random(-1, 1))
	  Goto Fire+7
	}
}


Actor MeowitzerCat
{
	Damage 25
	PROJECTILE
	Speed 50
	BounceType "Doom"
	Bouncecount 4
	BounceFactor 1.0
	WallBounceFactor 1.0
	Radius 8
	Height 16
	Scale 0.125
	SeeSound "cataclysm/fire"
	DeathSound "cataclysm/boom"
	Obituary "%o was catbombed by %k's Meowitzer."
	+EXTREMEDEATH
	+SKYEXPLODE
	-NOTELEPORT
	States
	{
		Spawn:
		TNT1 A 0
		FCKK A 7 Bright A_Playsound("cataclysm/flying",CHAN_AUTO,0.7)
		FCKK BCDEFGH 7 Bright
		loop
		Death:
		TNT1 A 0
		TNT1 A 0 A_SetScale(1.0)
		TNT1 A 0 A_Playsound("weapons/rocklx",CHAN_AUTO)
		MISL B 6 Bright A_Explode(128,128,0)
		MISL C 5 Bright
		MISL D 4 Bright
		stop
	}
}

ACTOR ChonkyCat : MeowitzerCat
{
	Damage 20
	Scale 0.375
	BounceCount 4
	Speed 25
	Gravity 0.4
	-NOGRAVITY
	-BOUNCEONWALLS
	Radius 16
	Height 32
	States
	{
	Spawn:
	  FCKK A 7 Bright A_Playsound("cataclysm/flying")
	  FCKK BCDEFGHA 7 Bright
	  Loop
	Death:
	  TNT1 A 0
	  TNT1 A 0 A_SetScale(2.0)
	  TNT1 A 0 A_Explode(256,256,0)
	  MISL BBBBBBBBCCCCCCDD 1 Bright A_SpawnItemEx("MeowitzerCatChunk",0,0,0,random(10,20),random(10,20),random(5,20),random(0,359),SXF_TRANSFERPOINTERS)
	  MISL D 2 Bright
	  Stop
	}
}

ACTOR ExtremeChonkyCat : ChonkyCat
{
	States
	{
	XDeath:
	  TNT1 A 0
	  TNT1 A 0 A_Playsound("misc/crit",CHAN_AUTO)
	  Goto Death
	}
}

ACTOR MeowitzerCatChunk : MeowitzerCat
{
	BounceCount 3
	-NOGRAVITY
}