Classes:PowerDrain
Classes: Inventory→Powerup→PowerDrain
(more)
Note: Wait! Stop! Before you copy this actor's definition into your mod, remember the following things:
|
Health drain power | |||
---|---|---|---|
Actor type | Power | Game | ![]() |
DoomEd Number | None | Class Name | PowerDrain |
PowerDrain is an internal class. An item of this class is placed in the player's inventory while the Drain powerup is effective. During the time this effect is active, the player will be given health that amounts to 50% of the damage done to other monsters/players.
The strength of drain effect can be controlled with the Powerup.Strength property which acts as a multiplier. In addition, if multiple powerups of this type are in the inventory, the engine picks the one with the most strength yield to boost the amount of health drained.
Each time a drain event happens, the *drainhealth player sound is played. The sound is played on the item channel (CHAN_ITEM) at full volume and with normal attenuation (ATTN_NORM).
Like all other powerup items of this class are never used directly. Instead you have to create a new item that inherits from PowerupGiver to give it to the player.
Examples
This defines ZDoom's Drain item and is an example for an item that is put in the inventory:
ACTOR Drain : PowerupGiver { Inventory.PickupMessage "Vampirism!!" Inventory.Icon "MEGAA0" Powerup.Color Red 0.25 Inventory.MaxAmount 0 Inventory.UseSound "pickups/slowmo" Powerup.Type "Drain" Powerup.Duration 1000 Translation "128:143=176:191" +INVENTORY.AUTOACTIVATE +INVENTORY.FANCYPICKUPSOUND States { Spawn: MEGA ABCD 4 Bright Loop } }
ZScript definition
class PowerDrain : Powerup { Default { Powerup.Strength 0.5; Powerup.Duration -60; } }
DECORATE definition (deprecated)
ACTOR PowerDrain : Powerup native { Powerup.Duration -60 }