
ACTOR Powerup_particles
{
	+NOBLOCKMAP
+NOINTERACTION
	Gravity 0.125
	RenderStyle Add
	Scale 0.4
	States
	{
	Spawn:
		03FX FG 7 BRIGHT 
		Stop
	}
}



ACTOR PowerupTotem_particles : Powerup_Particles
{
Scale 0.25
Translation "0:255=%[0.00,0.00,0.00]:[2.00,1.01,1.51]"
}

ACTOR PowerupBlistering_particles : Powerup_Particles
{
Scale 0.25
Translation "0:255=%[0.00,0.00,0.00]:[2.00,1.01,1.01]"
}



//Radiation suit
ACTOR Dusk_RadSuit : PowerupGiver replaces RadSuit
{
	//$Category Doosk Items/Powerups
	//$Sprite prcsA0
	//$Title Radiation suit
	//$Color 9
	Game Doom
	Height 48
	Radius 20
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	Inventory.MaxAmount 0
	Inventory.PickupMessage "$GOTSUIT"
	Powerup.Type IronFeet
	Scale 0.5
	States
	{
	Spawn:
		PRCS ABCDEFGHIJKLMNOP 4 bright 
		Loop
	}
}	






//Adds to the screen a subtle white tone, instead of making everything ugly inverted colors.
ACTOR Dusk_InvulnerabilitySphere : InvulnerabilitySphere replaces InvulnerabilitySphere
{
	//$Category Doosk Items/Powerups
	//$Sprite pinvA0
	//$Title Invulnerability sphere
	//$Color 9
	+COUNTITEM
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	+INVENTORY.BIGPOWERUP
	Inventory.MaxAmount 0
	Powerup.Type Invulnerable
	Powerup.Color White
	Inventory.PickupSound "misc/p_pkup"
}




//Soap/blistering heat replacement.
ACTOR Dusk_Blursphere : Blursphere  {}

actor Dusk_unspecifiedPickup_blursphere : RandomSpawner replaces blursphere
{
	//$Category Doosk Items/Powerups
	//$Sprite soapA0
	//$Title Soap/Blursphere
	//$Color 9
    DropItem "SoapTypeCheck", 255, 1
    DropItem "Dusk_Blursphere", 255, 3
}


ACTOR Dusk_Allmap : Allmap  {}

actor Dusk_unspecifiedPickup_Allmap : RandomSpawner replaces Allmap
{
	//$Category Doosk Items/Powerups
	//$Sprite PMAPA0
	//$Title Blistering heat/Computer map
	//$Color 9
	+NOTDMATCH
    DropItem "Blistering_Heat_Pickup", 255, 1
    DropItem "Dusk_Allmap", 255, 3
}







//Allows weapon to fire faster. Can only be stacked twice.
//Modified the totem to give you 50 health, in compensation for the 100 berserk used to give you.


//Fake inventory that gives you the actual powerup plus some additional inventory.
ACTOR Fastfire_Totem_Pickup : CustomInventory replaces berserk
{
	//$Category Doosk Items/Powerups
	//$Sprite ffirA0
	//$Title Fast fire totem
	//$Color 9
	+COUNTITEM
	+INVENTORY.ALWAYSPICKUP
//	+INVENTORY.BIGPOWERUP
+ALWAYSRESPAWN
  +INVENTORY.AUTOACTIVATE
  -INVENTORY.IGNORESKILL
  Inventory.PickupMessage "$TOTEM_PICK"
	Inventory.PickupSound "misc/p_pkup"
  Inventory.Icon "TNT1A0"
	Inventory.RespawnTics 3150//aprox one minute 30

	Height 48
	Radius 20
	Scale 0.65
	States
	{
	Spawn:
		TNT1 A 0 NoDelay ACS_NamedExecuteWithResult("ZA_RemoveIfDuel")
		FFIR ABCDEFGHIJKLMNOP 4 bright A_SpawnItemEx("PowerupTotem_Particles", random2[BoltSpark]()*0.045625, random2[BoltSpark]()*0.045625, random2[BoltSpark]()*0.075625+24, 0,0,1,0,SXF_ABSOLUTEPOSITION, 40)
		"####" "#" 0 A_CheckSight("Simple")
		Loop

Simple:
		FFIR ABCDEFGHIJKLMNOP 4 bright 
Goto Spawn


	Pickup:
		TNT1 A 0 A_GiveInventory("Fastfire_Totem")
		TNT1 A 0 A_GiveInventory("Fastfire_TotemAmount",30)//Unlocks totems tiers.
		TNT1 A 0 A_GiveInventory("Fastfire_ClockAmount",30)//Shows clock hud.
		TNT1 A 0 HealThing(50, 0)
		Stop
	}
}



