2020-05-10 07:28:13 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
/*
|
|
|
|
Copyright (C) 1996, 2003 - 3D Realms Entertainment
|
|
|
|
Copyright (C) 2000, 2003 - Matt Saettler (EDuke Enhancements)
|
2020-05-13 14:19:39 +00:00
|
|
|
Copyright (C) 2020 - Christoph Oelckers
|
2020-05-10 07:28:13 +00:00
|
|
|
|
|
|
|
This file is part of Enhanced Duke Nukem 3D version 1.5 - Atomic Edition
|
|
|
|
|
|
|
|
Duke Nukem 3D is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License
|
|
|
|
as published by the Free Software Foundation; either version 2
|
|
|
|
of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
|
|
|
Original Source: 1996 - Todd Replogle
|
|
|
|
Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms
|
|
|
|
|
|
|
|
EDuke enhancements integrated: 04/13/2003 - Matt Saettler
|
|
|
|
|
|
|
|
Note: EDuke source was in transition. Changes are in-progress in the
|
|
|
|
source as it is released.
|
|
|
|
|
|
|
|
*/
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
2020-05-10 10:42:47 +00:00
|
|
|
#include "ns.h"
|
|
|
|
#include "global.h"
|
2020-06-24 19:21:02 +00:00
|
|
|
#include "sounds.h"
|
2020-07-03 21:56:14 +00:00
|
|
|
#include "names_d.h"
|
2020-07-07 15:56:20 +00:00
|
|
|
#include "mapinfo.h"
|
2020-10-21 17:14:41 +00:00
|
|
|
#include "dukeactor.h"
|
2020-12-01 11:52:49 +00:00
|
|
|
#include "secrets.h"
|
2020-05-10 07:28:13 +00:00
|
|
|
|
|
|
|
// PRIMITIVE
|
2020-05-10 10:42:47 +00:00
|
|
|
BEGIN_DUKE_NS
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
bool isadoorwall_d(int dapic)
|
|
|
|
{
|
2020-05-12 11:43:24 +00:00
|
|
|
switch(dapic)
|
|
|
|
{
|
|
|
|
case DOORTILE1:
|
|
|
|
case DOORTILE2:
|
|
|
|
case DOORTILE3:
|
|
|
|
case DOORTILE4:
|
|
|
|
case DOORTILE5:
|
|
|
|
case DOORTILE6:
|
|
|
|
case DOORTILE7:
|
|
|
|
case DOORTILE8:
|
|
|
|
case DOORTILE9:
|
|
|
|
case DOORTILE10:
|
|
|
|
case DOORTILE11:
|
|
|
|
case DOORTILE12:
|
|
|
|
case DOORTILE14:
|
|
|
|
case DOORTILE15:
|
|
|
|
case DOORTILE16:
|
|
|
|
case DOORTILE17:
|
|
|
|
case DOORTILE18:
|
|
|
|
case DOORTILE19:
|
|
|
|
case DOORTILE20:
|
|
|
|
case DOORTILE21:
|
|
|
|
case DOORTILE22:
|
|
|
|
case DOORTILE23:
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
2020-05-10 10:42:47 +00:00
|
|
|
}
|
|
|
|
|
2020-05-10 14:53:09 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void animatewalls_d(void)
|
|
|
|
{
|
2021-11-17 21:52:57 +00:00
|
|
|
int t;
|
2020-05-12 11:43:24 +00:00
|
|
|
|
2021-11-17 21:52:57 +00:00
|
|
|
for (int p = 0; p < numanimwalls; p++)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-11-17 23:30:37 +00:00
|
|
|
auto wal = animwall[p].wall;
|
2021-11-17 21:52:57 +00:00
|
|
|
int j = wal->picnum;
|
2020-05-12 11:43:24 +00:00
|
|
|
|
|
|
|
switch (j)
|
|
|
|
{
|
|
|
|
case SCREENBREAK1:
|
|
|
|
case SCREENBREAK2:
|
|
|
|
case SCREENBREAK3:
|
|
|
|
case SCREENBREAK4:
|
|
|
|
case SCREENBREAK5:
|
|
|
|
|
|
|
|
case SCREENBREAK9:
|
|
|
|
case SCREENBREAK10:
|
|
|
|
case SCREENBREAK11:
|
|
|
|
case SCREENBREAK12:
|
|
|
|
case SCREENBREAK13:
|
|
|
|
case SCREENBREAK14:
|
|
|
|
case SCREENBREAK15:
|
|
|
|
case SCREENBREAK16:
|
|
|
|
case SCREENBREAK17:
|
|
|
|
case SCREENBREAK18:
|
|
|
|
case SCREENBREAK19:
|
|
|
|
|
|
|
|
if ((krand() & 255) < 16)
|
|
|
|
{
|
2021-11-17 21:52:57 +00:00
|
|
|
animwall[p].tag = wal->picnum;
|
|
|
|
wal->picnum = SCREENBREAK6;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
case SCREENBREAK6:
|
|
|
|
case SCREENBREAK7:
|
|
|
|
case SCREENBREAK8:
|
|
|
|
|
2021-11-17 21:52:57 +00:00
|
|
|
if (animwall[p].tag >= 0 && wal->extra != FEMPIC2 && wal->extra != FEMPIC3)
|
|
|
|
wal->picnum = animwall[p].tag;
|
2020-05-12 11:43:24 +00:00
|
|
|
else
|
|
|
|
{
|
2021-11-17 21:52:57 +00:00
|
|
|
wal->picnum++;
|
|
|
|
if (wal->picnum == (SCREENBREAK6 + 3))
|
|
|
|
wal->picnum = SCREENBREAK6;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2021-12-18 14:11:21 +00:00
|
|
|
if (wal->cstat & CSTAT_WALL_MASKED)
|
2021-11-17 21:52:57 +00:00
|
|
|
switch (wal->overpicnum)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
|
|
|
case W_FORCEFIELD:
|
|
|
|
case W_FORCEFIELD + 1:
|
|
|
|
case W_FORCEFIELD + 2:
|
|
|
|
|
|
|
|
t = animwall[p].tag;
|
|
|
|
|
2021-12-18 14:11:21 +00:00
|
|
|
if (wal->cstat & CSTAT_WALL_ANY_EXCEPT_BLOCK)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-11-17 21:52:57 +00:00
|
|
|
wal->addxpan(-t / 4096.f); // bcos(t, -12);
|
|
|
|
wal->addypan(-t / 4096.f); // bsin(t, -12);
|
2020-05-12 11:43:24 +00:00
|
|
|
|
2021-11-17 21:52:57 +00:00
|
|
|
if (wal->extra == 1)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-11-17 21:52:57 +00:00
|
|
|
wal->extra = 0;
|
2020-05-12 11:43:24 +00:00
|
|
|
animwall[p].tag = 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
animwall[p].tag += 128;
|
|
|
|
|
|
|
|
if (animwall[p].tag < (128 << 4))
|
|
|
|
{
|
|
|
|
if (animwall[p].tag & 128)
|
2021-11-17 21:52:57 +00:00
|
|
|
wal->overpicnum = W_FORCEFIELD;
|
|
|
|
else wal->overpicnum = W_FORCEFIELD + 1;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if ((krand() & 255) < 32)
|
|
|
|
animwall[p].tag = 128 << (krand() & 3);
|
2021-11-17 21:52:57 +00:00
|
|
|
else wal->overpicnum = W_FORCEFIELD + 1;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2020-05-10 14:53:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void operaterespawns_d(int low)
|
|
|
|
{
|
2020-10-23 18:49:52 +00:00
|
|
|
DukeStatIterator it(STAT_FX);
|
|
|
|
while (auto act = it.Next())
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 17:19:45 +00:00
|
|
|
if (act->spr.lotag == low) switch (act->spr.picnum)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
|
|
|
case RESPAWN:
|
2021-12-21 17:19:45 +00:00
|
|
|
if (badguypic(act->spr.hitag) && ud.monsters_off) break;
|
2020-05-12 11:43:24 +00:00
|
|
|
|
2020-10-23 18:49:52 +00:00
|
|
|
auto star = spawn(act, TRANSPORTERSTAR);
|
2021-11-19 11:32:12 +00:00
|
|
|
if (star)
|
|
|
|
{
|
2022-08-20 15:59:15 +00:00
|
|
|
star->spr.pos.Z -= 32;
|
2020-05-12 11:43:24 +00:00
|
|
|
|
2021-12-21 17:19:45 +00:00
|
|
|
act->spr.extra = 66 - 12; // Just a way to killit
|
2021-11-19 11:32:12 +00:00
|
|
|
}
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2020-05-10 14:53:09 +00:00
|
|
|
}
|
|
|
|
|
2020-05-10 16:05:36 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2020-11-02 18:53:04 +00:00
|
|
|
void operateforcefields_d(DDukeActor* act, int low)
|
2020-05-10 16:05:36 +00:00
|
|
|
{
|
2020-11-02 18:53:04 +00:00
|
|
|
operateforcefields_common(act, low, { W_FORCEFIELD, W_FORCEFIELD + 1, W_FORCEFIELD + 2, BIGFORCE });
|
2020-05-10 16:05:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// how NOT to implement switch animations...
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2021-11-17 23:16:53 +00:00
|
|
|
bool checkhitswitch_d(int snum, walltype* wwal, DDukeActor *act)
|
2020-05-10 16:05:36 +00:00
|
|
|
{
|
2020-05-12 11:43:24 +00:00
|
|
|
uint8_t switchpal;
|
2021-11-17 22:01:27 +00:00
|
|
|
int lotag, hitag, picnum, correctdips, numdips;
|
2020-05-12 11:43:24 +00:00
|
|
|
int sx, sy;
|
2020-05-10 16:05:36 +00:00
|
|
|
|
2021-11-17 23:16:53 +00:00
|
|
|
if (wwal == nullptr && act == nullptr) return 0;
|
2020-05-12 11:43:24 +00:00
|
|
|
correctdips = 1;
|
|
|
|
numdips = 0;
|
2021-12-30 09:30:21 +00:00
|
|
|
|
2020-10-26 06:30:34 +00:00
|
|
|
if (act)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 17:19:45 +00:00
|
|
|
lotag = act->spr.lotag;
|
2020-05-12 05:51:45 +00:00
|
|
|
if (lotag == 0) return 0;
|
2021-12-21 17:19:45 +00:00
|
|
|
hitag = act->spr.hitag;
|
2022-01-31 18:21:49 +00:00
|
|
|
sx = act->int_pos().X;
|
|
|
|
sy = act->int_pos().Y;
|
2021-12-21 17:19:45 +00:00
|
|
|
picnum = act->spr.picnum;
|
|
|
|
switchpal = act->spr.pal;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-11-17 22:01:27 +00:00
|
|
|
lotag = wwal->lotag;
|
2020-05-12 05:51:45 +00:00
|
|
|
if (lotag == 0) return 0;
|
2021-11-17 22:01:27 +00:00
|
|
|
hitag = wwal->hitag;
|
2022-01-27 16:41:10 +00:00
|
|
|
sx = wwal->wall_int_pos().X;
|
|
|
|
sy = wwal->wall_int_pos().Y;
|
2021-11-17 22:01:27 +00:00
|
|
|
picnum = wwal->picnum;
|
|
|
|
switchpal = wwal->pal;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
switch (picnum)
|
|
|
|
{
|
|
|
|
case DIPSWITCH:
|
|
|
|
case DIPSWITCH + 1:
|
|
|
|
case TECHSWITCH:
|
|
|
|
case TECHSWITCH + 1:
|
|
|
|
case ALIENSWITCH:
|
|
|
|
case ALIENSWITCH + 1:
|
|
|
|
break;
|
2020-05-12 05:51:45 +00:00
|
|
|
case DEVELOPERCOMMENTARY + 1: //Twentieth Anniversary World Tour
|
2020-10-26 06:30:34 +00:00
|
|
|
if (act)
|
2020-05-12 05:51:45 +00:00
|
|
|
{
|
2020-05-12 11:43:24 +00:00
|
|
|
StopCommentary();
|
2021-12-21 17:19:45 +00:00
|
|
|
act->spr.picnum = DEVELOPERCOMMENTARY;
|
2020-05-12 05:51:45 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
case DEVELOPERCOMMENTARY: //Twentieth Anniversary World Tour
|
2020-10-26 06:30:34 +00:00
|
|
|
if (act)
|
2020-05-12 05:51:45 +00:00
|
|
|
{
|
2020-10-26 06:30:34 +00:00
|
|
|
if (StartCommentary(lotag, act))
|
2021-12-21 17:19:45 +00:00
|
|
|
act->spr.picnum = DEVELOPERCOMMENTARY+1;
|
2020-05-12 05:51:45 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
2020-05-12 11:43:24 +00:00
|
|
|
case ACCESSSWITCH:
|
|
|
|
case ACCESSSWITCH2:
|
|
|
|
if (ps[snum].access_incs == 0)
|
|
|
|
{
|
|
|
|
if (switchpal == 0)
|
|
|
|
{
|
|
|
|
if ((ps[snum].got_access & 1))
|
|
|
|
ps[snum].access_incs = 1;
|
|
|
|
else FTA(70, &ps[snum]);
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (switchpal == 21)
|
|
|
|
{
|
|
|
|
if (ps[snum].got_access & 2)
|
|
|
|
ps[snum].access_incs = 1;
|
|
|
|
else FTA(71, &ps[snum]);
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (switchpal == 23)
|
|
|
|
{
|
|
|
|
if (ps[snum].got_access & 4)
|
|
|
|
ps[snum].access_incs = 1;
|
|
|
|
else FTA(72, &ps[snum]);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ps[snum].access_incs == 1)
|
|
|
|
{
|
2020-10-26 06:30:34 +00:00
|
|
|
if (!act)
|
2021-11-17 23:20:39 +00:00
|
|
|
ps[snum].access_wall = wwal;
|
2020-05-12 11:43:24 +00:00
|
|
|
else
|
2020-10-25 05:34:25 +00:00
|
|
|
ps[snum].access_spritenum = act;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2021-11-14 11:25:25 +00:00
|
|
|
[[fallthrough]];
|
2020-05-12 11:43:24 +00:00
|
|
|
case DIPSWITCH2:
|
|
|
|
case DIPSWITCH2 + 1:
|
|
|
|
case DIPSWITCH3:
|
|
|
|
case DIPSWITCH3 + 1:
|
|
|
|
case MULTISWITCH:
|
|
|
|
case MULTISWITCH + 1:
|
|
|
|
case MULTISWITCH + 2:
|
|
|
|
case MULTISWITCH + 3:
|
|
|
|
case PULLSWITCH:
|
|
|
|
case PULLSWITCH + 1:
|
|
|
|
case HANDSWITCH:
|
|
|
|
case HANDSWITCH + 1:
|
|
|
|
case SLOTDOOR:
|
|
|
|
case SLOTDOOR + 1:
|
|
|
|
case LIGHTSWITCH:
|
|
|
|
case LIGHTSWITCH + 1:
|
|
|
|
case SPACELIGHTSWITCH:
|
|
|
|
case SPACELIGHTSWITCH + 1:
|
|
|
|
case SPACEDOORSWITCH:
|
|
|
|
case SPACEDOORSWITCH + 1:
|
|
|
|
case FRANKENSTINESWITCH:
|
|
|
|
case FRANKENSTINESWITCH + 1:
|
|
|
|
case LIGHTSWITCH2:
|
|
|
|
case LIGHTSWITCH2 + 1:
|
|
|
|
case POWERSWITCH1:
|
|
|
|
case POWERSWITCH1 + 1:
|
|
|
|
case LOCKSWITCH1:
|
|
|
|
case LOCKSWITCH1 + 1:
|
|
|
|
case POWERSWITCH2:
|
|
|
|
case POWERSWITCH2 + 1:
|
|
|
|
if (check_activator_motion(lotag)) return 0;
|
|
|
|
break;
|
|
|
|
default:
|
2020-05-14 10:14:03 +00:00
|
|
|
if (fi.isadoorwall(picnum) == 0) return 0;
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2020-10-26 05:35:33 +00:00
|
|
|
DukeStatIterator it(STAT_DEFAULT);
|
|
|
|
while (auto other = it.Next())
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 20:39:57 +00:00
|
|
|
if (lotag == other->spr.lotag) switch (other->spr.picnum)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
|
|
|
case DIPSWITCH:
|
|
|
|
case TECHSWITCH:
|
|
|
|
case ALIENSWITCH:
|
2021-12-21 20:39:57 +00:00
|
|
|
if (act && act == other) other->spr.picnum++;
|
|
|
|
else if (other->spr.hitag == 0) correctdips++;
|
2020-05-12 11:43:24 +00:00
|
|
|
numdips++;
|
|
|
|
break;
|
|
|
|
case TECHSWITCH + 1:
|
|
|
|
case DIPSWITCH + 1:
|
|
|
|
case ALIENSWITCH + 1:
|
2021-12-21 20:39:57 +00:00
|
|
|
if (act && act == other) other->spr.picnum--;
|
|
|
|
else if (other->spr.hitag == 1) correctdips++;
|
2020-05-12 11:43:24 +00:00
|
|
|
numdips++;
|
|
|
|
break;
|
|
|
|
case MULTISWITCH:
|
|
|
|
case MULTISWITCH + 1:
|
|
|
|
case MULTISWITCH + 2:
|
|
|
|
case MULTISWITCH + 3:
|
2021-12-21 20:39:57 +00:00
|
|
|
other->spr.picnum++;
|
|
|
|
if (other->spr.picnum > (MULTISWITCH + 3))
|
|
|
|
other->spr.picnum = MULTISWITCH;
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case ACCESSSWITCH:
|
|
|
|
case ACCESSSWITCH2:
|
|
|
|
case SLOTDOOR:
|
|
|
|
case LIGHTSWITCH:
|
|
|
|
case SPACELIGHTSWITCH:
|
|
|
|
case SPACEDOORSWITCH:
|
|
|
|
case FRANKENSTINESWITCH:
|
|
|
|
case LIGHTSWITCH2:
|
|
|
|
case POWERSWITCH1:
|
|
|
|
case LOCKSWITCH1:
|
|
|
|
case POWERSWITCH2:
|
|
|
|
case HANDSWITCH:
|
|
|
|
case PULLSWITCH:
|
|
|
|
case DIPSWITCH2:
|
|
|
|
case DIPSWITCH3:
|
2021-12-21 20:39:57 +00:00
|
|
|
other->spr.picnum++;
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case PULLSWITCH + 1:
|
|
|
|
case HANDSWITCH + 1:
|
|
|
|
case LIGHTSWITCH2 + 1:
|
|
|
|
case POWERSWITCH1 + 1:
|
|
|
|
case LOCKSWITCH1 + 1:
|
|
|
|
case POWERSWITCH2 + 1:
|
|
|
|
case SLOTDOOR + 1:
|
|
|
|
case LIGHTSWITCH + 1:
|
|
|
|
case SPACELIGHTSWITCH + 1:
|
|
|
|
case SPACEDOORSWITCH + 1:
|
|
|
|
case FRANKENSTINESWITCH + 1:
|
|
|
|
case DIPSWITCH2 + 1:
|
|
|
|
case DIPSWITCH3 + 1:
|
2021-12-21 20:39:57 +00:00
|
|
|
other->spr.picnum--;
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-12-21 08:23:39 +00:00
|
|
|
for (auto& wal : wall)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-11-17 22:01:27 +00:00
|
|
|
if (lotag == wal.lotag)
|
|
|
|
switch (wal.picnum)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
|
|
|
case DIPSWITCH:
|
|
|
|
case TECHSWITCH:
|
|
|
|
case ALIENSWITCH:
|
2021-11-17 22:01:27 +00:00
|
|
|
if (!act && &wal == wwal) wal.picnum++;
|
|
|
|
else if (wal.hitag == 0) correctdips++;
|
2020-05-12 11:43:24 +00:00
|
|
|
numdips++;
|
|
|
|
break;
|
|
|
|
case DIPSWITCH + 1:
|
|
|
|
case TECHSWITCH + 1:
|
|
|
|
case ALIENSWITCH + 1:
|
2021-11-17 22:01:27 +00:00
|
|
|
if (!act && &wal == wwal) wal.picnum--;
|
|
|
|
else if (wal.hitag == 1) correctdips++;
|
2020-05-12 11:43:24 +00:00
|
|
|
numdips++;
|
|
|
|
break;
|
|
|
|
case MULTISWITCH:
|
|
|
|
case MULTISWITCH + 1:
|
|
|
|
case MULTISWITCH + 2:
|
|
|
|
case MULTISWITCH + 3:
|
2021-11-17 22:01:27 +00:00
|
|
|
wal.picnum++;
|
|
|
|
if (wal.picnum > (MULTISWITCH + 3))
|
|
|
|
wal.picnum = MULTISWITCH;
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case ACCESSSWITCH:
|
|
|
|
case ACCESSSWITCH2:
|
|
|
|
case SLOTDOOR:
|
|
|
|
case LIGHTSWITCH:
|
|
|
|
case SPACELIGHTSWITCH:
|
|
|
|
case SPACEDOORSWITCH:
|
|
|
|
case LIGHTSWITCH2:
|
|
|
|
case POWERSWITCH1:
|
|
|
|
case LOCKSWITCH1:
|
|
|
|
case POWERSWITCH2:
|
|
|
|
case PULLSWITCH:
|
|
|
|
case HANDSWITCH:
|
|
|
|
case DIPSWITCH2:
|
|
|
|
case DIPSWITCH3:
|
2021-11-17 22:01:27 +00:00
|
|
|
wal.picnum++;
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case HANDSWITCH + 1:
|
|
|
|
case PULLSWITCH + 1:
|
|
|
|
case LIGHTSWITCH2 + 1:
|
|
|
|
case POWERSWITCH1 + 1:
|
|
|
|
case LOCKSWITCH1 + 1:
|
|
|
|
case POWERSWITCH2 + 1:
|
|
|
|
case SLOTDOOR + 1:
|
|
|
|
case LIGHTSWITCH + 1:
|
|
|
|
case SPACELIGHTSWITCH + 1:
|
|
|
|
case SPACEDOORSWITCH + 1:
|
|
|
|
case DIPSWITCH2 + 1:
|
|
|
|
case DIPSWITCH3 + 1:
|
2021-11-17 22:01:27 +00:00
|
|
|
wal.picnum--;
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-11-14 14:03:50 +00:00
|
|
|
if (lotag == -1)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2020-07-07 15:56:20 +00:00
|
|
|
setnextmap(false);
|
2020-05-12 11:43:24 +00:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2022-02-05 11:05:29 +00:00
|
|
|
vec3_t v = { sx, sy, ps[snum].player_int_pos().Z };
|
2020-05-12 11:43:24 +00:00
|
|
|
switch (picnum)
|
|
|
|
{
|
|
|
|
default:
|
2020-05-14 10:14:03 +00:00
|
|
|
if (fi.isadoorwall(picnum) == 0) break;
|
2021-11-14 11:25:25 +00:00
|
|
|
[[fallthrough]];
|
2020-05-12 11:43:24 +00:00
|
|
|
case DIPSWITCH:
|
|
|
|
case DIPSWITCH + 1:
|
|
|
|
case TECHSWITCH:
|
|
|
|
case TECHSWITCH + 1:
|
|
|
|
case ALIENSWITCH:
|
|
|
|
case ALIENSWITCH + 1:
|
|
|
|
if (picnum == DIPSWITCH || picnum == DIPSWITCH + 1 ||
|
|
|
|
picnum == ALIENSWITCH || picnum == ALIENSWITCH + 1 ||
|
|
|
|
picnum == TECHSWITCH || picnum == TECHSWITCH + 1)
|
|
|
|
{
|
|
|
|
if (picnum == ALIENSWITCH || picnum == ALIENSWITCH + 1)
|
|
|
|
{
|
2020-10-26 06:30:34 +00:00
|
|
|
if (act)
|
2022-01-30 22:20:00 +00:00
|
|
|
S_PlaySound3D(ALIEN_SWITCH1, act, v);
|
|
|
|
else S_PlaySound3D(ALIEN_SWITCH1, ps[snum].GetActor(), v);
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-10-26 06:30:34 +00:00
|
|
|
if (act)
|
2022-01-30 22:20:00 +00:00
|
|
|
S_PlaySound3D(SWITCH_ON, act, v);
|
|
|
|
else S_PlaySound3D(SWITCH_ON, ps[snum].GetActor(), v);
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
if (numdips != correctdips) break;
|
2022-01-30 22:20:00 +00:00
|
|
|
S_PlaySound3D(END_OF_LEVEL_WARN, ps[snum].GetActor(), v);
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
2021-11-14 11:25:25 +00:00
|
|
|
[[fallthrough]];
|
2020-05-12 11:43:24 +00:00
|
|
|
case DIPSWITCH2:
|
|
|
|
case DIPSWITCH2 + 1:
|
|
|
|
case DIPSWITCH3:
|
|
|
|
case DIPSWITCH3 + 1:
|
|
|
|
case MULTISWITCH:
|
|
|
|
case MULTISWITCH + 1:
|
|
|
|
case MULTISWITCH + 2:
|
|
|
|
case MULTISWITCH + 3:
|
|
|
|
case ACCESSSWITCH:
|
|
|
|
case ACCESSSWITCH2:
|
|
|
|
case SLOTDOOR:
|
|
|
|
case SLOTDOOR + 1:
|
|
|
|
case LIGHTSWITCH:
|
|
|
|
case LIGHTSWITCH + 1:
|
|
|
|
case SPACELIGHTSWITCH:
|
|
|
|
case SPACELIGHTSWITCH + 1:
|
|
|
|
case SPACEDOORSWITCH:
|
|
|
|
case SPACEDOORSWITCH + 1:
|
|
|
|
case FRANKENSTINESWITCH:
|
|
|
|
case FRANKENSTINESWITCH + 1:
|
|
|
|
case LIGHTSWITCH2:
|
|
|
|
case LIGHTSWITCH2 + 1:
|
|
|
|
case POWERSWITCH1:
|
|
|
|
case POWERSWITCH1 + 1:
|
|
|
|
case LOCKSWITCH1:
|
|
|
|
case LOCKSWITCH1 + 1:
|
|
|
|
case POWERSWITCH2:
|
|
|
|
case POWERSWITCH2 + 1:
|
|
|
|
case HANDSWITCH:
|
|
|
|
case HANDSWITCH + 1:
|
|
|
|
case PULLSWITCH:
|
|
|
|
case PULLSWITCH + 1:
|
|
|
|
|
|
|
|
if (picnum == MULTISWITCH || picnum == (MULTISWITCH + 1) ||
|
|
|
|
picnum == (MULTISWITCH + 2) || picnum == (MULTISWITCH + 3))
|
|
|
|
lotag += picnum - MULTISWITCH;
|
|
|
|
|
2021-12-24 09:53:27 +00:00
|
|
|
DukeStatIterator itr(STAT_EFFECTOR);
|
|
|
|
while (auto other = itr.Next())
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 17:19:45 +00:00
|
|
|
if (other->spr.hitag == lotag)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 17:19:45 +00:00
|
|
|
switch (other->spr.lotag)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
|
|
|
case SE_12_LIGHT_SWITCH:
|
2021-11-20 23:33:17 +00:00
|
|
|
other->sector()->floorpal = 0;
|
2020-10-26 05:45:28 +00:00
|
|
|
other->temp_data[0]++;
|
|
|
|
if (other->temp_data[0] == 2)
|
|
|
|
other->temp_data[0]++;
|
2020-05-12 11:43:24 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
case SE_24_CONVEYOR:
|
|
|
|
case SE_34:
|
|
|
|
case SE_25_PISTON:
|
2020-10-26 05:45:28 +00:00
|
|
|
other->temp_data[4] = !other->temp_data[4];
|
|
|
|
if (other->temp_data[4])
|
2020-05-12 11:43:24 +00:00
|
|
|
FTA(15, &ps[snum]);
|
|
|
|
else FTA(2, &ps[snum]);
|
|
|
|
break;
|
|
|
|
case SE_21_DROP_FLOOR:
|
|
|
|
FTA(2, &ps[screenpeek]);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
operateactivators(lotag, snum);
|
2020-11-02 18:53:04 +00:00
|
|
|
fi.operateforcefields(ps[snum].GetActor(), lotag);
|
2020-05-12 11:43:24 +00:00
|
|
|
operatemasterswitches(lotag);
|
|
|
|
|
|
|
|
if (picnum == DIPSWITCH || picnum == DIPSWITCH + 1 ||
|
|
|
|
picnum == ALIENSWITCH || picnum == ALIENSWITCH + 1 ||
|
|
|
|
picnum == TECHSWITCH || picnum == TECHSWITCH + 1) return 1;
|
|
|
|
|
2020-05-14 10:14:03 +00:00
|
|
|
if (hitag == 0 && fi.isadoorwall(picnum) == 0)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2020-10-26 06:30:34 +00:00
|
|
|
if (act)
|
2022-01-30 22:20:00 +00:00
|
|
|
S_PlaySound3D(SWITCH_ON, act, v);
|
|
|
|
else S_PlaySound3D(SWITCH_ON, ps[snum].GetActor(), v);
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
else if (hitag != 0)
|
|
|
|
{
|
|
|
|
auto flags = S_GetUserFlags(hitag);
|
|
|
|
|
2020-10-26 06:30:34 +00:00
|
|
|
if (act && (flags & SF_TALK) == 0)
|
2022-01-30 22:20:00 +00:00
|
|
|
S_PlaySound3D(hitag, act, v);
|
2020-05-12 11:43:24 +00:00
|
|
|
else
|
2020-11-02 19:23:30 +00:00
|
|
|
S_PlayActorSound(hitag, ps[snum].GetActor());
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
2020-05-10 16:05:36 +00:00
|
|
|
}
|
|
|
|
|
2020-05-10 18:59:38 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2021-11-18 17:51:19 +00:00
|
|
|
void activatebysector_d(sectortype* sect, DDukeActor* activator)
|
2020-05-10 18:59:38 +00:00
|
|
|
{
|
2021-11-07 13:55:28 +00:00
|
|
|
int didit = 0;
|
2020-05-12 11:43:24 +00:00
|
|
|
|
2020-11-02 18:28:59 +00:00
|
|
|
DukeSectIterator it(sect);
|
|
|
|
while (auto act = it.Next())
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 17:19:45 +00:00
|
|
|
if (act->spr.picnum == ACTIVATOR)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 17:19:45 +00:00
|
|
|
operateactivators(act->spr.lotag, -1);
|
2020-05-12 11:43:24 +00:00
|
|
|
didit = 1;
|
|
|
|
// return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (didit == 0)
|
2020-11-02 18:28:59 +00:00
|
|
|
operatesectors(sect, activator);
|
2020-05-10 18:59:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2021-11-17 22:49:49 +00:00
|
|
|
void checkhitwall_d(DDukeActor* spr, walltype* wal, int x, int y, int z, int atwith)
|
2020-05-10 18:59:38 +00:00
|
|
|
{
|
2021-11-06 14:53:16 +00:00
|
|
|
int j, sn = -1, darkestwall;
|
2020-05-12 11:43:24 +00:00
|
|
|
|
2022-01-20 07:31:08 +00:00
|
|
|
if (wal->overpicnum == MIRROR && gs.actorinfo[atwith].flags2 & SFLAG2_BREAKMIRRORS)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2022-01-20 07:31:08 +00:00
|
|
|
lotsofglass(spr, wal, 70);
|
|
|
|
wal->cstat &= ~CSTAT_WALL_MASKED;
|
|
|
|
wal->overpicnum = MIRRORBROKE;
|
|
|
|
wal->portalflags = 0;
|
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, spr);
|
|
|
|
return;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
|
2021-12-18 14:11:21 +00:00
|
|
|
if (((wal->cstat & CSTAT_WALL_MASKED) || wal->overpicnum == BIGFORCE) && wal->twoSided())
|
2022-02-02 23:46:04 +00:00
|
|
|
if (wal->nextSector()->int_floorz() > z)
|
2022-08-28 09:35:03 +00:00
|
|
|
if (wal->nextSector()->floorz - wal->nextSector()->ceilingz)
|
2020-05-12 11:43:24 +00:00
|
|
|
switch (wal->overpicnum)
|
|
|
|
{
|
|
|
|
case W_FORCEFIELD:
|
|
|
|
case W_FORCEFIELD + 1:
|
|
|
|
case W_FORCEFIELD + 2:
|
|
|
|
wal->extra = 1; // tell the forces to animate
|
2021-11-14 11:25:25 +00:00
|
|
|
[[fallthrough]];
|
2020-05-12 11:43:24 +00:00
|
|
|
case BIGFORCE:
|
2020-10-24 05:22:44 +00:00
|
|
|
{
|
2021-11-18 18:04:00 +00:00
|
|
|
sectortype* sptr = nullptr;
|
|
|
|
updatesector(x, y, &sptr);
|
|
|
|
if (sptr == nullptr) return;
|
2020-10-24 05:22:44 +00:00
|
|
|
DDukeActor* spawned;
|
2020-05-12 11:43:24 +00:00
|
|
|
if (atwith == -1)
|
2021-11-18 18:04:00 +00:00
|
|
|
spawned = EGS(sptr, x, y, z, FORCERIPPLE, -127, 8, 8, 0, 0, 0, spr, 5);
|
2020-05-12 11:43:24 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
if (atwith == CHAINGUN)
|
2021-12-21 17:19:45 +00:00
|
|
|
spawned = EGS(sptr, x, y, z, FORCERIPPLE, -127, 16 + spr->spr.xrepeat, 16 + spr->spr.yrepeat, 0, 0, 0, spr, 5);
|
2021-11-18 18:04:00 +00:00
|
|
|
else spawned = EGS(sptr, x, y, z, FORCERIPPLE, -127, 32, 32, 0, 0, 0, spr, 5);
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
2021-11-19 08:47:17 +00:00
|
|
|
if (spawned)
|
|
|
|
{
|
2021-12-21 17:19:45 +00:00
|
|
|
spawned->spr.cstat |= CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_ALIGNMENT_WALL | CSTAT_SPRITE_YCENTER;
|
2021-11-19 08:47:17 +00:00
|
|
|
auto delta = wal->delta();
|
2022-08-16 21:20:35 +00:00
|
|
|
spawned->set_int_ang(getangle(-delta.X, -delta.Y) - 512);
|
2020-05-12 11:43:24 +00:00
|
|
|
|
2021-11-19 08:47:17 +00:00
|
|
|
S_PlayActorSound(SOMETHINGHITFORCE, spawned);
|
|
|
|
}
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
2020-10-24 05:22:44 +00:00
|
|
|
}
|
2020-05-12 11:43:24 +00:00
|
|
|
case FANSPRITE:
|
|
|
|
wal->overpicnum = FANSPRITEBROKE;
|
2021-12-18 14:11:21 +00:00
|
|
|
wal->cstat &= ~(CSTAT_WALL_BLOCK | CSTAT_WALL_BLOCK_HITSCAN);
|
2021-11-21 07:42:36 +00:00
|
|
|
if (wal->twoSided())
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-11-07 07:46:15 +00:00
|
|
|
wal->nextWall()->overpicnum = FANSPRITEBROKE;
|
2021-12-18 14:11:21 +00:00
|
|
|
wal->nextWall()->cstat &= ~(CSTAT_WALL_BLOCK | CSTAT_WALL_BLOCK_HITSCAN);
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
2020-07-25 07:32:54 +00:00
|
|
|
S_PlayActorSound(VENT_BUST, spr);
|
|
|
|
S_PlayActorSound(GLASS_BREAKING, spr);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
case GLASS:
|
2020-10-24 05:22:44 +00:00
|
|
|
{
|
2021-11-18 18:04:00 +00:00
|
|
|
sectortype* sptr = nullptr;
|
|
|
|
updatesector(x, y, &sptr);
|
|
|
|
if (sptr == nullptr) return;
|
2020-05-12 11:43:24 +00:00
|
|
|
wal->overpicnum = GLASS2;
|
2021-11-17 23:38:20 +00:00
|
|
|
lotsofglass(spr, wal, 10);
|
2020-05-12 11:43:24 +00:00
|
|
|
wal->cstat = 0;
|
|
|
|
|
2021-11-21 07:42:36 +00:00
|
|
|
if (wal->twoSided())
|
2021-11-07 07:46:15 +00:00
|
|
|
wal->nextWall()->cstat = 0;
|
2020-05-12 11:43:24 +00:00
|
|
|
|
2022-08-27 13:09:22 +00:00
|
|
|
auto spawned = EGS(sptr, x, y, z, SECTOREFFECTOR, 0, 0, 0, ps[0].angle.ang.Buildang(), 0, 0, spr, 3);
|
2021-11-19 08:47:17 +00:00
|
|
|
if (spawned)
|
|
|
|
{
|
2021-12-21 17:19:45 +00:00
|
|
|
spawned->spr.lotag = SE_128_GLASS_BREAKING;
|
2021-11-19 08:47:17 +00:00
|
|
|
spawned->temp_data[1] = 5;
|
|
|
|
spawned->temp_walls[0] = wal;
|
|
|
|
S_PlayActorSound(GLASS_BREAKING, spawned);
|
|
|
|
}
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
2020-10-24 05:22:44 +00:00
|
|
|
}
|
2020-05-12 11:43:24 +00:00
|
|
|
case STAINGLASS1:
|
2021-11-18 18:04:00 +00:00
|
|
|
sectortype* sptr = nullptr;
|
|
|
|
updatesector(x, y, &sptr);
|
|
|
|
if (sptr == nullptr) return;
|
2021-11-17 23:38:20 +00:00
|
|
|
lotsofcolourglass(spr, wal, 80);
|
2020-05-12 11:43:24 +00:00
|
|
|
wal->cstat = 0;
|
2021-11-21 07:42:36 +00:00
|
|
|
if (wal->twoSided())
|
2021-11-07 07:46:15 +00:00
|
|
|
wal->nextWall()->cstat = 0;
|
2020-07-25 07:32:54 +00:00
|
|
|
S_PlayActorSound(VENT_BUST, spr);
|
|
|
|
S_PlayActorSound(GLASS_BREAKING, spr);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (wal->picnum)
|
|
|
|
{
|
|
|
|
case COLAMACHINE:
|
|
|
|
case VENDMACHINE:
|
2021-11-17 23:32:46 +00:00
|
|
|
breakwall(wal->picnum + 2, spr, wal);
|
2020-07-25 07:32:54 +00:00
|
|
|
S_PlayActorSound(VENT_BUST, spr);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
case OJ:
|
|
|
|
case FEMPIC2:
|
|
|
|
case FEMPIC3:
|
|
|
|
|
|
|
|
case SCREENBREAK6:
|
|
|
|
case SCREENBREAK7:
|
|
|
|
case SCREENBREAK8:
|
|
|
|
|
|
|
|
case SCREENBREAK1:
|
|
|
|
case SCREENBREAK2:
|
|
|
|
case SCREENBREAK3:
|
|
|
|
case SCREENBREAK4:
|
|
|
|
case SCREENBREAK5:
|
|
|
|
|
|
|
|
case SCREENBREAK9:
|
|
|
|
case SCREENBREAK10:
|
|
|
|
case SCREENBREAK11:
|
|
|
|
case SCREENBREAK12:
|
|
|
|
case SCREENBREAK13:
|
|
|
|
case SCREENBREAK14:
|
|
|
|
case SCREENBREAK15:
|
|
|
|
case SCREENBREAK16:
|
|
|
|
case SCREENBREAK17:
|
|
|
|
case SCREENBREAK18:
|
|
|
|
case SCREENBREAK19:
|
|
|
|
case BORNTOBEWILDSCREEN:
|
|
|
|
|
2021-11-17 23:38:20 +00:00
|
|
|
lotsofglass(spr, wal, 30);
|
2020-05-12 11:43:24 +00:00
|
|
|
wal->picnum = W_SCREENBREAK + (krand() % 3);
|
2020-07-25 07:32:54 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, spr);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
case W_TECHWALL5:
|
|
|
|
case W_TECHWALL6:
|
|
|
|
case W_TECHWALL7:
|
|
|
|
case W_TECHWALL8:
|
|
|
|
case W_TECHWALL9:
|
2021-11-17 23:32:46 +00:00
|
|
|
breakwall(wal->picnum + 1, spr, wal);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
case W_MILKSHELF:
|
2021-11-17 23:32:46 +00:00
|
|
|
breakwall(W_MILKSHELFBROKE, spr, wal);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
case W_TECHWALL10:
|
2021-11-17 23:32:46 +00:00
|
|
|
breakwall(W_HITTECHWALL10, spr, wal);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
case W_TECHWALL1:
|
|
|
|
case W_TECHWALL11:
|
|
|
|
case W_TECHWALL12:
|
|
|
|
case W_TECHWALL13:
|
|
|
|
case W_TECHWALL14:
|
2021-11-17 23:32:46 +00:00
|
|
|
breakwall(W_HITTECHWALL1, spr, wal);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
case W_TECHWALL15:
|
2021-11-17 23:32:46 +00:00
|
|
|
breakwall(W_HITTECHWALL15, spr, wal);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
case W_TECHWALL16:
|
2021-11-17 23:32:46 +00:00
|
|
|
breakwall(W_HITTECHWALL16, spr, wal);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
case W_TECHWALL2:
|
2021-11-17 23:32:46 +00:00
|
|
|
breakwall(W_HITTECHWALL2, spr, wal);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
case W_TECHWALL3:
|
2021-11-17 23:32:46 +00:00
|
|
|
breakwall(W_HITTECHWALL3, spr, wal);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
case W_TECHWALL4:
|
2021-11-17 23:32:46 +00:00
|
|
|
breakwall(W_HITTECHWALL4, spr, wal);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
case ATM:
|
|
|
|
wal->picnum = ATMBROKE;
|
2020-10-24 05:22:44 +00:00
|
|
|
fi.lotsofmoney(spr, 1 + (krand() & 7));
|
2020-07-25 07:32:54 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, spr);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case WALLLIGHT1:
|
|
|
|
case WALLLIGHT2:
|
|
|
|
case WALLLIGHT3:
|
|
|
|
case WALLLIGHT4:
|
|
|
|
case TECHLIGHT2:
|
|
|
|
case TECHLIGHT4:
|
|
|
|
|
|
|
|
if (rnd(128))
|
2020-07-25 07:32:54 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, spr);
|
|
|
|
else S_PlayActorSound(GLASS_BREAKING, spr);
|
2021-11-17 23:38:20 +00:00
|
|
|
lotsofglass(spr, wal, 30);
|
2020-05-12 11:43:24 +00:00
|
|
|
|
|
|
|
if (wal->picnum == WALLLIGHT1)
|
|
|
|
wal->picnum = WALLLIGHTBUST1;
|
|
|
|
|
|
|
|
if (wal->picnum == WALLLIGHT2)
|
|
|
|
wal->picnum = WALLLIGHTBUST2;
|
|
|
|
|
|
|
|
if (wal->picnum == WALLLIGHT3)
|
|
|
|
wal->picnum = WALLLIGHTBUST3;
|
|
|
|
|
|
|
|
if (wal->picnum == WALLLIGHT4)
|
|
|
|
wal->picnum = WALLLIGHTBUST4;
|
|
|
|
|
|
|
|
if (wal->picnum == TECHLIGHT2)
|
|
|
|
wal->picnum = TECHLIGHTBUST2;
|
|
|
|
|
|
|
|
if (wal->picnum == TECHLIGHT4)
|
|
|
|
wal->picnum = TECHLIGHTBUST4;
|
|
|
|
|
|
|
|
if (!wal->lotag) return;
|
|
|
|
|
2021-11-21 07:42:36 +00:00
|
|
|
if (!wal->twoSided()) return;
|
2020-05-12 11:43:24 +00:00
|
|
|
darkestwall = 0;
|
|
|
|
|
2021-11-17 23:42:52 +00:00
|
|
|
for (auto& wl : wallsofsector(wal->nextSector()))
|
|
|
|
if (wl.shade > darkestwall)
|
|
|
|
darkestwall = wl.shade;
|
2020-05-12 11:43:24 +00:00
|
|
|
|
|
|
|
j = krand() & 1;
|
2020-10-24 05:22:44 +00:00
|
|
|
DukeStatIterator it(STAT_EFFECTOR);
|
|
|
|
while (auto effector = it.Next())
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 17:19:45 +00:00
|
|
|
if (effector->spr.hitag == wal->lotag && effector->spr.lotag == 3)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2020-10-24 05:22:44 +00:00
|
|
|
effector->temp_data[2] = j;
|
|
|
|
effector->temp_data[3] = darkestwall;
|
|
|
|
effector->temp_data[4] = 1;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2020-05-10 18:59:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2022-02-07 10:04:19 +00:00
|
|
|
void checkplayerhurt_d(player_struct* p, const Collision& coll)
|
2020-05-10 18:59:38 +00:00
|
|
|
{
|
2020-10-25 07:50:03 +00:00
|
|
|
if (coll.type == kHitSprite)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 17:19:45 +00:00
|
|
|
switch (coll.actor()->spr.picnum)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
|
|
|
case CACTUS:
|
|
|
|
if (p->hurt_delay < 8)
|
|
|
|
{
|
2021-12-21 17:19:45 +00:00
|
|
|
p->GetActor()->spr.extra -= 5;
|
2020-05-12 11:43:24 +00:00
|
|
|
p->hurt_delay = 16;
|
|
|
|
SetPlayerPal(p, PalEntry(32, 32, 0, 0));
|
2020-10-25 07:50:03 +00:00
|
|
|
S_PlayActorSound(DUKE_LONGTERM_PAIN, p->GetActor());
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2020-10-25 07:50:03 +00:00
|
|
|
if (coll.type != kHitWall) return;
|
2021-11-26 12:41:15 +00:00
|
|
|
auto wal = coll.hitWall;
|
2020-05-12 11:43:24 +00:00
|
|
|
|
|
|
|
if (p->hurt_delay > 0) p->hurt_delay--;
|
2021-12-18 14:16:31 +00:00
|
|
|
else if (wal->cstat & (CSTAT_WALL_BLOCK | CSTAT_WALL_ALIGN_BOTTOM | CSTAT_WALL_MASKED | CSTAT_WALL_BLOCK_HITSCAN)) switch (wal->overpicnum)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
|
|
|
case W_FORCEFIELD:
|
|
|
|
case W_FORCEFIELD + 1:
|
|
|
|
case W_FORCEFIELD + 2:
|
2021-12-21 17:19:45 +00:00
|
|
|
p->GetActor()->spr.extra -= 5;
|
2020-05-12 11:43:24 +00:00
|
|
|
|
|
|
|
p->hurt_delay = 16;
|
|
|
|
SetPlayerPal(p, PalEntry(32, 32, 0, 0));
|
|
|
|
|
2022-08-27 13:09:51 +00:00
|
|
|
p->vel.X = -p->angle.ang.Cos() * (1 << 22);
|
|
|
|
p->vel.Y = -p->angle.ang.Sin() * (1 << 22);
|
2020-10-25 07:50:03 +00:00
|
|
|
S_PlayActorSound(DUKE_LONGTERM_PAIN, p->GetActor());
|
2020-05-12 11:43:24 +00:00
|
|
|
|
2021-11-17 22:49:49 +00:00
|
|
|
fi.checkhitwall(p->GetActor(), wal,
|
2022-08-27 13:09:51 +00:00
|
|
|
p->player_int_pos().X + p->angle.ang.Cos() * (1 << 5),
|
|
|
|
p->player_int_pos().Y + p->angle.ang.Sin() * (1 << 5),
|
2022-02-04 17:11:44 +00:00
|
|
|
p->player_int_pos().Z, -1);
|
2020-05-12 11:43:24 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BIGFORCE:
|
|
|
|
p->hurt_delay = 26;
|
2021-11-17 22:49:49 +00:00
|
|
|
fi.checkhitwall(p->GetActor(), wal,
|
2022-08-27 13:09:51 +00:00
|
|
|
p->player_int_pos().X + p->angle.ang.Cos() * (1 << 5),
|
|
|
|
p->player_int_pos().Y + p->angle.ang.Sin() * (1 << 5),
|
2022-02-04 17:11:44 +00:00
|
|
|
p->player_int_pos().Z, -1);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
2020-05-10 18:59:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2021-11-18 16:55:08 +00:00
|
|
|
bool checkhitceiling_d(sectortype* sectp)
|
2020-05-10 18:59:38 +00:00
|
|
|
{
|
2020-11-02 18:41:06 +00:00
|
|
|
int j;
|
2020-05-12 11:43:24 +00:00
|
|
|
|
2021-11-06 22:05:25 +00:00
|
|
|
switch (sectp->ceilingpicnum)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
|
|
|
case WALLLIGHT1:
|
|
|
|
case WALLLIGHT2:
|
|
|
|
case WALLLIGHT3:
|
|
|
|
case WALLLIGHT4:
|
|
|
|
case TECHLIGHT2:
|
|
|
|
case TECHLIGHT4:
|
|
|
|
|
2021-11-18 16:55:08 +00:00
|
|
|
ceilingglass(ps[myconnectindex].GetActor(), sectp, 10);
|
2020-11-02 19:23:30 +00:00
|
|
|
S_PlayActorSound(GLASS_BREAKING, ps[screenpeek].GetActor());
|
2020-05-12 11:43:24 +00:00
|
|
|
|
2021-11-06 22:05:25 +00:00
|
|
|
if (sectp->ceilingpicnum == WALLLIGHT1)
|
|
|
|
sectp->ceilingpicnum = WALLLIGHTBUST1;
|
2020-05-12 11:43:24 +00:00
|
|
|
|
2021-11-06 22:05:25 +00:00
|
|
|
if (sectp->ceilingpicnum == WALLLIGHT2)
|
|
|
|
sectp->ceilingpicnum = WALLLIGHTBUST2;
|
2020-05-12 11:43:24 +00:00
|
|
|
|
2021-11-06 22:05:25 +00:00
|
|
|
if (sectp->ceilingpicnum == WALLLIGHT3)
|
|
|
|
sectp->ceilingpicnum = WALLLIGHTBUST3;
|
2020-05-12 11:43:24 +00:00
|
|
|
|
2021-11-06 22:05:25 +00:00
|
|
|
if (sectp->ceilingpicnum == WALLLIGHT4)
|
|
|
|
sectp->ceilingpicnum = WALLLIGHTBUST4;
|
2020-05-12 11:43:24 +00:00
|
|
|
|
2021-11-06 22:05:25 +00:00
|
|
|
if (sectp->ceilingpicnum == TECHLIGHT2)
|
|
|
|
sectp->ceilingpicnum = TECHLIGHTBUST2;
|
2020-05-12 11:43:24 +00:00
|
|
|
|
2021-11-06 22:05:25 +00:00
|
|
|
if (sectp->ceilingpicnum == TECHLIGHT4)
|
|
|
|
sectp->ceilingpicnum = TECHLIGHTBUST4;
|
2020-05-12 11:43:24 +00:00
|
|
|
|
|
|
|
|
2021-11-06 22:05:25 +00:00
|
|
|
if (!sectp->hitag)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-11-18 16:55:08 +00:00
|
|
|
DukeSectIterator it(sectp);
|
2020-11-02 18:41:06 +00:00
|
|
|
while (auto act = it.Next())
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 17:19:45 +00:00
|
|
|
if (act->spr.picnum == SECTOREFFECTOR && act->spr.lotag == 12)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2020-11-02 18:41:06 +00:00
|
|
|
DukeStatIterator it1(STAT_EFFECTOR);
|
|
|
|
while (auto act2 = it1.Next())
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 17:19:45 +00:00
|
|
|
if (act2->spr.hitag == act->spr.hitag)
|
2020-11-02 18:41:06 +00:00
|
|
|
act2->temp_data[3] = 1;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
j = krand() & 1;
|
2020-11-02 18:41:06 +00:00
|
|
|
DukeStatIterator it(STAT_EFFECTOR);
|
|
|
|
while (auto act = it.Next())
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 17:19:45 +00:00
|
|
|
if (act->spr.hitag == (sectp->hitag) && act->spr.lotag == 3)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2020-11-02 18:41:06 +00:00
|
|
|
act->temp_data[2] = j;
|
|
|
|
act->temp_data[4] = 1;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
2020-05-10 18:59:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2020-10-24 05:08:40 +00:00
|
|
|
void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj)
|
2020-05-10 18:59:38 +00:00
|
|
|
{
|
2020-05-12 11:43:24 +00:00
|
|
|
int j, k, p;
|
|
|
|
|
2021-12-21 20:39:57 +00:00
|
|
|
switch (targ->spr.picnum)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2020-07-06 13:48:51 +00:00
|
|
|
case WTGLASS1:
|
|
|
|
case WTGLASS2:
|
|
|
|
if (!isWorldTour())
|
|
|
|
break;
|
2020-10-24 04:16:33 +00:00
|
|
|
S_PlayActorSound(GLASS_BREAKING, targ);
|
2021-11-17 23:38:20 +00:00
|
|
|
lotsofglass(targ, nullptr, 10);
|
2020-10-24 04:16:33 +00:00
|
|
|
deletesprite(targ);
|
2020-07-06 13:48:51 +00:00
|
|
|
return;
|
|
|
|
|
2020-05-12 11:43:24 +00:00
|
|
|
case OCEANSPRITE1:
|
|
|
|
case OCEANSPRITE2:
|
|
|
|
case OCEANSPRITE3:
|
|
|
|
case OCEANSPRITE4:
|
|
|
|
case OCEANSPRITE5:
|
2020-10-24 04:16:33 +00:00
|
|
|
spawn(targ, SMALLSMOKE);
|
|
|
|
deletesprite(targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case QUEBALL:
|
|
|
|
case STRIPEBALL:
|
2021-12-21 20:39:57 +00:00
|
|
|
if (proj->spr.picnum == QUEBALL || proj->spr.picnum == STRIPEBALL)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 20:39:57 +00:00
|
|
|
proj->spr.xvel = (targ->spr.xvel >> 1) + (targ->spr.xvel >> 2);
|
2022-08-16 21:27:44 +00:00
|
|
|
proj->add_int_ang(-((targ->int_ang() << 1) + 1024));
|
2022-08-16 21:20:35 +00:00
|
|
|
targ->set_int_ang(getangle(targ->int_pos().X - proj->int_pos().X, targ->int_pos().Y - proj->int_pos().Y) - 512);
|
2020-05-12 11:43:24 +00:00
|
|
|
if (S_CheckSoundPlaying(POOLBALLHIT) < 2)
|
2020-10-24 04:16:33 +00:00
|
|
|
S_PlayActorSound(POOLBALLHIT, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (krand() & 3)
|
|
|
|
{
|
2021-12-21 20:39:57 +00:00
|
|
|
targ->spr.xvel = 164;
|
2022-08-28 03:15:31 +00:00
|
|
|
targ->spr.angle = proj->spr.angle;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-11-17 23:38:20 +00:00
|
|
|
lotsofglass(targ, nullptr, 3);
|
2020-10-24 04:16:33 +00:00
|
|
|
deletesprite(targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case TREE1:
|
|
|
|
case TREE2:
|
|
|
|
case TIRE:
|
|
|
|
case CONE:
|
|
|
|
case BOX:
|
2022-01-26 23:41:33 +00:00
|
|
|
if (actorflag(proj, SFLAG_INFLAME))
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2020-10-24 04:16:33 +00:00
|
|
|
if (targ->temp_data[0] == 0)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 20:39:57 +00:00
|
|
|
targ->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
2020-10-24 04:16:33 +00:00
|
|
|
targ->temp_data[0] = 1;
|
|
|
|
spawn(targ, BURNING);
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case CACTUS:
|
|
|
|
// case CACTUSBROKE:
|
2022-01-26 23:41:33 +00:00
|
|
|
if (actorflag(proj, SFLAG_INFLAME))
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
|
|
|
for (k = 0; k < 64; k++)
|
|
|
|
{
|
2022-01-31 18:21:49 +00:00
|
|
|
auto spawned = EGS(targ->sector(), targ->int_pos().X, targ->int_pos().Y, targ->int_pos().Z - (krand() % (48 << 8)), SCRAP3 + (krand() & 3), -8, 48, 48, krand() & 2047, (krand() & 63) + 64, -(krand() & 4095) - (targ->spr.zvel >> 2), targ, 5);
|
2021-12-24 09:53:27 +00:00
|
|
|
spawned->spr.pal = 8;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
|
2021-12-21 20:39:57 +00:00
|
|
|
if (targ->spr.picnum == CACTUS)
|
|
|
|
targ->spr.picnum = CACTUSBROKE;
|
|
|
|
targ->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case HANGLIGHT:
|
|
|
|
case GENERICPOLE2:
|
|
|
|
for (k = 0; k < 6; k++)
|
2022-01-31 18:21:49 +00:00
|
|
|
EGS(targ->sector(), targ->int_pos().X, targ->int_pos().Y, targ->int_pos().Z - (8 << 8), SCRAP1 + (krand() & 15), -8, 48, 48, krand() & 2047, (krand() & 63) + 64, -(krand() & 4095) - (targ->spr.zvel >> 2), targ, 5);
|
2020-10-24 04:16:33 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
|
|
|
deletesprite(targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case FANSPRITE:
|
2021-12-21 20:39:57 +00:00
|
|
|
targ->spr.picnum = FANSPRITEBROKE;
|
|
|
|
targ->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
2021-12-30 15:51:56 +00:00
|
|
|
if (targ->sector()->floorpicnum == FANSHADOW)
|
|
|
|
targ->sector()->floorpicnum = FANSHADOWBROKE;
|
2020-05-12 11:43:24 +00:00
|
|
|
|
2020-10-24 04:16:33 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
|
|
|
for (j = 0; j < 16; j++) RANDOMSCRAP(targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
case WATERFOUNTAIN:
|
|
|
|
case WATERFOUNTAIN + 1:
|
|
|
|
case WATERFOUNTAIN + 2:
|
|
|
|
case WATERFOUNTAIN + 3:
|
2021-12-21 20:39:57 +00:00
|
|
|
targ->spr.picnum = WATERFOUNTAINBROKE;
|
2020-10-24 04:16:33 +00:00
|
|
|
spawn(targ, TOILETWATER);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case SATELITE:
|
|
|
|
case FUELPOD:
|
|
|
|
case SOLARPANNEL:
|
|
|
|
case ANTENNA:
|
2021-12-21 20:39:57 +00:00
|
|
|
if (gs.actorinfo[SHOTSPARK1].scriptaddress && proj->spr.extra != ScriptCode[gs.actorinfo[SHOTSPARK1].scriptaddress])
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
|
|
|
for (j = 0; j < 15; j++)
|
2022-02-02 23:46:04 +00:00
|
|
|
EGS(targ->sector(), targ->int_pos().X, targ->int_pos().Y, targ->sector()->int_floorz() - (12 << 8) - (j << 9), SCRAP1 + (krand() & 15), -8, 64, 64,
|
2020-10-24 05:08:40 +00:00
|
|
|
krand() & 2047, (krand() & 127) + 64, -(krand() & 511) - 256, targ, 5);
|
|
|
|
spawn(targ, EXPLOSION2);
|
|
|
|
deletesprite(targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case BOTTLE1:
|
|
|
|
case BOTTLE2:
|
|
|
|
case BOTTLE3:
|
|
|
|
case BOTTLE4:
|
|
|
|
case BOTTLE5:
|
|
|
|
case BOTTLE6:
|
|
|
|
case BOTTLE8:
|
|
|
|
case BOTTLE10:
|
|
|
|
case BOTTLE11:
|
|
|
|
case BOTTLE12:
|
|
|
|
case BOTTLE13:
|
|
|
|
case BOTTLE14:
|
|
|
|
case BOTTLE15:
|
|
|
|
case BOTTLE16:
|
|
|
|
case BOTTLE17:
|
|
|
|
case BOTTLE18:
|
|
|
|
case BOTTLE19:
|
|
|
|
case WATERFOUNTAINBROKE:
|
|
|
|
case DOMELITE:
|
|
|
|
case SUSHIPLATE1:
|
|
|
|
case SUSHIPLATE2:
|
|
|
|
case SUSHIPLATE3:
|
|
|
|
case SUSHIPLATE4:
|
|
|
|
case SUSHIPLATE5:
|
|
|
|
case WAITTOBESEATED:
|
|
|
|
case VASE:
|
|
|
|
case STATUEFLASH:
|
|
|
|
case STATUE:
|
2021-12-21 20:39:57 +00:00
|
|
|
if (targ->spr.picnum == BOTTLE10)
|
2020-10-24 05:08:40 +00:00
|
|
|
fi.lotsofmoney(targ, 4 + (krand() & 3));
|
2021-12-21 20:39:57 +00:00
|
|
|
else if (targ->spr.picnum == STATUE || targ->spr.picnum == STATUEFLASH)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-11-17 23:38:20 +00:00
|
|
|
lotsofcolourglass(targ, nullptr, 40);
|
2020-10-24 04:16:33 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
2021-12-21 20:39:57 +00:00
|
|
|
else if (targ->spr.picnum == VASE)
|
2021-11-17 23:38:20 +00:00
|
|
|
lotsofglass(targ, nullptr, 40);
|
2020-05-12 11:43:24 +00:00
|
|
|
|
2020-10-24 04:16:33 +00:00
|
|
|
S_PlayActorSound(GLASS_BREAKING, targ);
|
2022-08-16 21:20:35 +00:00
|
|
|
targ->set_int_ang(krand() & 2047);
|
2021-11-17 23:38:20 +00:00
|
|
|
lotsofglass(targ, nullptr, 8);
|
2020-10-24 04:16:33 +00:00
|
|
|
deletesprite(targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case FETUS:
|
2021-12-21 20:39:57 +00:00
|
|
|
targ->spr.picnum = FETUSBROKE;
|
2020-10-24 04:16:33 +00:00
|
|
|
S_PlayActorSound(GLASS_BREAKING, targ);
|
2021-11-17 23:38:20 +00:00
|
|
|
lotsofglass(targ, nullptr, 10);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case FETUSBROKE:
|
|
|
|
for (j = 0; j < 48; j++)
|
|
|
|
{
|
2020-10-24 05:34:39 +00:00
|
|
|
fi.shoot(targ, BLOODSPLAT1);
|
2022-08-16 21:26:39 +00:00
|
|
|
targ->add_int_ang(333);
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
2020-10-24 04:16:33 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
|
|
|
S_PlayActorSound(SQUISHED, targ);
|
2021-11-14 11:25:25 +00:00
|
|
|
[[fallthrough]];
|
2020-05-12 11:43:24 +00:00
|
|
|
case BOTTLE7:
|
2020-10-24 04:16:33 +00:00
|
|
|
S_PlayActorSound(GLASS_BREAKING, targ);
|
2021-11-17 23:38:20 +00:00
|
|
|
lotsofglass(targ, nullptr, 10);
|
2020-10-24 04:16:33 +00:00
|
|
|
deletesprite(targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case HYDROPLANT:
|
2021-12-21 20:39:57 +00:00
|
|
|
targ->spr.picnum = BROKEHYDROPLANT;
|
2020-10-24 04:16:33 +00:00
|
|
|
S_PlayActorSound(GLASS_BREAKING, targ);
|
2021-11-17 23:38:20 +00:00
|
|
|
lotsofglass(targ, nullptr, 10);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FORCESPHERE:
|
2021-12-21 20:39:57 +00:00
|
|
|
targ->spr.xrepeat = 0;
|
2020-10-24 04:16:33 +00:00
|
|
|
if (targ->GetOwner())
|
|
|
|
{
|
|
|
|
targ->GetOwner()->temp_data[0] = 32;
|
|
|
|
targ->GetOwner()->temp_data[1] = !targ->GetOwner()->temp_data[1];
|
|
|
|
targ->GetOwner()->temp_data[2] ++;
|
|
|
|
}
|
|
|
|
spawn(targ, EXPLOSION2);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case BROKEHYDROPLANT:
|
2021-12-21 20:39:57 +00:00
|
|
|
if (targ->spr.cstat & CSTAT_SPRITE_BLOCK)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2020-10-24 04:16:33 +00:00
|
|
|
S_PlayActorSound(GLASS_BREAKING, targ);
|
2022-02-07 07:47:18 +00:00
|
|
|
targ->spr.pos.Z += 16;
|
2021-12-21 20:39:57 +00:00
|
|
|
targ->spr.cstat = 0;
|
2021-11-17 23:38:20 +00:00
|
|
|
lotsofglass(targ, nullptr, 5);
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case TOILET:
|
2021-12-21 20:39:57 +00:00
|
|
|
targ->spr.picnum = TOILETBROKE;
|
|
|
|
if (krand() & 1) targ->spr.cstat |= CSTAT_SPRITE_XFLIP;
|
|
|
|
targ->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
2020-10-24 04:16:33 +00:00
|
|
|
spawn(targ, TOILETWATER);
|
|
|
|
S_PlayActorSound(GLASS_BREAKING, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case STALL:
|
2021-12-21 20:39:57 +00:00
|
|
|
targ->spr.picnum = STALLBROKE;
|
|
|
|
if (krand() & 1) targ->spr.cstat |= CSTAT_SPRITE_XFLIP;
|
|
|
|
targ->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
2020-10-24 04:16:33 +00:00
|
|
|
spawn(targ, TOILETWATER);
|
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case HYDRENT:
|
2021-12-21 20:39:57 +00:00
|
|
|
targ->spr.picnum = BROKEFIREHYDRENT;
|
2020-10-24 04:16:33 +00:00
|
|
|
spawn(targ, TOILETWATER);
|
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case GRATE1:
|
2021-12-21 20:39:57 +00:00
|
|
|
targ->spr.picnum = BGRATE1;
|
|
|
|
targ->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
2020-10-24 04:16:33 +00:00
|
|
|
S_PlayActorSound(VENT_BUST, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case CIRCLEPANNEL:
|
2021-12-21 20:39:57 +00:00
|
|
|
targ->spr.picnum = CIRCLEPANNELBROKE;
|
|
|
|
targ->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
2020-10-24 04:16:33 +00:00
|
|
|
S_PlayActorSound(VENT_BUST, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case PANNEL1:
|
|
|
|
case PANNEL2:
|
2021-12-21 20:39:57 +00:00
|
|
|
targ->spr.picnum = BPANNEL1;
|
|
|
|
targ->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
2020-10-24 04:16:33 +00:00
|
|
|
S_PlayActorSound(VENT_BUST, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case PANNEL3:
|
2021-12-21 20:39:57 +00:00
|
|
|
targ->spr.picnum = BPANNEL3;
|
|
|
|
targ->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
2020-10-24 04:16:33 +00:00
|
|
|
S_PlayActorSound(VENT_BUST, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case PIPE1:
|
|
|
|
case PIPE2:
|
|
|
|
case PIPE3:
|
|
|
|
case PIPE4:
|
|
|
|
case PIPE5:
|
|
|
|
case PIPE6:
|
2021-12-21 20:39:57 +00:00
|
|
|
switch (targ->spr.picnum)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 20:39:57 +00:00
|
|
|
case PIPE1:targ->spr.picnum = PIPE1B; break;
|
|
|
|
case PIPE2:targ->spr.picnum = PIPE2B; break;
|
|
|
|
case PIPE3:targ->spr.picnum = PIPE3B; break;
|
|
|
|
case PIPE4:targ->spr.picnum = PIPE4B; break;
|
|
|
|
case PIPE5:targ->spr.picnum = PIPE5B; break;
|
|
|
|
case PIPE6:targ->spr.picnum = PIPE6B; break;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
2020-10-24 04:16:33 +00:00
|
|
|
{
|
2021-12-24 09:53:27 +00:00
|
|
|
auto spawned = spawn(targ, STEAM);
|
2022-08-28 09:35:03 +00:00
|
|
|
if (spawned) spawned->spr.pos.Z = targ->sector()->floorz - 32;
|
2020-10-24 04:16:33 +00:00
|
|
|
}
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case MONK:
|
|
|
|
case LUKE:
|
|
|
|
case INDY:
|
|
|
|
case JURYGUY:
|
2021-12-21 20:39:57 +00:00
|
|
|
S_PlayActorSound(targ->spr.lotag, targ);
|
|
|
|
spawn(targ, targ->spr.hitag);
|
2021-11-14 11:25:25 +00:00
|
|
|
[[fallthrough]];
|
2020-05-12 11:43:24 +00:00
|
|
|
case SPACEMARINE:
|
2020-10-24 05:08:40 +00:00
|
|
|
{
|
2021-12-21 20:39:57 +00:00
|
|
|
targ->spr.extra -= proj->spr.extra;
|
|
|
|
if (targ->spr.extra > 0) break;
|
2022-08-16 21:20:35 +00:00
|
|
|
targ->set_int_ang(krand() & 2047);
|
2020-10-24 05:34:39 +00:00
|
|
|
fi.shoot(targ, BLOODSPLAT1);
|
2022-08-16 21:20:35 +00:00
|
|
|
targ->set_int_ang(krand() & 2047);
|
2020-10-24 05:34:39 +00:00
|
|
|
fi.shoot(targ, BLOODSPLAT2);
|
2022-08-16 21:20:35 +00:00
|
|
|
targ->set_int_ang(krand() & 2047);
|
2020-10-24 05:34:39 +00:00
|
|
|
fi.shoot(targ, BLOODSPLAT3);
|
2022-08-16 21:20:35 +00:00
|
|
|
targ->set_int_ang(krand() & 2047);
|
2020-10-24 05:34:39 +00:00
|
|
|
fi.shoot(targ, BLOODSPLAT4);
|
2022-08-16 21:20:35 +00:00
|
|
|
targ->set_int_ang(krand() & 2047);
|
2020-10-24 05:34:39 +00:00
|
|
|
fi.shoot(targ, BLOODSPLAT1);
|
2022-08-16 21:20:35 +00:00
|
|
|
targ->set_int_ang(krand() & 2047);
|
2020-10-24 05:34:39 +00:00
|
|
|
fi.shoot(targ, BLOODSPLAT2);
|
2022-08-16 21:20:35 +00:00
|
|
|
targ->set_int_ang(krand() & 2047);
|
2020-10-24 05:34:39 +00:00
|
|
|
fi.shoot(targ, BLOODSPLAT3);
|
2022-08-16 21:20:35 +00:00
|
|
|
targ->set_int_ang(krand() & 2047);
|
2020-10-24 05:34:39 +00:00
|
|
|
fi.shoot(targ, BLOODSPLAT4);
|
2020-10-24 04:16:33 +00:00
|
|
|
fi.guts(targ, JIBS1, 1, myconnectindex);
|
|
|
|
fi.guts(targ, JIBS2, 2, myconnectindex);
|
|
|
|
fi.guts(targ, JIBS3, 3, myconnectindex);
|
|
|
|
fi.guts(targ, JIBS4, 4, myconnectindex);
|
|
|
|
fi.guts(targ, JIBS5, 1, myconnectindex);
|
|
|
|
fi.guts(targ, JIBS3, 6, myconnectindex);
|
2020-07-25 07:32:54 +00:00
|
|
|
S_PlaySound(SQUISHED);
|
2020-10-24 04:16:33 +00:00
|
|
|
deletesprite(targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
2020-10-24 05:08:40 +00:00
|
|
|
}
|
2020-05-12 11:43:24 +00:00
|
|
|
case CHAIR1:
|
|
|
|
case CHAIR2:
|
2021-12-21 20:39:57 +00:00
|
|
|
targ->spr.picnum = BROKENCHAIR;
|
|
|
|
targ->spr.cstat = 0;
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case CHAIR3:
|
|
|
|
case MOVIECAMERA:
|
|
|
|
case SCALE:
|
|
|
|
case VACUUM:
|
|
|
|
case CAMERALIGHT:
|
|
|
|
case IVUNIT:
|
|
|
|
case POT1:
|
|
|
|
case POT2:
|
|
|
|
case POT3:
|
|
|
|
case TRIPODCAMERA:
|
2020-10-24 04:16:33 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
|
|
|
for (j = 0; j < 16; j++) RANDOMSCRAP(targ);
|
|
|
|
deletesprite(targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case PLAYERONWATER:
|
2020-10-24 04:28:41 +00:00
|
|
|
targ = targ->GetOwner();
|
2020-10-24 05:04:29 +00:00
|
|
|
if (!targ) break;
|
2021-11-14 11:25:25 +00:00
|
|
|
[[fallthrough]];
|
2020-05-12 11:43:24 +00:00
|
|
|
default:
|
2021-12-21 20:39:57 +00:00
|
|
|
if ((targ->spr.cstat & CSTAT_SPRITE_ALIGNMENT_WALL) && targ->spr.hitag == 0 && targ->spr.lotag == 0 && targ->spr.statnum == 0)
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
|
2021-12-21 20:39:57 +00:00
|
|
|
if ((proj->spr.picnum == FREEZEBLAST || proj->GetOwner() != targ) && targ->spr.statnum != 4)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2020-10-24 04:16:33 +00:00
|
|
|
if (badguy(targ) == 1)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 20:39:57 +00:00
|
|
|
if (isWorldTour() && targ->spr.picnum == FIREFLY && targ->spr.xrepeat < 48)
|
2020-09-07 19:38:17 +00:00
|
|
|
break;
|
|
|
|
|
2021-12-21 20:39:57 +00:00
|
|
|
if (proj->spr.picnum == RPG) proj->spr.extra <<= 1;
|
2020-05-12 11:43:24 +00:00
|
|
|
|
2021-12-21 20:39:57 +00:00
|
|
|
if ((targ->spr.picnum != DRONE) && (targ->spr.picnum != ROTATEGUN) && (targ->spr.picnum != COMMANDER) && (targ->spr.picnum < GREENSLIME || targ->spr.picnum > GREENSLIME + 7))
|
|
|
|
if (proj->spr.picnum != FREEZEBLAST)
|
|
|
|
//if (actortype[targ->spr.picnum] == 0) //TRANSITIONAL. Cannot be done right with EDuke mess backing the engine.
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2020-11-02 18:41:06 +00:00
|
|
|
auto spawned = spawn(proj, JIBS6);
|
2021-11-19 11:32:12 +00:00
|
|
|
if (spawned)
|
|
|
|
{
|
2021-12-21 20:39:57 +00:00
|
|
|
if (proj->spr.pal == 6)
|
2021-12-21 17:19:45 +00:00
|
|
|
spawned->spr.pal = 6;
|
2022-02-07 07:47:18 +00:00
|
|
|
spawned->spr.pos.Z += 4;
|
2021-12-21 17:19:45 +00:00
|
|
|
spawned->spr.xvel = 16;
|
|
|
|
spawned->spr.xrepeat = spawned->spr.yrepeat = 24;
|
2022-08-16 21:26:39 +00:00
|
|
|
spawned->add_int_ang(32 - (krand() & 63));
|
2021-11-19 11:32:12 +00:00
|
|
|
}
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
|
2020-11-02 18:41:06 +00:00
|
|
|
auto Owner = proj->GetOwner();
|
2020-05-12 11:43:24 +00:00
|
|
|
|
2021-12-21 20:39:57 +00:00
|
|
|
if (Owner && Owner->spr.picnum == APLAYER && targ->spr.picnum != ROTATEGUN && targ->spr.picnum != DRONE)
|
2020-11-02 18:41:06 +00:00
|
|
|
if (ps[Owner->PlayerIndex()].curr_weapon == SHOTGUN_WEAPON)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2020-10-24 05:34:39 +00:00
|
|
|
fi.shoot(targ, BLOODSPLAT3);
|
|
|
|
fi.shoot(targ, BLOODSPLAT1);
|
|
|
|
fi.shoot(targ, BLOODSPLAT2);
|
|
|
|
fi.shoot(targ, BLOODSPLAT4);
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
|
2021-12-21 20:39:57 +00:00
|
|
|
if (targ->spr.picnum != TANK && !bossguy(targ) && targ->spr.picnum != RECON && targ->spr.picnum != ROTATEGUN)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 20:39:57 +00:00
|
|
|
if ((targ->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == 0)
|
2022-08-16 21:20:35 +00:00
|
|
|
targ->set_int_ang((proj->int_ang() + 1024) & 2047);
|
2021-12-21 20:39:57 +00:00
|
|
|
targ->spr.xvel = -(proj->spr.extra << 2);
|
2021-12-30 15:51:56 +00:00
|
|
|
auto sp = targ->sector();
|
2022-01-30 17:12:07 +00:00
|
|
|
pushmove(targ, &sp, 128L, (4 << 8), (4 << 8), CLIPMASK0);
|
2021-12-30 15:51:56 +00:00
|
|
|
if (sp != targ->sector() && sp != nullptr)
|
2021-11-26 20:52:01 +00:00
|
|
|
ChangeActorSect(targ, sp);
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
|
2021-12-21 20:39:57 +00:00
|
|
|
if (targ->spr.statnum == 2)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-11-26 20:52:01 +00:00
|
|
|
ChangeActorStat(targ, 1);
|
2020-10-24 04:16:33 +00:00
|
|
|
targ->timetosleep = SLEEPTIME;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
2021-12-21 20:39:57 +00:00
|
|
|
if ((targ->spr.xrepeat < 24 || targ->spr.picnum == SHARK) && proj->spr.picnum == SHRINKSPARK) return;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
|
2021-12-21 20:39:57 +00:00
|
|
|
if (targ->spr.statnum != 2)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 20:39:57 +00:00
|
|
|
if (proj->spr.picnum == FREEZEBLAST && ((targ->spr.picnum == APLAYER && targ->spr.pal == 1) || (gs.freezerhurtowner == 0 && proj->GetOwner() == targ)))
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
|
2020-09-07 19:38:17 +00:00
|
|
|
|
2021-12-21 20:39:57 +00:00
|
|
|
int hitpic = proj->spr.picnum;
|
2020-11-02 18:41:06 +00:00
|
|
|
auto Owner = proj->GetOwner();
|
2021-12-21 17:19:45 +00:00
|
|
|
if (Owner && Owner->spr.picnum == APLAYER)
|
2020-09-07 19:38:17 +00:00
|
|
|
{
|
2021-12-21 20:39:57 +00:00
|
|
|
if (targ->spr.picnum == APLAYER && ud.coop != 0 && ud.ffire == 0)
|
2020-09-07 19:38:17 +00:00
|
|
|
return;
|
|
|
|
|
2020-11-02 18:41:06 +00:00
|
|
|
auto tOwner = targ->GetOwner();
|
2021-12-21 17:19:45 +00:00
|
|
|
if (isWorldTour() && hitpic == FIREBALL && tOwner && tOwner->spr.picnum != FIREBALL)
|
2020-09-07 19:38:17 +00:00
|
|
|
hitpic = FLAMETHROWERFLAME;
|
|
|
|
}
|
|
|
|
|
2021-12-27 22:52:16 +00:00
|
|
|
targ->attackertype = hitpic;
|
2022-01-23 23:10:25 +00:00
|
|
|
targ->hitextra += proj->spr.extra;
|
2022-08-16 21:17:01 +00:00
|
|
|
targ->hitang = proj->int_ang();
|
2020-11-02 18:41:06 +00:00
|
|
|
targ->SetHitOwner(Owner);
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
|
2021-12-21 20:39:57 +00:00
|
|
|
if (targ->spr.statnum == 10)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 20:39:57 +00:00
|
|
|
p = targ->spr.yvel;
|
2020-11-02 23:20:51 +00:00
|
|
|
if (ps[p].newOwner != nullptr)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2020-11-02 23:20:51 +00:00
|
|
|
ps[p].newOwner = nullptr;
|
2022-02-05 11:05:29 +00:00
|
|
|
ps[p].restorexyz();
|
2020-10-07 12:13:21 +00:00
|
|
|
ps[p].angle.restore();
|
2020-05-12 11:43:24 +00:00
|
|
|
|
2022-02-04 17:11:44 +00:00
|
|
|
updatesector(ps[p].player_int_pos().X, ps[p].player_int_pos().Y, &ps[p].cursector);
|
2020-05-12 11:43:24 +00:00
|
|
|
|
2020-10-24 04:16:33 +00:00
|
|
|
DukeStatIterator it(STAT_ACTOR);
|
2021-12-24 09:53:27 +00:00
|
|
|
while (auto itActor = it.Next())
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2022-01-21 00:04:08 +00:00
|
|
|
if (actorflag(itActor, SFLAG2_CAMERA)) itActor->spr.yvel = 0;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-12-21 20:39:57 +00:00
|
|
|
if (targ->spr.xrepeat < 24 && proj->spr.picnum == SHRINKSPARK)
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
|
2020-10-24 05:08:40 +00:00
|
|
|
auto hitowner = targ->GetHitOwner();
|
2021-12-21 17:19:45 +00:00
|
|
|
if (!hitowner || hitowner->spr.picnum != APLAYER)
|
2020-05-12 11:43:24 +00:00
|
|
|
if (ud.player_skill >= 3)
|
2021-12-21 20:39:57 +00:00
|
|
|
proj->spr.extra += (proj->spr.extra >> 1);
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2020-05-10 18:59:38 +00:00
|
|
|
}
|
|
|
|
|
2021-11-17 23:16:53 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// taken out of checksectors to eliminate some gotos.
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void clearcameras(int i, player_struct* p)
|
|
|
|
{
|
|
|
|
if (i < 0)
|
|
|
|
{
|
2022-02-05 11:05:29 +00:00
|
|
|
p->restorexyz();
|
2021-11-17 23:16:53 +00:00
|
|
|
p->newOwner = nullptr;
|
|
|
|
|
2022-02-04 17:11:44 +00:00
|
|
|
updatesector(p->player_int_pos().X, p->player_int_pos().Y, &p->cursector);
|
2021-11-17 23:16:53 +00:00
|
|
|
|
|
|
|
DukeStatIterator it(STAT_ACTOR);
|
|
|
|
while (auto act = it.Next())
|
|
|
|
{
|
2022-01-21 00:04:08 +00:00
|
|
|
if (actorflag(act, SFLAG2_CAMERA)) act->spr.yvel = 0;
|
2021-11-17 23:16:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (p->newOwner != nullptr)
|
|
|
|
p->newOwner = nullptr;
|
|
|
|
}
|
|
|
|
|
2020-05-10 20:20:49 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void checksectors_d(int snum)
|
|
|
|
{
|
2020-05-12 11:43:24 +00:00
|
|
|
int i = -1, oldz;
|
2022-02-07 10:04:19 +00:00
|
|
|
player_struct* p;
|
2021-11-17 23:04:36 +00:00
|
|
|
walltype* hitscanwall;
|
2021-11-26 17:59:28 +00:00
|
|
|
HitInfo near;
|
2020-05-12 11:43:24 +00:00
|
|
|
|
|
|
|
p = &ps[snum];
|
2020-11-02 19:23:30 +00:00
|
|
|
auto pact = p->GetActor();
|
2020-05-12 11:43:24 +00:00
|
|
|
|
2021-11-19 07:58:31 +00:00
|
|
|
if (!p->insector()) return;
|
|
|
|
|
2021-11-21 07:56:39 +00:00
|
|
|
switch (p->cursector->lotag)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
case 32767:
|
2021-11-21 07:56:39 +00:00
|
|
|
p->cursector->lotag = 0;
|
2020-05-12 11:43:24 +00:00
|
|
|
FTA(9, p);
|
|
|
|
p->secret_rooms++;
|
2021-11-21 07:56:39 +00:00
|
|
|
SECRET_Trigger(sectnum(p->cursector));
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
case -1:
|
2021-11-21 07:56:39 +00:00
|
|
|
p->cursector->lotag = 0;
|
2020-07-07 15:56:20 +00:00
|
|
|
setnextmap(false);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
case -2:
|
2021-11-21 07:56:39 +00:00
|
|
|
p->cursector->lotag = 0;
|
2020-05-12 11:43:24 +00:00
|
|
|
p->timebeforeexit = 26 * 8;
|
2021-11-21 07:56:39 +00:00
|
|
|
p->customexitsound = p->cursector->hitag;
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
default:
|
2021-11-21 07:56:39 +00:00
|
|
|
if (p->cursector->lotag >= 10000 && p->cursector->lotag < 16383)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
|
|
|
if (snum == screenpeek || ud.coop == 1)
|
2021-11-21 07:56:39 +00:00
|
|
|
S_PlayActorSound(p->cursector->lotag - 10000, pact);
|
|
|
|
p->cursector->lotag = 0;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//After this point the the player effects the map with space
|
|
|
|
|
2021-12-21 17:19:45 +00:00
|
|
|
if (chatmodeon || p->GetActor()->spr.extra <= 0) return;
|
2020-05-12 11:43:24 +00:00
|
|
|
|
2020-08-28 20:51:05 +00:00
|
|
|
if (ud.cashman && PlayerInput(snum, SB_OPEN))
|
2020-11-02 18:53:04 +00:00
|
|
|
fi.lotsofmoney(p->GetActor(), 2);
|
2020-05-12 11:43:24 +00:00
|
|
|
|
2020-11-02 23:20:51 +00:00
|
|
|
if (p->newOwner != nullptr)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
|
|
|
if (abs(PlayerInputSideVel(snum)) > 768 || abs(PlayerInputForwardVel(snum)) > 768)
|
|
|
|
{
|
2021-11-17 23:16:53 +00:00
|
|
|
clearcameras(-1, p);
|
|
|
|
return;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-29 11:32:14 +00:00
|
|
|
if (!(PlayerInput(snum, SB_OPEN)))
|
2020-05-12 11:43:24 +00:00
|
|
|
p->toggle_key_flag = 0;
|
|
|
|
|
|
|
|
else if (!p->toggle_key_flag)
|
|
|
|
{
|
|
|
|
|
2020-08-29 11:32:14 +00:00
|
|
|
if (PlayerInput(snum, SB_ESCAPE))
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2020-11-02 23:20:51 +00:00
|
|
|
if (p->newOwner != nullptr)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-11-17 23:16:53 +00:00
|
|
|
clearcameras(-1, p);
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-11-26 17:59:28 +00:00
|
|
|
near.hitActor = nullptr;
|
2020-05-12 11:43:24 +00:00
|
|
|
p->toggle_key_flag = 1;
|
2021-11-17 23:04:36 +00:00
|
|
|
hitscanwall = nullptr;
|
2020-05-12 11:43:24 +00:00
|
|
|
|
|
|
|
i = hitawall(p, &hitscanwall);
|
2021-11-17 23:04:36 +00:00
|
|
|
if (hitscanwall != nullptr)
|
2021-11-17 22:40:10 +00:00
|
|
|
{
|
2021-11-17 23:04:36 +00:00
|
|
|
if (i < 1280 && hitscanwall->overpicnum == MIRROR)
|
|
|
|
if (hitscanwall->lotag > 0 && S_CheckSoundPlaying(hitscanwall->lotag) == 0 && snum == screenpeek)
|
2021-11-17 22:40:10 +00:00
|
|
|
{
|
2021-11-17 23:04:36 +00:00
|
|
|
S_PlayActorSound(hitscanwall->lotag, pact);
|
2021-11-17 22:40:10 +00:00
|
|
|
return;
|
|
|
|
}
|
2021-12-30 09:30:21 +00:00
|
|
|
|
2021-12-18 14:11:21 +00:00
|
|
|
if (hitscanwall != nullptr && (hitscanwall->cstat & CSTAT_WALL_MASKED))
|
2021-11-17 23:04:36 +00:00
|
|
|
if (hitscanwall->lotag)
|
2021-11-17 22:40:10 +00:00
|
|
|
return;
|
|
|
|
}
|
2020-11-02 23:20:51 +00:00
|
|
|
if (p->newOwner != nullptr)
|
2022-08-27 13:09:22 +00:00
|
|
|
neartag({ p->player_int_opos().X, p->player_int_opos().Y, p->player_int_opos().Z }, p->GetActor()->sector(), p->angle.oang.Buildang(), near, 1280L, 1);
|
2020-05-12 11:43:24 +00:00
|
|
|
else
|
|
|
|
{
|
2022-08-27 13:09:51 +00:00
|
|
|
neartag(p->player_int_pos(), p->GetActor()->sector(), p->angle.oang.Buildang(), near, 1280, 1);
|
2021-11-26 17:59:28 +00:00
|
|
|
if (near.actor() == nullptr && near.hitWall == nullptr && near.hitSector == nullptr)
|
2022-08-27 13:09:22 +00:00
|
|
|
neartag({ p->player_int_pos().X, p->player_int_pos().Y, p->player_int_pos().Z + (8 << 8) }, p->GetActor()->sector(), p->angle.oang.Buildang(), near, 1280, 1);
|
2021-11-26 17:59:28 +00:00
|
|
|
if (near.actor() == nullptr && near.hitWall == nullptr && near.hitSector == nullptr)
|
2022-08-27 13:09:22 +00:00
|
|
|
neartag({ p->player_int_pos().X, p->player_int_pos().Y, p->player_int_pos().Z + (16 << 8) }, p->GetActor()->sector(), p->angle.oang.Buildang(), near, 1280, 1);
|
2021-11-26 17:59:28 +00:00
|
|
|
if (near.actor() == nullptr && near.hitWall == nullptr && near.hitSector == nullptr)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2022-08-27 13:09:22 +00:00
|
|
|
neartag({ p->player_int_pos().X, p->player_int_pos().Y, p->player_int_pos().Z + (16 << 8) }, p->GetActor()->sector(), p->angle.oang.Buildang(), near, 1280, 3);
|
2021-11-26 17:59:28 +00:00
|
|
|
if (near.actor() != nullptr)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 17:19:45 +00:00
|
|
|
switch (near.actor()->spr.picnum)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
|
|
|
case FEM1:
|
|
|
|
case FEM2:
|
|
|
|
case FEM3:
|
|
|
|
case FEM4:
|
|
|
|
case FEM5:
|
|
|
|
case FEM6:
|
|
|
|
case FEM7:
|
|
|
|
case FEM8:
|
|
|
|
case FEM9:
|
|
|
|
case FEM10:
|
|
|
|
case PODFEM1:
|
|
|
|
case NAKED1:
|
|
|
|
case STATUE:
|
|
|
|
case TOUGHGAL:
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-11-26 17:59:28 +00:00
|
|
|
near.clearObj();
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-11-26 17:59:28 +00:00
|
|
|
if (p->newOwner == nullptr && near.actor() == nullptr && near.hitWall == nullptr && near.hitSector == nullptr)
|
2021-11-20 23:33:17 +00:00
|
|
|
if (isanunderoperator(p->GetActor()->sector()->lotag))
|
2021-12-30 15:51:56 +00:00
|
|
|
near.hitSector = p->GetActor()->sector();
|
2020-05-12 11:43:24 +00:00
|
|
|
|
2021-11-26 17:59:28 +00:00
|
|
|
if (near.hitSector && (near.hitSector->lotag & 16384))
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
|
2021-11-26 17:59:28 +00:00
|
|
|
if (near.actor() == nullptr && near.hitWall == nullptr)
|
2021-11-21 07:56:39 +00:00
|
|
|
if (p->cursector->lotag == 2)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2020-10-23 17:33:54 +00:00
|
|
|
DDukeActor* hit;
|
|
|
|
oldz = hitasprite(p->GetActor(), &hit);
|
2021-11-26 17:59:28 +00:00
|
|
|
if (hit) near.hitActor = hit;
|
|
|
|
if (oldz > 1280) near.hitActor = nullptr;
|
2020-10-23 17:33:54 +00:00
|
|
|
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
|
2021-11-26 17:59:28 +00:00
|
|
|
auto const neartagsprite = near.actor();
|
2020-10-27 06:00:39 +00:00
|
|
|
if (neartagsprite != nullptr)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-11-17 23:16:53 +00:00
|
|
|
if (fi.checkhitswitch(snum, nullptr, neartagsprite)) return;
|
2020-05-12 11:43:24 +00:00
|
|
|
|
2021-12-21 17:19:45 +00:00
|
|
|
switch (neartagsprite->spr.picnum)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
|
|
|
case TOILET:
|
|
|
|
case STALL:
|
|
|
|
if (p->last_pissed_time == 0)
|
|
|
|
{
|
2020-10-27 05:35:11 +00:00
|
|
|
S_PlayActorSound(DUKE_URINATE, p->GetActor());
|
2020-05-12 11:43:24 +00:00
|
|
|
|
|
|
|
p->last_pissed_time = 26 * 220;
|
|
|
|
p->transporter_hold = 29 * 2;
|
|
|
|
if (p->holster_weapon == 0)
|
|
|
|
{
|
|
|
|
p->holster_weapon = 1;
|
|
|
|
p->weapon_pos = -1;
|
|
|
|
}
|
2021-12-21 17:19:45 +00:00
|
|
|
if (p->GetActor()->spr.extra <= (gs.max_player_health - (gs.max_player_health / 10)))
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 17:19:45 +00:00
|
|
|
p->GetActor()->spr.extra += gs.max_player_health / 10;
|
|
|
|
p->last_extra = p->GetActor()->spr.extra;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
2021-12-21 17:19:45 +00:00
|
|
|
else if (p->GetActor()->spr.extra < gs.max_player_health)
|
|
|
|
p->GetActor()->spr.extra = gs.max_player_health;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
2020-10-27 05:35:11 +00:00
|
|
|
else if (S_CheckActorSoundPlaying(neartagsprite, FLUSH_TOILET) == 0)
|
2020-07-25 07:32:54 +00:00
|
|
|
S_PlayActorSound(FLUSH_TOILET, neartagsprite);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
case NUKEBUTTON:
|
2021-11-17 23:04:36 +00:00
|
|
|
{
|
|
|
|
walltype* wal;
|
|
|
|
hitawall(p, &wal);
|
|
|
|
if (wal != nullptr && wal->overpicnum == 0)
|
2020-10-27 05:35:11 +00:00
|
|
|
if (neartagsprite->temp_data[0] == 0)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2020-10-27 05:35:11 +00:00
|
|
|
neartagsprite->temp_data[0] = 1;
|
|
|
|
neartagsprite->SetOwner(p->GetActor());
|
2021-12-21 17:19:45 +00:00
|
|
|
p->buttonpalette = neartagsprite->spr.pal;
|
2020-05-12 11:43:24 +00:00
|
|
|
if (p->buttonpalette)
|
2021-12-21 17:19:45 +00:00
|
|
|
ud.secretlevel = neartagsprite->spr.lotag;
|
2020-05-12 11:43:24 +00:00
|
|
|
else ud.secretlevel = 0;
|
|
|
|
}
|
|
|
|
return;
|
2021-11-17 23:04:36 +00:00
|
|
|
}
|
2020-05-12 11:43:24 +00:00
|
|
|
case WATERFOUNTAIN:
|
2020-10-27 05:35:11 +00:00
|
|
|
if (neartagsprite->temp_data[0] != 1)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2020-10-27 05:35:11 +00:00
|
|
|
neartagsprite->temp_data[0] = 1;
|
|
|
|
neartagsprite->SetOwner(p->GetActor());
|
2020-05-12 11:43:24 +00:00
|
|
|
|
2021-12-21 17:19:45 +00:00
|
|
|
if (p->GetActor()->spr.extra < gs.max_player_health)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 17:19:45 +00:00
|
|
|
p->GetActor()->spr.extra++;
|
2020-10-27 05:35:11 +00:00
|
|
|
S_PlayActorSound(DUKE_DRINKING, p->GetActor());
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
case PLUG:
|
2020-11-02 19:23:30 +00:00
|
|
|
S_PlayActorSound(SHORT_CIRCUIT, pact);
|
2021-12-21 17:19:45 +00:00
|
|
|
p->GetActor()->spr.extra -= 2 + (krand() & 3);
|
2020-05-12 11:43:24 +00:00
|
|
|
SetPlayerPal(p, PalEntry(32, 48, 48, 64));
|
|
|
|
break;
|
|
|
|
case VIEWSCREEN:
|
|
|
|
case VIEWSCREEN2:
|
|
|
|
{
|
2020-11-02 18:41:06 +00:00
|
|
|
DukeStatIterator it(STAT_ACTOR);
|
|
|
|
while (auto acti = it.Next())
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2022-01-21 00:04:08 +00:00
|
|
|
if (actorflag(acti, SFLAG2_CAMERA) && acti->spr.yvel == 0 && neartagsprite->spr.hitag == acti->spr.lotag)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 20:39:57 +00:00
|
|
|
acti->spr.yvel = 1; //Using this camera
|
2020-07-26 09:44:31 +00:00
|
|
|
if (snum == screenpeek) S_PlaySound(MONITOR_ACTIVE);
|
2020-05-12 11:43:24 +00:00
|
|
|
|
2020-11-02 22:53:55 +00:00
|
|
|
neartagsprite->SetOwner(acti);
|
2021-12-21 17:19:45 +00:00
|
|
|
neartagsprite->spr.yvel = 1;
|
2020-11-04 18:25:49 +00:00
|
|
|
camsprite = neartagsprite;
|
2020-05-12 11:43:24 +00:00
|
|
|
|
2020-11-02 23:20:51 +00:00
|
|
|
p->newOwner = acti;
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
2020-11-04 19:44:12 +00:00
|
|
|
i = -1;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
|
2021-11-17 23:16:53 +00:00
|
|
|
clearcameras(i, p);
|
|
|
|
return;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-11-17 23:16:53 +00:00
|
|
|
if (!PlayerInput(snum, SB_OPEN)) return;
|
|
|
|
else if (p->newOwner != nullptr)
|
|
|
|
{
|
|
|
|
clearcameras(-1, p);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-11-26 17:59:28 +00:00
|
|
|
if (near.hitWall == nullptr && near.hitSector == nullptr && near.actor() == nullptr)
|
2020-10-23 17:33:54 +00:00
|
|
|
if (abs(hits(p->GetActor())) < 512)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
|
|
|
if ((krand() & 255) < 16)
|
2020-11-02 19:23:30 +00:00
|
|
|
S_PlayActorSound(DUKE_SEARCH2, pact);
|
|
|
|
else S_PlayActorSound(DUKE_SEARCH, pact);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-11-26 17:59:28 +00:00
|
|
|
if (near.hitWall)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-11-26 17:59:28 +00:00
|
|
|
if (near.hitWall->lotag > 0 && fi.isadoorwall(near.hitWall->picnum))
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-11-26 17:59:28 +00:00
|
|
|
if (hitscanwall == near.hitWall || hitscanwall == nullptr)
|
|
|
|
fi.checkhitswitch(snum, near.hitWall, nullptr);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
}
|
2020-11-02 23:20:51 +00:00
|
|
|
else if (p->newOwner != nullptr)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-11-17 23:16:53 +00:00
|
|
|
clearcameras(-1, p);
|
|
|
|
return;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-11-26 17:59:28 +00:00
|
|
|
if (near.hitSector && (near.hitSector->lotag & 16384) == 0 && isanearoperator(near.hitSector->lotag))
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-11-26 17:59:28 +00:00
|
|
|
DukeSectIterator it(near.hitSector);
|
2020-11-02 18:41:06 +00:00
|
|
|
while (auto act = it.Next())
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 17:19:45 +00:00
|
|
|
if (act->spr.picnum == ACTIVATOR || act->spr.picnum == MASTERSWITCH)
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
}
|
2021-11-26 17:59:28 +00:00
|
|
|
operatesectors(near.hitSector, p->GetActor());
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
2021-11-20 23:33:17 +00:00
|
|
|
else if ((p->GetActor()->sector()->lotag & 16384) == 0)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-11-20 23:33:17 +00:00
|
|
|
if (isanunderoperator(p->GetActor()->sector()->lotag))
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-11-21 00:04:16 +00:00
|
|
|
DukeSectIterator it(p->GetActor()->sector());
|
2020-11-02 18:41:06 +00:00
|
|
|
while (auto act = it.Next())
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 17:19:45 +00:00
|
|
|
if (act->spr.picnum == ACTIVATOR || act->spr.picnum == MASTERSWITCH) return;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
2021-11-21 00:10:50 +00:00
|
|
|
operatesectors(p->GetActor()->sector(), p->GetActor());
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
2021-11-26 17:59:28 +00:00
|
|
|
else fi.checkhitswitch(snum, near.hitWall, nullptr);
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
}
|
2020-05-10 20:20:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-10 16:05:36 +00:00
|
|
|
|
2020-05-10 10:42:47 +00:00
|
|
|
|
|
|
|
END_DUKE_NS
|