//==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 while firing before venting the weapon for a devastating blast

//Kustam is given a staff upgrade where charge strikes trap targets
//in a sphere of explosive energy on hit

Actor GMOTAPlasmaRifle : custominventory replaces PlasmaRifle
{
	Radius 14
	Height 14
	+quiet
    +DONTGIB
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 1
		TNT1 A 0 A_CustomMissile ("BlazTerrorSprite",0,0,0,CMF_AIMDIRECTION)
		TNT1 A 0 A_CustomMissile ("DoomslayerPlasmaSprite",0,0,0,CMF_AIMDIRECTION)
		TNT1 A 0 A_CustomMissile ("KustamGlaiveBoostSprite",0,0,0,CMF_AIMDIRECTION)
	spawn1:
		ITRO ABCDEFGH 1 Bright
		loop
	Pickup:
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory ("IamLordBlaz",1,"BlazTerror")
		TNT1 A 0 A_JumpIfInventory ("IamDoomSlayer",1,"DoomslayerPlasma")
		TNT1 A 0 A_JumpIfInventory ("IamKustam",1,"KustamGlaiveBoost")
		TNT1 A 1
		stop
	BlazTerror:
		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 ACS_NamedExecuteAlways("WeaponLog",0,5,0,0)			
		TNT1 A 0 A_GiveInventory ("BlazterEnergy",20)
		TNT1 A 0 A_GiveInventory ("TerrorUpgrade",1)
		TNT1 A 1 
		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_GiveInventory ("SlayerMettle",15)
		TNT1 A 0 A_GiveInventory ("Magmauler",1)
		TNT1 A 1
		stop
	KustamGlaiveBoost:
		TNT1 A 0
		TNT1 A 0 ACS_NamedExecuteAlways("WeaponLog",0,5,0,0)			
		TNT1 A 0 A_PlaySound ("Kustam/upgradeget",CHAN_ITEM)
		TNT1 A 0 A_SetBlend (FFFF00,0.1,5)
		TNT1 A 0 A_GiveInventory ("KustamLaserBattery",10)
		TNT1 A 0 A_GiveInventory ("KustamKineticBattery",10)
		TNT1 A 0 A_GiveInventory ("GlaiveBoostModule",1)
		TNT1 A 1
		stop
	}
}

//Blaz item token
actor TerrorUpgrade : inventory
{inventory.maxamount 1}

//Kustam item token
actor GlaiveBoostModule : inventory
{inventory.maxamount 1}


//Item Sprites
actor BlazTerrorSprite : 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
		MMPU 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)
		MMPU A 1 bright
		goto death
	death:
		TNT1 A 1
		stop
    }
}

actor KustamGlaiveBoostSprite : GMOTAweaponsprite
{
    VisibleToPlayerClass Kustam
    States
    {
	spawn:
		TNT1 A 0
		HCAV 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)
		HCAV A 1 bright
		goto death
	death:
		TNT1 A 1
		stop
    }
}


