Classes:PowerLightAmp
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:
|
| Light amplification power | |||
|---|---|---|---|
| Actor type | Power | Game | |
| DoomEd Number | None | Class Name | PowerLightAmp |
Classes: Inventory→Powerup→PowerLightAmp
→PowerTorch
One of the many powerups, i.e. items based on the Powerup class. While an item of this class is placed in an actor's inventory, the actor will be affected by it. Usually powerups are given through a PowerupGiver, but they can be given directly as well (see here for more details).
PowerLightAmp fully illuminates the level. The most basic example of it is Doom's Light Amplification Goggles.
The effect is provided by setting the owner's PlayerInfo field player.fixedlightlevel to 1.
ZScript definition
| Note: The ZScript definition below is for reference and may be different in the current version of UZDoom. The most up-to-date version of this code can be found on UZDoom GitHub. |
class PowerLightAmp : Powerup
{
Default
{
Powerup.Duration -120;
}
//===========================================================================
//
// APowerLightAmp :: DoEffect
//
//===========================================================================
override void DoEffect ()
{
Super.DoEffect ();
let player = Owner.player;
if (player != NULL && player.fixedcolormap < PlayerInfo.NUMCOLORMAPS)
{
if (!isBlinking())
{
player.fixedlightlevel = 1;
}
else
{
player.fixedlightlevel = -1;
}
}
}
//===========================================================================
//
// APowerLightAmp :: EndEffect
//
//===========================================================================
override void EndEffect ()
{
Super.EndEffect();
if (Owner != NULL && Owner.player != NULL && Owner.player.fixedcolormap < PlayerInfo.NUMCOLORMAPS)
{
Owner.player.fixedlightlevel = -1;
}
}
}
DECORATE definition
|
Warning: This is legacy code, kept for archival purposes only. DECORATE was effectively deprecated with the introduction of ZScript. UZDoom internally uses the ZScript definition above. |
ACTOR PowerLightAmp : Powerup native { Powerup.Duration -120 }
