TakeInventory

From Eternity Wiki
Revision as of 02:34, 10 May 2026 by Printz (talk | contribs)
Jump to navigationJump to search

Description

This is an ACS built-in function.

Takes (removes) one or more items from player's inventory.

Usage

void TakeInventory(str item_name, int amount)

Parameters

  • item_name: name of inventory item or power to remove
  • amount: how many to remove. Can be negative, which will remove all.

Return value

Examples

No examples given.

Notes

If amount is 0, it will do nothing.

If not activated by a given player, it will affect all players.

For taking power directly by Power... name, it will reduce by the given tics. If it's infinite (including always berserk), it will just disable it.

For taking health, it will never kill a player, just leave him/her at 1% health minimum.

For taking power by item effect name, it reduces the availability in tics, by multiplying by how much each pick-up provides. For berserk it always removes the power.

For taking weapons by giver name, it removes the weapon and also whatever ammo was provided when picking one up.

For taking backpacks, it will remove the ammo bonus, and:

  • if amount is less than -1 (e.g. -2 or less), then it will take all the ammo as well
  • if amount is exactly -1, only take away the bonus
  • if amount is strictly positive, take the ammo-per-backpack multiplied by that amount

This function's identification in zspecial.acs is: ACS internal.

See also