Classes:PowerHighJump

From ZDoom Wiki
Revision as of 15:14, 2 May 2017 by Blue Shadow (talk | contribs) (Remove {{new}})
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.
High jump power
Actor type Power Game MiniZDoomLogoIcon.png (ZDoom)
DoomEd Number None Class Name PowerHighJump


Classes: InventoryPowerupPowerHighJump

PowerHighJump is an internal class. An item of this class is placed in the player's inventory while HighJump is active. This powerup doubles the JumpZ of the playerclass, which effectively quadruples the player's jump height (until maxstepheight is considered; to determine effective jump multiplier, use (((JumpZ*2)**2)/2+maxstepheight)/((JumpZ**2)/2+maxstepheight)). This lasts until the powerup has expired.

The strength of the jump 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 jump height.

Like all other Powerups, items of this class are never used directly. Instead you have to create a new item that inherits from {{Class|PowerupGiver]] to give it to the player.

Example

This defines ZDoom's High Jump item and is an example for an item that is put in the inventory:

actor HighJump : PowerupGiver
{
 inventory.pickupmessage "High Jump!!"
 inventory.icon "MEGAA0"
 powerup.color DarkSalmon 0.25
 inventory.maxamount 0
 inventory.usesound "pickups/slowmo"
 powerup.type "HighJump"
 powerup.duration 1000
 translation "128:143=144:151"
 +AUTOACTIVATE
 +INVENTORY.FANCYPICKUPSOUND
   states
 {
 Spawn:
   MEGA ABCD 4 bright
   loop
 }
}

ZScript definition

class PowerHighJump : Powerup
{
    Default
    {
        Powerup.Strength 2;
    }
}

DECORATE definition (deprecated)

ACTOR PowerHighJump : Powerup native {}