actor morningstar : weapon
{
	Weapon.SelectionOrder 800
	Inventory.RestrictedTo "DoomSlayer"
	Tag "Mourning Star"
	states
	{
	spawn:
		SHOT A 1
		loop
	select:
		TNT1 A 0
		TNT1 A 0 a_playsound ("doomslayer/shotgunup")
	draw:
		MSFI A 1 a_raise
		TNT1 A 0 a_giveinventory ("UsingSlayerGun",1)
		TNT1 A 0 a_takeinventory ("berserkfists",99)
		MSFI AA 0 a_raise
		loop
	deselect:
		TNT1 A 0
		TNT1 A 0 a_jumpifhealthlower (1, "deadlower")
		TNT1 A 0 a_playsound ("doomslayer/holster",0)
	holster:
		TNT1 A 0
		MSFI A 1 a_lower
		TNT1 A 0 a_takeinventory ("UsingSlayerGun",99)
		MSFI AA 0 a_lower
		loop
	deadlower:
		TNT1 A 0
		TNT1 A 0
        TNT1 A 0 A_ClearRefire
		TNT1 AAAAAAAAAAAAA 0 a_lower
		TNT1 A 1 a_lower
		loop
	ready:
		MSFI A 1 a_weaponready (WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
		TNT1 A 0 a_jumpifinventory ("raging",1,"ragestart")
		loop
	Ragestart:
		TNT1 A 0
		TNT1 A 5 a_takeinventory ("raging",99)
		TNT1 A 0 A_giveinventory ("berserkfists",1)
		TNT1 A 0 A_Quake(2, 20, 0, 10,"silence")			
		TNT1 A 0 a_setinvulnerable
		RAGE ABCDDEE 2
		RAGE E 4
		TNT1 A 0 A_Quake(1, 18, 0, 10,"silence")			
		RAGE F 2
		TNT1 A 0 a_takeinventory ("UsingSlayerGun",99)
		TNT1 A 0 a_playsound ("doomslayer/channelsly",0,1,0,0.6)
		TNT1 A 0 A_SetBlend("99 15 15", 0.6, 60)
		TNT1 A 0 a_spawnitemex ("ragesplosion")
		TNT1 A 0 a_radiusthrust (12000,150,0,150)
		TNT1 A 0 a_giveinventory ("health",35)
		TNT1 A 0 a_alertmonsters
		TNT1 A 0 a_takeinventory ("zerkcharge",1)
		RAGE G 1 A_Quake(7, 55, 0, 10)	
		RAGE G 1 offset (3,37)
		RAGE G 1 offset (-2,30)
		RAGE G 1 offset (4,36)
		RAGE G 1 offset (-4,32)
		RAGE G 1 offset (3,35)
		RAGE G 1 offset (-5,28)
		RAGE G 1 offset (2,37)
		RAGE G 1 offset (-1,31)
		RAGE G 1 offset (2,35)
		RAGE G 1 offset (3,37)
		RAGE G 1 offset (-2,30)
		RAGE G 1 offset (4,36)
		RAGE G 1 offset (-4,32)
		RAGE G 1 offset (3,35)
		RAGE G 1 offset (-5,28)
		RAGE G 1 offset (2,37)
		RAGE G 1 offset (-1,31)
		RAGE G 1 offset (2,35)
		RAGE G 1 offset (3,37)
		RAGE G 1 offset (-2,30)
		RAGE G 1 offset (4,36)
		RAGE G 1 offset (-4,32)
		RAGE G 1 offset (3,35)
		RAGE G 1 offset (-5,28)
		RAGE G 1 offset (2,37)
		RAGE G 1 offset (-1,31)
		RAGE G 1 offset (2,35)
		RAGE G 1 offset (3,37)
		RAGE G 1 offset (-2,30)
		RAGE G 1 offset (4,36)
		RAGE G 1 offset (-4,32)
		RAGE G 1 offset (3,35)
		RAGE G 1 offset (-5,28)
		RAGE G 1 offset (2,37)
		RAGE G 1 offset (-1,31)
		RAGE G 1 offset (2,35)
		RAGE G 1 offset (0,32)
		RAGE G 2 
		RAGE HI 2
		TNT1 A 1 
		TNT1 A 0 a_unsetinvulnerable
		TNT1 A 0 A_giveinventory ("berserkfists",1)
		TNT1 A 1 a_selectweapon ("berserkfists")
		
		TNT1 A 0 
		TNT1 A 0 a_takeinventory ("sawglove",1)
		TNT1 A 0 a_takeinventory ("morningstar",1)
		TNT1 A 0 a_takeinventory ("Thunderbuss",1)
		TNT1 A 0 a_takeinventory ("Hydrarepeater",1)
		TNT1 A 0 a_takeinventory ("wrathcaster",1)
		TNT1 A 0 a_takeinventory ("infernorifle",1)
		TNT1 A 1 
		TNT1 A 0 a_takeinventory ("rend",1)
		TNT1 A 1
		goto deadlower
	fire:
		TNT1 A 0
		TNT1 A 0 a_jumpifinventory ("maceorbs",1,"realfire")
		TNT1 A 0 a_playsound ("doomslayer/click",0)
		MSFI A 1 offset (0,35)
		MSFI A 1 offset (0,40)
		MSFI A 1 offset (0,42)
		MSFI A 1 offset (0,36)
		MSFI A 1 offset (0,32)
		MSFI A 3
		goto ready
	realfire:
		TNT1 A 0
		TNT1 A 0 A_Quake(3, 8, 0, 10)
		TNT1 A 0 a_playsound ("doomslayer/shotgunfire",CHAN_WEAPON)
		MSFI B 2 bright
		TNT1 A 0 a_takeinventory ("maceorbs",1)
		TNT1 A 0 a_firebullets (0,0,1,0,"flickpuff")
		MSFI C 1 bright A_FireCustomMissile("MacePellet")
		MSDI CCC 0 Bright A_FireCustomMissile("MacePellet", Frandom(-1500, 1500) / 400.0)
		MSDI CCC 0 Bright A_FireCustomMissile("MacePellet", Frandom(-1500, 1500) / 700.0)
		MSFI C 1 bright
		MSFI D 1 bright
		MSFI E 4 
		MSFI FGHA 2 a_weaponready (WRF_NOPRIMARY|WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
		TNT1 A 0 a_playsound ("doomslayer/pumpdown",0)
		MSPM A 2 a_weaponready (WRF_NOPRIMARY|WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
		MSPM BBB 3 a_weaponready (WRF_NOPRIMARY)
		TNT1 A 0 a_playsound ("doomslayer/pumpup",0)
		MSPM C 2 a_weaponready (WRF_NOPRIMARY|WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
		MSFI A 2 a_weaponready (WRF_NOPRIMARY|WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
		MSFI A 1 a_weaponready (WRF_NOPRIMARY|WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
		goto ready
	altfire:
		TNT1 A 0
		TNT1 A 0 a_giveinventory ("UsingRend",1)
		MSFI IJ 1
		TNT1 A 1
		TNT1 A 0 a_playsound ("doomslayer/swordup")
		TNT1 A 0 a_jumpifinventory ("ATKringpowerup",1,"mightyswipe")
		RQML AB 1
		RSWP A 2
		TNT1 A 0 a_playsound ("doomslayer/sword",0)
		RSWP B 1 A_FireCustomMissile("slayermelee",0,0,40,0)
		RSWP C 1 A_FireCustomMissile("slayermelee",0,0,20,0)
		TNT1 A 0 A_FireCustomMissile("slayermelee",0,0,0,0)
		RSWP D 2 A_FireCustomMissile("slayermelee",0,0,-20,0)
		RSWP E 3 		
		TNT1 A 4
		LSWP A 2
		TNT1 A 0 a_playsound ("doomslayer/sword",0)
		LSWP B 1 A_FireCustomMissile("slayermelee",0,0,40,0)
		LSWP C 1 A_FireCustomMissile("slayermelee",0,0,20,0)
		LSWP D 2 A_FireCustomMissile("slayermelee",0,0,-20,0)
		LSWP E 2 
		TNT1 A 0 a_takeinventory ("UsingRend",99)
		TNT1 A 0 a_playsound ("doomslayer/sworddown")
		TNT1 A 3
		TNT1 A 2
		MSFI KLMA 1 a_weaponready (WRF_NOSECONDARY|WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
		goto ready
	Mightyswipe:
		TNT1 A 0
		TNT1 A 0
		RSWP A 2
		TNT1 A 0 a_playsound ("doomslayer/sword",0)
		RSWP B 1 A_FireCustomMissile("mightyslayermelee",0,0,40,0)
		RSWP C 1 A_FireCustomMissile("mightyslayermelee",0,0,20,0)
		TNT1 A 0 A_FireCustomMissile("mightyslayermelee",0,0,0,0)
		RSWP D 2 A_FireCustomMissile("mightyslayermelee",0,0,-20,0)
		RSWP E 3 		
		TNT1 A 4
		LSWP A 2
		TNT1 A 0 a_playsound ("doomslayer/sword",0)
		LSWP B 1 A_FireCustomMissile("mightyslayermelee",0,0,40,0)
		LSWP C 1 A_FireCustomMissile("mightyslayermelee",0,0,20,0)
		TNT1 A 0 A_FireCustomMissile("mightyslayermelee",0,0,0,0)
		LSWP D 2 A_FireCustomMissile("mightyslayermelee",0,0,-20,0)
		LSWP E 2 
		TNT1 A 0 a_takeinventory ("UsingRend",99)
		TNT1 A 0 a_playsound ("doomslayer/sworddown")
		TNT1 A 3
		TNT1 A 2
		MSFI KLMA 1 a_weaponready (WRF_NOSECONDARY|WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
		goto ready
		
	Reload:
		"####" "#" 1 a_jumpifinventory ("SlayerBombCooldown",1, "quickpunch")
		TNT1 A 0 a_playsound ("doomslayer/zerkswing",0)
		DSUB AB 2
		TNT1 A 0 a_jumpifinventory ("Thunderbombcheck",1,"Thunderbomb")
		TNT1 A 0 a_jumpifinventory ("Firebombcheck",1,"Firebomb")
		TNT1 A 0 a_jumpifinventory ("Beambombcheck",1,"beambomb")
		DSUB C 1 a_firecustommissile ("spikebomb")
		TNT1 A 0 a_giveinventory ("SlayerBombCooldown",200)
		DSUB DEF 1
		TNT1 A 5 a_weaponready (WRF_ALLOWZOOM)
		MSFI KLMA 1 a_weaponready (WRF_ALLOWZOOM)
		goto ready
	quickpunch:
		TNT1 A 0
		TNT1 A 0 a_playsound ("doomslayer/zerkswing",0)
		BERS JK 2
		TNT1 A 0 a_playsound ("Doomslayer/unf",0)
		BERS L 2 a_firecustommissile ("quickpunch")
		BERS NO 1
		TNT1 A 4
		MSFI KLMA 1 a_weaponready
		goto ready
	BeamBomb:
		TNT1 A 0
		TNT1 A 0 a_takeinventory ("bombammo",1)
		DSUB C 1 a_firecustommissile ("beambomb")
		TNT1 A 0 a_giveinventory ("SlayerBombCooldown",200)
		DSUB DEF 1
		TNT1 A 5 a_weaponready (WRF_ALLOWZOOM)
		MSFI KLMA 1 a_weaponready (WRF_ALLOWZOOM)
		goto ready
	FireBomb:
		TNT1 A 0
		TNT1 A 0 a_takeinventory ("bombammo",1)
		DSUB C 1 a_firecustommissile ("slayerfirebomb")
		TNT1 A 0 a_giveinventory ("SlayerBombCooldown",200)
		DSUB DEF 1
		TNT1 A 5 a_weaponready (WRF_ALLOWZOOM)
		MSFI KLMA 1 a_weaponready (WRF_ALLOWZOOM)
		goto ready
	ThunderBomb:
		TNT1 A 0
		TNT1 A 0 a_takeinventory ("bombammo",1)
		DSUB C 1 a_firecustommissile ("slayerThunderbomb")
		TNT1 A 0 a_giveinventory ("SlayerBombCooldown",200)
		DSUB DEF 1
		TNT1 A 5 a_weaponready (WRF_ALLOWZOOM)
		MSFI KLMA 1 a_weaponready (WRF_ALLOWZOOM)
		goto ready
		
		

	Zoom:
		"####" "#" 1 a_jumpifinventory ("SlayerDaggerCooldown",1, "quickpunch")
		TNT1 A 0 a_playsound ("doomslayer/zerkswing",0)
		DSUB AB 2
		TNT1 A 0 a_jumpifinventory ("FoodDaggercheck",1, "FoodDagger")
		TNT1 A 0 a_jumpifinventory ("AmmoDaggercheck",1, "AmmoDagger")
		TNT1 A 0 a_jumpifinventory ("SpreadDaggercheck",1, "SpreadDagger")
		TNT1 A 0 a_jumpifinventory ("GlassDaggercheck",1, "GlassDagger")
		DSUB C 1 a_firecustommissile ("draindagger")
		TNT1 A 0 a_giveinventory ("SlayerDaggerCooldown",200)
		DSUB DEF 1
		TNT1 A 5 a_weaponready (WRF_ALLOWRELOAD)
		MSFI KLMA 1 a_weaponready (WRF_ALLOWRELOAD)
		goto ready
	GlassDagger:
		TNT1 A 0
		TNT1 A 0 a_takeinventory ("daggerammo",1)
		DSUB C 1 a_firecustommissile ("Glassdagger")
		TNT1 A 0 a_giveinventory ("SlayerDaggerCooldown",200)
		DSUB DEF 1
		TNT1 A 5 a_weaponready (WRF_ALLOWRELOAD)
		MSFI KLMA 1 a_weaponready (WRF_ALLOWRELOAD)
		goto ready
	SpreadDagger:
		TNT1 A 0
		TNT1 A 0 a_takeinventory ("daggerammo",1)
		TNT1 A 0 a_firecustommissile ("SpreadDagger",-16)
		TNT1 A 0 a_firecustommissile ("SpreadDagger",-8)
		TNT1 A 0 a_firecustommissile ("SpreadDagger",-4)
		TNT1 A 0 a_firecustommissile ("SpreadDagger",4)
		TNT1 A 0 a_firecustommissile ("SpreadDagger",8)
		TNT1 A 0 a_firecustommissile ("SpreadDagger",16)
		DSUB C 1 a_firecustommissile ("Spreaddagger")
		TNT1 A 0 a_giveinventory ("SlayerDaggerCooldown",200)
		DSUB DEF 1
		TNT1 A 5 a_weaponready (WRF_ALLOWRELOAD)
		MSFI KLMA 1 a_weaponready (WRF_ALLOWRELOAD)
		goto ready
	AmmoDagger:
		TNT1 A 0
		TNT1 A 0 a_takeinventory ("daggerammo",1)
		DSUB C 1 a_firecustommissile ("Ammodagger")
		TNT1 A 0 a_giveinventory ("SlayerDaggerCooldown",200)
		DSUB DEF 1
		TNT1 A 5 a_weaponready (WRF_ALLOWRELOAD)
		MSFI KLMA 1 a_weaponready (WRF_ALLOWRELOAD)
		goto ready
	FoodDagger:
		TNT1 A 0
		TNT1 A 0 a_takeinventory ("daggerammo",1)
		DSUB C 1 a_firecustommissile ("Fooddagger")
		TNT1 A 0 a_giveinventory ("SlayerDaggerCooldown",200)
		DSUB DEF 1
		TNT1 A 5 a_weaponready (WRF_ALLOWRELOAD)
		MSFI KLMA 1 a_weaponready (WRF_ALLOWRELOAD)
		goto ready


	}
}

actor macepellet : FastProjectile
{
	+notimefreeze
    +FORCEXYBILLBOARD	
	+thruspecies
	+bright
	obituary "%o got %k's balls in their face."
	damage (30)
	damagetype "Macepellet"
	species "Friendly"
    missileheight 1
	speed 150
	height 1
	radius 1
	gravity 0.01
    Scale 1
	alpha 0.95
	-NOGRAVITY
	+BLOODSPLATTER
	+NOEXTREMEDEATH
	decal "BulletChip"
	states
	{
	Spawn:
		GBAL B 1
		loop
	Death:
		TNT1 A 0
		TNT1 A 0 a_stop
		TNT1 A 1 a_spawnitemex ("scatterballhit",-5,-5,0,frandom(-2,-8),frandom(-8,8),frandom(5,10),0,SXF_NOCHECKPOSITION)
		stop
	XDeath:
		TNT1 A 0
		TNT1 A 0
		TNT1 A 1 a_jumpifintargetinventory ("unleasher",1,"givecharge")
		stop
	givecharge:
		TNT1 A 0
		TNT1 A 0
		TNT1 A 1 A_GiveInventory("zerkcharge",1, AAPTR_TARGET)
		stop
	nothing:
		TNT1 A 0
		TNT1 A 5 
		stop
	}
}

actor MaceGrenade
{
	Radius 11
	Height 12
	Speed 50
	Damage (180)
	Projectile
	-nogravity
	gravity 1.1
	+bright
	decal Scorch
	Species "Friendly"
	+THRUSPECIES
	damagetype "Macebomb"
	SeeSound "GeoRev/Shot"
	States
	{
	spawn:
		FX18 MN 2
		loop
	death:
		TNT1 A 0
		TNT1 A 0 a_changeflag ("nogravity", 1)
		TNT1 A 0 a_playsound ("doomslayer/macebomb",0,1,0,0.50)
		TNT1 A 0 a_explode (120,150,1,0,150)
		TNT1 A 0 a_stop
		TNT1 A 0 Radius_Quake (2,6,0,10,0)
		MISL BCD 2
		stop
	Xdeath:
		TNT1 A 0 a_changeflag ("nogravity", 1)
		TNT1 A 0 a_playsound ("doomslayer/macebomb",0,1,0,0.50)
		TNT1 A 0 a_explode (120,150,1,0,150)
		TNT1 A 0 a_stop
		TNT1 A 0 A_CustomMissile("macebomblet", 8,0, 0, CMF_AIMDIRECTION)
		TNT1 A 0 A_CustomMissile("macebomblet", 8,0, 45, CMF_AIMDIRECTION)
		TNT1 A 0 A_CustomMissile("macebomblet", 8,0, 90, CMF_AIMDIRECTION)
		TNT1 A 0 A_CustomMissile("macebomblet", 8,0, 135, CMF_AIMDIRECTION)
		TNT1 A 0 A_CustomMissile("macebomblet", 8,0, 180, CMF_AIMDIRECTION)
		TNT1 A 0 A_CustomMissile("macebomblet", 8,0, 225, CMF_AIMDIRECTION)
		TNT1 A 0 A_CustomMissile("macebomblet", 8,0, 270, CMF_AIMDIRECTION)
		TNT1 A 0 A_CustomMissile("macebomblet", 8,0, 315, CMF_AIMDIRECTION)
		TNT1 A 0 A_CustomMissile("macebomblet", 8,0, 360, CMF_AIMDIRECTION)
		TNT1 A 0 Radius_Quake (2,6,0,10,0)
		MISL B 1 a_jumpifintargetinventory ("unleasher",1,"givecharge")
		MISL CD 2
		stop
	givecharge:
		TNT1 A 0
		MISL B 1 A_GiveInventory("zerkcharge",2, AAPTR_TARGET)
		MISL CD 2
		stop
	}
}

actor MaceBomblet
{
	Radius 11
	Height 12
	Speed 10
	Damage (40)
	Projectile
	-nogravity
	species "friendly"
	+thruspecies
	decal DoomimpScorch
	damagetype "Macebomb"
	gravity 1.1
	+bright
	scale 1
	+THRUACTORS
	states
	{
	spawn:
		GBAL BC 2
		GBAL BC 2
		TNT1 A 0 a_changeflag ("THRUACTORS",0)
	flight:
		GBAL BC 2
		loop
	death:
		TNT1 A 0
		TNT1 A 0 a_changeflag ("nogravity", 1)
		TNT1 A 0 a_playsound ("doomslayer/macebomblet",0,0.50,0,0.40)
		TNT1 A 0 a_explode (50,60,1,0,60)
		TNT1 A 0 Radius_Quake (1,3,0,6,0)
		TNT1 A 0 a_stop
		SSFX CDEFGH 1
		stop
	}
}
