Actor ShadowWarriorHealthBonus : HealthBonus replaces HealthBonus { Inventory.Amount 2 Inventory.PickupSound "SWITEMUP" } 
Actor ShadowWarriorArmorBonus : ArmorBonus replaces ArmorBonus { Inventory.Amount 2 Inventory.PickupSound "SWITEMUP" }

Actor ShadowWarriorLowMedikit : Health 20020
{
    //$Category Shadow Warrior Items
	Inventory.Amount 20
	Inventory.PickupMessage "Medikit +20"
	Health.LowMessage 20, "Medikit +20"
	Inventory.PickupSound "SWITEMUP"
	States
	{
	Spawn:
		SWIN N -1
		Stop
	}
}


ACTOR PortableMedikit : CustomInventory 20021
{
    //$Category Shadow Warrior Items
	Inventory.PickupMessage "Portable Medikit"
	Inventory.Amount 100
	Inventory.InterHubAmount 100
	Inventory.MaxAmount 100
	Inventory.Icon "MEDKB0"
	Inventory.PickupSound "SWITEMUP"
    +INVENTORY.INVBAR
    -INVENTORY.AUTOACTIVATE
	+INVENTORY.PERSISTENTPOWER
	States
	{
	Spawn:
		MEDK A -1
		stop
    Use:
        TNT1 A 1
		TNT1 A 0 A_jumpifinventory("health",100,"Spawn")
		TNT1 A 0 A_JumpIfInventory("PortableMedikit",1,"Use2")
		Fail
	Use2:
	    TNT1 A 1
		TNT1 A 0  A_JumpIfHealthLower(100, "Use3")
		Fail
    Use3:
	     TNT1 A 1
		 TNT1 A 0 A_PlaySound("AHH", 3)
         TNT1 A 0 A_GiveInventory("health",1)
		 TNT1 A 0 A_TakeInventory("PortableMedikit",1)
		 TNT1 A 0 A_jumpifinventory("health",100,"Spawn")
	    Goto Use
    }
}


Actor Cookie : CustomInventory 20022
{
    //$Category Shadow Warrior Items
	+COUNTITEM
	+INVENTORY.AUTOACTIVATE
	Inventory.PickupMessage "Fortune Cookie"
	Inventory.PickupSound "ITEMBIG2"
	States
	{
	Spawn:
		MEDK C 1 Bright
		Loop
	Pickup:
	    TNT1 A 0 A_JumpIfInventory("Health", 200, "Pickup")
	    TNT1 A 0 A_GiveInventory("CookieHealth", 1)
	    TNT1 A 0 ACS_ExecuteAlways(978, 0,0,0)
		Stop
	}
}

Actor CookieHealth : Health {Inventory.Amount 50 Inventory.MaxAmount 200}

ACTOR Tools : Inventory 20023
{
    //$Category Shadow Warrior Items
	Inventory.PickupMessage "Tools"
	Inventory.Amount 1
	Inventory.InterHubAmount 1
	Inventory.MaxAmount 1
	Inventory.Icon "SWINO0"
	Inventory.PickupSound "SWITEMUP"
    +INVENTORY.INVBAR
    -INVENTORY.AUTOACTIVATE
	+INVENTORY.PERSISTENTPOWER
	States
	{
	Spawn:
		SWIN P -1
		stop
    }
}

ACTOR NightVisionSW : CustomInventory 20024
{
    //$Category Shadow Warrior Items
	Inventory.PickupMessage "Night Vision"
	Inventory.Amount 100
	Inventory.InterHubAmount 100
	Inventory.MaxAmount 100
	Inventory.Icon "NIGHB0"
	Inventory.PickupSound "SWITEMUP"
	SpawnId 242
    +INVENTORY.INVBAR
    -INVENTORY.AUTOACTIVATE
	+INVENTORY.PERSISTENTPOWER
	scale 0.5
	States
	{
	Spawn:
		NIGH A -1
		stop
	Use:
	TNT1 A 1 
	TNT1 A 0 A_JumpIfInventory("NightVisionSWCheck", 1, "Use2")
	TNT1 A 0 A_GiveInventory("NightVisionSWCheck", 1)
	TNT1 A 0 A_PlaySound("NVON")
	TNT1 A 0 ACS_ExecuteAlways(289, 0,0,0)
	Fail
	Use2:
	TNT1 A 0 A_PlaySound("NVOFF")
	TNT1 A 0 A_TakeInventory("NightVisionSWCheck", 2)
	Fail
    }
}

