Classes:PowerMorph

From ZDoom Wiki
Jump to: navigation, search
Note: Wait! Stop! Before you copy this actor's definition into your mod, remember the following things:
  1. You do not need to copy that actor, since it is already defined.
  2. In fact, it's not just useless, it's actually harmful as it can cause problems.
  3. If you want to modify it, or use a modified version, using inheritance is the way to go.
  4. The actor definitions here are put on the wiki for reference purpose only. Learn from them, don't copy them.
  5. There is only one exception: if what you want is changing Ammo capacity, you need to create a new type from Ammo.
Transformation power
Actor type Power Game MiniZDoomLogoIcon.png
DoomEd Number None Class Name PowerMorph


Classes: InventoryPowerupPowerMorph
   (more)

PowerMorph is an internal class. An item of this class is placed in the player's inventory while the Morph powerup is effective. When the power is initially given, the player will be morphed into another player class and will stay that way until the power expires, upon which they will unmorph back into whatever player class they started out as. This power makes the morphing effect available as a power instead of a curse.


Using in DECORATE

The PowerMorph base class defines the same special properties as the MorphProjectile class, except for the MonsterClass property, which doesn't apply to players and the Duration property, which for powerups is set via the associated powerup giver. They are summarised here; for full details and additional notes, please refer to the MorphProjectile class.

  • PowerMorph.PlayerClass classname
Defines what class to morph the player into.
  • PowerMorph.MorphStyle flags
Defines the behaviour of the morphing effects.
  • PowerMorph.MorphFlash classname
Defines the effect flash actor to spawn when the player morphs. If omitted, the game's default teleport fog is used.
  • PowerMorph.UnMorphFlash classname
Defines the effect flash actor to spawn when the player unmorphs. If omitted, the game's default teleport fog is used

Example:

The example below defines a Morph item that, when activated, turns you into a giant cat for two minutes; it is modelled on the Porkelator, but it is a power instead of a curse; you have 500 health points, a chainsaw-like slashing paws attack and can duke it out with Demons and Imps no problem! The essential code is shown below, the full example WAD is here. You can't pickup any items, including health at the moment, but then as a chicken or pig you couldn't either :P Can you survive 120 seconds with 500 health? A Hell Knight can, so try it :)

ACTOR Kittylator : PowerupGiver 666
{
 ....
 Inventory.PickupMessage "Thou possesseth the Kittylator!!"  
 Inventory.PickupSound "world/thunder"
 ....
 Powerup.Type Kitty 
 Powerup.Duration 4200// about 120 seconds
 +COUNTITEM
 +FLOATBOB
 -INVENTORY.AUTOACTIVATE
 -INVENTORY.ALWAYSPICKUP
 States
 {
  Spawn:
   KITT A 12
    ....
    Loop
 }
}
ACTOR PowerKitty : PowerMorph
{
 PowerMorph.PlayerClass "LargeBlackCat"
 PowerMorph.MorphStyle (MRF_FULLHEALTH|MRF_ADDSTAMINA)
}

Notes:

Customisable pickup and weapon switching for morphed players and things like that are being considered on the "to do" list, but may not be possible until DoomScript. You can give a morphed class the +PICKUP actor flag, but this causes a lot of trouble with weapon switching; for full details and additional notes, please refer to the MorphProjectile class.

DECORATE definition

ACTOR PowerMorph : Powerup native
{
  Powerup.Duration -40
}