 actor BigBagOAmmo : backpack replaces backpack
{
  Inventory.PickupMessage "$POWER_backpack"
  Inventory.PickupSound "items/bakpakpk"
  scale 0.7
  +COUNTITEM
  states
  {
  Spawn:
    BPAK A 10
	BPAK A 1 bright
    loop
  }
}
ACTOR Ashesmap : MapRevealer replaces Allmap
{
  +COUNTITEM
  +INVENTORY.FANCYPICKUPSOUND
  +INVENTORY.ALWAYSPICKUP
  Inventory.MaxAmount 0
  scale 0.8
  Inventory.PickupSound "items/armorpickup"
  Inventory.PickupMessage "$POWER_map"
  States
  {
  Spawn:
    PMAP A 10
	PMAP A 10 Bright
    loop
  }
}
ACTOR StimHealthUp : PowerupGiver 
{
  +INVENTORY.INTERHUBSTRIP
  +INVENTORY.AUTOACTIVATE
  Inventory.PickupMessage " "
  Tag " "
  Powerup.Duration -30
  Powerup.Color None
  Powerup.Type Regeneration
  States
  {
  Spawn:
    TNT1 A 1
    Loop
  }
}
Actor Purgeeffect : PowerupGiver 
{
  Powerup.Type "powerironfeet"
  Powerup.Duration -30
  Powerup.Color 180, 180, 64, 0.125
  States
  {
  Spawn:
    TNT1 A 11
    LOOP
  }
}
ACTOR Powerrage : PowerupGiver replaces Berserk
{
  +COUNTITEM
  +INVENTORY.BIGPOWERUP
  +INVENTORY.FANCYPICKUPSOUND
  +Inventory.InvBar
  Powerup.Duration -30
  Powerup.Color 255, 0, 0, 0.125
   Inventory.MaxAmount 10
  Inventory.Interhubamount 10
  Inventory.Icon "INVFA0"
   Inventory.PickupMessage "$POWER_FRNZY"
     Tag "$TAG_FRNZY"
   inventory.usesound "items/stimuse3"
  Powerup.Type "PowerDoubleFiringSpeed"
   Scale 0.75
  States
  {
 Spawn:
    PSTR A 10
	PSTR A 10 Bright
    LOOP
  }
}
Actor RegenStimpack : PowerupGiver replaces soulsphere
{
   Inventory.PickupMessage "$POWER_REGEN"
     Tag "$TAG_REGEN"
  Powerup.Type Regeneration
  Powerup.Duration -30
  Inventory.MaxAmount 10
  Inventory.Interhubamount 10
  Inventory.Icon "INVRA0"
  +Inventory.InvBar
  +CountItem
  +INVENTORY.BIGPOWERUP
  +INVENTORY.FANCYPICKUPSOUND
  inventory.usesound "items/stimuse"
  Scale 0.75
  States
  {
  Spawn:
    SOUL A 10
	SOUL A 10 Bright
    LOOP
  }
}
Actor PurgeStimpack : CustomInventory replaces radsuit
{
   Inventory.PickupMessage "$POWER_PURGE"
     Tag "$TAG_PURGE"
  Inventory.MaxAmount 10
  Inventory.Interhubamount 10
  Inventory.Icon "INVPA0"
  +Inventory.InvBar
  +CountItem
  +INVENTORY.BIGPOWERUP
  +INVENTORY.FANCYPICKUPSOUND
  Inventory.PickupSound "misc/p_pkup"
  inventory.usesound "items/stimuse2"
  Scale 0.8
  States
  {
  Spawn:
    SUIT A 10
	SUIT A 10 Bright
    LOOP
  Use:
    TNT1 A 0 A_GiveInventory("Powerironfeet")
	TNT1 A 0
	stop
  }
}
ACTOR BlackwaterBonus : UpgradeStamina
 {
   Inventory.Amount 1
   Inventory.MaxAmount 200
   Inventory.PickupMessage "Max health increased by 100!"
   states
   {
   Spawn:
      BWVI A 5
      loop
   }
 }
