From ecdfe39ddf74fc43a849f47bdcda3883d9304c1a Mon Sep 17 00:00:00 2001 From: inkoalawetrust <56005600+inkoalawetrust@users.noreply.github.com> Date: Sun, 23 Feb 2025 05:19:16 +0200 Subject: [PATCH] Exposed DElevator to ZScript. --- src/playsim/mapthinkers/a_floor.cpp | 8 +++++++- src/playsim/mapthinkers/a_floor.h | 12 +++++++----- wadsrc/static/zscript/doombase.zs | 19 +++++++++++++++++++ 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/src/playsim/mapthinkers/a_floor.cpp b/src/playsim/mapthinkers/a_floor.cpp index e81c10713c..d4492d9e00 100644 --- a/src/playsim/mapthinkers/a_floor.cpp +++ b/src/playsim/mapthinkers/a_floor.cpp @@ -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) + //========================================================================== // // @@ -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); diff --git a/src/playsim/mapthinkers/a_floor.h b/src/playsim/mapthinkers/a_floor.h index e0331bca69..891ce948eb 100644 --- a/src/playsim/mapthinkers/a_floor.h +++ b/src/playsim/mapthinkers/a_floor.h @@ -105,6 +105,13 @@ public: elevateLower }; + EElevator m_Type; + int m_Direction; + double m_FloorDestDist; + double m_CeilingDestDist; + double m_Speed; + + void Construct(sector_t *sec); void OnDestroy() override; @@ -112,11 +119,6 @@ public: void Tick (); protected: - EElevator m_Type; - int m_Direction; - double m_FloorDestDist; - double m_CeilingDestDist; - double m_Speed; TObjPtr m_Interp_Ceiling; TObjPtr m_Interp_Floor; diff --git a/wadsrc/static/zscript/doombase.zs b/wadsrc/static/zscript/doombase.zs index 46fdc4239b..c4582c15e3 100644 --- a/wadsrc/static/zscript/doombase.zs +++ b/wadsrc/static/zscript/doombase.zs @@ -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 {}