From d2a51a57e1e84453feb3f5f025cde66b974a2767 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 8 Jan 2017 01:15:45 +0100 Subject: [PATCH] - added new Stairs_BuildUpDoomCrush special from Eternity and used it to fix the bad implementation to make Doom's turbo stairs crush. This also removes the crushing from Generic_Stairs entirely, just like it was in Boom. --- src/actionspecials.h | 1 + src/p_floor.cpp | 2 +- src/p_lnspec.cpp | 7 +++++++ src/p_spec.h | 3 ++- wadsrc/static/xlat/base.txt | 8 ++++---- wadsrc/static/xlat/strife.txt | 4 ++-- 6 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/actionspecials.h b/src/actionspecials.h index 9b9c38cb97..3edb1671d3 100644 --- a/src/actionspecials.h +++ b/src/actionspecials.h @@ -258,5 +258,6 @@ DEFINE_SPECIAL(Ceiling_LowerByTexture, 269, 2, 4, 4) DEFINE_SPECIAL(Stairs_BuildDownDoom, 270, 5, 5, 5) DEFINE_SPECIAL(Stairs_BuildUpDoomSync, 271, 4, 4, 4) DEFINE_SPECIAL(Stairs_BuildDownDoomSync, 272, 4, 4, 4) +DEFINE_SPECIAL(Stairs_BuildUpDoomCrush, 273, 5, 5, 5) #undef DEFINE_SPECIAL diff --git a/src/p_floor.cpp b/src/p_floor.cpp index 34163987c9..dbe3792daf 100644 --- a/src/p_floor.cpp +++ b/src/p_floor.cpp @@ -625,7 +625,7 @@ bool EV_BuildStairs (int tag, DFloor::EStair type, line_t *line, floor->m_PauseTime = 0; floor->m_StepTime = floor->m_PerStepTime = persteptime; - floor->m_Crush = (!(usespecials & DFloor::stairUseSpecials) && speed == 4) ? 10 : -1; //jff 2/27/98 fix uninitialized crush field + floor->m_Crush = (usespecials & DFloor::stairCrush) ? 10 : -1; //jff 2/27/98 fix uninitialized crush field floor->m_Hexencrush = false; floor->m_Speed = speed; diff --git a/src/p_lnspec.cpp b/src/p_lnspec.cpp index e9b9d53a4f..c1e342de82 100644 --- a/src/p_lnspec.cpp +++ b/src/p_lnspec.cpp @@ -591,6 +591,13 @@ FUNC(LS_Stairs_BuildUpDoom) arg2, SPEED(arg1), TICS(arg3), arg4, 0, 0); } +FUNC(LS_Stairs_BuildUpDoomCrush) +// Stairs_BuildUpDoom (tag, speed, height, delay, reset) +{ + return EV_BuildStairs(arg0, DFloor::buildUp, ln, + arg2, SPEED(arg1), TICS(arg3), arg4, 0, DFloor::stairCrush); +} + FUNC(LS_Stairs_BuildDownDoom) // Stair_BuildDownDoom (tag, speed, height, delay, reset) { diff --git a/src/p_spec.h b/src/p_spec.h index ea98c82c14..a2fd0727ac 100644 --- a/src/p_spec.h +++ b/src/p_spec.h @@ -503,7 +503,8 @@ public: enum EStairType { stairUseSpecials = 1, - stairSync = 2 + stairSync = 2, + stairCrush = 4, }; DFloor (sector_t *sec); diff --git a/wadsrc/static/xlat/base.txt b/wadsrc/static/xlat/base.txt index 8a99ba3183..0fc02739ef 100644 --- a/wadsrc/static/xlat/base.txt +++ b/wadsrc/static/xlat/base.txt @@ -99,7 +99,7 @@ include "xlat/defines.i" 97 = WALK|REP|MONST, Teleport (0, tag) 98 = WALK|REP, Floor_LowerToHighest (tag, F_FAST, 136) 99 = USE|REP, Door_LockedRaise (tag, D_FAST, 0, BCard | CardIsSkull) -100 = WALK, Stairs_BuildUpDoom (tag, ST_TURBO, 16, 0, 0) +100 = WALK, Stairs_BuildUpDoomCrush (tag, ST_TURBO, 16, 0, 0) 101 = USE, Floor_RaiseToLowestCeiling (tag, F_SLOW) 102 = USE, Floor_LowerToHighest (tag, F_SLOW, 128) 103 = USE, Door_Open (tag, D_SLOW) @@ -126,7 +126,7 @@ include "xlat/defines.i" 124 = WALK, Exit_Secret (0) 125 = MONWALK, Teleport (0, tag) 126 = MONWALK|REP, Teleport (0, tag) -127 = USE, Stairs_BuildUpDoom (tag, ST_TURBO, 16, 0, 0) +127 = USE, Stairs_BuildUpDoomCrush (tag, ST_TURBO, 16, 0, 0) 128 = WALK|REP, Floor_RaiseToNearest (tag, F_SLOW) 129 = WALK|REP, Floor_RaiseToNearest (tag, F_FAST) 130 = WALK, Floor_RaiseToNearest (tag, F_FAST) @@ -259,9 +259,9 @@ include "xlat/defines.i" 254 = 0, Scroll_Texture_Model (lineid, 0) 255 = 0, Scroll_Texture_Offsets () 256 = WALK|REP, Stairs_BuildUpDoom (tag, ST_SLOW, 8, 0, 0) -257 = WALK|REP, Stairs_BuildUpDoom (tag, ST_TURBO, 16, 0, 0) +257 = WALK|REP, Stairs_BuildUpDoomCrush (tag, ST_TURBO, 16, 0, 0) 258 = USE|REP, Stairs_BuildUpDoom (tag, ST_SLOW, 8, 0, 0) -259 = USE|REP, Stairs_BuildUpDoom (tag, ST_TURBO, 16, 0, 0) +259 = USE|REP, Stairs_BuildUpDoomCrush (tag, ST_TURBO, 16, 0, 0) 260 = 0, TranslucentLine (lineid, 168) // Changed to better reflect the BOOM default 261 = 0, Transfer_CeilingLight (tag) 262 = WALK|MONST, Teleport_Line (tag, tag, 1) diff --git a/wadsrc/static/xlat/strife.txt b/wadsrc/static/xlat/strife.txt index 50fcb2ff8e..e4ae8244f1 100644 --- a/wadsrc/static/xlat/strife.txt +++ b/wadsrc/static/xlat/strife.txt @@ -120,7 +120,7 @@ RetailOnly = 121 104 = WALK, Light_MinNeighbor (tag) 108 = WALK, Door_Raise (tag, D_FAST, VDOORWAIT) 109 = WALK, Door_Open (tag, D_FAST) -100 = WALK, Stairs_BuildUpDoom (tag, ST_TURBO, 16, 0, 0) +100 = WALK, Stairs_BuildUpDoomCrush (tag, ST_TURBO, 16, 0, 0) 197 = WALK|REP, ACS_ExecuteAlways (0, 0, 197, tag) 110 = WALK, Door_Close (tag, D_FAST) 119 = WALK, Floor_RaiseToNearest (tag, F_SLOW) @@ -255,7 +255,7 @@ RetailOnly = 121 112 = USE, Door_Open (tag, D_FAST) 113 = USE, Door_Close (tag, D_FAST) 122 = USE, Plat_DownWaitUpStayLip (tag, P_TURBO, PLATWAIT, 0) -127 = USE, Stairs_BuildUpDoom (tag, ST_TURBO, 16, 0, 0) +127 = USE, Stairs_BuildUpDoomCrush (tag, ST_TURBO, 16, 0, 0) 131 = USE, Floor_RaiseToNearest (tag, F_FAST) 133 = USE, Door_LockedRaise (tag, D_FAST, 0, 4) 135 = USE, Door_LockedRaise (tag, D_FAST, 0, 11)