A_TakeFromSiblings

From ZDoom Wiki
Jump to navigation Jump to search

int A_TakeFromSiblings (string type [, int count])

Usage

Removes count items of type type from the calling actor's siblings' inventory. The minimum amount of item of a type in an inventory is zero, removing a greater amount than what a sibling actually possesses will not result in a negative amount.

An actor's siblings are actors which share a common master actor with said actor. These siblings are considered the children of the master. This relationship is formed when those children actors are spawned by the master actor through A_SpawnItemEx with the SXF_SETMASTER flag passed to the function.

Parameters

  • type: the item to take. This should be a valid inventory item.
  • count: the number of samples of this item to take. If this is 0 or a value which is equal to or greater than the number of samples in the inventory, the item is cleared from the inventory unless it has the INVENTORY.KEEPDEPLETED flag set, and in which case, its amount is merely reduced to 0. Default is 0.

Return value

The function returns the total number of sibling actors which have one or more samples of type (before attempting removal) in their inventory.

Examples

Nuvolachalk.png Note: This article lists no examples. If you make use of this feature in your own project(s) or know of any basic examples that could be shared, please add them. This will make it easier to understand for future authors seeking assistance. Your contributions are greatly appreciated.