ACTOR BlackwaterVial : CustomInventory replaces InvulnerabilitySphere
{
    Inventory.PickupMessage "$POWER_BW"
  Inventory.MaxAmount 1
  Inventory.Interhubamount 1
  Inventory.Icon "INVBA0"
  +CountItem
  +INVENTORY.BIGPOWERUP
  +INVENTORY.FANCYPICKUPSOUND
  Inventory.PickupSound "items/BWVuse"
  Scale 0.8
  States
  {
  Spawn:
    BWVI A 10
	BWVI A 10 Bright
    LOOP
  Pickup:
    TNT1 A 0 A_GiveInventory("BlackwaterBonus",100)
	TNT1 A 0 ACS_namedexecute("BlackwaterScreen",0)
	TNT1 A 0
	stop
  }
}
ACTOR NightvisorBattery : CustomInventory
{
+COUNTITEM
+INVENTORY.INVBAR
Inventory.Amount 1
Inventory.MaxAmount 5
Inventory.PickupFlash "PickupFlash"
Inventory.Icon "CELLA0" 
Inventory.PickupSound "misc/p_pkup"
 Inventory.PickupMessage "$POWER_NIGHTBAT"
     Tag "$TAG_NIGHTBAT"
States
{
Spawn:
CELL A -1

Use:
TNT1 A 0 A_GiveInventory("Nightvisor",120)
Stop
}
}
ACTOR NVGSwitch: Inventory  //Quest One
{
    Inventory.Amount 1
    Inventory.MaxAmount 1
	Inventory.InterHubAmount 0
    -INVBAR
}
ACTOR Nightvisor : CustomInventory replaces Infrared
    {
    +COUNTITEM
    +INVENTORY.INVBAR
    +INVENTORY.KEEPDEPLETED
    +INVENTORY.FANCYPICKUPSOUND
	+INVENTORY.NOSCREENBLINK
    Inventory.Amount 120
    Inventory.MaxAmount 120
	Inventory.InterHubAmount 120
    Inventory.PickupFlash "PickupFlash"
    Inventory.Icon "INVNA0" 
    Inventory.PickupSound "misc/p_pkup"
     Inventory.PickupMessage "$POWER_NIGHTVISOR"
     Tag "$TAG_NIGHTVISOR"
    States
    {
    Spawn:
    NVIS A 6 Bright
    NVIS A 6
    Loop

    Use:
	 TNT1 A 0
    {
	If(CountInv("Nvgswitch")<1) //Can toggled off by pressing button BT_USER1
       {
          A_giveInventory("nvgswitch");
		  A_playsound("items/nightvisionon");
		  Return state("");
		  }
		  else
		  {
		  A_takeInventory("nvgswitch");
		  A_playsound("items/nightvisionoff");
		  Return state("");
		  }
		 }		  
    TNT1 A 0 A_GiveInventory("Colorize")
    TNT1 A 0 A_Overlay(5,"NightVisorOn",1)
    Stop

    NightVisorOn:
    TNT1 A 0 A_OverlayFlags(5,PSPF_RENDERSTYLE|PSPF_ALPHA,1)
    TNT1 A 0 A_OverlayRenderStyle(5,STYLE_translucent)
    TNT1 A 0 A_OverlayAlpha(5,1.0)
    PVIS A 12
    NightVisorWork:
    TNT1 A 0
    {
    If(CountInv("Nightvisor")<1||CountInv("Nvgswitch")<1) //Can toggled off by pressing button BT_USER1
       {
          A_TakeInventory("Colorize");
          A_TakeInventory("PowerNightVision");
          Return state("Null");
       }
    Else
       {
          If(CountInv("PowerNightVision")>0){Return state("");}
          Else
             {
                A_GiveInventory("PowerNightVision",1);
                A_TakeInventory("Nightvisor",1);
                Return state("");
             }
       }

    }
    PVIS ABC 2
    Loop
	}
	}

    ACTOR PowerNightVision : Powerup
    {
	+INVENTORY.NOSCREENBLINK
    Powerup.Duration -3 //Nightvision depletion speed, 1 per second by default
    }

    ACTOR Colorize : Powerup
    {
	+INVENTORY.NOSCREENBLINK
    Powerup.Color DarkGreen,0.4 //Coloring of nightvision
    Powerup.Duration 0x7FFFFFFF
	powerup.Colormap 0.0, 0.0, 0.0, 0.0, 0.3, 0.0
    }
	
ACTOR ItemModKit : CustomInventory replaces BlurSphere
    {
    +COUNTITEM
    +INVENTORY.INVBAR
    +INVENTORY.FANCYPICKUPSOUND
	+INVENTORY.NOSCREENBLINK
    Inventory.Amount 1
    Inventory.MaxAmount 5
    Inventory.PickupFlash "PickupFlash"
    Inventory.Icon "IKITA0" 
    Inventory.PickupSound "misc/p_pkup"
    Inventory.PickupMessage "$POWER_MODKIT"
     Tag "$TAG_MODKIT"
    States
	{
	Spawn:
    MKIT A 6 Bright
    MKIT A 6
    Loop
	
	Use:
	TNT1 A 0 ACS_NAMEDEXECUTEWITHRESULT("ModkitCheck",0)
	TNT1 A 0
	Fail
	}
}
ACTOR NewCoat : inventory
{
Inventory.MaxAmount 1
+IGNORESKILL
}
ACTOR DuraBattery : inventory
{
  scale 0.8
  +COUNTITEM
  states
  {
  Spawn:
    BPAK A -1
    stop
  Pickup:
    TNT1 A 0 A_GiveInventory ("batteries", 240)
    TNT1 A 0 A_GiveInventory ("batteryreload",1)
    stop
  }
}