//The actual powerup
ACTOR Fastfire_Totem :  PowerupGiver //replaces Berserk//PowerWeaponLevel2
{
  +COUNTITEM
  +INVENTORY.AUTOACTIVATE
  +INVENTORY.ALWAYSPICKUP
  +INVENTORY.BIGPOWERUP
  Inventory.Icon "TNT1A0"
//  Inventory.Icon "FFIRE0"
  Inventory.MaxAmount 0
  Powerup.Duration -30
  Powerup.Color 255, 0, 0, 0.125
  Inventory.PickupMessage "$TOTEM_PICK"
  Powerup.Type FastTotemSpeed
	Inventory.PickupSound "misc/p_pkup"
	Inventory.RespawnTics 3150
	Scale 0.5
States
  {
  Spawn:
    FFIR A -1 Bright
    Stop
  }
}



//This powerup is used to modify weapons behaviours. (aka fast fire)
//Added "power" at the beggining to be detected by powerup.type
Actor PowerFastTotemSpeed : PowerDamage
{
	Powerup.Duration -30
	DamageFactor "Normal", 1
  Powerup.Color 255, 0, 0, 0.125
	+INVENTORY.UNDROPPABLE
}



/*
ACTOR powerfastfire_power : PowerWeaponLevel2
{
  Powerup.Duration -30
  Inventory.Icon "TNT1A0"
  Powerup.Color 255, 0, 0, 0.125
//	+INVENTORY.PERSISTENTPOWER//GZDoom and Zandronum
	+INVENTORY.UNDROPPABLE
//	Inventory.MaxAmount 1
//  +INVENTORY.NOTELEPORTFREEZE
}
*/



//If inventory is over 30, weapons will fire thrice as fast.
ACTOR Fastfire_TotemAmount : Inventory				{   Inventory.MaxAmount 60	}


//Mostly used for the hud clock.
ACTOR Fastfire_ClockAmount : Inventory				{   Inventory.MaxAmount 30	}
ACTOR Blistering_ClockAmount : Inventory				{   Inventory.MaxAmount 30	}




//Powerup that supposedly freezes time for a bit, assuming player doesn't move.
//Works in conjuction with some scripts.
//Done by ivory Duke.


//Fake inventory that gives you the actual powerup and the hud clock thingy.
ACTOR Blistering_Heat_Pickup : CustomInventory //replaces berserk
{
	+COUNTITEM
	+INVENTORY.ALWAYSPICKUP
	+INVENTORY.BIGPOWERUP
  Inventory.PickupMessage "$BLISTER_PICK"
	Inventory.PickupSound "misc/p_pkup"
  Inventory.Icon "TNT1A0"
	Height 48
	Radius 20
	Inventory.RespawnTics 4200//aprox 2 minutes

	Scale 0.65
	States
	{
	Spawn:
		TNT1 A 0 NoDelay ACS_NamedExecuteWithResult("ZA_RemoveIfDuel")
		BHET ABCDEFGHIJKLMNOP 4 bright A_SpawnItemEx("PowerupBlistering_Particles", random2[BoltSpark]()*0.055625, random2[BoltSpark]()*0.055625, random2[BoltSpark]()*0.075625+24, 0,0,1,0,SXF_ABSOLUTEPOSITION, 40)
		"####" "#" 0 A_CheckSight("Simple")
		Loop

Simple:
		BHET ABCDEFGHIJKLMNOP 4 bright 
Goto Spawn

	Pickup:
		TNT1 A 0 A_GiveInventory("BlisteringHeat")
		TNT1 A 0 A_GiveInventory("Blistering_ClockAmount",30)//Shows clock hud.
		Stop
	}
}



//The actual powerup, a mashup of decorate and acs.
Actor BlisteringHeat : Fastfire_Totem
{
	+NOTDMATCH
	Inventory.PickupMessage "$BLISTER_PICK"
	Powerup.Color 0, 0, 20, 0.15
	Powerup.Duration -30
	Powerup.Type BlisteringPower
	Inventory.RespawnTics 4200//aprox 2 minutes

	Scale 0.5
States
  {
  Spawn:
    BHET E -1 Bright
    Stop
  }
}

Actor PowerBlisteringPower : PowerDamage
{
	Powerup.Duration -30
	DamageFactor "Normal", 1
}


Actor BlisteringFreeze : PowerTimeFreezer
{
	Powerup.Duration 2//2 tics. Powerup is given constantly through acs if doom class or zscript if dusk class.
}





//This powerup is used to modify weapons behaviours and make them use a different ammo pool.
ACTOR Duskammo_Powerup : PowerWeaponLevel2
{
  Powerup.Duration 0x7FFFFFFD
  Inventory.Icon "TNT1A0"
	+INVENTORY.PERSISTENTPOWER//GZDoom and Zandronum
	+INVENTORY.UNDROPPABLE
//	Inventory.MaxAmount 1
//  +INVENTORY.NOTELEPORTFREEZE
}