A_DropItem

From ZDoom Wiki
Jump to navigation Jump to search

Actor A_DropItem (class<Actor> item [, int dropamount [, int chance]])

Usage

The calling actor drops the specified item. This works in a similar way to the DropItem actor property.

Parameters

  • item: The item to drop. This can be any valid actor class, not just inventory.
  • dropamount: The inventory amount the dropped item contains. This is only meaningful with actors inheriting from the Inventory class. If dropamount is greater than 0, the amount of inventory gained from picking up the item equals exactly to that number. Otherwise, the amount gotten is the same as the amount defined by the item itself, except for ammo items, which in this case, the amount is determined by the current skill level's DropAmmoFactor. Default is -1.
  • chance: The probability of the drop. This ranges from 0 as being "never drop" to 256 as being "always drop". Default is 256.

Return value

Returns a pointer to item if it was dropped successfully, otherwise it returns null.

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.


See also