Classes:ThrustFloor

From ZDoom Wiki
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.
Spike
Actor type Hazard Game MiniHexenLogoIcon.png (Hexen)
DoomEd Number None Class Name ThrustFloor


Classes: ThrustFloor
 →ThrustFloorDown
 →ThrustFloorUp
ThrustFloor defines the behavior of spikes, and it is its children classes that should be used in a map. The first argument determines whether it starts raised (true) or sunk (false), and the second determines whether it is bloody (true) or not (false). These values are changed during play. A_ThrustInitDn creates dirt clumps that are then destroyed by A_ThrustRaise, leaving some short-lived dirt instead. Many flags are also set and reset by these functions, erasing most other flags that could be added to a custom object.

DECORATE definition

ACTOR ThrustFloor native
{
  Radius 20
  Height 128

  action native A_ThrustRaise();
  action native A_ThrustImpale();
  action native A_ThrustLower();
  action native A_ThrustInitDn();
  action native A_ThrustInitUp();

  States
  {
  ThrustRaising:
    TSPK A 2 A_ThrustRaise
    Loop
  BloodThrustRaising:
    TSPK B 2 A_ThrustRaise
    Loop
  ThrustLower:
    TSPK A 2 A_ThrustLower
    Loop
  BloodThrustLower:
    TSPK B 2 A_ThrustLower
    Loop
  ThrustInit1:
    TSPK A 3
    TSPK A 4 A_ThrustInitDn
    TSPK A -1
    Loop
  BloodThrustInit1:
    TSPK B 3
    TSPK B 4 A_ThrustInitDn
    TSPK B -1
    Loop
  ThrustInit2:
    TSPK A 3
    TSPK A 4 A_ThrustInitUp
    TSPK A 10
    Loop
  BloodThrustInit2:
    TSPK B 3
    TSPK B 4 A_ThrustInitUp
    TSPK B 10
    Loop
  ThrustRaise:
    TSPK A 8 A_ThrustRaise
    TSPK A 6 A_ThrustRaise
    TSPK A 4 A_ThrustRaise
    TSPK A 3 A_SetSolid
    TSPK A 2 A_ThrustImpale
    Loop
  BloodThrustRaise:
    TSPK B 8 A_ThrustRaise
    TSPK B 6 A_ThrustRaise
    TSPK B 4 A_ThrustRaise
    TSPK B 3 A_SetSolid
    TSPK B 2 A_ThrustImpale
    Loop
  }
}