actor HydraRepeater : weapon
{
	Weapon.SelectionOrder 600
	Inventory.RestrictedTo "DoomSlayer"
	Tag "Hydra Repeater"
	states
	{
	spawn:
		MGUN A 1
		loop
	select:
		TNT1 A 0
		TNT1 A 0 a_playsound ("doomslayer/hydraclose")
	draw:
		HYDR A 1 a_raise
		TNT1 A 0 a_giveinventory ("UsingSlayerGun",1)
		TNT1 A 0 a_takeinventory ("berserkfists",99)
		HYDR 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
		HYDR A 1 a_lower
		TNT1 A 0 a_takeinventory ("UsingSlayerGun",99)
		HYDR 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:
		TNT1 A 0 a_jumpifinventory ("raging",1,"ragestart")
		HYDR 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 ("spikes",1,"realfire")
		TNT1 A 0 a_playsound ("doomslayer/click",0)
		HYDR A 1 offset (0,35)
		HYDR A 1 offset (0,40)
		HYDR A 1 offset (0,42)
		HYDR A 1 offset (0,36)
		HYDR A 1 offset (0,32)
		HYDR A 3
		goto ready
	RealFire:
		TNT1 A 0
		TNT1 A 0 A_PlaySound("doomslayer/hydrashot", CHAN_WEAPON)
		TNT1 A 0 A_Quake(1, 2, 0, 10)
		TNT1 A 0 a_takeinventory ("spikes",1)
		TNT1 A 0 a_firebullets (0,0,1,0,"flickpuff")
		TNT1 A 0 offset (0,32)
		HYDR B 2 bright a_firecustommissile ("hydrabullet")
		HYDR A 2 offset (0,38)
		TNT1 A 0 offset (0,34)
		TNT1 A 0 a_jumpifinventory ("spikes",1,"finish")
		goto ready
	finish:
		TNT1 A 0 A_PlaySound("doomslayer/hydrashot", CHAN_WEAPON)
		TNT1 A 0 A_Quake(1, 2, 0, 10)
		TNT1 A 0 a_takeinventory ("spikes",1)
		TNT1 A 0 a_firebullets (0,0,1,0,"flickpuff")
		HYDR B 2 bright  a_firecustommissile ("hydrabullet")
		HYDR A 1 offset (0,38)
		HYDR A 1 offset (0,34)
		TNT1 A 0 a_refire ("ammocheck")
		goto ready
	ammocheck:
		TNT1 A 0
		HYDR A 1 a_jumpifinventory ("spikes",1,"spraying")
		goto ready
	spraying:
		TNT1 A 0
		TNT1 A 0 A_PlaySound("doomslayer/hydrashot", CHAN_WEAPON)
		TNT1 A 0 A_Quake(1, 2, 0, 10)
		TNT1 A 0 a_takeinventory ("spikes",1)
		TNT1 A 0 a_firebullets (0,0,1,0,"flickpuff")
		HYDR B 2 bright a_firecustommissile ("hydrabullet",Frandom(-1500, 1500) / 300.0)
		HYDR A 2 offset (0,38)
		TNT1 A 0 offset (0,34)
		TNT1 A 0 a_refire ("ammocheck")
		goto ready
	altfire:
		TNT1 A 0
		TNT1 A 0 a_giveinventory ("UsingRend",1)
		HYDR ST 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
		HYDR UVA 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
		HYDR UVA 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)
		HYDR UVA 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 5
		HYDR UVA 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)
		HYDR UVA 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)
		HYDR UVA 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)
		HYDR UVA 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)
		HYDR UVA 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)
		HYDR UVA 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)
		HYDR UVA 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)
		HYDR UVA 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)
		HYDR UVA 1 a_weaponready (WRF_ALLOWRELOAD)
		goto ready
	}
}

actor hydrabullet : fastprojectile
{
	+notimefreeze
	projectile
	+THRUSPECIES
	species "friendly"
	missiletype "hydratrail"
	missileheight 8
	+FORCEXYBILLBOARD
	+Bloodsplatter
	+LOOKALLAROUND
	+bright
	height 12
	radius 5
	speed 100
	damage (50)
	scale 0.80
	decal bulletchip
	states
	{
	spawn:
		HRBL A 1
		loop
	death:
		TNT1 A 0
		TNT1 A 0 a_playsound ("doomslayer/hydramiss",0,0.80,0,1.20)
		TNT1 A 1 a_spawnitemex ("Bulletpuff")
		stop
	xdeath:
		TNT1 A 0
		TNT1 A 0 a_playsound ("doomslayer/hydrahit",0)
		TNT1 A 1 a_jumpifintargetinventory ("unleasher",1,"givecharge")
		stop
	givecharge:
		TNT1 A 0
		TNT1 A 1 A_GiveInventory("zerkcharge",1, AAPTR_TARGET)
		stop
	}
}

actor hydratrail
{
	+NOINTERACTION
	+clientsideonly
	Radius 4
	Height 5
	Renderstyle add
	scale 0.80
	Alpha 0.85
	States
	{
	Spawn:
		TNT1 A 0
		HRBL A 1 Bright a_fadeout (0.50)
		wait
	}
}


actor hydramissile
{
	+notimefreeze
	projectile
	+THRUSPECIES
	species "friendly"
	+FORCEXYBILLBOARD
	+Bloodsplatter
	+LOOKALLAROUND
	+bright
	height 12
	radius 5
	speed 50
	damage (160)
	scale 0.60
	decal DoomimpScorch
	seesound "doomslayer/hydrawoosh"
	deathsound "doomslayer/hydraboom"
	states
	{
	spawn:
		TNT1 A 0
		HMSL A 1 a_weave (0,8,0,1)
		loop
	death:
		TNT1 A 0
		TNT1 A 0 a_explode (20,60,1,0,15)
		HMSL BCDEFG 2
		stop
	Xdeath:
		TNT1 A 0
		TNT1 A 0 a_explode (45,90,1,0,15)
		HSML B 1 a_jumpifintargetinventory ("unleasher",1,"givecharge")
		HMSL CDEFG 2
		stop
	givecharge:
		TNT1 A 0
		HSML B 1 A_GiveInventory("zerkcharge",2, AAPTR_TARGET)
		HMSL CDEFG 2
		stop
	}
}