ACTOR NightVisionSWCheck : Inventory
{
	Inventory.Amount 1
	Inventory.MaxAmount 1
    -INVENTORY.INVBAR
    -INVENTORY.AUTOACTIVATE
}


ACTOR SmokeBomb : CustomInventory 20025
{
    //$Category Shadow Warrior Items
	Inventory.PickupMessage "Smoke Bomb"
	Inventory.Amount 100
	Inventory.InterHubAmount 100
	Inventory.MaxAmount 100
	Inventory.Icon "SWINB0"
	Inventory.PickupSound "SWITEMUP"
    +INVENTORY.INVBAR
    -INVENTORY.AUTOACTIVATE
	+INVENTORY.PERSISTENTPOWER
	scale 0.5
	States
	{
	Spawn:
		SWIN A -1
		stop
	Use:
	TNT1 A 1 
	TNT1 A 0 A_JumpIfInventory("SmokeBombCheck", 1, "Use2")
	TNT1 A 0 A_GiveInventory("SmokeBombCheck", 1)
	TNT1 A 0 A_PlaySound("GASPOP")
	TNT1 A 0 A_PlaySound("LoWang/ShadowWarrior", 5)
	TNT1 A 0 ACS_ExecuteAlways(290, 0,0,0)
	Fail
	Use2:
	TNT1 A 0 
	Fail
    }
}

ACTOR SmokeBombCheck : Inventory
{
	Inventory.Amount 1
	Inventory.MaxAmount 1
    -INVENTORY.INVBAR
    -INVENTORY.AUTOACTIVATE
}

