Classes:PowerupGiver
From ZDoom Wiki
| Inventory | |||
|---|---|---|---|
| Actor type | Internal | Game | |
| DoomEd Number | None | Class Name | Inventory |
Classes: Inventory→PowerupGiver
→ArtiFly
→ArtiInvisibility
→ArtiInvulnerability
→ArtiInvulnerability2
→ArtiSpeedBoots
→ArtiTomeOfPower
→ArtiTorch
→BlurSphere
→EnvironmentalSuit
→Infrared
→InvulnerabilitySphere
→RadSuit
→Scanner
→ShadowArmor
→Targeter
A PowerupGiver is used to give one of the existing powerups to the player using or picking up this item. PowerupGiver is never used directly. It is only used as a base class for many predefined inventory items (e.g. the partial invisibility sphere of Doom or as a base to define new powerup pickups.
Using in DECORATE
There are two ways to define a powerup giver item:
- Items that activate automatically when the player picks them up
- Items that go into the player's inventory and have to be used to do their work.
To create items that get used automatically you have to set inventory.maxamount to 0 and specify the flag +INVENTORY.AUTOACTIVATE. In any other case you will create items that go into the inventory.
Powerup givers support these special properties in addition to the basic Inventory properties:
- powerup.color color, alpha
- powerup.color InverseMap
- powerup.color GoldMap
- Specifies the color and the opacity of the screen blend that is used when the powerup is active. Color is specified either as three integers, an "RR GG BB" string or a color name from the X11R6RGB lump. Alpha is a value between 0.0 and 1.0. Instead of specifying a color you can also use the predefined values 'InverseMap' and 'GoldMap'. These don't set a blending value but instead use either Doom's inverted or Heretic's golden invulnerability palettes.
- powerup.duration time
- The length of time the power up will last in tics (1/35 of a second.)
- powerup.type power_name
- The type of powerup given when item is picked up.
- Possible powerups are: Invulnerable, Strength, Invisibility, Ghost, Shadow, IronFeet, Mask, LightAmp, Torch, Flight, WeaponLevel2, Speed, Minotaur, Scanner, Targeter, Frightener, Damage, Drain, TimeFreezer, Regeneration, Protection, HighJump, Morph.
- powerup.mode mode
- Currently only applies to Invulnerability. Possible modes are: None and Reflective. Reflective makes all projectiles bounce off of the player while the powerup is in effect.
Examples:
This defines Heretic's invulnerability item and is an example for an item that is put in the inventory:
actor ArtiInvulnerability : PowerupGiver 84 { spawnid 133 inventory.pickupmessage "RING OF INVINCIBILITY" inventory.icon "ARTIINVU" inventory.respawntics 4230 inventory.defmaxamount powerup.duration 30 powerup.type "Invulnerable" +COUNTITEM +FLOATBOB +INVENTORY.PICKUPFLASH states { Spawn: INVU ABCD 3 loop } }
This defines Doom's Light Amplification Visor and is an example for an item that activates when being picked up:
actor Infrared : PowerupGiver 2045 { spawnid 138 inventory.pickupmessage "Light Amplification Visor" inventory.maxamount 0 powerup.duration 90 powerup.type "LightAmp" +COUNTITEM +INVENTORY.AUTOACTIVATE +INVENTORY.ALWAYSPICKUP states { Spawn: PVIS A 6 PVIS B 6 bright loop } }
DECORATE definition
Actor PowerupGiver : Inventory native { Inventory.DefMaxAmount +INVENTORY.INVBAR +INVENTORY.FANCYPICKUPSOUND Inventory.PickupSound "misc/p_pkup" }

