Classes:Ammo
| Note: Wait! Stop! You do not need to copy this actor's code into your project! Here's why: 
 | 
| Ammo | |||
|---|---|---|---|
| Actor type | Internal | Game |  (ZDoom) | 
| DoomEd Number | None | Class Name | Ammo | 
Classes: Inventory→Ammo
 →BlasterAmmo
 →Cell
 →Clip
 →ClipOfBullets
 →CrossbowAmmo
 →ElectricBolts
 →EnergyPod
 →GoldWandAmmo
 →HEGrenadeRounds
 →MaceAmmo
 →Mana1
 →Mana2
 →MiniMissiles
 →PhoenixRodAmmo
 →PhosphorusGrenadeRounds
 →PoisonBolts
 →RocketAmmo
 →Shell
 →SkullRodAmmo
An Ammo item defines ammunition for use by weapons. For the most part ammo acts like a normal inventory item but there are some differences:
- Only items that inherit directly from Ammo are separate types. All items that inherit from a subclass of Ammo define new pickup items for that ammo type.
- The amount of ammo the player can carry can be affected by picking up a subclass of BackpackItem.
- The amount of ammo each item gives the player can be increased for the easiest and hardest skill level in the game.
- Ammunition is never placed in the inventory bar. Instead, it is shown in its own place on the HUD or status bar.
Using in DECORATE
Ammo items support all the basic Inventory properties. In addition they define:
- Ammo.BackpackAmount amount
- The amount of this ammo type received from a backpack.
- Ammo.BackpackMaxAmount amount
- The maximum amount of this ammo type that can be carried with a backpack.
- Ammo.DropAmount amount
- Specifies the amount of ammo a dropped item without any explicit amount given contains. By default ammo amount is reduced by half when it's dropped by enemies, but this property can override that. Note that dropped amount can also be explicitly set in the DropItem property.
Note that ammo capacity (Inventory.MaxAmount, Ammo.BackpackAmount and Ammo.BackpackMaxAmount) are only relevant for a type derived directly from Ammo, such as Clip. Types with further derivation (such as ClipBox which is derived from Clip) use their parent class's amounts.
Examples:
This defines a new ammo type:
actor LaserRecharge : Ammo 10471
{
  Inventory.PickupMessage "Laser recharge unit"
  Inventory.Amount 10
  Inventory.MaxAmount 200
  Inventory.Icon "AAMOA0"
  Ammo.BackpackAmount 10
  Ammo.BackpackMaxAmount 400
  states
  {
  Spawn:
    ZCLP A -1
    stop
  }
}
This defines a second pickup item for the same ammo type:
actor LargeLaserRecharge : LaserRecharge 10472
{
  Inventory.PickupMessage "Large laser recharge unit"
  Inventory.Amount 50
  states
  {
  Spawn:
    AAMO A -1
    stop
  }
}
DECORATE definition
ACTOR Ammo : Inventory native { +INVENTORY.KEEPDEPLETED Inventory.PickupSound "misc/ammo_pkup" }
See also
- Chex Quest actors
- Chex Quest internal actors
- Chex Quest 3 actors
- Chex Quest 3 internal actors
- Doom actors
- Doom internal actors
- Doom II actors
- Doom II internal actors
- Heretic actors
- Heretic internal actors
- Hexen actors
- Hexen internal actors
- Strife actors
- Strife internal actors
- ZDoom actors
- ZDoom internal actors
- Internal
- Editing references