Classes:PowerMorph
Note: Wait! Stop! Before you copy this actor's definition into your mod, remember the following things:
|
| Transformation power | |||
|---|---|---|---|
| Actor type | Power | Game | |
| DoomEd Number | None | Class Name | PowerMorph |
Classes: Inventory→Powerup→PowerMorph
(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 }