Classes:WeaponGiver

From ZDoom Wiki
Jump to navigation Jump to search
Note: Wait! Stop! You do not need to copy this actor's code into your project! Here's why:
  1. This actor is already defined in GZDoom, there's no reason to define it again.
  2. In fact, trying to define an actor with the same name will cause an error (because it already exists).
  3. If you want to make your own version of this actor, use inheritance.
  4. Definitions for existing actors are put on the wiki for reference purpose only.
Weapon giver
Actor type Internal Game MiniZDoomLogoIcon.png (ZDoom)
DoomEd Number None Class Name WeaponGiver


Classes: InventoryWeaponWeaponGiverAssaultGunStanding
A class that is used to define alternate pickups for weapons. A weapon giver is affected by game modes like a weapon (for respawning, staying, and so on) but isn't, itself, a weapon. Instead, it gives the last weapon defined in its DropItem list. For this reason, a weapon giver should have only one entry in its DropItem list.

Like a weapon, a WeaponGiver can be specified a certain amount of ammo. By default (for the -1 value), it will give the same amount as the weapon it gives; but a value of 0 or more is given it overrides the weapon's normal ammo quantity. This can be used to create fully-loaded or fully-depleted variant of weapons.

DECORATE definition

ACTOR WeaponGiver : Weapon native
{
  Weapon.AmmoGive1 -1
  Weapon.AmmoGive2 -1
}