//==Plasma Gun==
//Blaz gets the Hyper Module, allowing him to put the Blazter into a supercharged mode
//for a short period of time, massively boosting its attack power, at the cost
//of rendering the gun unable to fire for a short time
//Doomslayer is given the Infernfo Rifle, a rapid firing fireball gun that builds
//heat over time and while firing before venting the weapon for a devastating blast

Actor GMOTAPlasmaRifle : custominventory replaces PlasmaRifle
{
	Radius 14
	Height 14
	+quiet
    +DONTGIB
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 1
		TNT1 A 0 a_custommissile ("BlazHyperSprite",0,0,0,CMF_AIMDIRECTION)
		TNT1 A 0 a_custommissile ("DoomslayerPlasmaSprite",0,0,0,CMF_AIMDIRECTION)
	spawn1:
		ITRO ABCDEFGH 1 Bright
		loop
	Pickup:
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory ("IamLordBlaz",1,"BlazHyper")
		TNT1 A 0 A_JumpIfInventory ("IamDoomSlayer",1,"DoomslayerPlasma")
		TNT1 A 1
		stop
	BlazHyper:
		TNT1 A 0
		TNT1 A 0
		TNT1 A 0 a_setblend (FFFF00,0.1,5)
		TNT1 A 0 a_playsound ("powerups/upgrade",CHAN_ITEM)
		TNT1 A 0 a_jumpifinventory ("Hyperparts", 1, "nohelp")
		TNT1 A 0 ACS_NamedExecuteAlways("WeaponLog",0,5,0,0)			
		//TNT1 A 0 a_log ("Hyper Parts!")
		TNT1 A 0 a_print ("Hyper Mode enabled, press zoom to charge")
		TNT1 A 0 a_giveinventory ("hyperparts",1)
		TNT1 A 1 
		stop
	nohelp:
		TNT1 A 0
		TNT1 A 0 a_giveinventory ("hyperparts", 1)
		TNT1 A 0 ACS_NamedExecuteAlways("WeaponLog",0,5,0,0)			
		//TNT1 A 0 a_log ("Hyper parts converted to dark gems!")
		TNT1 A 1 a_giveinventory ("subshotammo", 10)
		stop
	DoomslayerPlasma:
		TNT1 A 0
		TNT1 A 0 ACS_NamedExecuteAlways("WeaponLog",0,5,0,0)			
		//TNT1 A 0 a_log ("You got the Inferno Rifle!")
		TNT1 A 0 a_playsound ("misc/w_pkup",CHAN_ITEM)
		TNT1 A 0 a_setblend (FFFF00,0.1,5)
		TNT1 A 0 a_jumpifinventory ("Gotinfernorifle", 1, "nohelpslayer")
		TNT1 A 0 a_giveinventory ("firegems",50)
		TNT1 A 0 a_print ("Weapon builds heat over time and while firing, press secondary to vent")
		TNT1 A 0 a_giveinventory ("infernorifle",1)
		TNT1 A 0 a_giveinventory ("GotInfernoRifle",1)
		TNT1 A 1
		stop
	nohelpSlayer:
		TNT1 A 0
		TNT1 A 1 a_giveinventory ("firegems",50)
		stop
	}
}

actor hyperparts : inventory
{inventory.maxamount 3}

actor GotInfernorifle : inventory
{
	+UNTOSSABLE
	inventory.maxamount 1
}


actor BlazHyperSprite : GMOTAweaponsprite
{
    VisibleToPlayerClass LordBlaz
    States
    {
	spawn:
		TNT1 A 0
		HYUG A 1 bright
		TNT1 A 0 a_warp (AAPTR_TARGET,0,0,0,0,WARPF_INTERPOLATE|WARPF_NOCHECKPOSITION)
		TNT1 A 0 a_checkflag ("SPECIAL","spawn",AAPTR_TARGET)
		HYUG A 1 bright
		goto death
	death:
		TNT1 A 1
		stop
    }
}

actor DoomSlayerPlasmaSprite : GMOTAweaponsprite
{
    VisibleToPlayerClass DoomSlayer
    States
    {
	spawn:
		TNT1 A 0
		IRPU A 1 bright
		TNT1 A 0 a_warp (AAPTR_TARGET,0,0,0,0,WARPF_INTERPOLATE|WARPF_NOCHECKPOSITION)
		TNT1 A 0 a_checkflag ("SPECIAL","spawn",AAPTR_TARGET)
		IRPU A 1 bright
		goto death
	death:
		TNT1 A 1
		stop
    }
}

