2020-05-10 10:42:47 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
/*
|
|
|
|
Copyright (C) 1996, 2003 - 3D Realms Entertainment
|
|
|
|
Copyright (C) 2017-2019 Nuke.YKT
|
2020-05-13 14:19:39 +00:00
|
|
|
Copyright (C) 2020 - Christoph Oelckers
|
2020-05-10 10:42:47 +00:00
|
|
|
|
|
|
|
This file is part of 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
|
|
|
|
*/
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#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_r.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 10:42:47 +00:00
|
|
|
|
|
|
|
// PRIMITIVE
|
|
|
|
BEGIN_DUKE_NS
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
bool isadoorwall_r(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 RRTILE1856:
|
|
|
|
case RRTILE1877:
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
2020-05-10 10:42:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool isablockdoor(int dapic)
|
|
|
|
{
|
2020-05-12 11:43:24 +00:00
|
|
|
switch (dapic)
|
|
|
|
{
|
|
|
|
case RRTILE1792:
|
|
|
|
case RRTILE1801:
|
|
|
|
case RRTILE1805:
|
|
|
|
case RRTILE1807:
|
|
|
|
case RRTILE1808:
|
|
|
|
case RRTILE1812:
|
|
|
|
case RRTILE1821:
|
|
|
|
case RRTILE1826:
|
|
|
|
case RRTILE1850:
|
|
|
|
case RRTILE1851:
|
|
|
|
case RRTILE1856:
|
|
|
|
case RRTILE1877:
|
|
|
|
case RRTILE1938:
|
|
|
|
case RRTILE1942:
|
|
|
|
case RRTILE1944:
|
|
|
|
case RRTILE1945:
|
|
|
|
case RRTILE1951:
|
|
|
|
case RRTILE1961:
|
|
|
|
case RRTILE1964:
|
|
|
|
case RRTILE1985:
|
|
|
|
case RRTILE1995:
|
|
|
|
case RRTILE2022:
|
|
|
|
case RRTILE2052:
|
|
|
|
case RRTILE2053:
|
|
|
|
case RRTILE2060:
|
|
|
|
case RRTILE2074:
|
|
|
|
case RRTILE2132:
|
|
|
|
case RRTILE2136:
|
|
|
|
case RRTILE2139:
|
|
|
|
case RRTILE2150:
|
|
|
|
case RRTILE2178:
|
|
|
|
case RRTILE2186:
|
|
|
|
case RRTILE2319:
|
|
|
|
case RRTILE2321:
|
|
|
|
case RRTILE2326:
|
|
|
|
case RRTILE2329:
|
|
|
|
case RRTILE2578:
|
|
|
|
case RRTILE2581:
|
|
|
|
case RRTILE2610:
|
|
|
|
case RRTILE2613:
|
|
|
|
case RRTILE2621:
|
|
|
|
case RRTILE2622:
|
|
|
|
case RRTILE2676:
|
|
|
|
case RRTILE2732:
|
|
|
|
case RRTILE2831:
|
|
|
|
case RRTILE2832:
|
|
|
|
case RRTILE2842:
|
|
|
|
case RRTILE2940:
|
|
|
|
case RRTILE2970:
|
|
|
|
case RRTILE3083:
|
|
|
|
case RRTILE3100:
|
|
|
|
case RRTILE3155:
|
|
|
|
case RRTILE3195:
|
|
|
|
case RRTILE3232:
|
|
|
|
case RRTILE3600:
|
|
|
|
case RRTILE3631:
|
|
|
|
case RRTILE3635:
|
|
|
|
case RRTILE3637:
|
|
|
|
case RRTILE3643+2:
|
|
|
|
case RRTILE3643+3:
|
|
|
|
case RRTILE3647:
|
|
|
|
case RRTILE3652:
|
|
|
|
case RRTILE3653:
|
|
|
|
case RRTILE3671:
|
|
|
|
case RRTILE3673:
|
|
|
|
case RRTILE3684:
|
|
|
|
case RRTILE3708:
|
|
|
|
case RRTILE3714:
|
|
|
|
case RRTILE3716:
|
|
|
|
case RRTILE3723:
|
|
|
|
case RRTILE3725:
|
|
|
|
case RRTILE3737:
|
|
|
|
case RRTILE3754:
|
|
|
|
case RRTILE3762:
|
|
|
|
case RRTILE3763:
|
|
|
|
case RRTILE3764:
|
|
|
|
case RRTILE3765:
|
|
|
|
case RRTILE3767:
|
|
|
|
case RRTILE3793:
|
|
|
|
case RRTILE3814:
|
|
|
|
case RRTILE3815:
|
|
|
|
case RRTILE3819:
|
|
|
|
case RRTILE3827:
|
|
|
|
case RRTILE3837:
|
2020-05-10 10:42:47 +00:00
|
|
|
return true;
|
|
|
|
|
2020-05-12 11:43:24 +00:00
|
|
|
case RRTILE1996:
|
|
|
|
case RRTILE2382:
|
|
|
|
case RRTILE2961:
|
|
|
|
case RRTILE3804:
|
|
|
|
case RRTILE7430:
|
|
|
|
case RRTILE7467:
|
|
|
|
case RRTILE7469:
|
|
|
|
case RRTILE7470:
|
|
|
|
case RRTILE7475:
|
|
|
|
case RRTILE7566:
|
|
|
|
case RRTILE7576:
|
|
|
|
case RRTILE7716:
|
|
|
|
case RRTILE8063:
|
|
|
|
case RRTILE8067:
|
|
|
|
case RRTILE8076:
|
|
|
|
case RRTILE8106:
|
|
|
|
case RRTILE8379:
|
|
|
|
case RRTILE8380:
|
|
|
|
case RRTILE8565:
|
|
|
|
case RRTILE8605:
|
|
|
|
return isRRRA();
|
|
|
|
}
|
|
|
|
return false;
|
2020-05-10 10:42:47 +00:00
|
|
|
}
|
|
|
|
|
2020-05-10 14:53:09 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void animatewalls_r(void)
|
|
|
|
{
|
2021-11-17 22:06:28 +00:00
|
|
|
int t;
|
2020-05-12 11:43:24 +00:00
|
|
|
|
|
|
|
if (isRRRA() &&ps[screenpeek].sea_sick_stat == 1)
|
|
|
|
{
|
2021-12-21 08:23:39 +00:00
|
|
|
for (auto& wal : wall)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-11-17 22:06:28 +00:00
|
|
|
if (wal.picnum == RRTILE7873)
|
|
|
|
wal.addxpan(6);
|
|
|
|
else if (wal.picnum == RRTILE7870)
|
|
|
|
wal.addxpan(6);
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-11-17 22:06:28 +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 22:06:28 +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:
|
|
|
|
|
|
|
|
if ((krand() & 255) < 16)
|
|
|
|
{
|
2021-11-17 22:06:28 +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:
|
|
|
|
|
|
|
|
if (animwall[p].tag >= 0)
|
2021-11-17 22:06:28 +00:00
|
|
|
wal->picnum = animwall[p].tag;
|
2020-05-12 11:43:24 +00:00
|
|
|
else
|
|
|
|
{
|
2021-11-17 22:06:28 +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 22:06:28 +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 22:06:28 +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 22:06:28 +00:00
|
|
|
if (wal->extra == 1)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-11-17 22:06:28 +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 22:06:28 +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 22:06:28 +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_r(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:
|
2020-11-02 20:21:52 +00:00
|
|
|
{
|
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-12-21 17:19:45 +00:00
|
|
|
if (star) star->spr.z -= (32 << 8);
|
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
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
2020-11-02 20:21:52 +00:00
|
|
|
}
|
2020-05-12 11:43:24 +00:00
|
|
|
case RRTILE7424:
|
|
|
|
if (isRRRA() && !ud.monsters_off)
|
2021-11-26 20:52:01 +00:00
|
|
|
ChangeActorStat(act, 119);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
2020-05-10 14:53:09 +00:00
|
|
|
}
|
2020-05-10 10:42:47 +00:00
|
|
|
|
2020-05-10 16:05:36 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2020-11-02 18:53:04 +00:00
|
|
|
void operateforcefields_r(DDukeActor* act, int low)
|
2020-05-10 16:05:36 +00:00
|
|
|
{
|
2020-11-02 18:53:04 +00:00
|
|
|
operateforcefields_common(act, low, { BIGFORCE });
|
2020-05-10 16:05:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2021-11-17 23:16:53 +00:00
|
|
|
bool checkhitswitch_r(int snum, walltype* wwal, DDukeActor* act)
|
2020-05-10 16:05:36 +00:00
|
|
|
{
|
2020-08-11 22:31:04 +00:00
|
|
|
uint8_t switchpal;
|
2021-11-17 22:10:25 +00:00
|
|
|
int lotag, hitag, picnum, correctdips, numdips;
|
2020-05-12 11:43:24 +00:00
|
|
|
int sx, sy;
|
|
|
|
|
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;
|
|
|
|
|
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-10-26 05:55:16 +00:00
|
|
|
if (lotag == 0) return 0;
|
2021-12-21 17:19:45 +00:00
|
|
|
hitag = act->spr.hitag;
|
|
|
|
sx = act->spr.x;
|
|
|
|
sy = act->spr.y;
|
|
|
|
picnum = act->spr.picnum;
|
|
|
|
switchpal = act->spr.pal;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-11-17 22:10:25 +00:00
|
|
|
lotag = wwal->lotag;
|
2020-10-26 05:55:16 +00:00
|
|
|
if (lotag == 0) return 0;
|
2021-11-17 22:10:25 +00:00
|
|
|
hitag = wwal->hitag;
|
|
|
|
sx = wwal->x;
|
|
|
|
sy = wwal->y;
|
|
|
|
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;
|
|
|
|
case ACCESSSWITCH:
|
|
|
|
case ACCESSSWITCH2:
|
|
|
|
if (ps[snum].access_incs == 0)
|
|
|
|
{
|
|
|
|
if (switchpal == 0)
|
|
|
|
{
|
|
|
|
if (ps[snum].keys[1])
|
|
|
|
ps[snum].access_incs = 1;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
FTA(70, &ps[snum]);
|
2020-10-26 06:30:34 +00:00
|
|
|
if (isRRRA()) S_PlayActorSound(99, act? act : ps[snum].GetActor());
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (switchpal == 21)
|
|
|
|
{
|
|
|
|
if (ps[snum].keys[2])
|
|
|
|
ps[snum].access_incs = 1;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
FTA(71, &ps[snum]);
|
2020-10-26 06:30:34 +00:00
|
|
|
if (isRRRA()) S_PlayActorSound(99, act ? act : ps[snum].GetActor());
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (switchpal == 23)
|
|
|
|
{
|
|
|
|
if (ps[snum].keys[3])
|
|
|
|
ps[snum].access_incs = 1;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
FTA(72, &ps[snum]);
|
2020-10-26 06:30:34 +00:00
|
|
|
if (isRRRA()) S_PlayActorSound(99, act ? act : ps[snum].GetActor());
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
2020-08-11 22:31:04 +00:00
|
|
|
goto goOn1;
|
|
|
|
|
2020-05-12 11:43:24 +00:00
|
|
|
case MULTISWITCH2:
|
|
|
|
case MULTISWITCH2 + 1:
|
|
|
|
case MULTISWITCH2 + 2:
|
|
|
|
case MULTISWITCH2 + 3:
|
|
|
|
case RRTILE8464:
|
|
|
|
case RRTILE8660:
|
2020-08-11 22:31:04 +00:00
|
|
|
if (!isRRRA()) break;
|
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:
|
|
|
|
case NUKEBUTTON:
|
|
|
|
case NUKEBUTTON + 1:
|
|
|
|
case RRTILE2214:
|
|
|
|
case RRTILE2697:
|
|
|
|
case RRTILE2697 + 1:
|
|
|
|
case RRTILE2707:
|
|
|
|
case RRTILE2707 + 1:
|
2020-08-11 22:31:04 +00:00
|
|
|
goOn1:
|
2020-05-12 11:43:24 +00:00
|
|
|
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 06:02:36 +00:00
|
|
|
DukeStatIterator it(STAT_DEFAULT);
|
|
|
|
while (auto other = it.Next())
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 20:43:41 +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:43:41 +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:43:41 +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:43:41 +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 MULTISWITCH2:
|
|
|
|
case MULTISWITCH2 + 1:
|
|
|
|
case MULTISWITCH2 + 2:
|
|
|
|
case MULTISWITCH2 + 3:
|
|
|
|
if (!isRRRA()) break;
|
2021-12-21 20:43:41 +00:00
|
|
|
other->spr.picnum++;
|
|
|
|
if (other->spr.picnum > (MULTISWITCH2 + 3))
|
|
|
|
other->spr.picnum = MULTISWITCH2;
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case RRTILE2214:
|
2020-07-07 15:56:20 +00:00
|
|
|
//if (ud.level_numbe r > 6) ud.level_numbe r = 0; ??? Looks like some leftover garbage.
|
2021-12-21 20:43:41 +00:00
|
|
|
other->spr.picnum++;
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8660:
|
|
|
|
if (!isRRRA()) break;
|
2021-11-14 11:25:25 +00:00
|
|
|
[[fallthrough]];
|
2020-05-12 11:43:24 +00:00
|
|
|
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:
|
|
|
|
case NUKEBUTTON:
|
|
|
|
case RRTILE2697:
|
|
|
|
case RRTILE2707:
|
2021-12-21 20:43:41 +00:00
|
|
|
if (other->spr.picnum == DIPSWITCH3)
|
|
|
|
if (other->spr.hitag == 999)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2020-10-26 06:10:45 +00:00
|
|
|
DukeStatIterator it1(107);
|
|
|
|
while (auto other2 = it1.Next())
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 17:19:45 +00:00
|
|
|
if (other2->spr.picnum == RRTILE3410)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 17:19:45 +00:00
|
|
|
other2->spr.picnum++;
|
|
|
|
other2->spr.hitag = 100;
|
|
|
|
other2->spr.extra = 0;
|
2020-10-26 06:10:45 +00:00
|
|
|
S_PlayActorSound(474, other2);
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
2021-12-21 17:19:45 +00:00
|
|
|
else if (other2->spr.picnum == RRTILE295)
|
2020-10-26 06:10:45 +00:00
|
|
|
deletesprite(other2);
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
2021-12-21 20:43:41 +00:00
|
|
|
other->spr.picnum++;
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
}
|
2021-12-21 20:43:41 +00:00
|
|
|
if (other->spr.picnum == NUKEBUTTON)
|
2020-05-12 11:43:24 +00:00
|
|
|
chickenplant = 0;
|
2021-12-21 20:43:41 +00:00
|
|
|
if (other->spr.picnum == RRTILE8660)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
|
|
|
BellTime = 132;
|
2020-10-27 05:35:11 +00:00
|
|
|
BellSprite = other;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
2021-12-21 20:43:41 +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:
|
|
|
|
case NUKEBUTTON + 1:
|
|
|
|
case RRTILE2697 + 1:
|
|
|
|
case RRTILE2707 + 1:
|
2021-12-21 20:43:41 +00:00
|
|
|
if (other->spr.picnum == NUKEBUTTON + 1)
|
2020-05-12 11:43:24 +00:00
|
|
|
chickenplant = 1;
|
2021-12-21 20:43:41 +00:00
|
|
|
if (other->spr.hitag != 999)
|
|
|
|
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:10:25 +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:10:25 +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:10:25 +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:10:25 +00:00
|
|
|
wal.picnum++;
|
|
|
|
if (wal.picnum > (MULTISWITCH + 3))
|
|
|
|
wal.picnum = MULTISWITCH;
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case MULTISWITCH2:
|
|
|
|
case MULTISWITCH2 + 1:
|
|
|
|
case MULTISWITCH2 + 2:
|
|
|
|
case MULTISWITCH2 + 3:
|
|
|
|
if (!isRRRA()) break;
|
2021-11-17 22:10:25 +00:00
|
|
|
wal.picnum++;
|
|
|
|
if (wal.picnum > (MULTISWITCH2 + 3))
|
|
|
|
wal.picnum = MULTISWITCH2;
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8660:
|
|
|
|
if (!isRRRA()) break;
|
2021-11-14 11:25:25 +00:00
|
|
|
[[fallthrough]];
|
2020-05-12 11:43:24 +00:00
|
|
|
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:
|
|
|
|
case RRTILE2697:
|
|
|
|
case RRTILE2707:
|
2021-11-17 22:10:25 +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:
|
|
|
|
case RRTILE2697 + 1:
|
|
|
|
case RRTILE2707 + 1:
|
2021-11-17 22:10:25 +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
|
|
|
}
|
|
|
|
|
2021-10-31 06:52:52 +00:00
|
|
|
vec3_t v = { sx, sy, ps[snum].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)
|
2020-10-26 05:55:16 +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)
|
2020-10-26 05:55:16 +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;
|
2020-10-26 05:55:16 +00:00
|
|
|
S_PlaySound3D(END_OF_LEVEL_WARN, ps[snum].GetActor(), &v);
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
2020-08-11 22:31:04 +00:00
|
|
|
goto goOn2;
|
2020-05-12 11:43:24 +00:00
|
|
|
case MULTISWITCH2:
|
|
|
|
case MULTISWITCH2 + 1:
|
|
|
|
case MULTISWITCH2 + 2:
|
|
|
|
case MULTISWITCH2 + 3:
|
|
|
|
case RRTILE8464:
|
|
|
|
case RRTILE8660:
|
|
|
|
if (!isRRRA()) break;
|
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:
|
|
|
|
case RRTILE2697:
|
|
|
|
case RRTILE2697 + 1:
|
|
|
|
case RRTILE2707:
|
|
|
|
case RRTILE2707 + 1:
|
2020-08-11 22:31:04 +00:00
|
|
|
goOn2:
|
2020-05-12 11:43:24 +00:00
|
|
|
if (isRRRA())
|
|
|
|
{
|
2020-10-26 06:30:34 +00:00
|
|
|
if (picnum == RRTILE8660 && act)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
|
|
|
BellTime = 132;
|
2020-10-26 06:30:34 +00:00
|
|
|
BellSprite = act;
|
2021-12-21 17:19:45 +00:00
|
|
|
act->spr.picnum++;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
else if (picnum == RRTILE8464)
|
|
|
|
{
|
2021-12-21 17:19:45 +00:00
|
|
|
act->spr.picnum = act->spr.picnum + 1;
|
2020-05-12 11:43:24 +00:00
|
|
|
if (hitag == 10001)
|
|
|
|
{
|
|
|
|
if (ps[snum].SeaSick == 0)
|
|
|
|
ps[snum].SeaSick = 350;
|
2020-11-02 18:54:20 +00:00
|
|
|
operateactivators(668, snum);
|
2020-05-12 11:43:24 +00:00
|
|
|
operatemasterswitches(668);
|
2020-10-26 05:55:16 +00:00
|
|
|
S_PlayActorSound(328, ps[snum].GetActor());
|
2020-05-12 11:43:24 +00:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (hitag == 10000)
|
|
|
|
{
|
|
|
|
if (picnum == MULTISWITCH || picnum == (MULTISWITCH + 1) ||
|
|
|
|
picnum == (MULTISWITCH + 2) || picnum == (MULTISWITCH + 3) ||
|
|
|
|
picnum == MULTISWITCH2 || picnum == (MULTISWITCH2 + 1) ||
|
|
|
|
picnum == (MULTISWITCH2 + 2) || picnum == (MULTISWITCH2 + 3))
|
|
|
|
{
|
2020-10-26 06:30:34 +00:00
|
|
|
DDukeActor* switches[3];
|
|
|
|
int switchcount = 0, j;
|
2020-10-26 05:55:16 +00:00
|
|
|
S_PlaySound3D(SWITCH_ON, act, &v);
|
2021-12-04 12:02:38 +00:00
|
|
|
DukeSpriteIterator it;
|
2020-10-26 05:59:21 +00:00
|
|
|
while (auto actt = it.Next())
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 17:19:45 +00:00
|
|
|
int jpn = actt->spr.picnum;
|
|
|
|
int jht = actt->spr.hitag;
|
2020-05-12 11:43:24 +00:00
|
|
|
if ((jpn == MULTISWITCH || jpn == MULTISWITCH2) && jht == 10000)
|
|
|
|
{
|
2020-10-24 05:48:51 +00:00
|
|
|
if (switchcount < 3)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2020-10-26 06:30:34 +00:00
|
|
|
switches[switchcount] = actt;
|
2020-10-24 05:48:51 +00:00
|
|
|
switchcount++;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-10-24 05:48:51 +00:00
|
|
|
if (switchcount == 3)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-04 12:02:38 +00:00
|
|
|
// This once was a linear search over sprites[] so bring things back in order, just to be safe.
|
|
|
|
if (switches[0]->GetIndex() > switches[1]->GetIndex()) std::swap(switches[0], switches[1]);
|
|
|
|
if (switches[0]->GetIndex() > switches[2]->GetIndex()) std::swap(switches[0], switches[2]);
|
|
|
|
if (switches[1]->GetIndex() > switches[2]->GetIndex()) std::swap(switches[1], switches[2]);
|
|
|
|
|
2020-10-26 05:55:16 +00:00
|
|
|
S_PlaySound3D(78, act, &v);
|
2020-10-24 05:48:51 +00:00
|
|
|
for (j = 0; j < switchcount; j++)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 17:19:45 +00:00
|
|
|
switches[j]->spr.hitag = 0;
|
2020-05-12 11:43:24 +00:00
|
|
|
if (picnum >= MULTISWITCH2)
|
2021-12-21 17:19:45 +00:00
|
|
|
switches[j]->spr.picnum = MULTISWITCH2 + 3;
|
2020-05-12 11:43:24 +00:00
|
|
|
else
|
2021-12-21 17:19:45 +00:00
|
|
|
switches[j]->spr.picnum = MULTISWITCH + 3;
|
2021-11-17 23:16:53 +00:00
|
|
|
checkhitswitch_r(snum, nullptr, switches[j]);
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (picnum == MULTISWITCH || picnum == (MULTISWITCH + 1) ||
|
|
|
|
picnum == (MULTISWITCH + 2) || picnum == (MULTISWITCH + 3))
|
|
|
|
lotag += picnum - MULTISWITCH;
|
|
|
|
if (isRRRA())
|
|
|
|
{
|
|
|
|
if (picnum == MULTISWITCH2 || picnum == (MULTISWITCH2 + 1) ||
|
|
|
|
picnum == (MULTISWITCH2 + 2) || picnum == (MULTISWITCH2 + 3))
|
|
|
|
lotag += picnum - MULTISWITCH2;
|
|
|
|
}
|
|
|
|
|
2020-10-26 06:02:36 +00:00
|
|
|
DukeStatIterator it(STAT_EFFECTOR);
|
|
|
|
while (auto other = it.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 46:
|
2020-08-11 22:31:04 +00:00
|
|
|
case SE_47_LIGHT_SWITCH:
|
|
|
|
case SE_48_LIGHT_SWITCH:
|
2020-05-12 11:43:24 +00:00
|
|
|
if (!isRRRA()) break;
|
2021-11-14 11:25:25 +00:00
|
|
|
[[fallthrough]];
|
2020-08-11 22:31:04 +00:00
|
|
|
case SE_12_LIGHT_SWITCH:
|
2021-11-20 23:33:17 +00:00
|
|
|
other->sector()->floorpal = 0;
|
2020-10-26 06:02:36 +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;
|
2020-08-11 22:31:04 +00:00
|
|
|
case SE_24_CONVEYOR:
|
|
|
|
case SE_34:
|
|
|
|
case SE_25_PISTON:
|
2020-10-26 06:02:36 +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;
|
2020-08-11 22:31:04 +00:00
|
|
|
case SE_21_DROP_FLOOR:
|
2020-05-12 11:43:24 +00:00
|
|
|
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)
|
2020-10-26 05:55:16 +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)
|
2020-10-26 05:55:16 +00:00
|
|
|
S_PlaySound3D(hitag, act, &v);
|
2020-05-12 11:43:24 +00:00
|
|
|
else
|
2020-10-26 05:55:16 +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 10:42:47 +00:00
|
|
|
|
2020-05-10 18:59:38 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2021-11-18 17:51:19 +00:00
|
|
|
void activatebysector_r(sectortype* sect, DDukeActor* activator)
|
2020-05-10 18:59:38 +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
|
|
|
// return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-11-18 17:51:19 +00:00
|
|
|
if (sect->lotag != 22)
|
2020-11-02 18:28:59 +00:00
|
|
|
operatesectors(sect, activator);
|
2020-05-10 18:59:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-05-16 10:47:01 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2021-11-17 23:40:40 +00:00
|
|
|
static void lotsofpopcorn(DDukeActor *actor, walltype* wal, int n)
|
2020-05-16 10:47:01 +00:00
|
|
|
{
|
2021-11-17 22:24:37 +00:00
|
|
|
int j, z;
|
2021-11-18 17:51:19 +00:00
|
|
|
int a;
|
2020-05-16 10:47:01 +00:00
|
|
|
|
2021-11-18 17:51:19 +00:00
|
|
|
sectortype* sect = nullptr;
|
2020-05-16 10:47:01 +00:00
|
|
|
|
2021-11-17 23:40:40 +00:00
|
|
|
if (wal == nullptr)
|
2020-05-16 10:47:01 +00:00
|
|
|
{
|
|
|
|
for (j = n - 1; j >= 0; j--)
|
|
|
|
{
|
2021-12-21 20:43:41 +00:00
|
|
|
a = actor->spr.ang - 256 + (krand() & 511) + 1024;
|
|
|
|
EGS(actor->spr.sector(), actor->spr.x, actor->spr.y, actor->spr.z, POPCORN, -32, 36, 36, a, 32 + (krand() & 63), 1024 - (krand() & 1023), actor, 5);
|
2020-05-16 10:47:01 +00:00
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
j = n + 1;
|
|
|
|
|
2021-11-17 22:24:37 +00:00
|
|
|
int x1 = wal->x;
|
|
|
|
int y1 = wal->y;
|
2020-05-16 10:47:01 +00:00
|
|
|
|
2021-11-17 22:24:37 +00:00
|
|
|
auto delta = wal->delta();
|
2020-05-16 10:47:01 +00:00
|
|
|
|
2021-12-22 09:26:51 +00:00
|
|
|
x1 -= Sgn(delta.X);
|
2021-12-22 09:28:51 +00:00
|
|
|
y1 += Sgn(delta.Y);
|
2020-05-16 10:47:01 +00:00
|
|
|
|
2021-12-22 09:26:51 +00:00
|
|
|
delta.X /= j;
|
2021-12-22 09:28:51 +00:00
|
|
|
delta.Y /= j;
|
2020-05-16 10:47:01 +00:00
|
|
|
|
|
|
|
for (j = n; j > 0; j--)
|
|
|
|
{
|
2021-12-22 09:26:51 +00:00
|
|
|
x1 += delta.X;
|
2021-12-22 09:28:51 +00:00
|
|
|
y1 += delta.Y;
|
2020-05-16 10:47:01 +00:00
|
|
|
|
|
|
|
updatesector(x1, y1, §);
|
2021-11-18 17:51:19 +00:00
|
|
|
if (sect)
|
2020-05-16 10:47:01 +00:00
|
|
|
{
|
2021-11-18 17:51:19 +00:00
|
|
|
z = sect->floorz - (krand() & (abs(sect->ceilingz - sect->floorz)));
|
2020-05-16 10:47:01 +00:00
|
|
|
if (z < -(32 << 8) || z >(32 << 8))
|
2021-12-21 20:43:41 +00:00
|
|
|
z = actor->spr.z - (32 << 8) + (krand() & ((64 << 8) - 1));
|
|
|
|
a = actor->spr.ang - 1024;
|
|
|
|
EGS(actor->spr.sector(), x1, y1, z, POPCORN, -32, 36, 36, a, 32 + (krand() & 63), -(krand() & 1023), actor, 5);
|
2020-05-16 10:47:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-05-10 18:59:38 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2021-11-17 22:49:49 +00:00
|
|
|
void checkhitwall_r(DDukeActor* spr, walltype* wal, int x, int y, int z, int atwith)
|
2020-05-10 18:59:38 +00:00
|
|
|
{
|
2021-11-15 23:30:01 +00:00
|
|
|
int j;
|
2021-11-06 14:53:16 +00:00
|
|
|
int sn = -1, darkestwall;
|
2020-05-12 11:43:24 +00:00
|
|
|
|
|
|
|
if (wal->overpicnum == MIRROR)
|
|
|
|
{
|
|
|
|
switch (atwith)
|
|
|
|
{
|
|
|
|
case RPG2:
|
|
|
|
if (!isRRRA()) break;
|
2021-11-14 11:25:25 +00:00
|
|
|
[[fallthrough]];
|
2020-05-12 11:43:24 +00:00
|
|
|
case HEAVYHBOMB:
|
|
|
|
case RADIUSEXPLOSION:
|
|
|
|
case RPG:
|
|
|
|
case HYDRENT:
|
|
|
|
case SEENINE:
|
|
|
|
case OOZFILTER:
|
|
|
|
case EXPLODINGBARREL:
|
2021-11-17 23:38:20 +00:00
|
|
|
lotsofglass(spr, wal, 70);
|
2021-12-18 14:11:21 +00:00
|
|
|
wal->cstat &= ~CSTAT_WALL_MASKED;
|
2020-05-12 11:43:24 +00:00
|
|
|
wal->overpicnum = MIRRORBROKE;
|
2021-03-21 09:58:11 +00:00
|
|
|
wal->portalflags = 0;
|
2020-07-25 07:32:54 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, spr);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-12-18 14:11:21 +00:00
|
|
|
if (((wal->cstat & CSTAT_WALL_MASKED) || wal->overpicnum == BIGFORCE) && wal->twoSided())
|
2021-11-07 07:26:06 +00:00
|
|
|
if (wal->nextSector()->floorz > z)
|
|
|
|
if (wal->nextSector()->floorz - wal->nextSector()->ceilingz)
|
2020-05-12 11:43:24 +00:00
|
|
|
switch (wal->overpicnum)
|
|
|
|
{
|
|
|
|
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 RRTILE1973:
|
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:40:40 +00:00
|
|
|
lotsofpopcorn(spr, wal, 64);
|
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
|
|
|
|
2021-11-18 18:04:00 +00:00
|
|
|
auto spawned = EGS(sptr, x, y, z, SECTOREFFECTOR, 0, 0, 0, ps[0].angle.ang.asbuild(), 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_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 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
|
|
|
|
2021-11-18 18:04:00 +00:00
|
|
|
auto spawned = EGS(sptr, x, y, z, SECTOREFFECTOR, 0, 0, 0, ps[0].angle.ang.asbuild(), 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] = 2;
|
|
|
|
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:
|
|
|
|
updatesector(x, y, &sn); if (sn < 0) 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 RRTILE8464:
|
|
|
|
if (isRRRA()) break;
|
|
|
|
break;
|
|
|
|
case RRTILE3643:
|
|
|
|
case RRTILE3643 + 1:
|
|
|
|
case RRTILE3643 + 2:
|
|
|
|
case RRTILE3643 + 3:
|
|
|
|
{
|
2021-11-21 07:42:36 +00:00
|
|
|
auto sect = wal->nextWall()->nextSector();
|
2020-11-02 19:33:44 +00:00
|
|
|
DukeSectIterator it(sect);
|
|
|
|
while (auto act = it.Next())
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 20:43:41 +00:00
|
|
|
if (act->spr.lotag == 6)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2020-11-02 19:33:44 +00:00
|
|
|
act->spriteextra++;
|
|
|
|
if (act->spriteextra == 25)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-11-20 23:41:52 +00:00
|
|
|
for(auto& wl : wallsofsector(act->sector()))
|
2021-11-17 23:42:52 +00:00
|
|
|
{
|
2021-11-21 07:42:36 +00:00
|
|
|
if (wl.twoSided()) wl.nextSector()->lotag = 0;
|
2021-11-17 23:42:52 +00:00
|
|
|
}
|
2021-12-21 20:43:41 +00:00
|
|
|
act->spr.sector()->lotag = 0;
|
2021-12-21 17:19:45 +00:00
|
|
|
S_StopSound(act->spr.lotag);
|
2020-11-02 19:33:44 +00:00
|
|
|
S_PlayActorSound(400, act);
|
|
|
|
deletesprite(act);
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
case RRTILE7555:
|
|
|
|
if (!isRRRA()) break;
|
|
|
|
wal->picnum = SBMOVE;
|
2020-07-25 07:32:54 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, spr);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
case RRTILE7441:
|
|
|
|
if (!isRRRA()) break;
|
|
|
|
wal->picnum = RRTILE5016;
|
2020-07-25 07:32:54 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, spr);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
case RRTILE7559:
|
|
|
|
if (!isRRRA()) break;
|
|
|
|
wal->picnum = RRTILE5017;
|
2020-07-25 07:32:54 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, spr);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
case RRTILE7433:
|
|
|
|
if (!isRRRA()) break;
|
|
|
|
wal->picnum = RRTILE5018;
|
2020-07-25 07:32:54 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, spr);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
case RRTILE7557:
|
|
|
|
if (!isRRRA()) break;
|
|
|
|
wal->picnum = RRTILE5019;
|
2020-07-25 07:32:54 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, spr);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
case RRTILE7553:
|
|
|
|
if (!isRRRA()) break;
|
|
|
|
wal->picnum = RRTILE5020;
|
2020-07-25 07:32:54 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, spr);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
case RRTILE7552:
|
|
|
|
if (!isRRRA()) break;
|
|
|
|
wal->picnum = RRTILE5021;
|
2020-07-25 07:32:54 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, spr);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
case RRTILE7568:
|
|
|
|
if (!isRRRA()) break;
|
|
|
|
wal->picnum = RRTILE5022;
|
2020-07-25 07:32:54 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, spr);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
case RRTILE7540:
|
|
|
|
if (!isRRRA()) break;
|
|
|
|
wal->picnum = RRTILE5023;
|
2020-07-25 07:32:54 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, spr);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
case RRTILE7558:
|
|
|
|
if (!isRRRA()) break;
|
|
|
|
wal->picnum = RRTILE5024;
|
2020-07-25 07:32:54 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, spr);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
case RRTILE7554:
|
|
|
|
if (!isRRRA()) break;
|
|
|
|
wal->picnum = RRTILE5025;
|
2020-07-25 07:32:54 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, spr);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
case RRTILE7579:
|
|
|
|
if (!isRRRA()) break;
|
|
|
|
wal->picnum = RRTILE5026;
|
2020-07-25 07:32:54 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, spr);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
case RRTILE7561:
|
|
|
|
if (!isRRRA()) break;
|
|
|
|
wal->picnum = RRTILE5027;
|
2020-07-25 07:32:54 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, spr);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
case RRTILE7580:
|
|
|
|
if (!isRRRA()) break;
|
|
|
|
wal->picnum = RRTILE5037;
|
2020-07-25 07:32:54 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, spr);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
case RRTILE8227:
|
|
|
|
if (!isRRRA()) break;
|
|
|
|
wal->picnum = RRTILE5070;
|
2020-07-25 07:32:54 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, spr);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
case RRTILE8503:
|
|
|
|
if (!isRRRA()) break;
|
|
|
|
wal->picnum = RRTILE5079;
|
2020-07-25 07:32:54 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, spr);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
case RRTILE8567:
|
|
|
|
case RRTILE8568:
|
|
|
|
case RRTILE8569:
|
|
|
|
case RRTILE8570:
|
|
|
|
case RRTILE8571:
|
|
|
|
if (!isRRRA()) break;
|
|
|
|
wal->picnum = RRTILE5082;
|
2020-07-25 07:32:54 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, spr);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
case RRTILE7859:
|
|
|
|
if (!isRRRA()) break;
|
|
|
|
wal->picnum = RRTILE5081;
|
2020-07-25 07:32:54 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, spr);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
case RRTILE8496:
|
|
|
|
if (!isRRRA()) break;
|
|
|
|
wal->picnum = RRTILE5061;
|
2020-07-25 07:32:54 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, spr);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
case RRTILE8617:
|
|
|
|
if (!isRRRA()) break;
|
|
|
|
if (numplayers < 2)
|
|
|
|
{
|
|
|
|
wal->picnum = RRTILE8618;
|
2020-07-25 07:32:54 +00:00
|
|
|
S_PlayActorSound(47, spr);
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
return;
|
|
|
|
case RRTILE8620:
|
|
|
|
if (!isRRRA()) break;
|
|
|
|
wal->picnum = RRTILE8621;
|
2020-07-25 07:32:54 +00:00
|
|
|
S_PlayActorSound(47, spr);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
case RRTILE8622:
|
|
|
|
if (!isRRRA()) break;
|
|
|
|
wal->picnum = RRTILE8623;
|
2020-07-25 07:32:54 +00:00
|
|
|
S_PlayActorSound(495, spr);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
case RRTILE7657:
|
|
|
|
if (!isRRRA()) break;
|
|
|
|
wal->picnum = RRTILE7659;
|
2020-07-25 07:32:54 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, spr);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
case RRTILE8497:
|
|
|
|
if (!isRRRA()) break;
|
|
|
|
wal->picnum = RRTILE5076;
|
2020-07-25 07:32:54 +00:00
|
|
|
S_PlayActorSound(495, spr);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
case RRTILE7533:
|
|
|
|
if (!isRRRA()) break;
|
|
|
|
wal->picnum = RRTILE5035;
|
2020-07-25 07:32:54 +00:00
|
|
|
S_PlayActorSound(495, spr);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
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(GLASS_BREAKING, spr);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
case OJ:
|
|
|
|
|
|
|
|
case SCREENBREAK6:
|
|
|
|
case SCREENBREAK7:
|
|
|
|
case SCREENBREAK8:
|
|
|
|
|
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() % (isRRRA() ? 2 : 3));
|
2020-07-25 07:32:54 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, spr);
|
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 WALLLIGHT3:
|
|
|
|
case WALLLIGHT4:
|
|
|
|
case TECHLIGHT2:
|
|
|
|
case TECHLIGHT4:
|
|
|
|
case RRTILE1814:
|
|
|
|
case RRTILE1939:
|
|
|
|
case RRTILE1986:
|
|
|
|
case RRTILE1988:
|
|
|
|
case RRTILE2123:
|
|
|
|
case RRTILE2125:
|
|
|
|
case RRTILE2636:
|
|
|
|
case RRTILE2878:
|
|
|
|
case RRTILE2898:
|
|
|
|
case RRTILE3200:
|
|
|
|
case RRTILE3202:
|
|
|
|
case RRTILE3204:
|
|
|
|
case RRTILE3206:
|
|
|
|
case RRTILE3208:
|
|
|
|
|
|
|
|
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 == RRTILE1814)
|
|
|
|
wal->picnum = RRTILE1817;
|
|
|
|
|
|
|
|
if (wal->picnum == RRTILE1986)
|
|
|
|
wal->picnum = RRTILE1987;
|
|
|
|
|
|
|
|
if (wal->picnum == RRTILE1939)
|
|
|
|
wal->picnum = RRTILE2004;
|
|
|
|
|
|
|
|
if (wal->picnum == RRTILE1988)
|
|
|
|
wal->picnum = RRTILE2005;
|
|
|
|
|
|
|
|
if (wal->picnum == RRTILE2898)
|
|
|
|
wal->picnum = RRTILE2899;
|
|
|
|
|
|
|
|
if (wal->picnum == RRTILE2878)
|
|
|
|
wal->picnum = RRTILE2879;
|
|
|
|
|
|
|
|
if (wal->picnum == RRTILE2123)
|
|
|
|
wal->picnum = RRTILE2124;
|
|
|
|
|
|
|
|
if (wal->picnum == RRTILE2125)
|
|
|
|
wal->picnum = RRTILE2126;
|
|
|
|
|
|
|
|
if (wal->picnum == RRTILE3200)
|
|
|
|
wal->picnum = RRTILE3201;
|
|
|
|
|
|
|
|
if (wal->picnum == RRTILE3202)
|
|
|
|
wal->picnum = RRTILE3203;
|
|
|
|
|
|
|
|
if (wal->picnum == RRTILE3204)
|
|
|
|
wal->picnum = RRTILE3205;
|
|
|
|
|
|
|
|
if (wal->picnum == RRTILE3206)
|
|
|
|
wal->picnum = RRTILE3207;
|
|
|
|
|
|
|
|
if (wal->picnum == RRTILE3208)
|
|
|
|
wal->picnum = RRTILE3209;
|
|
|
|
|
|
|
|
if (wal->picnum == RRTILE2636)
|
|
|
|
wal->picnum = RRTILE2637;
|
|
|
|
|
|
|
|
if (wal->picnum == WALLLIGHT1)
|
|
|
|
wal->picnum = WALLLIGHTBUST1;
|
|
|
|
|
|
|
|
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-21 07:42:36 +00:00
|
|
|
for (auto& wl : wallsofsector(wal->nextSector()))
|
2021-11-17 23:50:33 +00:00
|
|
|
if (wl.shade > darkestwall)
|
|
|
|
darkestwall = wl.shade;
|
2020-05-12 11:43:24 +00:00
|
|
|
|
|
|
|
j = krand() & 1;
|
2020-11-02 19:33:44 +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 == wal->lotag && act->spr.lotag == 3)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2020-11-02 19:33:44 +00:00
|
|
|
act->temp_data[2] = j;
|
|
|
|
act->temp_data[3] = darkestwall;
|
|
|
|
act->temp_data[4] = 1;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2020-05-10 18:59:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2020-10-25 07:50:03 +00:00
|
|
|
void checkplayerhurt_r(struct 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 RRTILE2430:
|
|
|
|
case RRTILE2431:
|
|
|
|
case RRTILE2432:
|
|
|
|
case RRTILE2443:
|
|
|
|
case RRTILE2446:
|
|
|
|
case RRTILE2451:
|
|
|
|
case RRTILE2455:
|
|
|
|
if (isRRRA() && p->hurt_delay2 < 8)
|
|
|
|
{
|
2021-12-21 17:19:45 +00:00
|
|
|
p->GetActor()->spr.extra -= 2;
|
2020-05-12 11:43:24 +00:00
|
|
|
p->hurt_delay2 = 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;
|
|
|
|
case CACTUS:
|
|
|
|
if (!isRRRA() && 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-11-02 19:23:30 +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 BIGFORCE:
|
|
|
|
p->hurt_delay = 26;
|
2021-11-17 22:49:49 +00:00
|
|
|
fi.checkhitwall(p->GetActor(), wal,
|
2021-12-22 09:36:09 +00:00
|
|
|
p->pos.X + p->angle.ang.bcos(-9),
|
2021-10-31 06:52:52 +00:00
|
|
|
p->pos.y + p->angle.ang.bsin(-9),
|
|
|
|
p->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_r(sectortype* sectp)
|
2020-05-10 18:59:38 +00:00
|
|
|
{
|
2021-11-07 13:55:28 +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 WALLLIGHT3:
|
|
|
|
case WALLLIGHT4:
|
|
|
|
case TECHLIGHT2:
|
|
|
|
case TECHLIGHT4:
|
|
|
|
case RRTILE1939:
|
|
|
|
case RRTILE1986:
|
|
|
|
case RRTILE1988:
|
|
|
|
case RRTILE2123:
|
|
|
|
case RRTILE2125:
|
|
|
|
case RRTILE2878:
|
|
|
|
case RRTILE2898:
|
|
|
|
|
|
|
|
|
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 == 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->ceilingpicnum == RRTILE1986)
|
|
|
|
sectp->ceilingpicnum = RRTILE1987;
|
2020-05-12 11:43:24 +00:00
|
|
|
|
2021-11-06 22:05:25 +00:00
|
|
|
if (sectp->ceilingpicnum == RRTILE1939)
|
|
|
|
sectp->ceilingpicnum = RRTILE2004;
|
2020-05-12 11:43:24 +00:00
|
|
|
|
2021-11-06 22:05:25 +00:00
|
|
|
if (sectp->ceilingpicnum == RRTILE1988)
|
|
|
|
sectp->ceilingpicnum = RRTILE2005;
|
2020-05-12 11:43:24 +00:00
|
|
|
|
2021-11-06 22:05:25 +00:00
|
|
|
if (sectp->ceilingpicnum == RRTILE2898)
|
|
|
|
sectp->ceilingpicnum = RRTILE2899;
|
2020-05-12 11:43:24 +00:00
|
|
|
|
2021-11-06 22:05:25 +00:00
|
|
|
if (sectp->ceilingpicnum == RRTILE2878)
|
|
|
|
sectp->ceilingpicnum = RRTILE2879;
|
2020-05-12 11:43:24 +00:00
|
|
|
|
2021-11-06 22:05:25 +00:00
|
|
|
if (sectp->ceilingpicnum == RRTILE2123)
|
|
|
|
sectp->ceilingpicnum = RRTILE2124;
|
2020-05-12 11:43:24 +00:00
|
|
|
|
2021-11-06 22:05:25 +00:00
|
|
|
if (sectp->ceilingpicnum == RRTILE2125)
|
|
|
|
sectp->ceilingpicnum = RRTILE2126;
|
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 19:33:44 +00:00
|
|
|
while (auto act1 = it.Next())
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 20:43:41 +00:00
|
|
|
if (act1->spr.picnum == SECTOREFFECTOR && (act1->spr.lotag == 12 || (isRRRA() && (act1->spr.lotag == 47 || act1->spr.lotag == 48))))
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2020-11-02 19:33:44 +00:00
|
|
|
DukeStatIterator it(STAT_EFFECTOR);
|
|
|
|
while (auto act2 = it.Next())
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 20:43:41 +00:00
|
|
|
if (act2->spr.hitag == act1->spr.hitag)
|
2020-11-02 19:33:44 +00:00
|
|
|
act2->temp_data[3] = 1;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
j = krand() & 1;
|
2020-11-02 19:33:44 +00:00
|
|
|
DukeStatIterator it(STAT_EFFECTOR);
|
|
|
|
while (auto act1 = it.Next())
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 20:43:41 +00:00
|
|
|
if (act1->spr.hitag == (sectp->hitag) && act1->spr.lotag == 3)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2020-11-02 19:33:44 +00:00
|
|
|
act1->temp_data[2] = j;
|
|
|
|
act1->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:04:29 +00:00
|
|
|
void checkhitsprite_r(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:43:41 +00:00
|
|
|
if (isRRRA()) switch (targ->spr.picnum)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
|
|
|
case RRTILE8464:
|
|
|
|
break;
|
|
|
|
case RRTILE8487:
|
|
|
|
case RRTILE8489:
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(471, targ);
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum++;
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE7638:
|
|
|
|
case RRTILE7644:
|
|
|
|
case RRTILE7646:
|
|
|
|
case RRTILE7650:
|
|
|
|
case RRTILE7653:
|
|
|
|
case RRTILE7655:
|
|
|
|
case RRTILE7691:
|
|
|
|
case RRTILE7876:
|
|
|
|
case RRTILE7881:
|
|
|
|
case RRTILE7883:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum++;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(VENT_BUST, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE7879:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum++;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(495, targ);
|
2020-10-24 05:04:29 +00:00
|
|
|
fi.hitradius(targ, 10, 0, 0, 1, 1);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE7648:
|
|
|
|
case RRTILE7694:
|
|
|
|
case RRTILE7700:
|
|
|
|
case RRTILE7702:
|
|
|
|
case RRTILE7711:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum++;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(47, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE7636:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum += 3;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(VENT_BUST, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE7875:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum += 3;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(VENT_BUST, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE7640:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum += 2;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(VENT_BUST, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE7595:
|
|
|
|
case RRTILE7704:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE7705;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(495, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8579:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5014;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE7441:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5016;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE7534:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5029;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE7545:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5030;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE7547:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5031;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE7574:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5032;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE7575:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5033;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE7578:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5034;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE7478:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5035;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8525:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5036;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8537:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5062;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8215:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5064;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8216:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5065;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8217:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5066;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8218:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5067;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8220:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5068;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8221:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5069;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8312:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5071;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(472, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8395:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5072;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8423:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5073;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE3462:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5074;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case UWHIP:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5075;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8608:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5083;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8609:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5084;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8567:
|
|
|
|
case RRTILE8568:
|
|
|
|
case RRTILE8569:
|
|
|
|
case RRTILE8570:
|
|
|
|
case RRTILE8571:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5082;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8640:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5085;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8611:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5086;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case TECHLIGHTBUST2:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = TECHLIGHTBUST4;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8497:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5076;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8162:
|
|
|
|
case RRTILE8163:
|
|
|
|
case RRTILE8164:
|
|
|
|
case RRTILE8165:
|
|
|
|
case RRTILE8166:
|
|
|
|
case RRTILE8167:
|
|
|
|
case RRTILE8168:
|
2021-11-26 20:52:01 +00:00
|
|
|
ChangeActorStat(targ, STAT_MISC);
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5063;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8589:
|
|
|
|
case RRTILE8590:
|
|
|
|
case RRTILE8591:
|
|
|
|
case RRTILE8592:
|
|
|
|
case RRTILE8593:
|
|
|
|
case RRTILE8594:
|
|
|
|
case RRTILE8595:
|
2021-11-26 20:52:01 +00:00
|
|
|
ChangeActorStat(targ, STAT_MISC);
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE8588;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE3497:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5076;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE3498:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5077;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE3499:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5078;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8503:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5079;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE7901:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5080;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE7696:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE7697;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(DUKE_SHUCKS, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE7806:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5043;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE7885:
|
|
|
|
case RRTILE7890:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5045;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(495, targ);
|
2020-10-24 05:04:29 +00:00
|
|
|
fi.hitradius(targ, 10, 0, 0, 1, 1);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE7886:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5046;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(495, targ);
|
2020-10-24 05:04:29 +00:00
|
|
|
fi.hitradius(targ, 10, 0, 0, 1, 1);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE7887:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5044;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-10-24 05:04:29 +00:00
|
|
|
fi.hitradius(targ, 10, 0, 0, 1, 1);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE7900:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5047;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE7906:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5048;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE7912:
|
|
|
|
case RRTILE7913:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5049;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8047:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5050;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8596:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE8598;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8059:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5051;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8060:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5052;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8222:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5053;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8223:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5054;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8224:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5055;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8370:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5056;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8371:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5057;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8372:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5058;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8373:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5059;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8396:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5038;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8397:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5039;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8398:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5040;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8399:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5041;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8385:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE8386;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8387:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE8388;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8389:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE8390;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8391:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE8392;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE7553:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5035;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8475:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5075;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8498:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5077;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8499:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5078;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE2445:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE2450;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE2123:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE2124;
|
2020-10-24 04:28:41 +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 RRTILE3773:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE8651;
|
2020-10-24 04:28:41 +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 RRTILE7533:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5035;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(495, targ);
|
2020-10-24 05:04:29 +00:00
|
|
|
fi.hitradius(targ, 10, 0, 0, 1, 1);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8394:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5072;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(495, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8461:
|
|
|
|
case RRTILE8462:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE5074;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8679:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE8680;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(DUKE_SHUCKS, targ);
|
2020-10-24 05:04:29 +00:00
|
|
|
fi.hitradius(targ, 10, 0, 0, 1, 1);
|
2021-12-21 20:43:41 +00:00
|
|
|
if (targ->spr.lotag != 0)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2020-11-02 19:42:20 +00:00
|
|
|
DukeSpriteIterator it;
|
|
|
|
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 == RRTILE8679 && act->spr.pal == 4)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 20:43:41 +00:00
|
|
|
if (act->spr.lotag == targ->spr.lotag)
|
2021-12-21 17:19:45 +00:00
|
|
|
act->spr.picnum = RRTILE8680;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case RRTILE3584:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE8681;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(495, targ);
|
2020-10-24 05:04:29 +00:00
|
|
|
fi.hitradius(targ, 250, 0, 0, 1, 1);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8682:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE8683;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE8099:
|
2021-12-21 20:43:41 +00:00
|
|
|
if (targ->spr.lotag == 5)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.lotag = 0;
|
|
|
|
targ->spr.picnum = RRTILE5087;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(340, targ);
|
2020-11-02 19:42:20 +00:00
|
|
|
DukeSpriteIterator it;
|
|
|
|
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 == RRTILE8094)
|
|
|
|
act->spr.picnum = RRTILE5088;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case RRTILE2431:
|
2021-12-21 20:43:41 +00:00
|
|
|
if (targ->spr.pal != 4)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE2451;
|
|
|
|
if (targ->spr.lotag != 0)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2020-11-02 19:42:20 +00:00
|
|
|
DukeSpriteIterator it;
|
|
|
|
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 == RRTILE2431 && act->spr.pal == 4)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 20:43:41 +00:00
|
|
|
if (targ->spr.lotag == act->spr.lotag)
|
2021-12-21 17:19:45 +00:00
|
|
|
act->spr.picnum = RRTILE2451;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case RRTILE2443:
|
2021-12-21 20:43:41 +00:00
|
|
|
if (targ->spr.pal != 19)
|
|
|
|
targ->spr.picnum = RRTILE2455;
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE2455:
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(SQUISHED, targ);
|
2020-10-24 05:04:29 +00:00
|
|
|
fi.guts(targ, RRTILE2465, 3, myconnectindex);
|
|
|
|
deletesprite(targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE2451:
|
2021-12-21 20:43:41 +00:00
|
|
|
if (targ->spr.pal != 4)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(SQUISHED, targ);
|
2021-12-21 20:43:41 +00:00
|
|
|
if (targ->spr.lotag != 0)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2020-11-02 19:42:20 +00:00
|
|
|
DukeSpriteIterator it;
|
|
|
|
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 == RRTILE2451 && act->spr.pal == 4)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 20:43:41 +00:00
|
|
|
if (targ->spr.lotag == act->spr.lotag)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2020-10-24 05:04:29 +00:00
|
|
|
fi.guts(targ, RRTILE2460, 12, myconnectindex);
|
|
|
|
fi.guts(targ, RRTILE2465, 3, myconnectindex);
|
2021-12-21 17:19:45 +00:00
|
|
|
act->spr.xrepeat = 0;
|
|
|
|
act->spr.yrepeat = 0;
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.xrepeat = 0;
|
|
|
|
targ->spr.yrepeat = 0;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-10-24 05:04:29 +00:00
|
|
|
fi.guts(targ, RRTILE2460, 12, myconnectindex);
|
|
|
|
fi.guts(targ, RRTILE2465, 3, myconnectindex);
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.xrepeat = 0;
|
|
|
|
targ->spr.yrepeat = 0;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case RRTILE2437:
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(439, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2021-12-21 20:43:41 +00:00
|
|
|
switch (targ->spr.picnum)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
|
|
|
case RRTILE3114:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE3117;
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE2876:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE2990;
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE3152:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE3218;
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE3153:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE3219;
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE2030:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE2034;
|
2020-10-24 04:28:41 +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 RRTILE2893:
|
|
|
|
case RRTILE2915:
|
|
|
|
case RRTILE3115:
|
|
|
|
case RRTILE3171:
|
2021-12-21 20:43:41 +00:00
|
|
|
switch (targ->spr.picnum)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
|
|
|
case RRTILE2915:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE2977;
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE2893:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE2978;
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE3115:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE3116;
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE3171:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = RRTILE3216;
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
}
|
2020-10-24 04:28:41 +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 RRTILE2156:
|
|
|
|
case RRTILE2158:
|
|
|
|
case RRTILE2160:
|
|
|
|
case RRTILE2175:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum++;
|
2020-10-24 04:28:41 +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 RRTILE2137:
|
|
|
|
case RRTILE2151:
|
|
|
|
case RRTILE2152:
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_BREAKING, targ);
|
2021-11-17 23:38:20 +00:00
|
|
|
lotsofglass(targ, nullptr, 10);
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum++;
|
2020-05-12 11:43:24 +00:00
|
|
|
for (k = 0; k < 6; k++)
|
2021-12-21 20:43:41 +00:00
|
|
|
EGS(targ->spr.sector(), targ->spr.x, targ->spr.y, targ->spr.z - (8 << 8), SCRAP6 + (krand() & 15), -8, 48, 48, krand() & 2047, (krand() & 63) + 64, -(krand() & 4095) - (targ->spr.zvel >> 2), targ, 5);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case BOWLINGBALL:
|
2021-12-21 20:43:41 +00:00
|
|
|
proj->spr.xvel = (targ->spr.xvel >> 1) + (targ->spr.xvel >> 2);
|
|
|
|
proj->spr.ang -= (krand() & 16);
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(355, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case STRIPEBALL:
|
|
|
|
case QUEBALL:
|
2021-06-09 21:53:05 +00:00
|
|
|
case BOWLINGPIN:
|
|
|
|
case BOWLINGPIN + 1:
|
2020-05-12 11:43:24 +00:00
|
|
|
case HENSTAND:
|
|
|
|
case HENSTAND + 1:
|
2021-12-21 20:43:41 +00:00
|
|
|
if (proj->spr.picnum == QUEBALL || proj->spr.picnum == STRIPEBALL)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 20:43:41 +00:00
|
|
|
proj->spr.xvel = (targ->spr.xvel >> 1) + (targ->spr.xvel >> 2);
|
|
|
|
proj->spr.ang -= (targ->spr.ang << 1) + 1024;
|
|
|
|
targ->spr.ang = getangle(targ->spr.x - proj->spr.x, targ->spr.y - proj->spr.y) - 512;
|
2020-05-12 11:43:24 +00:00
|
|
|
if (S_CheckSoundPlaying(POOLBALLHIT) < 2)
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(POOLBALLHIT, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
2021-12-21 20:43:41 +00:00
|
|
|
else if (proj->spr.picnum == BOWLINGPIN || proj->spr.picnum == BOWLINGPIN + 1)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 20:43:41 +00:00
|
|
|
proj->spr.xvel = (targ->spr.xvel >> 1) + (targ->spr.xvel >> 2);
|
|
|
|
proj->spr.ang -= ((targ->spr.ang << 1) + krand()) & 64;
|
|
|
|
targ->spr.ang = (targ->spr.ang + krand()) & 16;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(355, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
2021-12-21 20:43:41 +00:00
|
|
|
else if (proj->spr.picnum == HENSTAND || proj->spr.picnum == HENSTAND + 1)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 20:43:41 +00:00
|
|
|
proj->spr.xvel = (targ->spr.xvel >> 1) + (targ->spr.xvel >> 2);
|
|
|
|
proj->spr.ang -= ((targ->spr.ang << 1) + krand()) & 16;
|
|
|
|
targ->spr.ang = (targ->spr.ang + krand()) & 16;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(355, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (krand() & 3)
|
|
|
|
{
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.xvel = 164;
|
|
|
|
targ->spr.ang = proj->spr.ang;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case TREE1:
|
|
|
|
case TREE2:
|
|
|
|
case TIRE:
|
|
|
|
case BOX:
|
2021-12-21 20:43:41 +00:00
|
|
|
switch (proj->spr.picnum)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
|
|
|
case RPG2:
|
|
|
|
if (!isRRRA()) break;
|
2021-11-14 11:25:25 +00:00
|
|
|
[[fallthrough]];
|
2020-05-12 11:43:24 +00:00
|
|
|
case RADIUSEXPLOSION:
|
|
|
|
case RPG:
|
|
|
|
case FIRELASER:
|
|
|
|
case HYDRENT:
|
|
|
|
case HEAVYHBOMB:
|
|
|
|
case TRIPBOMBSPRITE:
|
|
|
|
case COOLEXPLOSION1:
|
|
|
|
case OWHIP:
|
|
|
|
case UWHIP:
|
2020-10-24 05:04:29 +00:00
|
|
|
if (targ->temp_data[0] == 0)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
2020-10-24 05:04:29 +00:00
|
|
|
targ->temp_data[0] = 1;
|
|
|
|
spawn(targ, BURNING);
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case CACTUS:
|
|
|
|
// case CACTUSBROKE:
|
2021-12-21 20:43:41 +00:00
|
|
|
switch (proj->spr.picnum)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
|
|
|
case RPG2:
|
|
|
|
if (!isRRRA()) break;
|
2021-11-14 11:25:25 +00:00
|
|
|
[[fallthrough]];
|
2020-05-12 11:43:24 +00:00
|
|
|
case RADIUSEXPLOSION:
|
|
|
|
case RPG:
|
|
|
|
case FIRELASER:
|
|
|
|
case HYDRENT:
|
|
|
|
case HEAVYHBOMB:
|
|
|
|
case TRIPBOMBSPRITE:
|
|
|
|
case COOLEXPLOSION1:
|
|
|
|
case OWHIP:
|
|
|
|
case UWHIP:
|
|
|
|
for (k = 0; k < 64; k++)
|
|
|
|
{
|
2021-12-21 20:43:41 +00:00
|
|
|
auto j = EGS(targ->spr.sector(), targ->spr.x, targ->spr.y, targ->spr.z - (krand() % (48 << 8)), SCRAP6 + (krand() & 3), -8, 48, 48, krand() & 2047, (krand() & 63) + 64, -(krand() & 4095) - (targ->spr.zvel >> 2), targ, 5);
|
2021-12-21 17:19:45 +00:00
|
|
|
j->spr.pal = 8;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
|
2021-12-21 20:43:41 +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
|
|
|
// else deletesprite(i);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case FANSPRITE:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = FANSPRITEBROKE;
|
|
|
|
targ->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
2020-10-24 04:28:41 +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:
|
2020-10-24 05:04:29 +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:43:41 +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++)
|
2021-12-21 20:43:41 +00:00
|
|
|
EGS(targ->spr.sector(), targ->spr.x, targ->spr.y, targ->spr.sector()->floorz - (12 << 8) - (j << 9), SCRAP1 + (krand() & 15), -8, 64, 64,
|
2020-10-24 05:04:29 +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 RRTILE1824:
|
|
|
|
if (!isRRRA()) break;
|
2021-11-14 11:25:25 +00:00
|
|
|
[[fallthrough]];
|
2020-05-12 11:43:24 +00:00
|
|
|
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 DOMELITE:
|
|
|
|
case SUSHIPLATE1:
|
|
|
|
case SUSHIPLATE2:
|
|
|
|
case SUSHIPLATE3:
|
|
|
|
case SUSHIPLATE4:
|
|
|
|
case SUSHIPLATE5:
|
|
|
|
case WAITTOBESEATED:
|
|
|
|
case VASE:
|
|
|
|
case STATUEFLASH:
|
|
|
|
case STATUE:
|
2021-12-21 20:43:41 +00:00
|
|
|
if (targ->spr.picnum == BOTTLE10)
|
2020-10-24 05:04:29 +00:00
|
|
|
fi.lotsofmoney(targ, 4 + (krand() & 3));
|
2021-12-21 20:43:41 +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:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
2021-12-21 20:43:41 +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:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_BREAKING, targ);
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.ang = krand() & 2047;
|
2021-11-17 23:38:20 +00:00
|
|
|
lotsofglass(targ, nullptr, 8);
|
2020-10-24 05:04:29 +00:00
|
|
|
deletesprite(targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case RRTILE2654:
|
|
|
|
case RRTILE2656:
|
|
|
|
case RRTILE3172:
|
|
|
|
if (!isRRRA()) break;
|
2021-11-14 11:25:25 +00:00
|
|
|
[[fallthrough]];
|
2020-05-12 11:43:24 +00:00
|
|
|
case BOTTLE7:
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_BREAKING, targ);
|
2021-11-17 23:38:20 +00:00
|
|
|
lotsofglass(targ, nullptr, 10);
|
2020-10-24 05:04:29 +00:00
|
|
|
deletesprite(targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case FORCESPHERE:
|
2020-11-02 19:33:44 +00:00
|
|
|
{
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.xrepeat = 0;
|
2020-11-02 19:33:44 +00:00
|
|
|
auto Owner = targ->GetOwner();
|
|
|
|
if (Owner)
|
|
|
|
{
|
|
|
|
Owner->temp_data[0] = 32;
|
|
|
|
Owner->temp_data[1] = !Owner->temp_data[1];
|
|
|
|
Owner->temp_data[2] ++;
|
|
|
|
}
|
2020-10-24 05:04:29 +00:00
|
|
|
spawn(targ, EXPLOSION2);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
2020-11-02 19:33:44 +00:00
|
|
|
}
|
2020-05-12 11:43:24 +00:00
|
|
|
case TOILET:
|
2021-12-21 20:43:41 +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 05:04:29 +00:00
|
|
|
spawn(targ, TOILETWATER);
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_BREAKING, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case STALL:
|
2021-12-21 20:43:41 +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 05:04:29 +00:00
|
|
|
spawn(targ, TOILETWATER);
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case HYDRENT:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = BROKEFIREHYDRENT;
|
2020-10-24 05:04:29 +00:00
|
|
|
spawn(targ, TOILETWATER);
|
2020-05-12 11:43:24 +00:00
|
|
|
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case GRATE1:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = BGRATE1;
|
|
|
|
targ->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(VENT_BUST, targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case CIRCLEPANNEL:
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->spr.picnum = CIRCLEPANNELBROKE;
|
|
|
|
targ->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
2020-10-24 04:28:41 +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:43:41 +00:00
|
|
|
switch (targ->spr.picnum)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 20:43:41 +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 05:04:29 +00:00
|
|
|
{
|
|
|
|
auto j = spawn(targ, STEAM);
|
2021-12-21 20:43:41 +00:00
|
|
|
if (j) j->spr.z = targ->spr.sector()->floorz - (32 << 8);
|
2020-10-24 05:04:29 +00:00
|
|
|
}
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case CHAIR1:
|
|
|
|
case CHAIR2:
|
2021-12-21 20:43:41 +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:
|
2020-10-24 04:28:41 +00:00
|
|
|
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
|
|
|
|
for (j = 0; j < 16; j++) RANDOMSCRAP(targ);
|
2020-10-24 05:04:29 +00:00
|
|
|
deletesprite(targ);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case PLAYERONWATER:
|
2020-10-24 04:28:41 +00:00
|
|
|
targ = targ->GetOwner();
|
|
|
|
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:43:41 +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:43:41 +00:00
|
|
|
if ((proj->spr.picnum == SHRINKSPARK || proj->spr.picnum == FREEZEBLAST || proj->GetOwner() != targ) && targ->spr.statnum != 4)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2020-10-24 05:04:29 +00:00
|
|
|
if (badguy(targ) == 1)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 20:43:41 +00:00
|
|
|
if (proj->spr.picnum == RPG) proj->spr.extra <<= 1;
|
|
|
|
else if (isRRRA() && proj->spr.picnum == RPG2) proj->spr.extra <<= 1;
|
2020-05-12 11:43:24 +00:00
|
|
|
|
2021-12-21 20:43:41 +00:00
|
|
|
if ((targ->spr.picnum != DRONE))
|
|
|
|
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 19:00:15 +00:00
|
|
|
auto spawned = spawn(proj, JIBS6);
|
2021-11-19 11:32:12 +00:00
|
|
|
if (spawned)
|
|
|
|
{
|
2021-12-21 20:43:41 +00:00
|
|
|
if (proj->spr.pal == 6)
|
2021-12-21 17:19:45 +00:00
|
|
|
spawned->spr.pal = 6;
|
|
|
|
spawned->spr.z += (4 << 8);
|
|
|
|
spawned->spr.xvel = 16;
|
|
|
|
spawned->spr.xrepeat = spawned->spr.yrepeat = 24;
|
|
|
|
spawned->spr.ang += 32 - (krand() & 63);
|
2021-11-19 11:32:12 +00:00
|
|
|
}
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
|
2020-11-02 19:42:20 +00:00
|
|
|
auto Owner = proj->GetOwner();
|
2020-05-12 11:43:24 +00:00
|
|
|
|
2021-12-21 20:43:41 +00:00
|
|
|
if (Owner && Owner->spr.picnum == APLAYER && targ->spr.picnum != DRONE)
|
2020-11-02 19:42:20 +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:43:41 +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 05:04:29 +00:00
|
|
|
targ->timetosleep = SLEEPTIME;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-12-21 20:43:41 +00:00
|
|
|
if (targ->spr.statnum != 2)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 20:43:41 +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;
|
|
|
|
|
2021-12-21 20:43:41 +00:00
|
|
|
targ->picnum = proj->spr.picnum;
|
|
|
|
targ->extra += proj->spr.extra;
|
|
|
|
if (targ->spr.picnum != COW)
|
|
|
|
targ->ang = proj->spr.ang;
|
2020-11-02 22:53:55 +00:00
|
|
|
targ->SetHitOwner(proj->GetOwner());
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
|
2021-12-21 20:43:41 +00:00
|
|
|
if (targ->spr.statnum == 10)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-12-21 20:43:41 +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;
|
2021-12-22 09:36:09 +00:00
|
|
|
ps[p].pos.X = ps[p].oposx;
|
2021-10-31 06:52:52 +00:00
|
|
|
ps[p].pos.y = ps[p].oposy;
|
|
|
|
ps[p].pos.z = ps[p].oposz;
|
2020-05-12 11:43:24 +00:00
|
|
|
|
2021-12-22 09:36:09 +00:00
|
|
|
updatesector(ps[p].pos.X, ps[p].pos.y, &ps[p].cursector);
|
2020-05-12 11:43:24 +00:00
|
|
|
|
2020-11-02 19:42:20 +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.picnum == CAMERA1) act->spr.yvel = 0;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
}
|
2020-11-02 19:42:20 +00:00
|
|
|
auto Owner = targ->GetHitOwner();
|
2021-12-21 17:19:45 +00:00
|
|
|
if (!Owner || Owner->spr.picnum != APLAYER)
|
2020-05-12 11:43:24 +00:00
|
|
|
if (ud.player_skill >= 3)
|
2021-12-21 20:43:41 +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
|
|
|
}
|
|
|
|
|
2020-05-10 20:20:49 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void checksectors_r(int snum)
|
|
|
|
{
|
2021-11-14 14:03:50 +00:00
|
|
|
int oldz;
|
2020-05-12 11:43:24 +00:00
|
|
|
struct 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-05-12 11:43:24 +00:00
|
|
|
if (!isRRRA() || !RRRA_ExitedLevel)
|
|
|
|
{
|
2020-07-07 15:56:20 +00:00
|
|
|
setnextmap(false);
|
2020-05-12 11:43:24 +00:00
|
|
|
RRRA_ExitedLevel = 1;
|
|
|
|
}
|
|
|
|
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)
|
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-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)
|
|
|
|
{
|
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
|
|
|
|
|
|
|
hitawall(p, &hitscanwall);
|
|
|
|
|
2021-11-17 23:04:36 +00:00
|
|
|
if (hitscanwall != nullptr)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-11-17 22:40:10 +00:00
|
|
|
if (isRRRA())
|
|
|
|
{
|
2021-11-17 23:04:36 +00:00
|
|
|
if (hitscanwall->overpicnum == MIRROR && snum == screenpeek)
|
2021-11-17 22:40:10 +00:00
|
|
|
if (numplayers == 1)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-11-17 22:40:10 +00:00
|
|
|
if (S_CheckActorSoundPlaying(pact, 27) == 0 && S_CheckActorSoundPlaying(pact, 28) == 0 && S_CheckActorSoundPlaying(pact, 29) == 0
|
|
|
|
&& S_CheckActorSoundPlaying(pact, 257) == 0 && S_CheckActorSoundPlaying(pact, 258) == 0)
|
|
|
|
{
|
|
|
|
int snd = krand() % 5;
|
|
|
|
if (snd == 0)
|
|
|
|
S_PlayActorSound(27, pact);
|
|
|
|
else if (snd == 1)
|
|
|
|
S_PlayActorSound(28, pact);
|
|
|
|
else if (snd == 2)
|
|
|
|
S_PlayActorSound(29, pact);
|
|
|
|
else if (snd == 3)
|
|
|
|
S_PlayActorSound(257, pact);
|
|
|
|
else if (snd == 4)
|
|
|
|
S_PlayActorSound(258, pact);
|
|
|
|
}
|
|
|
|
return;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
2021-11-17 22:40:10 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-11-17 23:04:36 +00:00
|
|
|
if (hitscanwall->overpicnum == MIRROR)
|
|
|
|
if (hitscanwall->lotag > 0 && S_CheckActorSoundPlaying(pact, 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-18 14:11:21 +00:00
|
|
|
if ((hitscanwall->cstat & CSTAT_WALL_MASKED))
|
2021-11-17 23:04:36 +00:00
|
|
|
if (hitscanwall->lotag)
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
2021-11-17 22:40:10 +00:00
|
|
|
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
if (isRRRA())
|
|
|
|
{
|
|
|
|
if (p->OnMotorcycle)
|
|
|
|
{
|
|
|
|
if (p->MotoSpeed < 20)
|
|
|
|
{
|
|
|
|
OffMotorcycle(p);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (p->OnBoat)
|
|
|
|
{
|
|
|
|
if (p->MotoSpeed < 20)
|
|
|
|
{
|
|
|
|
OffBoat(p);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
2021-11-26 17:59:28 +00:00
|
|
|
neartag(p->pos, p->GetActor()->sector(), p->angle.oang.asbuild(), near , 1280, 3);
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
|
2020-11-02 23:20:51 +00:00
|
|
|
if (p->newOwner != nullptr)
|
2021-11-26 17:59:28 +00:00
|
|
|
neartag({ p->oposx, p->oposy, p->oposz }, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280L, 1);
|
2020-05-12 11:43:24 +00:00
|
|
|
else
|
|
|
|
{
|
2021-11-26 17:59:28 +00:00
|
|
|
neartag(p->pos, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280, 1);
|
|
|
|
if (near.actor() == nullptr && near.hitWall == nullptr && near.hitSector == nullptr)
|
2021-12-22 09:36:09 +00:00
|
|
|
neartag({ p->pos.X, p->pos.y, p->pos.z + (8 << 8) }, p->GetActor()->sector(), p->angle.oang.asbuild(), near, 1280, 1);
|
2021-11-26 17:59:28 +00:00
|
|
|
if (near.actor() == nullptr && near.hitWall == nullptr && near.hitSector == nullptr)
|
2021-12-22 09:36:09 +00:00
|
|
|
neartag({ p->pos.X, p->pos.y, p->pos.z + (16 << 8) }, p->GetActor()->sector(), p->angle.oang.asbuild(), 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
|
|
|
{
|
2021-12-22 09:36:09 +00:00
|
|
|
neartag({ p->pos.X, p->pos.y, p->pos.z + (16 << 8) }, p->GetActor()->sector(), p->angle.oang.asbuild(), 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 FEM10:
|
|
|
|
case NAKED1:
|
|
|
|
case STATUE:
|
|
|
|
case TOUGHGAL:
|
|
|
|
return;
|
|
|
|
case COW:
|
2021-11-26 17:59:28 +00:00
|
|
|
near.actor()->spriteextra = 1;
|
2020-05-12 11:43:24 +00:00
|
|
|
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-21 17:19:45 +00:00
|
|
|
near.hitSector = p->GetActor()->spr.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-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 RRTILE8448:
|
|
|
|
if (!isRRRA()) return;
|
2020-07-25 07:32:54 +00:00
|
|
|
if (!S_CheckActorSoundPlaying(neartagsprite, 340))
|
|
|
|
S_PlayActorSound(340, neartagsprite);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
case RRTILE8704:
|
|
|
|
if (!isRRRA()) return;
|
|
|
|
if (numplayers == 1)
|
|
|
|
{
|
|
|
|
// This is from RedneckGDX - the version in RR Reconstruction looked like broken nonsense.
|
2020-10-27 05:35:11 +00:00
|
|
|
if (S_CheckActorSoundPlaying(neartagsprite, 445) || sound445done != 0)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2020-10-27 05:35:11 +00:00
|
|
|
if (!S_CheckActorSoundPlaying(neartagsprite, 445) && !S_CheckActorSoundPlaying(neartagsprite, 446) &&
|
|
|
|
!S_CheckActorSoundPlaying(neartagsprite, 447) && sound445done != 0)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
|
|
|
if ((krand() % 2) == 1)
|
2020-07-25 07:32:54 +00:00
|
|
|
S_PlayActorSound(446, neartagsprite);
|
2020-05-12 11:43:24 +00:00
|
|
|
else
|
2020-07-25 07:32:54 +00:00
|
|
|
S_PlayActorSound(447, neartagsprite);
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-07-25 07:32:54 +00:00
|
|
|
S_PlayActorSound(445, neartagsprite);
|
2020-07-18 11:27:24 +00:00
|
|
|
sound445done = 1;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
case EMPTYBIKE:
|
|
|
|
if (!isRRRA()) return;
|
2020-10-27 06:00:39 +00:00
|
|
|
OnMotorcycle(p, neartagsprite);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
case EMPTYBOAT:
|
|
|
|
if (!isRRRA()) return;
|
2020-10-27 05:35:11 +00:00
|
|
|
OnBoat(p, neartagsprite);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
case RRTILE8164:
|
|
|
|
case RRTILE8165:
|
|
|
|
case RRTILE8166:
|
|
|
|
case RRTILE8167:
|
|
|
|
case RRTILE8168:
|
|
|
|
case RRTILE8591:
|
|
|
|
case RRTILE8592:
|
|
|
|
case RRTILE8593:
|
|
|
|
case RRTILE8594:
|
|
|
|
case RRTILE8595:
|
|
|
|
if (!isRRRA()) return;
|
2021-12-21 17:19:45 +00:00
|
|
|
neartagsprite->spr.extra = 60;
|
2020-07-25 07:32:54 +00:00
|
|
|
S_PlayActorSound(235, neartagsprite);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
case TOILET:
|
|
|
|
case STALL:
|
|
|
|
case RRTILE2121:
|
|
|
|
case RRTILE2122:
|
|
|
|
if (p->last_pissed_time == 0)
|
|
|
|
{
|
2020-11-02 19:23:30 +00:00
|
|
|
S_PlayActorSound(435, pact);
|
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-11-02 19:23:30 +00:00
|
|
|
else if (S_CheckActorSoundPlaying(pact, DUKE_GRUNT) == 0)
|
|
|
|
S_PlayActorSound(DUKE_GRUNT, pact);
|
2020-05-12 11:43:24 +00:00
|
|
|
return;
|
|
|
|
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-11-02 19:23:30 +00:00
|
|
|
S_PlayActorSound(DUKE_DRINKING, pact);
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-28 20:51:05 +00:00
|
|
|
if (!PlayerInput(snum, SB_OPEN)) return;
|
2020-05-12 11:43:24 +00:00
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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 19:42:20 +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
|
|
|
if (haskey(near.hitSector, snum))
|
|
|
|
operatesectors(near.hitSector, p->GetActor());
|
2020-05-12 11:43:24 +00:00
|
|
|
else
|
|
|
|
{
|
2020-11-07 09:23:31 +00:00
|
|
|
if (neartagsprite && neartagsprite->spriteextra > 3)
|
2020-11-02 19:23:30 +00:00
|
|
|
S_PlayActorSound(99, pact);
|
2020-05-12 11:43:24 +00:00
|
|
|
else
|
2020-11-02 19:23:30 +00:00
|
|
|
S_PlayActorSound(419, pact);
|
2020-05-12 11:43:24 +00:00
|
|
|
FTA(41, p);
|
|
|
|
}
|
|
|
|
}
|
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 19:42:20 +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-11-02 19:42:20 +00:00
|
|
|
return;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
2021-11-26 17:59:28 +00:00
|
|
|
if (haskey(near.hitSector, snum))
|
2021-12-21 17:19:45 +00:00
|
|
|
operatesectors(p->GetActor()->spr.sector(), p->GetActor());
|
2020-05-12 11:43:24 +00:00
|
|
|
else
|
|
|
|
{
|
2020-11-07 09:23:31 +00:00
|
|
|
if (neartagsprite && neartagsprite->spriteextra > 3)
|
2020-11-02 19:23:30 +00:00
|
|
|
S_PlayActorSound(99, pact);
|
2020-05-12 11:43:24 +00:00
|
|
|
else
|
2020-11-02 19:23:30 +00:00
|
|
|
S_PlayActorSound(419, pact);
|
2020-05-12 11:43:24 +00:00
|
|
|
FTA(41, p);
|
|
|
|
}
|
|
|
|
}
|
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
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2021-11-17 23:42:52 +00:00
|
|
|
void dofurniture(walltype* wlwal, sectortype* sectp, int snum)
|
2020-05-10 20:20:49 +00:00
|
|
|
{
|
2021-11-21 07:42:36 +00:00
|
|
|
assert(wlwal->twoSided());
|
|
|
|
auto nextsect = wlwal->nextSector();
|
2020-05-12 11:43:24 +00:00
|
|
|
int var_C;
|
|
|
|
int x;
|
|
|
|
int y;
|
|
|
|
int min_x;
|
|
|
|
int min_y;
|
|
|
|
int max_x;
|
|
|
|
int max_y;
|
|
|
|
int ins;
|
|
|
|
int var_cx;
|
|
|
|
|
|
|
|
var_C = 1;
|
|
|
|
max_x = max_y = -0x20000;
|
|
|
|
min_x = min_y = 0x20000;
|
2021-11-17 23:42:52 +00:00
|
|
|
var_cx = sectp->hitag;
|
2020-05-12 11:43:24 +00:00
|
|
|
if (var_cx > 16)
|
|
|
|
var_cx = 16;
|
|
|
|
else if (var_cx == 0)
|
|
|
|
var_cx = 4;
|
2021-11-17 22:24:37 +00:00
|
|
|
for(auto& wal : wallsofsector(nextsect))
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-11-17 22:24:37 +00:00
|
|
|
x = wal.x;
|
|
|
|
y = wal.y;
|
2020-05-12 11:43:24 +00:00
|
|
|
if (x > max_x)
|
|
|
|
max_x = x;
|
|
|
|
if (y > max_y)
|
|
|
|
max_y = y;
|
|
|
|
if (x < min_x)
|
|
|
|
min_x = x;
|
|
|
|
if (y < min_y)
|
|
|
|
min_y = y;
|
|
|
|
}
|
|
|
|
max_x += var_cx + 1;
|
|
|
|
max_y += var_cx + 1;
|
|
|
|
min_x -= var_cx + 1;
|
|
|
|
min_y -= var_cx + 1;
|
2021-11-18 18:57:14 +00:00
|
|
|
ins = inside(max_x, max_y, sectp);
|
2020-05-12 11:43:24 +00:00
|
|
|
if (!ins)
|
|
|
|
var_C = 0;
|
2021-11-18 18:57:14 +00:00
|
|
|
ins = inside(max_x, min_y, sectp);
|
2020-05-12 11:43:24 +00:00
|
|
|
if (!ins)
|
|
|
|
var_C = 0;
|
2021-11-18 18:57:14 +00:00
|
|
|
ins = inside(min_x, min_y, sectp);
|
2020-05-12 11:43:24 +00:00
|
|
|
if (!ins)
|
|
|
|
var_C = 0;
|
2021-11-18 18:57:14 +00:00
|
|
|
ins = inside(min_x, max_y, sectp);
|
2020-05-12 11:43:24 +00:00
|
|
|
if (!ins)
|
|
|
|
var_C = 0;
|
|
|
|
if (var_C)
|
|
|
|
{
|
2020-11-02 19:23:30 +00:00
|
|
|
if (S_CheckActorSoundPlaying(ps[snum].GetActor(), 389) == 0)
|
|
|
|
S_PlayActorSound(389, ps[snum].GetActor());
|
2021-11-17 22:24:37 +00:00
|
|
|
for(auto& wal : wallsofsector(nextsect))
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-11-17 22:24:37 +00:00
|
|
|
x = wal.x;
|
|
|
|
y = wal.y;
|
2021-11-17 22:40:10 +00:00
|
|
|
switch (wlwal->lotag)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
|
|
|
case 42:
|
2021-11-17 22:24:37 +00:00
|
|
|
y = wal.y + var_cx;
|
|
|
|
dragpoint(&wal, x, y);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case 41:
|
2021-11-17 22:24:37 +00:00
|
|
|
x = wal.x - var_cx;
|
|
|
|
dragpoint(&wal, x, y);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case 40:
|
2021-11-17 22:24:37 +00:00
|
|
|
y = wal.y - var_cx;
|
|
|
|
dragpoint(&wal, x, y);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case 43:
|
2021-11-17 22:24:37 +00:00
|
|
|
x = wal.x + var_cx;
|
|
|
|
dragpoint(&wal, x, y);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-11-17 22:24:37 +00:00
|
|
|
for(auto& wal : wallsofsector(nextsect))
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-11-17 22:24:37 +00:00
|
|
|
x = wal.x;
|
|
|
|
y = wal.y;
|
2021-11-17 22:40:10 +00:00
|
|
|
switch (wlwal->lotag)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
|
|
|
case 42:
|
2021-11-17 22:24:37 +00:00
|
|
|
y = wal.y - (var_cx - 2);
|
|
|
|
dragpoint(&wal, x, y);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case 41:
|
2021-11-17 22:24:37 +00:00
|
|
|
x = wal.x + (var_cx - 2);
|
|
|
|
dragpoint(&wal, x, y);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case 40:
|
2021-11-17 22:24:37 +00:00
|
|
|
y = wal.y + (var_cx - 2);
|
|
|
|
dragpoint(&wal, x, y);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case 43:
|
2021-11-17 22:24:37 +00:00
|
|
|
x = wal.x - (var_cx - 2);
|
|
|
|
dragpoint(&wal, x, y);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-05-10 20:20:49 +00:00
|
|
|
}
|
|
|
|
|
2020-05-14 07:07:07 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2021-11-21 08:08:05 +00:00
|
|
|
void tearitup(sectortype* sect)
|
2020-05-14 07:07:07 +00:00
|
|
|
{
|
2020-11-02 19:33:44 +00:00
|
|
|
DukeSectIterator it(sect);
|
|
|
|
while (auto act = it.Next())
|
2020-05-14 07:07:07 +00:00
|
|
|
{
|
2021-12-21 17:19:45 +00:00
|
|
|
if (act->spr.picnum == DESTRUCTO)
|
2020-05-14 07:07:07 +00:00
|
|
|
{
|
2020-11-02 19:33:44 +00:00
|
|
|
act->picnum = SHOTSPARK1;
|
|
|
|
act->extra = 1;
|
2020-05-14 07:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-05-10 10:42:47 +00:00
|
|
|
END_DUKE_NS
|