Skip to content

Commit

Permalink
Exposed DElevator to ZScript.
Browse files Browse the repository at this point in the history
  • Loading branch information
inkoalawetrust authored and madame-rachelle committed Mar 5, 2025
1 parent f0d0f25 commit ecdfe39
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 6 deletions.
8 changes: 7 additions & 1 deletion src/playsim/mapthinkers/a_floor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,12 @@ void DElevator::Serialize(FSerializer &arc)
("interp_ceiling", m_Interp_Ceiling);
}

DEFINE_FIELD(DElevator, m_Type)
DEFINE_FIELD(DElevator, m_Direction)
DEFINE_FIELD(DElevator, m_FloorDestDist)
DEFINE_FIELD(DElevator, m_CeilingDestDist)
DEFINE_FIELD(DElevator, m_Speed)

//==========================================================================
//
//
Expand Down Expand Up @@ -973,7 +979,7 @@ void DElevator::Tick ()
}
}

if (res == EMoveResult::pastdest) // if destination height acheived
if (res == EMoveResult::pastdest) // if destination height achieved
{
// make floor stop sound
SN_StopSequence (m_Sector, CHAN_FLOOR);
Expand Down
12 changes: 7 additions & 5 deletions src/playsim/mapthinkers/a_floor.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,18 +105,20 @@ class DElevator : public DMover
elevateLower
};

EElevator m_Type;
int m_Direction;
double m_FloorDestDist;
double m_CeilingDestDist;
double m_Speed;


void Construct(sector_t *sec);

void OnDestroy() override;
void Serialize(FSerializer &arc);
void Tick ();

protected:
EElevator m_Type;
int m_Direction;
double m_FloorDestDist;
double m_CeilingDestDist;
double m_Speed;
TObjPtr<DInterpolation*> m_Interp_Ceiling;
TObjPtr<DInterpolation*> m_Interp_Floor;

Expand Down
19 changes: 19 additions & 0 deletions wadsrc/static/zscript/doombase.zs
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,25 @@ class SectorEffect : Thinker native
class Mover : SectorEffect native
{}

class Elevator : Mover native
{
enum EElevator
{
elevateUp,
elevateDown,
elevateCurrent,
// [RH] For FloorAndCeiling_Raise/Lower
elevateRaise,
elevateLower
};

native readonly EElevator m_Type;
native readonly int m_Direction;
native readonly double m_FloorDestDist;
native readonly double m_CeilingDestDist;
native readonly double m_Speed;
}

class MovingFloor : Mover native
{}

Expand Down

0 comments on commit ecdfe39

Please sign in to comment.