/////////////////////////////////////////////////////////////////////////
// Inventory definitions
/////////////////////////////////////////////////////////////////////////

actor shieldauto : ArmorBonus{
  +COUNTITEM
  +INVENTORY.ALWAYSPICKUP
   Armor.Savepercent 100.00
   Armor.Saveamount 5
   Armor.maxfullabsorb 0
   Armor.MaxSaveamount 200
}

actor fullshield : BasicArmorPickup{
	Armor.saveamount 200
	Armor.savepercent 100.00
	Armor.maxfullabsorb 0
}

actor overshield : BasicArmorPickup{
	Armor.saveamount 600
	Armor.savepercent 100.00
	Armor.maxfullabsorb 0
}

actor shieldbooster : CustomInventory replaces BlueArmor{
	scale 0.33
	Inventory.Amount 1
	Inventory.Maxamount 10
	Inventory.PickupMessage "Shield Booster Unit"
	inventory.pickupsound "items/armorpickup"
	-INVENTORY.INVBAR
    +COUNTITEM
	+INVENTORY.BIGPOWERUP
	States{
		Spawn:
			SBST ABCDEDCB 2 bright
			loop
		Use:
			TNT1 A 0
			TNT1 A 0 A_PlaySound("items/armorup", CHAN_AUTO)
			TNT1 A 0 A_Giveinventory("fullshield", 1)
			TNT1 A 0 A_TakeInventory("PlayerShieldDamage",999)
			//fail 
			Stop
	}
}


actor sbooster_spawner : RandomSpawner replaces Radsuit {
	dropitem "shieldbooster", 255 1
	dropitem "healthstim", 255 4
}


//No Stimpacks, no health bonus and no armor bonus in the mod, only medikits... 
//
actor NullItem1 replaces HealthBonus{}
actor NullItem2 replaces ArmorBonus{}
actor NullActor {}

//health stims
actor healthstim : CustomInventory replaces GreenArmor 26100 {
  inventory.amount 1
  inventory.maxamount 15
  inventory.pickupsound "items/hstim_up"
  inventory.pickupmessage "Health Stim"
  scale 0.28
  -INVENTORY.INVBAR
  +COUNTITEM
  +INVENTORY.BIGPOWERUP
  states{
  	Spawn:
		HSTI A -1
		loop
	Use:
		TNT1 A 0
		TNT1 A 0 A_PlaySound("items/stimshot", CHAN_VOICE)
		TNT1 A 0 A_GiveInventory("lifeup", 1)
		//fail
		Stop
	}
}

actor healtstims_spawner: RandomSpawner replaces Medikit{
	DropItem "healthstim" 48
}

actor healtstims_spawner2: RandomSpawner {
	DropItem "healthstim" 164
}

actor healthpack : CustomInventory replaces Berserk {
	scale 0.28
	Inventory.PickupMessage "Health Pack"
	inventory.pickupsound "items/hpack_up"
	//+INVENTORY.ALWAYSPICKUP
    +COUNTITEM
	+INVENTORY.BIGPOWERUP
	States{
		Spawn:
			MPAK A -1
			stop
		Pickup:
			TNT1 A 0 A_JumpIfInventory("healthstim",14,"PickupFail")
			TNT1 A 0 A_GiveInventory("healthstim", 2)
			stop
		PickupFail:
			TNT1 A 0
			fail
	}

}




actor lifeup : Health {
  +COUNTITEM
  +INVENTORY.ALWAYSPICKUP
  +INVENTORY.BIGPOWERUP
  Inventory.Amount 80
  Inventory.MaxAmount 200
}



actor overshieldsphere : custominventory replaces soulsphere {
	+FLOATBOB
	+COUNTITEM
	+INVENTORY.ALWAYSPICKUP
	+INVENTORY.BIGPOWERUP
	inventory.pickupsound "powerup/overshield"
	inventory.pickupmessage "OverShield Sphere!"
	states {
		spawn:
			OSHD ABCDCBA 2 bright
			loop
		pickup:
			TNT1 A 0 A_GiveInventory("overshield")
			TNT1 A 0 A_SetBlend("99 58 0", 0.8, 15)
			TNT1 A 0 A_TakeInventory("PlayerShieldDamage",999)
			stop
	}
}

actor defensesphere : custominventory replaces blursphere {
	scale 0.9
	+FLOATBOB
	+COUNTITEM
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	+INVENTORY.BIGPOWERUP
	inventory.pickupsound "powerup/defense"
	inventory.pickupmessage "Defense Sphere!"
	states {
		spawn:
			DEFS ABCDE 4 bright
			loop
		pickup:
			TNT1 A 0 A_GiveInventory("defense_powerup")
			TNT1 A 0 ACS_ExecuteAlways(pmsx_PowerUpFlash,0, 4,0,0)
			stop
	}
}

actor defense_powerup : PowerupGiver {
	//powerup.color "255 132 0"
	Inventory.MaxAmount 0
	Powerup.Type DefenseAura
	powerup.duration -60
	+AUTOACTIVATE
}

actor PowerDefenseAura : PowerProtection
{
	damagefactor "normal", 0.5
}

actor inmunesphere : custominventory replaces InvulnerabilitySphere {
	+FLOATBOB
	+COUNTITEM
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	+INVENTORY.BIGPOWERUP
	inventory.pickupsound "powerup/inmune" 
	inventory.pickupmessage "Inmunity Sphere!"
	states{
		spawn:
			INVS ABCDCB 4 Bright
			loop
		pickup:
			TNT1 A 0 A_GiveInventory("invul_powerup")
			TNT1 A 0 ACS_ExecuteAlways(pmsx_PowerUpFlash,0, 1,0,0)
			stop
	}
}

actor invul_powerup : PowerupGiver {
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	Inventory.MaxAmount 0
	Powerup.Type "Invulnerable"
}



actor ultrasphere : CustomInventory replaces Megasphere
{
  +FLOATBOB
  +COUNTITEM
  +INVENTORY.ALWAYSPICKUP
  +INVENTORY.BIGPOWERUP
  Inventory.PickupMessage "Ultra Sphere!!"
  Inventory.PickupSound "powerup/ultra"
  States
  {
  Spawn:
    ULSP ABCDCB 4 bright
    Loop
  Pickup:
    TNT1 A 0 A_GiveInventory("overshield", 1)
    TNT1 A 0 A_GiveInventory("ultralifeup", 1)
	TNT1 A 0 A_GiveInventory("PlayerStamina", 100)
	TNT1 A 0 A_TakeInventory("PlayerShieldDamage",999)
	TNT1 A 0 ACS_ExecuteAlways(pmsx_PowerUpFlash,0, 2,0,0)
    Stop
  }
}

actor ultralifeup : health {
	Inventory.Amount 400
	Inventory.MaxAmount 400
}

actor pdafullmap : CustomInventory replaces Allmap {
	+COUNTITEM
	+INVENTORY.ALWAYSPICKUP
	Inventory.PickupSound "powerup/allmap"
	Inventory.PickupMessage "Area Map PDA"
	states{
		spawn:
			AMPD A -1 bright
			stop
		pickup:
			TNT1 A 0 ACS_ExecuteAlways(pmsx_PowerUpFlash,0, 3,0,0)
			TNT1 A 0 A_GiveInventory("Allmap")
			stop
	}
}

actor msxBackpack : BackpackItem replaces Backpack {
	scale 0.75
	Inventory.PickupMessage "Ammunition Backpack"
	inventory.pickupsound "items/ammopack"
	states{
		spawn:
			BPK2 A -1
			stop
	}
}

actor msxBackpack2 : msxBackpack replaces Chainsaw{}