ACTOR FlashBomb : CustomInventory 20026
{
    //$Category Shadow Warrior Items
	Inventory.PickupMessage "Flash Bomb"
	Inventory.Amount 2
	Inventory.InterHubAmount 2
	Inventory.MaxAmount 2
	Inventory.Icon "SWIND0"
	Inventory.PickupSound "SWITEMUP"
    +INVENTORY.INVBAR
    -INVENTORY.AUTOACTIVATE
	+INVENTORY.PERSISTENTPOWER 
	scale 0.5
	States
	{
	Spawn:
		SWIN C -1
		stop
	Use:
	TNT1 A 0
	TNT1 A 0 A_TakeInventory("FlashBomb", 1)
	TNT1 A 0 A_SetBlend("99 99 99", 1.0, 55)
	TNT1 A 0 A_SpawnItemEx("FlashExplode", 0, 15, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
	TNT1 A 0 A_PlaySound("GASPOP")
	fail
    }
}

Actor FlashExplode
{
+NODAMAGETHRUST
DamageType "FlashBombDamage"
States
{
Spawn:
TNT1 A 1
TNT1 A 0 A_Explode(5, 600)
stop
}
}


ACTOR GasBomb : CustomInventory 20027
{
    //$Category Shadow Warrior Items
	Inventory.PickupMessage "Gas Bomb"
	Inventory.Amount 1
	Inventory.InterHubAmount 1
	Inventory.MaxAmount 1
	Inventory.Icon "SWINF0"
	Inventory.PickupSound "SWITEMUP"
    +INVENTORY.INVBAR
    -INVENTORY.AUTOACTIVATE
	+INVENTORY.PERSISTENTPOWER
	scale 0.5
	States
	{
	Spawn:
		SWIN E -1
		stop
	Use:
	TNT1 A 0
	TNT1 A 0 A_PlaySound("PUNCH")
	TNT1 A 0 A_FireCustomMissile("GasBombProjectile")
	Stop
    }
}

Actor GasBombProjectile
{
	Radius 2
	height 2
	Speed 5
	Projectile
	-NOGRAVITY
	+RANDOMIZE
	+DOOMBOUNCE
	+BOUNCEONACTORS
	+NODAMAGETHRUST
	+BLOODLESSIMPACT
	+NOBLOOD
	DamageType "GasBombDamage"
	Gravity 0.15
    scale 0.3	
    DeathSound "BTFIRE"
    SeeSound "CHBNCE1"
    States
	{
    Spawn: 
     SWB1 ABCDE 4 A_CustomMissile("GrenadeSmoke",0,0,0) 
	 Loop
	Death:
	TNT1 A 1
	TNT1 A 0 A_PlaySound("BTFIRE")
	//TNT1 A 0 A_SpawnItemEx("SmokeProjectile2", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
	SWB1 A 0 A_PlaySound("HISS1", 5, 1.0, true)
	GasBombReaction:
	   TNT1 A 0 A_JumpIfInventory("GasBombReactionTime", 30, "TimeOut")
	   SWB1 A 4 A_CustomMissile("GasBombSmoke", 0, 0, random (0, 360), 2, random (80, 120))
	   SWB1 B 4 A_Explode(2, 300)
	   SWB1 C 4 A_CustomMissile("GasBombSmoke", 0, 0, random (0, 360), 2, random (80, 120))
	   SWB1 D 4 A_Explode(2, 300)
	   SWB1 E 4 A_CustomMissile("GasBombSmoke", 0, 0, random (0, 360), 2, random (80, 120))
	   TNT1 A 0 A_Explode(2, 300)
	   TNT1 A 0 A_GiveInventory("GasBombReactionTime", 1)
	   Loop
	TimeOut:
	SWB1 A 0 A_StopSound(5)
	Stop 
}
}

Actor GasBombReactionTime : Inventory { Inventory.MaxAmount 30 }

Actor GasBombSmoke
{
speed 2
+NOGRAVITY
+NOBLOCKMAP
+NOCLIP
+MISSILE
+BLOODLESSIMPACT
+NOBLOOD 
+FORCEXYBILLBOARD
+NODAMAGETHRUST
scale 0.3
    States
	{
    Spawn:
     SMBM ABCDEFGHIJKLMNOPQRST 5
	 Stop
}
}

ACTOR Caltrops : CustomInventory 20028
{
    //$Category Shadow Warrior Items
	Inventory.PickupMessage "Caltrops"
	Inventory.Amount 3
	Inventory.InterHubAmount 3
	Inventory.MaxAmount 3
	Inventory.Icon "SWINH0"
	Inventory.PickupSound "SWITEMUP"
    +INVENTORY.INVBAR
    -INVENTORY.AUTOACTIVATE
	+INVENTORY.PERSISTENTPOWER
	scale 0.5
	States
	{
	Spawn:
		SWIN G -1
		stop
	Use:
	TNT1 A 0
	TNT1 A 0 A_PlaySound("PUNCH")
	TNT1 A 0 A_TakeInventory("Caltrops", 1)
	TNT1 A 0 A_FireCustomMissile("CaltropsMissile")
	fail
    }
}

Actor CaltropsMissile
{
	Radius 2
	height 2
	Speed 5
	Projectile
	Damage 0
	+Ripper
	-NOGRAVITY
	Gravity 0.25	
    DeathSound "TACK1"
    States
	   {
       Spawn: 
          SWIN IJ 4 
	      Loop
	   Death:
	      TNT1 A 1
	      TNT1 A 0 A_SpawnItemEx("CaltropsOnMap", 0, 0, 5)
	      Stop 
        }
}


Actor CaltropsOnMap
{
  radius 6
  height 4
  scale 0.4
  speed 0
  Damage 3
  DamageType "CaltropsDamage"
  +NODAMAGETHRUST
  +NOGRAVITY
  +MISSILE
  +SHOOTABLE
  +BLOODSPLATTER
  scale 1.0
  States
  {
  Spawn:
    TNT1 A 0
	TNT1 A 0 A_JumpIfCloser(20, "Death")
    SWIN K 1 
    loop
  Death:
    TNT1 A 1 A_Explode(15, 6)
    stop
  XDeath:
    TNT1 A 1 A_Explode(15, 6)
    stop
  }
}








Actor ShadowWarriorGrayArmor : BasicArmorPickup replaces GreenArmor 20029
{
    //$Category Shadow Warrior Items
	Radius 20
	Height 16
	Inventory.Pickupmessage "ARMOR"
	Inventory.Icon "SWINL0"
	Armor.SavePercent 40
	Armor.SaveAmount 50
	Inventory.PickupSound "ITEMBIG2"
	States
	{
	Spawn:
	   SWIN L -1 
	stop
	}
}

Actor ShadowWarriorRedArmor : BasicArmorPickup replaces BlueArmor 20030
{
    //$Category Shadow Warrior Items
	Radius 20
	Height 16
	Inventory.Pickupmessage "ARMOR"
	Inventory.Icon "SWINM0"
	Armor.SavePercent 90
	Armor.SaveAmount 100
	Inventory.PickupSound "ITEMBIG2"
	States
	{
	Spawn:
	   SWIN M -1 
	stop
	}
}






