2020-05-07 12:55:04 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
/*
|
|
|
|
Copyright (C) 1996, 2003 - 3D Realms Entertainment
|
2020-05-07 20:30:19 +00:00
|
|
|
Copyright (C) 2017-2019 Nuke.YKT
|
2020-05-13 14:19:39 +00:00
|
|
|
Copyright (C) 2020 - Christoph Oelckers
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2020-05-07 20:30:19 +00:00
|
|
|
This file is part of Duke Nukem 3D version 1.5 - Atomic Edition
|
2020-05-07 12:55:04 +00:00
|
|
|
|
|
|
|
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-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-05-07 12:55:04 +00:00
|
|
|
|
|
|
|
BEGIN_DUKE_NS
|
|
|
|
|
2020-05-08 22:34:48 +00:00
|
|
|
void dojaildoor();
|
|
|
|
void moveminecart();
|
|
|
|
|
2020-10-22 20:31:10 +00:00
|
|
|
void ballreturn(DDukeActor* spr);
|
2021-11-18 19:17:47 +00:00
|
|
|
void pinsectorresetdown(sectortype* sect);
|
|
|
|
int pinsectorresetup(sectortype* sect);
|
|
|
|
int checkpins(sectortype* sect);
|
|
|
|
void resetpins(sectortype* sect);
|
2020-05-08 22:34:48 +00:00
|
|
|
void resetlanepics(void);
|
|
|
|
|
|
|
|
|
2020-05-07 12:55:04 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2021-11-06 21:57:26 +00:00
|
|
|
bool ceilingspace_r(sectortype* sectp)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2021-12-18 12:14:56 +00:00
|
|
|
if (sectp && (sectp->ceilingstat & CSTAT_SECTOR_SKY) && sectp->ceilingpal == 0)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2021-11-06 21:57:26 +00:00
|
|
|
switch(sectp->ceilingpicnum)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2020-05-07 20:30:19 +00:00
|
|
|
case MOONSKY1:
|
|
|
|
case BIGORBIT1:
|
|
|
|
return 1;
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2021-11-06 21:57:26 +00:00
|
|
|
|
2020-05-07 12:55:04 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2021-11-06 21:57:26 +00:00
|
|
|
bool floorspace_r(sectortype* sectp)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2021-12-18 12:14:56 +00:00
|
|
|
if (sectp && (sectp->floorstat & CSTAT_SECTOR_SKY) && sectp->ceilingpal == 0)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2021-11-06 21:57:26 +00:00
|
|
|
switch(sectp->floorpicnum)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2020-05-07 20:30:19 +00:00
|
|
|
case MOONSKY1:
|
|
|
|
case BIGORBIT1:
|
|
|
|
return 1;
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2020-10-22 17:08:10 +00:00
|
|
|
void check_fta_sounds_r(DDukeActor* actor)
|
2020-05-16 10:47:01 +00:00
|
|
|
{
|
2021-12-21 17:19:45 +00:00
|
|
|
if (actor->spr.extra > 0) switch (actor->spr.picnum)
|
2020-05-16 10:47:01 +00:00
|
|
|
{
|
|
|
|
case COOT: // LIZTROOP
|
|
|
|
if (!isRRRA() && (krand() & 3) == 2)
|
2020-10-22 17:08:10 +00:00
|
|
|
S_PlayActorSound(PRED_RECOG, actor);
|
2020-05-16 10:47:01 +00:00
|
|
|
break;
|
|
|
|
case BILLYCOCK:
|
|
|
|
case BILLYRAY:
|
|
|
|
case BRAYSNIPER: // PIGCOP
|
2020-10-22 17:08:10 +00:00
|
|
|
S_PlayActorSound(PIG_RECOG, actor);
|
2020-05-16 10:47:01 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2022-11-12 08:33:33 +00:00
|
|
|
void addweapon_r(player_struct* p, int weapon, bool wswitch)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2021-11-07 13:07:08 +00:00
|
|
|
int cw = p->curr_weapon;
|
2020-05-07 12:55:04 +00:00
|
|
|
if (p->OnMotorcycle || p->OnBoat)
|
|
|
|
{
|
2021-05-15 08:23:50 +00:00
|
|
|
p->gotweapon[weapon] = true;;
|
2020-05-09 09:44:50 +00:00
|
|
|
if (weapon == THROWSAW_WEAPON)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2021-05-15 08:23:50 +00:00
|
|
|
p->gotweapon[BUZZSAW_WEAPON] = true;
|
2020-05-09 09:44:50 +00:00
|
|
|
p->ammo_amount[BUZZSAW_WEAPON] = 1;
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
2020-05-09 09:44:50 +00:00
|
|
|
else if (weapon == CROSSBOW_WEAPON)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2021-05-15 08:23:50 +00:00
|
|
|
p->gotweapon[CHICKEN_WEAPON] = true;
|
|
|
|
p->gotweapon[DYNAMITE_WEAPON] = true;
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
2020-05-09 09:44:50 +00:00
|
|
|
else if (weapon == SLINGBLADE_WEAPON)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2020-05-09 09:44:50 +00:00
|
|
|
p->ammo_amount[SLINGBLADE_WEAPON] = 1;
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (p->gotweapon[weapon] == 0)
|
|
|
|
{
|
2021-05-15 08:23:50 +00:00
|
|
|
p->gotweapon[weapon] = true;;
|
2020-05-09 09:44:50 +00:00
|
|
|
if (weapon == THROWSAW_WEAPON)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2021-05-15 08:23:50 +00:00
|
|
|
p->gotweapon[BUZZSAW_WEAPON] = true;
|
2020-11-22 16:50:38 +00:00
|
|
|
p->ammo_amount[BUZZSAW_WEAPON] = 1;
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
|
|
|
if (isRRRA())
|
|
|
|
{
|
2020-05-09 09:44:50 +00:00
|
|
|
if (weapon == CROSSBOW_WEAPON)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2021-05-15 08:23:50 +00:00
|
|
|
p->gotweapon[CHICKEN_WEAPON] = true;
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
2020-05-09 09:44:50 +00:00
|
|
|
if (weapon == SLINGBLADE_WEAPON)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2020-05-09 09:44:50 +00:00
|
|
|
p->ammo_amount[SLINGBLADE_WEAPON] = 50;
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
|
|
|
}
|
2020-10-24 18:43:36 +00:00
|
|
|
if (weapon == CROSSBOW_WEAPON)
|
|
|
|
{
|
2021-05-15 08:23:50 +00:00
|
|
|
p->gotweapon[DYNAMITE_WEAPON] = true;
|
2020-10-24 18:43:36 +00:00
|
|
|
}
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2020-05-09 09:44:50 +00:00
|
|
|
if (weapon != DYNAMITE_WEAPON)
|
2020-05-07 12:55:04 +00:00
|
|
|
cw = weapon;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
cw = weapon;
|
|
|
|
|
2022-11-12 08:33:33 +00:00
|
|
|
if (!wswitch) return;
|
|
|
|
|
2020-05-09 09:44:50 +00:00
|
|
|
if (weapon == DYNAMITE_WEAPON)
|
2020-05-07 12:55:04 +00:00
|
|
|
p->last_weapon = -1;
|
|
|
|
|
|
|
|
p->random_club_frame = 0;
|
|
|
|
|
|
|
|
if (p->holster_weapon == 0)
|
|
|
|
{
|
|
|
|
p->weapon_pos = -1;
|
|
|
|
p->last_weapon = p->curr_weapon;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
p->weapon_pos = 10;
|
|
|
|
p->holster_weapon = 0;
|
|
|
|
p->last_weapon = -1;
|
|
|
|
}
|
|
|
|
|
2020-09-16 11:01:09 +00:00
|
|
|
p->okickback_pic = p->kickback_pic = 0;
|
2020-05-07 12:55:04 +00:00
|
|
|
p->curr_weapon = cw;
|
2021-07-17 02:12:12 +00:00
|
|
|
p->wantweaponfire = -1;
|
2020-05-07 12:55:04 +00:00
|
|
|
|
|
|
|
switch (weapon)
|
|
|
|
{
|
2020-05-09 09:44:50 +00:00
|
|
|
case SLINGBLADE_WEAPON:
|
2020-05-07 20:30:19 +00:00
|
|
|
if (!isRRRA()) break;
|
2020-05-07 12:55:04 +00:00
|
|
|
case KNEE_WEAPON:
|
2020-07-20 21:21:27 +00:00
|
|
|
case DYNAMITE_WEAPON:
|
2020-05-07 12:55:04 +00:00
|
|
|
case TRIPBOMB_WEAPON:
|
2020-05-20 08:38:56 +00:00
|
|
|
case THROWINGDYNAMITE_WEAPON:
|
2020-05-07 12:55:04 +00:00
|
|
|
break;
|
2020-05-12 11:43:24 +00:00
|
|
|
case SHOTGUN_WEAPON:
|
2020-11-02 19:23:05 +00:00
|
|
|
S_PlayActorSound(SHOTGUN_COCK, p->GetActor());
|
2020-05-07 12:55:04 +00:00
|
|
|
break;
|
2020-05-12 11:43:24 +00:00
|
|
|
case PISTOL_WEAPON:
|
2020-11-02 19:23:05 +00:00
|
|
|
S_PlayActorSound(INSERT_CLIP, p->GetActor());
|
2020-05-07 12:55:04 +00:00
|
|
|
break;
|
2020-05-12 11:43:24 +00:00
|
|
|
default:
|
2020-11-02 19:23:05 +00:00
|
|
|
S_PlayActorSound(EJECT_CLIP, p->GetActor());
|
2020-05-07 12:55:04 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2020-10-21 20:04:39 +00:00
|
|
|
void hitradius_r(DDukeActor* actor, int r, int hp1, int hp2, int hp3, int hp4)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2022-09-13 18:01:17 +00:00
|
|
|
double radius = r * inttoworld;
|
2020-05-07 12:55:04 +00:00
|
|
|
static const uint8_t statlist[] = { STAT_DEFAULT, STAT_ACTOR, STAT_STANDABLE, STAT_PLAYER, STAT_FALLER, STAT_ZOMBIEACTOR, STAT_MISC };
|
|
|
|
|
2022-10-07 21:33:37 +00:00
|
|
|
if (actor->spr.scale.X >= 0.17675 || !(actor->spr.picnum == RPG || ((isRRRA()) && actor->spr.picnum == RPG2)))
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2021-12-30 15:51:56 +00:00
|
|
|
BFSSectorSearch search(actor->sector());
|
2021-12-30 09:30:21 +00:00
|
|
|
|
2021-11-21 07:42:36 +00:00
|
|
|
while (auto dasectp = search.GetNext())
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2022-09-12 22:55:15 +00:00
|
|
|
if ((dasectp->ceilingz- actor->spr.pos.Z) < radius * 16) // what value range is this supposed to be? The check that was here did not multiply correctly
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2022-11-15 14:44:33 +00:00
|
|
|
auto wal = dasectp->walls.Data();
|
2022-09-12 22:55:15 +00:00
|
|
|
double d = (wal->pos - actor->spr.pos.XY()).Sum();
|
|
|
|
if (d < radius)
|
2021-11-18 16:55:08 +00:00
|
|
|
fi.checkhitceiling(dasectp);
|
2021-11-15 23:23:18 +00:00
|
|
|
else
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2021-11-16 16:43:19 +00:00
|
|
|
auto thirdpoint = wal->point2Wall()->point2Wall();
|
2022-09-12 22:55:15 +00:00
|
|
|
d = (thirdpoint->pos - actor->spr.pos.XY()).Sum();
|
|
|
|
if (d < radius)
|
2021-11-18 16:55:08 +00:00
|
|
|
fi.checkhitceiling(dasectp);
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
2020-05-07 20:30:19 +00:00
|
|
|
}
|
2021-12-30 09:30:21 +00:00
|
|
|
|
2022-11-15 14:24:17 +00:00
|
|
|
for (auto& wal : dasectp->walls)
|
2021-11-16 16:45:41 +00:00
|
|
|
{
|
2022-09-12 22:55:15 +00:00
|
|
|
if ((wal.pos - actor->spr.pos.XY()).Sum() < radius)
|
2021-11-15 23:23:18 +00:00
|
|
|
{
|
2021-11-21 07:42:36 +00:00
|
|
|
if (wal.twoSided())
|
2021-11-15 23:23:18 +00:00
|
|
|
{
|
2021-11-21 07:42:36 +00:00
|
|
|
search.Add(wal.nextSector());
|
2021-11-15 23:23:18 +00:00
|
|
|
}
|
2022-08-22 16:39:33 +00:00
|
|
|
DVector3 w1(((wal.pos + wal.point2Wall()->pos) * 0.5 + actor->spr.pos) * 0.5, actor->spr.pos.Z); // half way between the actor and the wall's center.
|
|
|
|
sectortype* sect = wal.sectorp();
|
|
|
|
updatesector(w1, §);
|
|
|
|
|
|
|
|
if (sect && cansee(w1, sect, actor->spr.pos, actor->sector()))
|
2022-08-23 20:39:07 +00:00
|
|
|
fi.checkhitwall(actor, &wal, DVector3(wal.pos, actor->spr.pos.Z), actor->spr.picnum);
|
2021-11-15 23:23:18 +00:00
|
|
|
}
|
2021-11-16 16:45:41 +00:00
|
|
|
}
|
2021-11-15 23:23:18 +00:00
|
|
|
}
|
|
|
|
}
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2022-08-22 16:39:33 +00:00
|
|
|
double q = zrand(32) - 24;
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2020-10-21 20:04:39 +00:00
|
|
|
auto Owner = actor->GetOwner();
|
2021-11-16 16:45:41 +00:00
|
|
|
for (int x = 0; x < 7; x++)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2020-10-21 20:04:39 +00:00
|
|
|
DukeStatIterator it1(statlist[x]);
|
|
|
|
while (auto act2 = it1.Next())
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2022-01-26 23:41:33 +00:00
|
|
|
if (x == 0 || x >= 5 || actorflag(act2, SFLAG_HITRADIUS_FLAG1))
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2021-12-21 18:56:46 +00:00
|
|
|
if (act2->spr.cstat & CSTAT_SPRITE_BLOCK_ALL)
|
2022-09-13 18:01:17 +00:00
|
|
|
if ((actor->spr.pos - act2->spr.pos).Length() < radius)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2022-08-22 16:39:33 +00:00
|
|
|
if (badguy(act2) && !cansee(act2->spr.pos.plusZ(q), act2->sector(), actor->spr.pos.plusZ(q), actor->sector()))
|
2020-05-08 22:34:48 +00:00
|
|
|
continue;
|
2022-08-22 16:39:33 +00:00
|
|
|
|
2020-10-24 05:15:10 +00:00
|
|
|
fi.checkhitsprite(act2, actor);
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
|
|
|
}
|
2022-01-18 22:09:42 +00:00
|
|
|
else if (act2->spr.extra >= 0 && act2 != actor && (actorflag(act2, SFLAG_HITRADIUS_FLAG2) || badguy(act2) || (act2->spr.cstat & CSTAT_SPRITE_BLOCK_ALL)))
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2021-12-21 18:13:49 +00:00
|
|
|
if (actor->spr.picnum == MORTER && act2 == Owner)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2020-05-07 20:30:19 +00:00
|
|
|
continue;
|
|
|
|
}
|
2021-12-21 18:13:49 +00:00
|
|
|
if ((isRRRA()) && actor->spr.picnum == CHEERBOMB && act2 == Owner)
|
2020-05-07 20:30:19 +00:00
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2022-02-04 17:06:08 +00:00
|
|
|
if (act2->spr.picnum == APLAYER) act2->spr.pos.Z -= gs.playerheight;
|
2022-09-13 18:01:17 +00:00
|
|
|
double dist = (actor->spr.pos - act2->spr.pos).Length();
|
2022-02-04 17:06:08 +00:00
|
|
|
if (act2->spr.picnum == APLAYER) act2->spr.pos.Z += gs.playerheight;
|
2020-05-07 20:30:19 +00:00
|
|
|
|
2022-09-13 18:01:17 +00:00
|
|
|
if (dist < radius && cansee(act2->spr.pos.plusZ(-8), act2->sector(), actor->spr.pos.plusZ(-12), actor->sector()))
|
2020-05-07 20:30:19 +00:00
|
|
|
{
|
2021-12-21 18:56:46 +00:00
|
|
|
if ((isRRRA()) && act2->spr.picnum == MINION && act2->spr.pal == 19)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2022-09-30 11:51:37 +00:00
|
|
|
act2->hitang = (act2->spr.pos - actor->spr.pos).Angle();
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2021-12-21 18:56:46 +00:00
|
|
|
if (actor->spr.picnum == RPG && act2->spr.extra > 0)
|
2021-12-27 22:52:16 +00:00
|
|
|
act2->attackertype = RPG;
|
2021-12-21 18:56:46 +00:00
|
|
|
else if ((isRRRA()) && actor->spr.picnum == RPG2 && act2->spr.extra > 0)
|
2021-12-27 22:52:16 +00:00
|
|
|
act2->attackertype = RPG;
|
2020-05-07 20:30:19 +00:00
|
|
|
else
|
2021-12-27 22:52:16 +00:00
|
|
|
act2->attackertype = RADIUSEXPLOSION;
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2022-09-13 18:01:17 +00:00
|
|
|
if (dist < radius / 3)
|
2020-05-07 20:30:19 +00:00
|
|
|
{
|
|
|
|
if (hp4 == hp3) hp4++;
|
2022-01-23 23:10:25 +00:00
|
|
|
act2->hitextra = hp3 + (krand() % (hp4 - hp3));
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
2022-09-13 18:01:17 +00:00
|
|
|
else if (dist < 2 * radius / 3)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2020-05-07 20:30:19 +00:00
|
|
|
if (hp3 == hp2) hp3++;
|
2022-01-23 23:10:25 +00:00
|
|
|
act2->hitextra = hp2 + (krand() % (hp3 - hp2));
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
2022-09-13 18:01:17 +00:00
|
|
|
else if (dist < radius)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2020-05-07 20:30:19 +00:00
|
|
|
if (hp2 == hp1) hp2++;
|
2022-01-23 23:10:25 +00:00
|
|
|
act2->hitextra = hp1 + (krand() % (hp2 - hp1));
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
|
|
|
|
2021-12-21 18:56:46 +00:00
|
|
|
int pic = act2->spr.picnum;
|
2020-05-07 20:30:19 +00:00
|
|
|
if ((isRRRA())?
|
|
|
|
(pic != HULK && pic != MAMA && pic != BILLYPLAY && pic != COOTPLAY && pic != MAMACLOUD) :
|
|
|
|
(pic != HULK && pic != SBMOVE))
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2022-09-11 20:57:56 +00:00
|
|
|
if (act2->vel.X < 0) act2->vel.X = 0;
|
|
|
|
act2->vel.X += ((actor->spr.extra / 4.));
|
2020-05-07 20:30:19 +00:00
|
|
|
}
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2022-01-17 23:54:10 +00:00
|
|
|
if (actorflag(act2, SFLAG_HITRADIUSCHECK))
|
2020-10-24 05:15:10 +00:00
|
|
|
fi.checkhitsprite(act2, actor);
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2021-12-21 18:56:46 +00:00
|
|
|
if (act2->spr.picnum != RADIUSEXPLOSION &&
|
2021-12-21 17:19:45 +00:00
|
|
|
Owner && Owner->spr.statnum < MAXSTATUS)
|
2020-05-07 20:30:19 +00:00
|
|
|
{
|
2021-12-21 18:56:46 +00:00
|
|
|
if (act2->spr.picnum == APLAYER)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2021-11-16 16:45:41 +00:00
|
|
|
int p = act2->PlayerIndex();
|
2020-11-02 23:20:51 +00:00
|
|
|
if (ps[p].newOwner != nullptr)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2020-05-07 20:30:19 +00:00
|
|
|
clearcamera(&ps[p]);
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
|
|
|
}
|
2020-10-21 20:04:39 +00:00
|
|
|
act2->SetHitOwner(actor->GetOwner());
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2022-09-13 18:09:29 +00:00
|
|
|
int movesprite_ex_r(DDukeActor* actor, const DVector3& change, unsigned int cliptype, Collision &result)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2020-10-24 07:31:15 +00:00
|
|
|
int bg = badguy(actor);
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2022-10-07 21:33:37 +00:00
|
|
|
if (actor->spr.statnum == 5 || (bg && actor->spr.scale.X < 0.0625))
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2022-09-13 18:09:29 +00:00
|
|
|
actor->spr.pos += change;
|
2020-05-07 12:55:04 +00:00
|
|
|
if (bg)
|
2022-02-06 21:45:47 +00:00
|
|
|
SetActor(actor, actor->spr.pos);
|
2020-10-24 07:31:15 +00:00
|
|
|
return result.setNone();
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
|
|
|
|
2021-12-30 15:51:56 +00:00
|
|
|
auto dasectp = actor->sector();
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2022-08-29 20:28:48 +00:00
|
|
|
auto ppos = actor->spr.pos;
|
2022-10-07 21:33:37 +00:00
|
|
|
ppos.Z -= (tileHeight(actor->spr.picnum) * actor->spr.scale.Y) * 0.5;
|
2020-05-07 12:55:04 +00:00
|
|
|
|
|
|
|
if (bg)
|
|
|
|
{
|
2022-10-07 21:33:37 +00:00
|
|
|
if (actor->spr.scale.X > 0.9375 )
|
2022-09-30 15:57:22 +00:00
|
|
|
clipmove(ppos, &dasectp, change * 0.5, 64., 4., 4., cliptype, result);
|
2020-10-24 07:31:15 +00:00
|
|
|
else
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2022-09-30 15:57:22 +00:00
|
|
|
clipmove(ppos, &dasectp, change * 0.5, 12., 4., 4., cliptype, result);
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
|
|
|
|
2021-11-21 08:05:58 +00:00
|
|
|
if (dasectp == nullptr || (dasectp != nullptr && actor->actorstayput != nullptr && actor->actorstayput != dasectp))
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2021-11-21 08:05:58 +00:00
|
|
|
if (dasectp && dasectp->lotag == ST_1_ABOVE_WATER)
|
2022-09-13 18:09:29 +00:00
|
|
|
actor->spr.angle = randomAngle();
|
2020-10-24 07:31:15 +00:00
|
|
|
else if ((actor->temp_data[0] & 3) == 1)
|
2022-09-13 18:09:29 +00:00
|
|
|
actor->spr.angle = randomAngle();
|
2022-02-06 21:45:47 +00:00
|
|
|
SetActor(actor, actor->spr.pos);
|
2021-11-21 08:05:58 +00:00
|
|
|
if (dasectp == nullptr) dasectp = §or[0];
|
|
|
|
return result.setSector(dasectp);
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
2022-09-15 16:05:01 +00:00
|
|
|
if ((result.type == kHitWall || result.type == kHitSprite) && (actor->cgg == 0)) actor->spr.angle += DAngle45 + DAngle90;
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-12-21 18:13:49 +00:00
|
|
|
if (actor->spr.statnum == STAT_PROJECTILE)
|
2022-09-30 15:57:22 +00:00
|
|
|
clipmove(ppos, &dasectp, change * 0.5, 0.5, 4., 4., cliptype, result);
|
2020-05-07 12:55:04 +00:00
|
|
|
else
|
2022-10-04 17:06:49 +00:00
|
|
|
clipmove(ppos, &dasectp, change * 0.5, actor->clipdist, 4., 4., cliptype, result);
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
2022-08-29 20:28:48 +00:00
|
|
|
actor->spr.pos.XY() = ppos.XY();
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2021-11-21 08:05:58 +00:00
|
|
|
if (dasectp)
|
2021-12-30 15:51:56 +00:00
|
|
|
if ((dasectp != actor->sector()))
|
2021-11-26 20:52:01 +00:00
|
|
|
ChangeActorSect(actor, dasectp);
|
2022-09-13 18:09:29 +00:00
|
|
|
double daz = actor->spr.pos.Z + change.Z * 0.5;
|
2022-02-03 23:45:24 +00:00
|
|
|
if (daz > actor->ceilingz && daz <= actor->floorz)
|
|
|
|
actor->spr.pos.Z = daz;
|
2021-11-06 19:46:08 +00:00
|
|
|
else if (result.type == kHitNone)
|
2021-11-21 08:05:58 +00:00
|
|
|
return result.setSector(dasectp);
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2021-11-06 19:46:08 +00:00
|
|
|
return result.type;
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2021-11-07 13:07:08 +00:00
|
|
|
void lotsoffeathers_r(DDukeActor *actor, int n)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2020-10-24 07:35:43 +00:00
|
|
|
lotsofstuff(actor, n, MONEY);
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2021-11-07 13:07:08 +00:00
|
|
|
void guts_r(DDukeActor* actor, int gtype, int n, int p)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2021-11-14 14:03:50 +00:00
|
|
|
int j;
|
2022-10-07 16:51:29 +00:00
|
|
|
double scale;
|
2020-05-07 12:55:04 +00:00
|
|
|
uint8_t pal;
|
|
|
|
|
2022-10-07 21:33:37 +00:00
|
|
|
if (badguy(actor) && actor->spr.scale.X < 0.25)
|
2022-10-07 16:51:29 +00:00
|
|
|
scale = 0.0625;
|
|
|
|
else scale = 0.25;
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2022-09-12 23:02:13 +00:00
|
|
|
double gutz = actor->spr.pos.Z - 8;
|
2022-09-27 11:59:57 +00:00
|
|
|
double floorz = getflorzofslopeptr(actor->sector(), actor->spr.pos);
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2022-09-12 23:02:13 +00:00
|
|
|
if (gutz > floorz - 8)
|
|
|
|
gutz = floorz - 8;
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2022-09-12 23:02:13 +00:00
|
|
|
gutz += gs.actorinfo[actor->spr.picnum].gutsoffset;
|
2020-10-21 22:05:08 +00:00
|
|
|
|
2021-12-21 18:56:46 +00:00
|
|
|
if (badguy(actor) && actor->spr.pal == 6)
|
2020-05-07 12:55:04 +00:00
|
|
|
pal = 6;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pal = 0;
|
|
|
|
if (isRRRA())
|
|
|
|
{
|
2021-12-21 18:56:46 +00:00
|
|
|
if (actor->spr.picnum == MINION && (actor->spr.pal == 8 || actor->spr.pal == 19)) pal = actor->spr.pal;
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (j = 0; j < n; j++)
|
|
|
|
{
|
|
|
|
// RANDCORRECT version from RR.
|
2022-09-14 18:44:10 +00:00
|
|
|
DAngle a = randomAngle();
|
|
|
|
double zvel = -2 - krandf(8);
|
|
|
|
double vel = 3 + krandf(2);
|
2022-09-12 23:02:13 +00:00
|
|
|
DVector3 offs;
|
|
|
|
offs.Z = gutz - krandf(16);
|
|
|
|
offs.Y = krandf(16) - 8;
|
|
|
|
offs.X = krandf(16) - 8;
|
2020-05-07 12:55:04 +00:00
|
|
|
// TRANSITIONAL: owned by a player???
|
2022-10-07 16:51:29 +00:00
|
|
|
auto spawned = CreateActor(actor->sector(), offs + actor->spr.pos.XY(), gtype, -32, DVector2(scale, scale), a, vel, zvel, ps[p].GetActor(), 5);
|
2021-11-19 08:47:17 +00:00
|
|
|
if (spawned && pal != 0)
|
2021-12-21 17:19:45 +00:00
|
|
|
spawned->spr.pal = pal;
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2020-10-21 19:41:14 +00:00
|
|
|
int ifhitbyweapon_r(DDukeActor *actor)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2020-10-21 19:41:14 +00:00
|
|
|
int p;
|
|
|
|
auto hitowner = actor->GetHitOwner();
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2022-01-23 23:10:25 +00:00
|
|
|
if (actor->hitextra >= 0)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2021-12-21 18:13:49 +00:00
|
|
|
if (actor->spr.extra >= 0)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2021-12-21 18:13:49 +00:00
|
|
|
if (actor->spr.picnum == APLAYER)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2020-05-07 20:30:19 +00:00
|
|
|
if (ud.god) return -1;
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2020-10-21 19:41:14 +00:00
|
|
|
p = actor->PlayerIndex();
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2020-10-21 19:41:14 +00:00
|
|
|
if (hitowner &&
|
2021-12-21 17:19:45 +00:00
|
|
|
hitowner->spr.picnum == APLAYER &&
|
2020-05-07 12:55:04 +00:00
|
|
|
ud.coop == 1 &&
|
|
|
|
ud.ffire == 0)
|
|
|
|
return -1;
|
|
|
|
|
2022-01-23 23:10:25 +00:00
|
|
|
actor->spr.extra -= actor->hitextra;
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2020-10-21 19:41:14 +00:00
|
|
|
if (hitowner)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2021-12-27 22:52:16 +00:00
|
|
|
if (actor->spr.extra <= 0 && actor->attackertype != FREEZEBLAST)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2021-12-21 18:13:49 +00:00
|
|
|
actor->spr.extra = 0;
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2020-10-21 19:41:14 +00:00
|
|
|
ps[p].wackedbyactor = hitowner;
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2021-12-21 17:19:45 +00:00
|
|
|
if (hitowner->spr.picnum == APLAYER && p != hitowner->PlayerIndex())
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2020-10-21 19:41:14 +00:00
|
|
|
ps[p].frag_ps = hitowner->PlayerIndex();
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
2020-10-21 19:41:14 +00:00
|
|
|
actor->SetHitOwner(ps[p].GetActor());
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-20 07:31:08 +00:00
|
|
|
if (attackerflag(actor, SFLAG2_DOUBLEDMGTHRUST))
|
2020-05-07 20:30:19 +00:00
|
|
|
{
|
2022-09-11 22:40:33 +00:00
|
|
|
ps[p].vel.XY() += actor->hitang.ToVector() * actor->hitextra * 0.25;
|
2022-01-20 07:31:08 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-09-11 22:40:33 +00:00
|
|
|
ps[p].vel.XY() += actor->hitang.ToVector() * actor->hitextra * 0.125;
|
2020-05-07 20:30:19 +00:00
|
|
|
}
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-01-23 23:10:25 +00:00
|
|
|
if (actor->hitextra == 0)
|
2022-10-07 21:33:37 +00:00
|
|
|
if (actor->spr.scale.X < 0.375)
|
2020-05-07 12:55:04 +00:00
|
|
|
return -1;
|
|
|
|
|
2022-01-23 23:10:25 +00:00
|
|
|
actor->spr.extra -= actor->hitextra;
|
2021-12-21 18:13:49 +00:00
|
|
|
if (actor->spr.picnum != RECON && actor->GetOwner() && actor->GetOwner()->spr.statnum < MAXSTATUS)
|
2020-10-21 19:41:14 +00:00
|
|
|
actor->SetOwner(hitowner);
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
|
|
|
|
2022-01-23 23:10:25 +00:00
|
|
|
actor->hitextra = -1;
|
2021-12-27 22:52:16 +00:00
|
|
|
return actor->attackertype;
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-23 23:10:25 +00:00
|
|
|
actor->hitextra = -1;
|
2020-05-07 12:55:04 +00:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2020-05-07 20:30:19 +00:00
|
|
|
void movefallers_r(void)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2020-10-22 17:31:06 +00:00
|
|
|
DukeStatIterator it(STAT_FALLER);
|
|
|
|
while (auto act = it.Next())
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2021-12-30 15:51:56 +00:00
|
|
|
auto sectp = act->sector();
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2020-10-22 17:31:06 +00:00
|
|
|
if (act->temp_data[0] == 0)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2022-02-07 07:47:18 +00:00
|
|
|
act->spr.pos.Z -= 16;
|
2022-09-15 15:53:16 +00:00
|
|
|
DAngle saved_angle = act->spr.angle;
|
2021-12-21 18:56:46 +00:00
|
|
|
int x = act->spr.extra;
|
2020-10-22 17:31:06 +00:00
|
|
|
int j = fi.ifhitbyweapon(act);
|
|
|
|
if (j >= 0)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2022-01-19 18:15:23 +00:00
|
|
|
if (gs.actorinfo[j].flags2 & SFLAG2_EXPLOSIVE)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2021-12-21 18:56:46 +00:00
|
|
|
if (act->spr.extra <= 0)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2020-10-22 17:31:06 +00:00
|
|
|
act->temp_data[0] = 1;
|
2021-12-24 09:53:27 +00:00
|
|
|
DukeStatIterator itr(STAT_FALLER);
|
|
|
|
while (auto ac2 = itr.Next())
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2021-12-21 18:56:46 +00:00
|
|
|
if (ac2->spr.hitag == act->spr.hitag)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2020-10-22 17:31:06 +00:00
|
|
|
ac2->temp_data[0] = 1;
|
2021-12-21 17:19:45 +00:00
|
|
|
ac2->spr.cstat &= ~CSTAT_SPRITE_ONE_SIDE;
|
|
|
|
if (ac2->spr.picnum == CEILINGSTEAM || ac2->spr.picnum == STEAM)
|
|
|
|
ac2->spr.cstat |= CSTAT_SPRITE_INVISIBLE;
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-01-23 23:10:25 +00:00
|
|
|
act->hitextra = 0;
|
2021-12-21 18:56:46 +00:00
|
|
|
act->spr.extra = x;
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
|
|
|
}
|
2022-09-15 15:53:16 +00:00
|
|
|
act->spr.angle = saved_angle;
|
2022-02-07 07:47:18 +00:00
|
|
|
act->spr.pos.Z += 16;
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
2020-10-22 17:31:06 +00:00
|
|
|
else if (act->temp_data[0] == 1)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2021-12-21 18:56:46 +00:00
|
|
|
if (act->spr.lotag > 0)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2021-12-21 18:56:46 +00:00
|
|
|
act->spr.lotag -= 3;
|
2022-09-13 17:55:54 +00:00
|
|
|
act->vel.X = 4 + krandf(8);
|
|
|
|
act->vel.Z = -4 + krandf(4);
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-09-14 17:29:29 +00:00
|
|
|
if (act->vel.X > 0)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2022-09-11 17:28:45 +00:00
|
|
|
act->vel.X -= 1/8.;
|
2020-10-22 17:31:06 +00:00
|
|
|
ssp(act, CLIPMASK0);
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
|
|
|
|
2022-09-11 22:34:18 +00:00
|
|
|
double grav;
|
|
|
|
if (fi.floorspace(act->sector())) grav = 0;
|
2020-05-07 12:55:04 +00:00
|
|
|
else
|
|
|
|
{
|
2021-12-30 15:51:56 +00:00
|
|
|
if (fi.ceilingspace(act->sector()))
|
2022-09-11 22:34:18 +00:00
|
|
|
grav = gs.gravity / 6;
|
2020-05-07 12:55:04 +00:00
|
|
|
else
|
2022-09-11 22:34:18 +00:00
|
|
|
grav = gs.gravity;
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
|
|
|
|
2022-08-20 18:11:01 +00:00
|
|
|
if (act->spr.pos.Z < sectp->floorz - 1)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2022-09-11 22:34:18 +00:00
|
|
|
act->vel.Z += grav;
|
2022-09-03 08:03:30 +00:00
|
|
|
if (act->vel.Z > 24)
|
2022-09-11 17:28:45 +00:00
|
|
|
act->vel.Z = 24;
|
2022-09-03 08:03:30 +00:00
|
|
|
act->spr.pos.Z += act->vel.Z;
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
2022-08-20 18:11:01 +00:00
|
|
|
if ((sectp->floorz - act->spr.pos.Z) < 16)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2020-10-22 17:31:06 +00:00
|
|
|
int j = 1 + (krand() & 7);
|
2022-09-11 22:34:18 +00:00
|
|
|
for (int x = 0; x < j; x++) RANDOMSCRAP(act);
|
2022-11-20 18:25:23 +00:00
|
|
|
act->Destroy();
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2020-05-07 20:30:19 +00:00
|
|
|
void movestandables_r(void)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2020-10-22 17:51:42 +00:00
|
|
|
DukeStatIterator it(STAT_STANDABLE);
|
|
|
|
while (auto act = it.Next())
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2021-12-21 17:19:45 +00:00
|
|
|
int picnum = act->spr.picnum;
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2022-11-20 18:25:23 +00:00
|
|
|
if (!act->insector() || actorflag(act, SFLAG2_DIENOW))
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2022-11-20 18:25:23 +00:00
|
|
|
act->Destroy();
|
2020-05-07 12:55:04 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2022-01-16 23:51:40 +00:00
|
|
|
if (act->GetClass() != RUNTIME_CLASS(DDukeActor))
|
|
|
|
{
|
|
|
|
CallTick(act);
|
|
|
|
continue;
|
|
|
|
}
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2020-05-07 20:30:19 +00:00
|
|
|
else if (isIn(picnum,
|
2020-05-07 12:55:04 +00:00
|
|
|
EXPLODINGBARREL,
|
|
|
|
WOODENHORSE,
|
|
|
|
HORSEONSIDE,
|
|
|
|
FIREBARREL,
|
|
|
|
FIREVASE,
|
|
|
|
NUKEBARREL,
|
|
|
|
NUKEBARRELDENTED,
|
|
|
|
NUKEBARRELLEAKED,
|
|
|
|
TOILETWATER,
|
|
|
|
RUBBERCAN,
|
|
|
|
STEAM,
|
2020-05-07 20:30:19 +00:00
|
|
|
CEILINGSTEAM))
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2022-09-14 20:49:01 +00:00
|
|
|
double x;
|
2020-10-23 15:44:45 +00:00
|
|
|
int p = findplayer(act, &x);
|
2020-10-22 17:51:42 +00:00
|
|
|
execute(act, p, x);
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2020-10-22 17:59:38 +00:00
|
|
|
static void chickenarrow(DDukeActor* actor)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2021-12-21 18:56:46 +00:00
|
|
|
actor->spr.hitag++;
|
2022-10-07 21:33:37 +00:00
|
|
|
if (actor->attackertype != BOSS2 && actor->spr.scale.X >= 0.15625 && actor->sector()->lotag != 2)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2020-10-22 17:59:38 +00:00
|
|
|
auto spawned = spawn(actor, SMALLSMOKE);
|
2022-02-06 21:56:25 +00:00
|
|
|
if (spawned) spawned->spr.pos.Z += 1;
|
2020-10-18 08:42:26 +00:00
|
|
|
if ((krand() & 15) == 2)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2020-10-22 17:59:38 +00:00
|
|
|
spawn(actor, MONEY);
|
2020-10-18 08:42:26 +00:00
|
|
|
}
|
|
|
|
}
|
2021-12-05 23:20:46 +00:00
|
|
|
DDukeActor* ts = actor->seek_actor;
|
2020-11-01 19:57:02 +00:00
|
|
|
if (!ts) return;
|
2020-10-22 17:59:38 +00:00
|
|
|
|
2021-12-21 17:19:45 +00:00
|
|
|
if (ts->spr.extra <= 0)
|
2020-11-01 19:57:02 +00:00
|
|
|
actor->seek_actor = nullptr;
|
2022-09-13 17:37:38 +00:00
|
|
|
|
2021-12-21 18:56:46 +00:00
|
|
|
if (actor->seek_actor && actor->spr.hitag > 5)
|
2020-10-18 08:42:26 +00:00
|
|
|
{
|
2022-09-13 19:15:30 +00:00
|
|
|
DAngle ang, ang2;
|
2022-09-30 11:51:37 +00:00
|
|
|
ang = (ts->spr.pos - actor->spr.pos).Angle();
|
2022-09-13 17:37:38 +00:00
|
|
|
ang2 = deltaangle(ang, actor->spr.angle);
|
|
|
|
// this was quite broken in the original code. Fixed so that it seeks properly
|
|
|
|
if (abs(ang2) < DAngle1 * 17.5)
|
|
|
|
{
|
|
|
|
actor->spr.angle = ang;
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
2022-09-13 17:37:38 +00:00
|
|
|
else if (ang2 > nullAngle)
|
2020-10-18 08:42:26 +00:00
|
|
|
{
|
2022-09-13 17:37:38 +00:00
|
|
|
actor->spr.angle -= DAngle1 * 9;
|
2020-10-18 08:42:26 +00:00
|
|
|
}
|
|
|
|
else
|
2022-09-13 17:37:38 +00:00
|
|
|
actor->spr.angle += DAngle1 * 9;
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2021-12-21 18:56:46 +00:00
|
|
|
if (actor->spr.hitag > 180)
|
2022-09-03 08:03:30 +00:00
|
|
|
if (actor->vel.Z <= 0)
|
2022-09-11 17:28:45 +00:00
|
|
|
actor->vel.Z += 200 / 256;
|
2020-10-18 08:42:26 +00:00
|
|
|
}
|
|
|
|
}
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2020-10-18 08:42:26 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2022-08-22 21:57:39 +00:00
|
|
|
static bool weaponhitsprite(DDukeActor *proj, DDukeActor *targ, const DVector3 &oldpos)
|
2020-10-18 08:42:26 +00:00
|
|
|
{
|
|
|
|
if (isRRRA())
|
|
|
|
{
|
2021-12-21 17:19:45 +00:00
|
|
|
if (targ->spr.picnum == MINION
|
2021-12-21 18:56:46 +00:00
|
|
|
&& (proj->spr.picnum == RPG || proj->spr.picnum == RPG2)
|
2021-12-21 17:19:45 +00:00
|
|
|
&& targ->spr.pal == 19)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2020-10-22 18:07:05 +00:00
|
|
|
S_PlayActorSound(RPG_EXPLODE, proj);
|
2022-01-31 18:21:11 +00:00
|
|
|
auto spawned = spawn(proj, EXPLOSION2);
|
|
|
|
if (spawned)
|
2022-08-22 21:57:39 +00:00
|
|
|
spawned->spr.pos = oldpos;
|
2020-10-18 08:42:26 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
2021-12-21 18:56:46 +00:00
|
|
|
else if (proj->spr.picnum == FREEZEBLAST && targ->spr.pal == 1)
|
2021-12-21 17:19:45 +00:00
|
|
|
if (badguy(targ) || targ->spr.picnum == APLAYER)
|
2020-10-18 08:42:26 +00:00
|
|
|
{
|
2020-10-22 18:07:05 +00:00
|
|
|
auto star = spawn(proj, TRANSPORTERSTAR);
|
2021-11-19 11:32:12 +00:00
|
|
|
if (star)
|
|
|
|
{
|
2021-12-21 17:19:45 +00:00
|
|
|
star->spr.pal = 1;
|
2022-10-07 21:52:29 +00:00
|
|
|
star->spr.scale = DVector2(0.5, 0.5);
|
2021-11-19 11:32:12 +00:00
|
|
|
}
|
2020-10-18 08:42:26 +00:00
|
|
|
|
2022-11-20 18:25:23 +00:00
|
|
|
proj->Destroy();
|
2020-10-18 08:42:26 +00:00
|
|
|
return true;
|
|
|
|
}
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2020-10-24 05:15:10 +00:00
|
|
|
fi.checkhitsprite(targ, proj);
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2021-12-21 17:19:45 +00:00
|
|
|
if (targ->spr.picnum == APLAYER)
|
2020-10-18 08:42:26 +00:00
|
|
|
{
|
2022-09-01 15:26:46 +00:00
|
|
|
int p = targ->PlayerIndex();
|
2020-10-22 18:07:05 +00:00
|
|
|
S_PlayActorSound(PISTOL_BODYHIT, targ);
|
2020-10-18 08:42:26 +00:00
|
|
|
|
2021-12-21 18:56:46 +00:00
|
|
|
if (proj->spr.picnum == SPIT)
|
2020-10-18 08:42:26 +00:00
|
|
|
{
|
2021-12-21 17:19:45 +00:00
|
|
|
if (isRRRA() && proj->GetOwner() && proj->GetOwner()->spr.picnum == MAMA)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2020-10-22 18:07:05 +00:00
|
|
|
guts_r(proj, RABBITJIBA, 2, myconnectindex);
|
|
|
|
guts_r(proj, RABBITJIBB, 2, myconnectindex);
|
|
|
|
guts_r(proj, RABBITJIBC, 2, myconnectindex);
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
|
|
|
|
2022-10-11 06:46:56 +00:00
|
|
|
ps[p].horizon.addadjustment(DAngle::fromDeg(-14.04));
|
2020-10-18 08:42:26 +00:00
|
|
|
ps[p].sync.actions |= SB_CENTERVIEW;
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2020-10-18 08:42:26 +00:00
|
|
|
if (ps[p].loogcnt == 0)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2020-10-22 18:07:05 +00:00
|
|
|
if (!S_CheckActorSoundPlaying(ps[p].GetActor(), DUKE_LONGTERM_PAIN))
|
|
|
|
S_PlayActorSound(DUKE_LONGTERM_PAIN, ps[p].GetActor());
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2020-10-22 18:07:05 +00:00
|
|
|
int j = 3 + (krand() & 3);
|
2020-10-18 08:42:26 +00:00
|
|
|
ps[p].numloogs = j;
|
|
|
|
ps[p].loogcnt = 24 * 4;
|
|
|
|
for (int x = 0; x < j; x++)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2021-12-30 11:45:53 +00:00
|
|
|
ps[p].loogie[x].X = krand() % 320;
|
2021-12-30 11:47:19 +00:00
|
|
|
ps[p].loogie[x].Y = krand() % 200;
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
|
|
|
}
|
2020-10-18 08:42:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2020-10-18 08:42:26 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2022-08-22 21:57:39 +00:00
|
|
|
static bool weaponhitwall(DDukeActor *proj, walltype* wal, const DVector3& oldpos)
|
2020-10-18 08:42:26 +00:00
|
|
|
{
|
2021-12-21 17:19:45 +00:00
|
|
|
if (isRRRA() && proj->GetOwner() && proj->GetOwner()->spr.picnum == MAMA)
|
2020-10-18 08:42:26 +00:00
|
|
|
{
|
2020-10-22 18:07:05 +00:00
|
|
|
guts_r(proj, RABBITJIBA, 2, myconnectindex);
|
|
|
|
guts_r(proj, RABBITJIBB, 2, myconnectindex);
|
|
|
|
guts_r(proj, RABBITJIBC, 2, myconnectindex);
|
2020-10-18 08:42:26 +00:00
|
|
|
}
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2021-12-21 18:56:46 +00:00
|
|
|
if (proj->spr.picnum != RPG && (!isRRRA() || proj->spr.picnum != RPG2) && proj->spr.picnum != FREEZEBLAST && proj->spr.picnum != SPIT && proj->spr.picnum != SHRINKSPARK && (wal->overpicnum == MIRROR || wal->picnum == MIRROR))
|
2020-10-18 08:42:26 +00:00
|
|
|
{
|
2022-09-30 11:39:39 +00:00
|
|
|
DAngle walang = wal->delta().Angle();
|
2022-09-15 15:53:16 +00:00
|
|
|
proj->spr.angle = walang * 2 - proj->spr.angle;
|
2020-10-22 18:07:05 +00:00
|
|
|
proj->SetOwner(proj);
|
|
|
|
spawn(proj, TRANSPORTERSTAR);
|
2020-10-18 08:42:26 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-08-22 21:57:39 +00:00
|
|
|
SetActor(proj, oldpos);
|
2022-08-23 20:39:07 +00:00
|
|
|
fi.checkhitwall(proj, wal, proj->spr.pos, proj->spr.picnum);
|
2020-10-18 08:42:26 +00:00
|
|
|
|
2021-12-21 18:56:46 +00:00
|
|
|
if (!isRRRA() && proj->spr.picnum == FREEZEBLAST)
|
2020-10-18 08:42:26 +00:00
|
|
|
{
|
2021-11-16 16:51:50 +00:00
|
|
|
if (wal->overpicnum != MIRROR && wal->picnum != MIRROR)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2021-12-21 18:56:46 +00:00
|
|
|
proj->spr.extra >>= 1;
|
2022-10-07 21:33:37 +00:00
|
|
|
if (proj->spr.scale.X > 0.125 )
|
2022-10-07 21:44:21 +00:00
|
|
|
proj->spr.scale.X += (-0.03125);
|
2022-10-07 21:33:37 +00:00
|
|
|
if (proj->spr.scale.Y > 0.125 )
|
2022-10-07 21:44:21 +00:00
|
|
|
proj->spr.scale.Y += (-0.03125);
|
2022-09-01 16:15:52 +00:00
|
|
|
proj->spr.yint--;
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
|
|
|
|
2022-09-30 11:39:39 +00:00
|
|
|
DAngle walang = wal->delta().Angle();
|
2022-09-15 15:53:16 +00:00
|
|
|
proj->spr.angle = walang * 2 - proj->spr.angle;
|
2020-10-18 08:42:26 +00:00
|
|
|
return true;
|
|
|
|
}
|
2021-12-21 18:56:46 +00:00
|
|
|
if (proj->spr.picnum == SHRINKSPARK)
|
2020-10-18 08:42:26 +00:00
|
|
|
{
|
2021-11-16 16:51:50 +00:00
|
|
|
if (wal->picnum >= RRTILE3643 && wal->picnum < RRTILE3643 + 3)
|
2020-05-07 20:30:19 +00:00
|
|
|
{
|
2022-11-20 18:25:23 +00:00
|
|
|
proj->Destroy();
|
2020-05-07 20:30:19 +00:00
|
|
|
}
|
2021-12-21 18:56:46 +00:00
|
|
|
if (proj->spr.extra <= 0)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2022-09-15 15:48:51 +00:00
|
|
|
proj->spr.pos += proj->spr.angle.ToVector() * 8;
|
2020-10-22 18:07:05 +00:00
|
|
|
auto Owner = proj->GetOwner();
|
2021-12-21 17:19:45 +00:00
|
|
|
if (!isRRRA() || !Owner || (Owner->spr.picnum != CHEER && Owner->spr.picnum != CHEERSTAYPUT))
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2020-10-22 18:07:05 +00:00
|
|
|
auto j = spawn(proj, CIRCLESTUCK);
|
2021-11-19 11:32:12 +00:00
|
|
|
if (j)
|
|
|
|
{
|
2022-10-07 21:52:29 +00:00
|
|
|
j->spr.scale = DVector2(0.125, 0.125);
|
2021-12-21 17:19:45 +00:00
|
|
|
j->spr.cstat = CSTAT_SPRITE_ALIGNMENT_WALL;
|
2022-09-14 20:57:42 +00:00
|
|
|
j->spr.angle += DAngle90;
|
2022-10-07 21:33:37 +00:00
|
|
|
j->clipdist = proj->spr.scale.X * tileWidth(proj->spr.picnum) * 0.125;
|
2021-11-19 11:32:12 +00:00
|
|
|
}
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
2022-11-20 18:25:23 +00:00
|
|
|
proj->Destroy();
|
2020-10-18 08:42:26 +00:00
|
|
|
return true;
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
2021-11-16 16:51:50 +00:00
|
|
|
if (wal->overpicnum != MIRROR && wal->picnum != MIRROR)
|
2020-10-18 08:42:26 +00:00
|
|
|
{
|
2021-12-21 18:56:46 +00:00
|
|
|
proj->spr.extra -= 20;
|
2022-09-01 16:15:52 +00:00
|
|
|
proj->spr.yint--;
|
2020-10-18 08:42:26 +00:00
|
|
|
}
|
|
|
|
|
2022-09-30 11:39:39 +00:00
|
|
|
DAngle k = wal->delta().Angle();
|
2022-09-14 20:57:42 +00:00
|
|
|
proj->spr.angle = k * 2 - proj->spr.angle;
|
2020-10-18 08:42:26 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2020-10-22 18:07:05 +00:00
|
|
|
|
2020-10-18 08:42:26 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2022-08-22 21:57:39 +00:00
|
|
|
bool weaponhitsector(DDukeActor *proj, const DVector3& oldpos)
|
2020-10-18 08:42:26 +00:00
|
|
|
{
|
2022-08-22 21:57:39 +00:00
|
|
|
SetActor(proj, oldpos);
|
2020-10-18 08:42:26 +00:00
|
|
|
|
2021-12-21 17:19:45 +00:00
|
|
|
if (isRRRA() && proj->GetOwner() && proj->GetOwner()->spr.picnum == MAMA)
|
2020-10-18 08:42:26 +00:00
|
|
|
{
|
2020-10-22 18:07:05 +00:00
|
|
|
guts_r(proj, RABBITJIBA, 2, myconnectindex);
|
|
|
|
guts_r(proj, RABBITJIBB, 2, myconnectindex);
|
|
|
|
guts_r(proj, RABBITJIBC, 2, myconnectindex);
|
2020-10-18 08:42:26 +00:00
|
|
|
}
|
|
|
|
|
2022-09-03 08:03:30 +00:00
|
|
|
if (proj->vel.Z < 0)
|
2020-10-18 08:42:26 +00:00
|
|
|
{
|
2021-12-30 15:51:56 +00:00
|
|
|
if (proj->sector()->ceilingstat & CSTAT_SECTOR_SKY)
|
|
|
|
if (proj->sector()->ceilingpal == 0)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2022-11-20 18:25:23 +00:00
|
|
|
proj->Destroy();
|
2020-10-18 08:42:26 +00:00
|
|
|
return true;
|
|
|
|
}
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2021-12-30 15:51:56 +00:00
|
|
|
fi.checkhitceiling(proj->sector());
|
2020-10-18 08:42:26 +00:00
|
|
|
}
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2021-12-21 18:56:46 +00:00
|
|
|
if (!isRRRA() && proj->spr.picnum == FREEZEBLAST)
|
2020-10-18 08:42:26 +00:00
|
|
|
{
|
2020-10-22 18:07:05 +00:00
|
|
|
bounce(proj);
|
|
|
|
ssp(proj, CLIPMASK1);
|
2021-12-21 18:56:46 +00:00
|
|
|
proj->spr.extra >>= 1;
|
2022-10-07 21:33:37 +00:00
|
|
|
if (proj->spr.scale.X > 0.125 )
|
2022-10-07 21:44:21 +00:00
|
|
|
proj->spr.scale.X += (-0.03125);
|
2022-10-07 21:33:37 +00:00
|
|
|
if (proj->spr.scale.Y > 0.125 )
|
2022-10-07 21:44:21 +00:00
|
|
|
proj->spr.scale.Y += (-0.03125);
|
2022-09-01 16:15:52 +00:00
|
|
|
proj->spr.yint--;
|
2020-10-18 08:42:26 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2020-10-18 08:42:26 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2020-10-22 18:21:21 +00:00
|
|
|
static void weaponcommon_r(DDukeActor *proj)
|
2020-10-18 08:42:26 +00:00
|
|
|
{
|
2022-09-13 18:02:15 +00:00
|
|
|
double vel = proj->vel.X;
|
|
|
|
double velz = proj->vel.Z;
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2022-09-13 18:02:15 +00:00
|
|
|
int p = -1;
|
2020-08-05 07:53:22 +00:00
|
|
|
|
2021-12-30 15:51:56 +00:00
|
|
|
if (proj->spr.picnum == RPG && proj->sector()->lotag == 2)
|
2020-10-18 08:42:26 +00:00
|
|
|
{
|
2022-09-13 18:02:15 +00:00
|
|
|
vel *= 0.5;
|
|
|
|
velz *= 0.5;
|
2020-10-18 08:42:26 +00:00
|
|
|
}
|
2021-12-30 15:51:56 +00:00
|
|
|
else if (isRRRA() && proj->spr.picnum == RPG2 && proj->sector()->lotag == 2)
|
2020-10-18 08:42:26 +00:00
|
|
|
{
|
2022-09-13 18:02:15 +00:00
|
|
|
vel *= 0.5;
|
|
|
|
velz *= 0.5;
|
2020-10-18 08:42:26 +00:00
|
|
|
}
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2022-09-13 18:02:15 +00:00
|
|
|
|
2022-08-22 21:57:39 +00:00
|
|
|
auto oldpos = proj->spr.pos;
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2020-10-22 18:21:21 +00:00
|
|
|
getglobalz(proj);
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2021-12-21 18:56:46 +00:00
|
|
|
switch (proj->spr.picnum)
|
2020-10-18 08:42:26 +00:00
|
|
|
{
|
|
|
|
case RPG:
|
2022-10-07 21:33:37 +00:00
|
|
|
if (proj->attackertype != BOSS2 && proj->spr.scale.X >= 0.15625 && proj->sector()->lotag != 2)
|
2020-10-18 08:42:26 +00:00
|
|
|
{
|
2022-01-30 17:25:26 +00:00
|
|
|
auto spawned = spawn(proj, SMALLSMOKE);
|
2022-02-06 21:56:25 +00:00
|
|
|
if (spawned) spawned->spr.pos.Z += 1;
|
2020-10-18 08:42:26 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case RPG2:
|
|
|
|
if (!isRRRA()) break;
|
2020-10-22 18:21:21 +00:00
|
|
|
chickenarrow(proj);
|
2020-10-18 08:42:26 +00:00
|
|
|
break;
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2020-10-18 08:42:26 +00:00
|
|
|
case RRTILE1790:
|
|
|
|
if (!isRRRA()) break;
|
2021-12-21 18:56:46 +00:00
|
|
|
if (proj->spr.extra)
|
2020-10-18 08:42:26 +00:00
|
|
|
{
|
2022-09-14 17:49:38 +00:00
|
|
|
proj->vel.Z = -(proj->spr.extra * 250/256.); // 250 looks like a typo...
|
2021-12-21 18:56:46 +00:00
|
|
|
proj->spr.extra--;
|
2020-10-18 08:42:26 +00:00
|
|
|
}
|
|
|
|
else
|
2020-10-22 18:21:21 +00:00
|
|
|
makeitfall(proj);
|
2022-10-07 21:33:37 +00:00
|
|
|
if (proj->spr.scale.X >= 0.15625 && proj->sector()->lotag != 2)
|
2020-10-18 08:42:26 +00:00
|
|
|
{
|
2022-01-30 17:25:26 +00:00
|
|
|
auto spawned = spawn(proj, SMALLSMOKE);
|
2022-02-06 21:56:25 +00:00
|
|
|
if (spawned) spawned->spr.pos.Z += 1;
|
2020-10-18 08:42:26 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2020-10-22 19:19:24 +00:00
|
|
|
Collision coll;
|
2022-09-13 18:02:15 +00:00
|
|
|
movesprite_ex(proj, DVector3(proj->spr.angle.ToVector() * vel, velz), CLIPMASK1, coll);
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2021-12-21 18:56:46 +00:00
|
|
|
if ((proj->spr.picnum == RPG || (isRRRA() && isIn(proj->spr.picnum, RPG2, RRTILE1790))) && proj->temp_actor != nullptr)
|
2022-09-11 18:46:21 +00:00
|
|
|
if ((proj->spr.pos.XY() - proj->temp_actor->spr.pos.XY()).Length() < 16)
|
2020-10-22 19:19:24 +00:00
|
|
|
coll.setSprite(proj->temp_actor);
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2021-12-30 15:51:56 +00:00
|
|
|
if (!proj->insector()) // || (isRR() && proj->sector()->filler == 800))
|
2020-10-18 08:42:26 +00:00
|
|
|
{
|
2022-11-20 18:25:23 +00:00
|
|
|
proj->Destroy();
|
2020-10-18 08:42:26 +00:00
|
|
|
return;
|
|
|
|
}
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2021-12-21 18:56:46 +00:00
|
|
|
if (coll.type != kHitSprite && proj->spr.picnum != FREEZEBLAST)
|
2020-10-18 08:42:26 +00:00
|
|
|
{
|
2022-02-03 23:55:12 +00:00
|
|
|
if (proj->spr.pos.Z < proj->ceilingz)
|
2020-10-18 08:42:26 +00:00
|
|
|
{
|
2021-12-30 15:51:56 +00:00
|
|
|
coll.setSector(proj->sector());
|
2022-09-11 17:28:45 +00:00
|
|
|
proj->vel.Z -= 1/256.;
|
2020-10-18 08:42:26 +00:00
|
|
|
}
|
|
|
|
else
|
2022-02-03 23:55:12 +00:00
|
|
|
if (proj->spr.pos.Z > proj->floorz)
|
2020-10-18 08:42:26 +00:00
|
|
|
{
|
2021-12-30 15:51:56 +00:00
|
|
|
coll.setSector(proj->sector());
|
|
|
|
if (proj->sector()->lotag != 1)
|
2022-09-11 17:28:45 +00:00
|
|
|
proj->vel.Z += 1/256.;
|
2020-10-18 08:42:26 +00:00
|
|
|
}
|
|
|
|
}
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2021-12-21 18:56:46 +00:00
|
|
|
if (proj->spr.picnum == FIRELASER)
|
2020-10-18 08:42:26 +00:00
|
|
|
{
|
2022-09-13 18:02:15 +00:00
|
|
|
for (int k = -3; k < 2; k++)
|
2020-10-18 08:42:26 +00:00
|
|
|
{
|
2022-09-13 18:02:15 +00:00
|
|
|
double zAdd = k * proj->vel.Z / 24;
|
|
|
|
auto x = CreateActor(proj->sector(), proj->spr.pos.plusZ(zAdd) + proj->spr.angle.ToVector() * k * 2.,
|
|
|
|
FIRELASER, -40 + (k << 2),
|
2022-10-07 21:41:15 +00:00
|
|
|
proj->spr.scale, nullAngle, 0., 0., proj->GetOwner(), 5);
|
2020-10-18 08:42:26 +00:00
|
|
|
|
2021-11-19 08:47:17 +00:00
|
|
|
if (x)
|
|
|
|
{
|
2021-12-21 17:19:45 +00:00
|
|
|
x->spr.cstat = CSTAT_SPRITE_YCENTER;
|
2021-12-21 18:56:46 +00:00
|
|
|
x->spr.pal = proj->spr.pal;
|
2021-11-19 08:47:17 +00:00
|
|
|
}
|
2020-10-18 08:42:26 +00:00
|
|
|
}
|
|
|
|
}
|
2022-09-03 08:03:30 +00:00
|
|
|
else if (proj->spr.picnum == SPIT) if (proj->vel.Z < 24)
|
2022-10-05 22:07:01 +00:00
|
|
|
proj->vel.Z += gs.gravity - 112/256.;
|
2020-10-18 08:42:26 +00:00
|
|
|
|
2020-10-22 19:19:24 +00:00
|
|
|
if (coll.type != 0)
|
2020-10-18 08:42:26 +00:00
|
|
|
{
|
2020-10-22 19:19:24 +00:00
|
|
|
if (coll.type == kHitSprite)
|
2020-10-18 08:42:26 +00:00
|
|
|
{
|
2021-11-26 12:41:15 +00:00
|
|
|
if (weaponhitsprite(proj, coll.actor(), oldpos)) return;
|
2020-10-18 08:42:26 +00:00
|
|
|
}
|
2020-10-22 19:19:24 +00:00
|
|
|
else if (coll.type == kHitWall)
|
2020-10-18 08:42:26 +00:00
|
|
|
{
|
2021-11-26 12:41:15 +00:00
|
|
|
if (weaponhitwall(proj, coll.hitWall, oldpos)) return;
|
2020-10-18 08:42:26 +00:00
|
|
|
}
|
2020-10-22 19:19:24 +00:00
|
|
|
else if (coll.type == kHitSector)
|
2020-10-18 08:42:26 +00:00
|
|
|
{
|
2020-10-22 18:21:21 +00:00
|
|
|
if (weaponhitsector(proj, oldpos)) return;
|
2020-10-18 08:42:26 +00:00
|
|
|
}
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2021-12-21 18:56:46 +00:00
|
|
|
if (proj->spr.picnum != SPIT)
|
2020-10-18 08:42:26 +00:00
|
|
|
{
|
2021-12-21 18:56:46 +00:00
|
|
|
if (proj->spr.picnum == RPG) rpgexplode(proj, coll.type, oldpos, EXPLOSION2, -1, -1, RPG_EXPLODE);
|
|
|
|
else if (isRRRA() && proj->spr.picnum == RPG2) rpgexplode(proj, coll.type, oldpos, EXPLOSION2, -1, 150, 247);
|
|
|
|
else if (isRRRA() && proj->spr.picnum == RRTILE1790) rpgexplode(proj, coll.type, oldpos, EXPLOSION2, -1, 160, RPG_EXPLODE);
|
|
|
|
else if (proj->spr.picnum != FREEZEBLAST && proj->spr.picnum != FIRELASER && proj->spr.picnum != SHRINKSPARK)
|
2020-10-18 08:42:26 +00:00
|
|
|
{
|
2021-12-24 09:53:27 +00:00
|
|
|
auto spawned = spawn(proj, 1441);
|
|
|
|
if (spawned)
|
2020-10-18 08:42:26 +00:00
|
|
|
{
|
2022-10-07 21:33:37 +00:00
|
|
|
auto scale = proj->spr.scale.X * 0.5;
|
2022-10-07 21:52:29 +00:00
|
|
|
spawned->spr.scale = DVector2(scale, scale);
|
2021-11-19 11:32:12 +00:00
|
|
|
if (coll.type == kHitSector)
|
2020-05-07 12:55:04 +00:00
|
|
|
{
|
2022-09-03 08:03:30 +00:00
|
|
|
if (proj->vel.Z < 0)
|
2021-11-19 11:32:12 +00:00
|
|
|
{
|
2021-12-24 09:53:27 +00:00
|
|
|
spawned->spr.cstat |= CSTAT_SPRITE_YFLIP;
|
2022-08-20 15:59:15 +00:00
|
|
|
spawned->spr.pos.Z += 72;
|
2021-11-19 11:32:12 +00:00
|
|
|
}
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
|
|
|
}
|
2020-10-18 08:42:26 +00:00
|
|
|
}
|
|
|
|
}
|
2022-11-20 18:25:23 +00:00
|
|
|
proj->Destroy();
|
2020-10-18 08:42:26 +00:00
|
|
|
return;
|
|
|
|
}
|
2022-10-07 21:33:37 +00:00
|
|
|
if ((proj->spr.picnum == RPG || (isRRRA() && proj->spr.picnum == RPG2)) && proj->sector()->lotag == 2 && proj->spr.scale.X >= 0.15625 && rnd(184))
|
2020-10-22 18:21:21 +00:00
|
|
|
spawn(proj, WATERBUBBLE);
|
|
|
|
|
2020-10-18 08:42:26 +00:00
|
|
|
}
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2020-10-18 08:42:26 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2020-10-18 08:42:26 +00:00
|
|
|
void moveweapons_r(void)
|
|
|
|
{
|
2020-10-22 18:21:21 +00:00
|
|
|
DukeStatIterator it(STAT_PROJECTILE);
|
|
|
|
while (auto proj = it.Next())
|
2020-10-18 08:42:26 +00:00
|
|
|
{
|
2022-11-20 18:25:23 +00:00
|
|
|
if (!proj->insector() || actorflag(proj, SFLAG2_DIENOW))
|
2020-10-18 08:42:26 +00:00
|
|
|
{
|
2022-11-20 18:25:23 +00:00
|
|
|
proj->Destroy();
|
2020-10-18 08:42:26 +00:00
|
|
|
continue;
|
|
|
|
}
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2022-11-20 19:40:46 +00:00
|
|
|
if (proj->GetClass() != RUNTIME_CLASS(DDukeActor))
|
2020-10-18 08:42:26 +00:00
|
|
|
{
|
2022-11-20 19:40:46 +00:00
|
|
|
CallTick(proj);
|
2020-10-18 08:42:26 +00:00
|
|
|
continue;
|
2022-11-20 19:40:46 +00:00
|
|
|
}
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2022-11-20 19:40:46 +00:00
|
|
|
switch (proj->spr.picnum)
|
|
|
|
{
|
2020-10-18 08:42:26 +00:00
|
|
|
case FREEZEBLAST:
|
2022-09-14 17:29:29 +00:00
|
|
|
if (proj->spr.yint < 1 || proj->spr.extra < 2 || (proj->vel.X == 0 && proj->vel.Z == 0))
|
2020-10-18 08:42:26 +00:00
|
|
|
{
|
2020-10-22 18:21:21 +00:00
|
|
|
auto star = spawn(proj, TRANSPORTERSTAR);
|
2021-11-19 11:32:12 +00:00
|
|
|
if (star)
|
|
|
|
{
|
2021-12-21 17:19:45 +00:00
|
|
|
star->spr.pal = 1;
|
2022-10-07 21:52:29 +00:00
|
|
|
star->spr.scale = DVector2(0.5, 0.5);
|
2021-11-19 11:32:12 +00:00
|
|
|
}
|
2022-11-20 18:25:23 +00:00
|
|
|
proj->Destroy();
|
2020-05-07 20:30:19 +00:00
|
|
|
continue;
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
2021-11-14 11:25:25 +00:00
|
|
|
[[fallthrough]];
|
2020-10-18 08:42:26 +00:00
|
|
|
case RPG2:
|
|
|
|
case RRTILE1790:
|
|
|
|
if (!isRRRA()) continue;
|
2021-11-14 11:25:25 +00:00
|
|
|
[[fallthrough]];
|
2020-10-18 08:42:26 +00:00
|
|
|
case SHRINKSPARK:
|
|
|
|
case RPG:
|
|
|
|
case FIRELASER:
|
|
|
|
case SPIT:
|
|
|
|
case COOLEXPLOSION1:
|
|
|
|
case OWHIP:
|
|
|
|
case UWHIP:
|
2020-10-22 18:21:21 +00:00
|
|
|
weaponcommon_r(proj);
|
2020-05-07 12:55:04 +00:00
|
|
|
continue;
|
2020-05-07 20:30:19 +00:00
|
|
|
|
|
|
|
|
|
|
|
case SHOTSPARK1:
|
2020-10-18 08:42:26 +00:00
|
|
|
{
|
2022-09-14 20:49:01 +00:00
|
|
|
double x;
|
2020-10-23 15:44:45 +00:00
|
|
|
int p = findplayer(proj, &x);
|
2020-10-22 18:21:21 +00:00
|
|
|
execute(proj, p, x);
|
2020-05-07 20:30:19 +00:00
|
|
|
continue;
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
2020-10-18 08:42:26 +00:00
|
|
|
}
|
2020-05-07 12:55:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-05-07 22:03:51 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void movetransports_r(void)
|
|
|
|
{
|
2021-11-14 14:03:50 +00:00
|
|
|
uint8_t warpdir = 0, warpspriteto;
|
2021-11-07 11:43:00 +00:00
|
|
|
int k, p, sectlotag;
|
2022-08-20 16:46:45 +00:00
|
|
|
int onfloorz;
|
|
|
|
double ll, ll2 = 0;
|
2020-10-22 19:42:02 +00:00
|
|
|
Collision coll;
|
2020-05-07 22:03:51 +00:00
|
|
|
|
2020-08-14 19:49:12 +00:00
|
|
|
//Transporters
|
2020-05-07 22:03:51 +00:00
|
|
|
|
2020-10-22 19:42:02 +00:00
|
|
|
DukeStatIterator iti(STAT_TRANSPORT);
|
|
|
|
while (auto act = iti.Next())
|
2020-05-07 22:03:51 +00:00
|
|
|
{
|
2021-12-30 15:51:56 +00:00
|
|
|
auto sectp = act->sector();
|
2021-11-06 23:09:37 +00:00
|
|
|
sectlotag = sectp->lotag;
|
2020-05-07 22:03:51 +00:00
|
|
|
|
2020-10-22 19:42:02 +00:00
|
|
|
auto Owner = act->GetOwner();
|
|
|
|
if (Owner == act || Owner == nullptr)
|
2020-05-07 22:03:51 +00:00
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2020-11-01 13:56:23 +00:00
|
|
|
onfloorz = act->temp_data[4];
|
2020-05-07 22:03:51 +00:00
|
|
|
|
2020-11-01 13:56:23 +00:00
|
|
|
if (act->temp_data[0] > 0) act->temp_data[0]--;
|
2020-05-07 22:03:51 +00:00
|
|
|
|
2021-11-21 00:10:50 +00:00
|
|
|
DukeSectIterator itj(act->sector());
|
2020-10-22 19:42:02 +00:00
|
|
|
while (auto act2 = itj.Next())
|
2020-05-07 22:03:51 +00:00
|
|
|
{
|
2021-12-21 19:02:06 +00:00
|
|
|
switch (act2->spr.statnum)
|
2020-05-07 22:03:51 +00:00
|
|
|
{
|
2020-05-12 11:43:24 +00:00
|
|
|
case STAT_PLAYER: // Player
|
2020-05-07 22:03:51 +00:00
|
|
|
|
2020-10-22 19:42:02 +00:00
|
|
|
if (act2->GetOwner())
|
2020-05-07 22:03:51 +00:00
|
|
|
{
|
2022-09-01 15:26:46 +00:00
|
|
|
p = act2->PlayerIndex();
|
2020-05-07 22:03:51 +00:00
|
|
|
|
|
|
|
ps[p].on_warping_sector = 1;
|
|
|
|
|
|
|
|
if (ps[p].transporter_hold == 0 && ps[p].jumping_counter == 0)
|
|
|
|
{
|
|
|
|
if (ps[p].on_ground && sectlotag == 0 && onfloorz && ps[p].jetpack_on == 0)
|
|
|
|
{
|
2020-10-22 19:42:02 +00:00
|
|
|
spawn(act, TRANSPORTERBEAM);
|
|
|
|
S_PlayActorSound(TELEPORTER, act);
|
2020-05-07 22:03:51 +00:00
|
|
|
|
2020-10-23 18:07:26 +00:00
|
|
|
for (k = connecthead; k >= 0; k = connectpoint2[k])
|
2021-11-21 07:56:39 +00:00
|
|
|
if (ps[k].cursector == Owner->sector())
|
2020-05-07 22:03:51 +00:00
|
|
|
{
|
|
|
|
ps[k].frag_ps = p;
|
2021-12-21 17:19:45 +00:00
|
|
|
ps[k].GetActor()->spr.extra = 0;
|
2020-05-07 22:03:51 +00:00
|
|
|
}
|
|
|
|
|
2022-08-28 03:15:31 +00:00
|
|
|
ps[p].angle.ang = Owner->spr.angle;
|
2020-05-07 22:03:51 +00:00
|
|
|
|
2020-10-22 19:42:02 +00:00
|
|
|
if (Owner->GetOwner() != Owner)
|
2020-05-07 22:03:51 +00:00
|
|
|
{
|
2020-11-01 13:56:23 +00:00
|
|
|
act->temp_data[0] = 13;
|
2020-10-22 19:42:02 +00:00
|
|
|
Owner->temp_data[0] = 13;
|
2020-05-07 22:03:51 +00:00
|
|
|
ps[p].transporter_hold = 13;
|
|
|
|
}
|
|
|
|
|
2022-11-21 04:08:33 +00:00
|
|
|
ps[p].GetActor()->spr.pos = Owner->spr.pos.plusZ(4);
|
2022-11-15 08:27:07 +00:00
|
|
|
ps[p].GetActor()->backuppos();
|
2022-02-05 09:51:45 +00:00
|
|
|
ps[p].setbobpos();
|
2020-05-07 22:03:51 +00:00
|
|
|
|
2021-11-26 20:52:01 +00:00
|
|
|
ChangeActorSect(act2, Owner->sector());
|
2021-12-30 15:51:56 +00:00
|
|
|
ps[p].setCursector(act2->sector());
|
2020-05-07 22:03:51 +00:00
|
|
|
|
2020-10-22 19:42:02 +00:00
|
|
|
auto beam = spawn(Owner, TRANSPORTERBEAM);
|
2021-11-19 11:32:12 +00:00
|
|
|
if (beam) S_PlayActorSound(TELEPORTER, beam);
|
2020-05-07 22:03:51 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else break;
|
|
|
|
|
2022-11-15 06:57:27 +00:00
|
|
|
if (onfloorz == 0 && fabs(act->spr.pos.Z - ps[p].posZget()) < 24)
|
2020-08-28 20:51:05 +00:00
|
|
|
if ((ps[p].jetpack_on == 0) || (ps[p].jetpack_on && PlayerInput(p, SB_JUMP)) ||
|
|
|
|
(ps[p].jetpack_on && PlayerInput(p, SB_CROUCH)))
|
2020-05-07 22:03:51 +00:00
|
|
|
{
|
2022-11-21 02:29:33 +00:00
|
|
|
ps[p].GetActor()->spr.pos.XY() += Owner->spr.pos.XY() - act->spr.pos.XY();
|
2022-11-21 02:14:14 +00:00
|
|
|
ps[p].GetActor()->backupvec2();
|
2020-05-07 22:03:51 +00:00
|
|
|
|
2020-08-28 20:51:05 +00:00
|
|
|
if (ps[p].jetpack_on && (PlayerInput(p, SB_JUMP) || ps[p].jetpack_on < 11))
|
2022-11-15 06:47:00 +00:00
|
|
|
ps[p].posZset(Owner->spr.pos.Z - 24);
|
|
|
|
else ps[p].posZset(Owner->spr.pos.Z + 24);
|
2022-11-21 02:15:13 +00:00
|
|
|
ps[p].GetActor()->backupz();
|
2020-05-07 22:03:51 +00:00
|
|
|
|
2021-11-26 20:52:01 +00:00
|
|
|
ChangeActorSect(act2, Owner->sector());
|
2021-11-21 07:45:07 +00:00
|
|
|
ps[p].setCursector(Owner->sector());
|
2020-05-07 22:03:51 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
k = 0;
|
|
|
|
|
|
|
|
if (isRRRA())
|
|
|
|
{
|
2022-11-15 06:57:27 +00:00
|
|
|
if (onfloorz && sectlotag == 160 && ps[p].posZget() > sectp->floorz - 48)
|
2020-05-07 22:03:51 +00:00
|
|
|
{
|
|
|
|
k = 2;
|
2022-11-15 06:47:00 +00:00
|
|
|
ps[p].posZset(Owner->sector()->ceilingz + 7);
|
2022-11-21 02:15:13 +00:00
|
|
|
ps[p].GetActor()->backupz();
|
2020-05-07 22:03:51 +00:00
|
|
|
}
|
|
|
|
|
2022-11-15 06:57:27 +00:00
|
|
|
if (onfloorz && sectlotag == 161 && ps[p].posZget() < sectp->ceilingz + 6)
|
2020-05-07 22:03:51 +00:00
|
|
|
{
|
|
|
|
k = 2;
|
2021-12-21 17:19:45 +00:00
|
|
|
if (ps[p].GetActor()->spr.extra <= 0) break;
|
2022-11-15 06:47:00 +00:00
|
|
|
ps[p].posZset(Owner->sector()->floorz - 49);
|
2022-11-21 02:15:13 +00:00
|
|
|
ps[p].GetActor()->backupz();
|
2020-05-07 22:03:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-11-15 06:57:27 +00:00
|
|
|
if ((onfloorz && sectlotag == ST_1_ABOVE_WATER && ps[p].posZget() > sectp->floorz - 6) ||
|
2020-05-07 22:03:51 +00:00
|
|
|
(onfloorz && sectlotag == ST_1_ABOVE_WATER && ps[p].OnMotorcycle))
|
|
|
|
{
|
|
|
|
if (ps[p].OnBoat) break;
|
|
|
|
k = 1;
|
|
|
|
if (screenpeek == p)
|
|
|
|
{
|
|
|
|
FX_StopAllSounds();
|
|
|
|
}
|
2020-10-22 19:42:02 +00:00
|
|
|
S_PlayActorSound(DUKE_UNDERWATER, ps[p].GetActor());
|
2022-11-15 06:47:00 +00:00
|
|
|
ps[p].posZset(Owner->sector()->ceilingz + 7);
|
2022-11-21 02:15:13 +00:00
|
|
|
ps[p].GetActor()->backupz();
|
2020-05-07 22:03:51 +00:00
|
|
|
if (ps[p].OnMotorcycle)
|
|
|
|
ps[p].moto_underwater = 1;
|
|
|
|
}
|
|
|
|
|
2022-11-15 06:57:27 +00:00
|
|
|
if (onfloorz && sectlotag == ST_2_UNDERWATER && ps[p].posZget() < sectp->ceilingz + 6)
|
2020-05-07 22:03:51 +00:00
|
|
|
{
|
|
|
|
k = 1;
|
2021-12-21 17:19:45 +00:00
|
|
|
if (ps[p].GetActor()->spr.extra <= 0) break;
|
2020-05-07 22:03:51 +00:00
|
|
|
if (screenpeek == p)
|
|
|
|
{
|
|
|
|
FX_StopAllSounds();
|
|
|
|
}
|
2020-10-22 19:42:02 +00:00
|
|
|
S_PlayActorSound(DUKE_GASP, ps[p].GetActor());
|
2020-05-07 22:03:51 +00:00
|
|
|
|
2022-11-15 06:47:00 +00:00
|
|
|
ps[p].posZset(Owner->sector()->floorz - 7);
|
2022-11-21 02:15:13 +00:00
|
|
|
ps[p].GetActor()->backupz();
|
2020-05-07 22:03:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (k == 1)
|
|
|
|
{
|
2022-11-21 02:29:33 +00:00
|
|
|
ps[p].GetActor()->spr.pos.XY() += Owner->spr.pos.XY() - act->spr.pos.XY();
|
2022-11-21 02:14:14 +00:00
|
|
|
ps[p].GetActor()->backupvec2();
|
2020-05-07 22:03:51 +00:00
|
|
|
|
2020-10-22 19:42:02 +00:00
|
|
|
if (Owner->GetOwner() != Owner)
|
2020-05-07 22:03:51 +00:00
|
|
|
ps[p].transporter_hold = -2;
|
2021-11-21 07:45:07 +00:00
|
|
|
ps[p].setCursector(Owner->sector());
|
2020-05-07 22:03:51 +00:00
|
|
|
|
2021-11-26 20:52:01 +00:00
|
|
|
ChangeActorSect(act2, Owner->sector());
|
2020-05-07 22:03:51 +00:00
|
|
|
|
|
|
|
if ((krand() & 255) < 32)
|
2020-10-22 19:42:02 +00:00
|
|
|
spawn(ps[p].GetActor(), WATERSPLASH2);
|
2020-05-07 22:03:51 +00:00
|
|
|
}
|
|
|
|
else if (isRRRA() && k == 2)
|
|
|
|
{
|
2022-11-21 02:29:33 +00:00
|
|
|
ps[p].GetActor()->spr.pos.XY() += Owner->spr.pos.XY() - act->spr.pos.XY();
|
2022-11-21 02:14:14 +00:00
|
|
|
ps[p].GetActor()->backupvec2();
|
2020-05-07 22:03:51 +00:00
|
|
|
|
2020-10-22 19:42:02 +00:00
|
|
|
if (Owner->GetOwner() != Owner)
|
2020-05-07 22:03:51 +00:00
|
|
|
ps[p].transporter_hold = -2;
|
2021-11-21 07:45:07 +00:00
|
|
|
ps[p].setCursector(Owner->sector());
|
2020-05-07 22:03:51 +00:00
|
|
|
|
2021-11-26 20:52:01 +00:00
|
|
|
ChangeActorSect(act2, Owner->sector());
|
2020-05-07 22:03:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case STAT_ACTOR:
|
2021-12-21 19:02:06 +00:00
|
|
|
if (act->spr.picnum == SHARK ||
|
|
|
|
(isRRRA() && (act->spr.picnum == CHEERBOAT || act->spr.picnum == HULKBOAT || act->spr.picnum == MINIONBOAT || act->spr.picnum == UFO1_RRRA)) ||
|
|
|
|
(!isRRRA() && (act->spr.picnum == UFO1_RR || act->spr.picnum == UFO2 || act->spr.picnum == UFO3 || act->spr.picnum == UFO4 || act->spr.picnum == UFO5))) continue;
|
2021-11-14 11:25:25 +00:00
|
|
|
[[fallthrough]];
|
2020-05-07 22:03:51 +00:00
|
|
|
case STAT_PROJECTILE:
|
|
|
|
case STAT_MISC:
|
|
|
|
case STAT_DUMMYPLAYER:
|
|
|
|
|
2022-09-03 08:03:30 +00:00
|
|
|
ll = abs(act2->vel.Z);
|
2020-05-07 22:03:51 +00:00
|
|
|
if (isRRRA())
|
|
|
|
{
|
2022-09-03 08:03:30 +00:00
|
|
|
if (act2->vel.Z >= 0)
|
2020-05-07 22:03:51 +00:00
|
|
|
warpdir = 2;
|
|
|
|
else
|
|
|
|
warpdir = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
warpspriteto = 0;
|
2022-08-20 16:46:45 +00:00
|
|
|
if (ll && sectlotag == ST_2_UNDERWATER && act2->spr.pos.Z < (sectp->ceilingz + ll))
|
2020-05-07 22:03:51 +00:00
|
|
|
warpspriteto = 1;
|
|
|
|
|
2022-08-20 16:46:45 +00:00
|
|
|
if (ll && sectlotag == ST_1_ABOVE_WATER && act2->spr.pos.Z > (sectp->floorz - ll))
|
2021-12-21 19:02:06 +00:00
|
|
|
if (!isRRRA() || (act2->spr.picnum != CHEERBOAT && act2->spr.picnum != HULKBOAT && act2->spr.picnum != MINIONBOAT))
|
2020-05-07 22:03:51 +00:00
|
|
|
warpspriteto = 1;
|
|
|
|
|
|
|
|
if (isRRRA())
|
|
|
|
{
|
2022-08-20 16:46:45 +00:00
|
|
|
if (ll && sectlotag == 161 && act2->spr.pos.Z < (sectp->ceilingz + ll) && warpdir == 1)
|
2020-05-07 22:03:51 +00:00
|
|
|
{
|
|
|
|
warpspriteto = 1;
|
2022-08-20 16:46:45 +00:00
|
|
|
ll2 = ll - abs(act2->spr.pos.Z - sectp->ceilingz);
|
2020-05-07 22:03:51 +00:00
|
|
|
}
|
2022-08-20 16:46:45 +00:00
|
|
|
else if (sectlotag == 161 && act2->spr.pos.Z < (sectp->ceilingz + 3.90625) && warpdir == 1)
|
2020-05-07 22:03:51 +00:00
|
|
|
{
|
|
|
|
warpspriteto = 1;
|
2022-08-20 16:46:45 +00:00
|
|
|
ll2 = zmaptoworld;
|
2020-05-07 22:03:51 +00:00
|
|
|
}
|
2022-08-20 16:46:45 +00:00
|
|
|
if (ll && sectlotag == 160 && act2->spr.pos.Z > (sectp->floorz - ll) && warpdir == 2)
|
2020-05-07 22:03:51 +00:00
|
|
|
{
|
|
|
|
warpspriteto = 1;
|
2022-08-20 16:46:45 +00:00
|
|
|
ll2 = ll - abs(sectp->floorz - act2->spr.pos.Z);
|
2020-05-07 22:03:51 +00:00
|
|
|
}
|
2022-08-20 16:46:45 +00:00
|
|
|
else if (sectlotag == 160 && act2->spr.pos.Z > (sectp->floorz - 3.90625) && warpdir == 2)
|
2020-05-07 22:03:51 +00:00
|
|
|
{
|
|
|
|
warpspriteto = 1;
|
2022-08-20 16:46:45 +00:00
|
|
|
ll2 = zmaptoworld;
|
2020-05-07 22:03:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-08-20 16:46:45 +00:00
|
|
|
if (sectlotag == 0 && (onfloorz || abs(act2->spr.pos.Z - act->spr.pos.Z) < 16))
|
2020-05-07 22:03:51 +00:00
|
|
|
{
|
2021-12-21 19:02:06 +00:00
|
|
|
if (Owner->GetOwner() != Owner && onfloorz && act->temp_data[0] > 0 && act2->spr.statnum != 5)
|
2020-05-07 22:03:51 +00:00
|
|
|
{
|
2020-11-01 13:56:23 +00:00
|
|
|
act->temp_data[0]++;
|
2020-05-08 22:34:48 +00:00
|
|
|
continue;
|
2020-05-07 22:03:51 +00:00
|
|
|
}
|
|
|
|
warpspriteto = 1;
|
|
|
|
}
|
|
|
|
|
2022-01-19 07:20:40 +00:00
|
|
|
if (warpspriteto)
|
2020-05-07 22:03:51 +00:00
|
|
|
{
|
2022-01-19 07:20:40 +00:00
|
|
|
if (actorflag(act2, SFLAG_NOTELEPORT)) continue;
|
|
|
|
switch (act2->spr.picnum)
|
2020-05-07 22:03:51 +00:00
|
|
|
{
|
2022-01-19 07:20:40 +00:00
|
|
|
case PLAYERONWATER:
|
|
|
|
if (sectlotag == ST_2_UNDERWATER)
|
|
|
|
{
|
|
|
|
act2->spr.cstat &= ~CSTAT_SPRITE_INVISIBLE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
[[fallthrough]];
|
|
|
|
default:
|
|
|
|
if (act2->spr.statnum == 5 && !(sectlotag == ST_1_ABOVE_WATER || sectlotag == ST_2_UNDERWATER || (isRRRA() && (sectlotag == 160 || sectlotag == 161))))
|
|
|
|
break;
|
|
|
|
[[fallthrough]];
|
2020-05-07 22:03:51 +00:00
|
|
|
|
2022-01-19 07:20:40 +00:00
|
|
|
case WATERBUBBLE:
|
|
|
|
if (rnd(192) && act2->spr.picnum == WATERBUBBLE)
|
|
|
|
break;
|
2020-05-07 22:03:51 +00:00
|
|
|
|
2022-01-19 07:20:40 +00:00
|
|
|
if (sectlotag > 0)
|
2020-05-07 22:03:51 +00:00
|
|
|
{
|
2022-01-19 07:20:40 +00:00
|
|
|
auto spawned = spawn(act2, WATERSPLASH2);
|
|
|
|
if (spawned && sectlotag == 1 && act2->spr.statnum == 4)
|
|
|
|
{
|
2022-09-13 17:55:54 +00:00
|
|
|
spawned->vel.X = act2->vel.X * 0.5;
|
2022-08-28 03:15:31 +00:00
|
|
|
spawned->spr.angle = act2->spr.angle;
|
2022-01-19 07:20:40 +00:00
|
|
|
ssp(spawned, CLIPMASK0);
|
|
|
|
}
|
2020-05-07 22:03:51 +00:00
|
|
|
}
|
|
|
|
|
2022-01-19 07:20:40 +00:00
|
|
|
switch (sectlotag)
|
2020-05-07 22:03:51 +00:00
|
|
|
{
|
2022-01-19 07:20:40 +00:00
|
|
|
case ST_0_NO_EFFECT:
|
|
|
|
if (onfloorz)
|
2020-05-07 22:03:51 +00:00
|
|
|
{
|
2022-01-19 07:20:40 +00:00
|
|
|
if (checkcursectnums(act->sector()) == -1 && checkcursectnums(Owner->sector()) == -1)
|
|
|
|
{
|
2022-08-20 16:46:45 +00:00
|
|
|
act2->spr.pos += (Owner->spr.pos - act->spr.pos.XY()).plusZ(-Owner->sector()->floorz);
|
2022-08-28 03:15:31 +00:00
|
|
|
act2->spr.angle = Owner->spr.angle;
|
2020-05-07 22:03:51 +00:00
|
|
|
|
2022-01-19 07:20:40 +00:00
|
|
|
act2->backupang();
|
2020-05-07 22:03:51 +00:00
|
|
|
|
2022-01-19 07:20:40 +00:00
|
|
|
auto beam = spawn(act, TRANSPORTERBEAM);
|
|
|
|
if (beam) S_PlayActorSound(TELEPORTER, beam);
|
2020-05-07 22:03:51 +00:00
|
|
|
|
2022-01-19 07:20:40 +00:00
|
|
|
beam = spawn(Owner, TRANSPORTERBEAM);
|
|
|
|
if (beam) S_PlayActorSound(TELEPORTER, beam);
|
2020-05-07 22:03:51 +00:00
|
|
|
|
2022-01-19 07:20:40 +00:00
|
|
|
if (Owner->GetOwner() != Owner)
|
|
|
|
{
|
|
|
|
act->temp_data[0] = 13;
|
|
|
|
Owner->temp_data[0] = 13;
|
|
|
|
}
|
|
|
|
|
|
|
|
ChangeActorSect(act2, Owner->sector());
|
2020-05-07 22:03:51 +00:00
|
|
|
}
|
2022-01-19 07:20:40 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-08-20 16:46:45 +00:00
|
|
|
act2->spr.pos.XY() += Owner->spr.pos.XY() - act->spr.pos.XY();
|
2022-02-04 08:50:40 +00:00
|
|
|
act2->spr.pos.Z = Owner->spr.pos.Z + 16;
|
2022-01-19 07:20:40 +00:00
|
|
|
act2->backupz();
|
2020-05-07 22:03:51 +00:00
|
|
|
|
2021-11-26 20:52:01 +00:00
|
|
|
ChangeActorSect(act2, Owner->sector());
|
2020-05-07 22:03:51 +00:00
|
|
|
}
|
2022-01-19 07:20:40 +00:00
|
|
|
break;
|
|
|
|
case ST_1_ABOVE_WATER:
|
2022-08-20 16:46:45 +00:00
|
|
|
act2->spr.pos.XY() += Owner->spr.pos.XY() - act->spr.pos.XY();
|
|
|
|
act2->spr.pos.Z = Owner->sector()->ceilingz + ll;
|
2021-12-30 16:10:08 +00:00
|
|
|
act2->backupz();
|
2020-05-07 22:03:51 +00:00
|
|
|
|
2021-11-26 20:52:01 +00:00
|
|
|
ChangeActorSect(act2, Owner->sector());
|
2020-05-07 22:03:51 +00:00
|
|
|
|
2022-01-19 07:20:40 +00:00
|
|
|
break;
|
|
|
|
case ST_2_UNDERWATER:
|
2022-08-20 16:46:45 +00:00
|
|
|
act2->spr.pos.XY() += Owner->spr.pos.XY() - act->spr.pos.XY();
|
|
|
|
act2->spr.pos.Z = Owner->sector()->ceilingz - ll;
|
2022-01-19 07:20:40 +00:00
|
|
|
act2->backupz();
|
2020-05-07 22:03:51 +00:00
|
|
|
|
2022-01-19 07:20:40 +00:00
|
|
|
ChangeActorSect(act2, Owner->sector());
|
2020-05-07 22:03:51 +00:00
|
|
|
|
2022-01-19 07:20:40 +00:00
|
|
|
break;
|
2020-05-07 22:03:51 +00:00
|
|
|
|
2022-01-19 07:20:40 +00:00
|
|
|
case 160:
|
|
|
|
if (!isRRRA()) break;
|
2022-08-20 16:46:45 +00:00
|
|
|
act2->spr.pos.XY() += Owner->spr.pos.XY() - act->spr.pos.XY();
|
|
|
|
act2->spr.pos.Z = Owner->sector()->ceilingz + ll2;
|
2022-01-19 07:20:40 +00:00
|
|
|
act2->backupz();
|
2020-05-07 22:03:51 +00:00
|
|
|
|
2022-01-19 07:20:40 +00:00
|
|
|
ChangeActorSect(act2, Owner->sector());
|
2020-05-07 22:03:51 +00:00
|
|
|
|
2022-09-03 16:41:25 +00:00
|
|
|
movesprite_ex(act2, DVector3(act2->spr.angle.ToVector() * act2->vel.X, 0), CLIPMASK1, coll);
|
2020-05-07 22:03:51 +00:00
|
|
|
|
2022-01-19 07:20:40 +00:00
|
|
|
break;
|
|
|
|
case 161:
|
|
|
|
if (!isRRRA()) break;
|
2022-08-20 16:46:45 +00:00
|
|
|
act2->spr.pos += Owner->spr.pos.XY() - act->spr.pos.XY();
|
|
|
|
act2->spr.pos.Z = Owner->sector()->floorz - ll;
|
2022-01-19 07:20:40 +00:00
|
|
|
act2->backupz();
|
2020-05-07 22:03:51 +00:00
|
|
|
|
2022-01-19 07:20:40 +00:00
|
|
|
ChangeActorSect(act2, Owner->sector());
|
2020-05-07 22:03:51 +00:00
|
|
|
|
2022-09-03 16:41:25 +00:00
|
|
|
movesprite_ex(act2, DVector3(act2->spr.angle.ToVector() * act2->vel.X, 0), CLIPMASK1, coll);
|
2020-05-07 22:03:51 +00:00
|
|
|
|
2022-01-19 07:20:40 +00:00
|
|
|
break;
|
|
|
|
}
|
2020-05-07 22:03:51 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-05-08 22:34:48 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void rrra_specialstats()
|
|
|
|
{
|
2020-10-22 20:21:40 +00:00
|
|
|
Collision coll;
|
|
|
|
DukeStatIterator it(117);
|
|
|
|
while (auto act = it.Next())
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
if (act->spr.hitag > 2)
|
|
|
|
act->spr.hitag = 0;
|
|
|
|
if ((act->spr.picnum == RRTILE8488 || act->spr.picnum == RRTILE8490) && act->spr.hitag != 2)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.hitag = 2;
|
|
|
|
act->spr.extra = -100;
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
2021-12-21 18:16:52 +00:00
|
|
|
if (act->spr.hitag == 0)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.extra++;
|
|
|
|
if (act->spr.extra >= 30)
|
|
|
|
act->spr.hitag = 1;
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
2021-12-21 18:16:52 +00:00
|
|
|
else if (act->spr.hitag == 1)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.extra--;
|
|
|
|
if (act->spr.extra <= -30)
|
|
|
|
act->spr.hitag = 0;
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
2021-12-21 18:16:52 +00:00
|
|
|
else if (act->spr.hitag == 2)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.extra--;
|
|
|
|
if (act->spr.extra <= -104)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
spawn(act, act->spr.lotag);
|
2022-11-20 18:25:23 +00:00
|
|
|
act->Destroy();
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
|
|
|
}
|
2022-09-13 18:02:15 +00:00
|
|
|
movesprite_ex(act, DVector3(0, 0, act->spr.extra / 128.), CLIPMASK0, coll);
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
|
|
|
|
2020-10-12 20:20:56 +00:00
|
|
|
it.Reset(118);
|
2020-10-22 20:21:40 +00:00
|
|
|
while (auto act = it.Next())
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
if (act->spr.hitag > 1)
|
|
|
|
act->spr.hitag = 0;
|
|
|
|
if (act->spr.hitag == 0)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.extra++;
|
|
|
|
if (act->spr.extra >= 20)
|
|
|
|
act->spr.hitag = 1;
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
2021-12-21 18:16:52 +00:00
|
|
|
else if (act->spr.hitag == 1)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.extra--;
|
|
|
|
if (act->spr.extra <= -20)
|
|
|
|
act->spr.hitag = 0;
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
2022-09-13 18:02:15 +00:00
|
|
|
movesprite_ex(act, DVector3(0, 0, act->spr.extra / 256.), CLIPMASK0, coll);
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
|
|
|
|
2020-05-14 07:07:07 +00:00
|
|
|
if (ps[screenpeek].MamaEnd > 0)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2020-05-14 07:07:07 +00:00
|
|
|
ps[screenpeek].MamaEnd--;
|
|
|
|
if (ps[screenpeek].MamaEnd == 0)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2020-09-03 21:10:28 +00:00
|
|
|
CompleteLevel(nullptr);
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (enemysizecheat > 0)
|
|
|
|
{
|
2021-12-24 09:53:27 +00:00
|
|
|
DukeSpriteIterator itr;
|
|
|
|
while (auto act = itr.Next())
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
switch (act->spr.picnum)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
|
|
|
//case 4049:
|
|
|
|
//case 4050:
|
|
|
|
case BILLYCOCK:
|
|
|
|
case BILLYRAY:
|
|
|
|
case BILLYRAYSTAYPUT:
|
|
|
|
case BRAYSNIPER:
|
|
|
|
case DOGRUN:
|
|
|
|
case LTH:
|
|
|
|
case HULKJUMP:
|
|
|
|
case HULK:
|
|
|
|
case HULKSTAYPUT:
|
|
|
|
case HEN:
|
|
|
|
case DRONE:
|
|
|
|
case PIG:
|
|
|
|
case MINION:
|
|
|
|
case MINIONSTAYPUT:
|
|
|
|
case UFO1_RRRA:
|
|
|
|
case UFO2:
|
|
|
|
case UFO3:
|
|
|
|
case UFO4:
|
|
|
|
case UFO5:
|
|
|
|
case COOT:
|
|
|
|
case COOTSTAYPUT:
|
|
|
|
case VIXEN:
|
|
|
|
case BIKERB:
|
|
|
|
case BIKERBV2:
|
|
|
|
case BIKER:
|
|
|
|
case MAKEOUT:
|
|
|
|
case CHEERB:
|
|
|
|
case CHEER:
|
|
|
|
case CHEERSTAYPUT:
|
|
|
|
case COOTPLAY:
|
|
|
|
case BILLYPLAY:
|
|
|
|
case MINIONBOAT:
|
|
|
|
case HULKBOAT:
|
|
|
|
case CHEERBOAT:
|
|
|
|
case RABBIT:
|
|
|
|
case MAMA:
|
|
|
|
if (enemysizecheat == 3)
|
|
|
|
{
|
2022-10-07 21:41:15 +00:00
|
|
|
act->spr.scale *= 2;
|
2022-09-09 16:16:29 +00:00
|
|
|
act->setClipDistFromTile();
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
|
|
|
else if (enemysizecheat == 2)
|
|
|
|
{
|
2022-10-07 21:41:15 +00:00
|
|
|
act->spr.scale *= 0.5;
|
2022-10-07 21:33:37 +00:00
|
|
|
act->clipdist = act->spr.scale.X, tileHeight(act->spr.picnum) * 0.125;
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2020-10-12 20:20:56 +00:00
|
|
|
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
|
|
|
enemysizecheat = 0;
|
|
|
|
}
|
|
|
|
|
2020-10-12 20:20:56 +00:00
|
|
|
it.Reset(121);
|
2020-10-22 20:21:40 +00:00
|
|
|
while (auto act = it.Next())
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.extra++;
|
|
|
|
if (act->spr.extra < 100)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
if (act->spr.extra == 90)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.picnum--;
|
|
|
|
if (act->spr.picnum < PIG + 7)
|
|
|
|
act->spr.picnum = PIG + 7;
|
|
|
|
act->spr.extra = 1;
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
2022-09-13 18:02:15 +00:00
|
|
|
movesprite_ex(act, DVector3(0, 0, -300/256.), CLIPMASK0, coll);
|
|
|
|
if (act->sector()->ceilingz+ 4 > act->spr.pos.Z)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.picnum = 0;
|
|
|
|
act->spr.extra = 100;
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
|
|
|
}
|
2021-12-21 18:16:52 +00:00
|
|
|
else if (act->spr.extra == 200)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2022-02-05 09:51:45 +00:00
|
|
|
// This was really 10 and not (10 << 8)!
|
|
|
|
SetActor(act, DVector3(act->spr.pos.X, act->spr.pos.Y, act->sector()->floorz - 10 * zmaptoworld));
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.extra = 1;
|
|
|
|
act->spr.picnum = PIG + 11;
|
2020-10-22 20:21:40 +00:00
|
|
|
spawn(act, TRANSPORTERSTAR);
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-11-20 10:58:19 +00:00
|
|
|
it.Reset(STAT_RABBITSPAWN);
|
2020-10-22 20:21:40 +00:00
|
|
|
while (auto act = it.Next())
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2022-11-20 10:58:19 +00:00
|
|
|
CallTick(act);
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
2020-10-12 20:20:56 +00:00
|
|
|
it.Reset(116);
|
2020-10-22 20:21:40 +00:00
|
|
|
while (auto act = it.Next())
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
if (act->spr.extra)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
if (act->spr.extra == act->spr.lotag)
|
2020-07-25 07:32:54 +00:00
|
|
|
S_PlaySound(183);
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.extra--;
|
2022-09-13 18:02:15 +00:00
|
|
|
int j = movesprite_ex(act, DVector3(act->spr.angle.ToVector() * act->spr.hitag / 16., act->spr.hitag / 128.), CLIPMASK0, coll);
|
2020-05-08 22:34:48 +00:00
|
|
|
if (j > 0)
|
|
|
|
{
|
2020-10-22 20:21:40 +00:00
|
|
|
S_PlayActorSound(PIPEBOMB_EXPLODE, act);
|
2022-11-20 18:25:23 +00:00
|
|
|
act->Destroy();
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
2021-12-21 18:16:52 +00:00
|
|
|
if (act->spr.extra == 0)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2020-07-25 07:32:54 +00:00
|
|
|
S_PlaySound(215);
|
2022-11-20 18:25:23 +00:00
|
|
|
act->Destroy();
|
2020-05-08 22:34:48 +00:00
|
|
|
earthquaketime = 32;
|
|
|
|
SetPlayerPal(&ps[myconnectindex], PalEntry(32, 32, 32, 48));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-12 20:20:56 +00:00
|
|
|
it.Reset(115);
|
2020-10-22 20:21:40 +00:00
|
|
|
while (auto act = it.Next())
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
if (act->spr.extra)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
if (act->spr.picnum != RRTILE8162)
|
|
|
|
act->spr.picnum = RRTILE8162;
|
|
|
|
act->spr.extra--;
|
|
|
|
if (act->spr.extra == 0)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
|
|
|
int rvar;
|
|
|
|
rvar = krand() & 127;
|
|
|
|
if (rvar < 96)
|
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.picnum = RRTILE8162 + 3;
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
|
|
|
else if (rvar < 112)
|
|
|
|
{
|
|
|
|
if (ps[screenpeek].SlotWin & 1)
|
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.picnum = RRTILE8162 + 3;
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.picnum = RRTILE8162 + 2;
|
2020-10-22 20:21:40 +00:00
|
|
|
spawn(act, BATTERYAMMO);
|
2020-05-08 22:34:48 +00:00
|
|
|
ps[screenpeek].SlotWin |= 1;
|
2020-10-22 20:21:40 +00:00
|
|
|
S_PlayActorSound(52, act);
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (rvar < 120)
|
|
|
|
{
|
|
|
|
if (ps[screenpeek].SlotWin & 2)
|
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.picnum = RRTILE8162 + 3;
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.picnum = RRTILE8162 + 6;
|
2022-10-17 16:22:38 +00:00
|
|
|
spawn(act, DYNAMITE);
|
2020-05-08 22:34:48 +00:00
|
|
|
ps[screenpeek].SlotWin |= 2;
|
2020-10-22 20:21:40 +00:00
|
|
|
S_PlayActorSound(52, act);
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (rvar < 126)
|
|
|
|
{
|
|
|
|
if (ps[screenpeek].SlotWin & 4)
|
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.picnum = RRTILE8162 + 3;
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.picnum = RRTILE8162 + 5;
|
2020-10-22 20:21:40 +00:00
|
|
|
spawn(act, SIXPAK);
|
2020-05-08 22:34:48 +00:00
|
|
|
ps[screenpeek].SlotWin |= 4;
|
2020-10-22 20:21:40 +00:00
|
|
|
S_PlayActorSound(52, act);
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (ps[screenpeek].SlotWin & 8)
|
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.picnum = RRTILE8162 + 3;
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.picnum = RRTILE8162 + 4;
|
2020-10-22 20:21:40 +00:00
|
|
|
spawn(act, ATOMICHEALTH);
|
2020-05-08 22:34:48 +00:00
|
|
|
ps[screenpeek].SlotWin |= 8;
|
2020-10-22 20:21:40 +00:00
|
|
|
S_PlayActorSound(52, act);
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-12 20:20:56 +00:00
|
|
|
it.Reset(122);
|
2020-10-22 20:21:40 +00:00
|
|
|
while (auto act = it.Next())
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
if (act->spr.extra)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
if (act->spr.picnum != RRTILE8589)
|
|
|
|
act->spr.picnum = RRTILE8589;
|
|
|
|
act->spr.extra--;
|
|
|
|
if (act->spr.extra == 0)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
|
|
|
int rvar;
|
|
|
|
rvar = krand() & 127;
|
|
|
|
if (rvar < 96)
|
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.picnum = RRTILE8589 + 4;
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
|
|
|
else if (rvar < 112)
|
|
|
|
{
|
|
|
|
if (ps[screenpeek].SlotWin & 1)
|
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.picnum = RRTILE8589 + 4;
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.picnum = RRTILE8589 + 5;
|
2020-10-22 20:21:40 +00:00
|
|
|
spawn(act, BATTERYAMMO);
|
2020-05-08 22:34:48 +00:00
|
|
|
ps[screenpeek].SlotWin |= 1;
|
2020-10-22 20:21:40 +00:00
|
|
|
S_PlayActorSound(342, act);
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (rvar < 120)
|
|
|
|
{
|
|
|
|
if (ps[screenpeek].SlotWin & 2)
|
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.picnum = RRTILE8589 + 4;
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.picnum = RRTILE8589 + 6;
|
2022-10-17 16:22:38 +00:00
|
|
|
spawn(act, DYNAMITE);
|
2020-05-08 22:34:48 +00:00
|
|
|
ps[screenpeek].SlotWin |= 2;
|
2020-10-22 20:21:40 +00:00
|
|
|
S_PlayActorSound(342, act);
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (rvar < 126)
|
|
|
|
{
|
|
|
|
if (ps[screenpeek].SlotWin & 4)
|
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.picnum = RRTILE8589 + 4;
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.picnum = RRTILE8589 + 2;
|
2020-10-22 20:21:40 +00:00
|
|
|
spawn(act, SIXPAK);
|
2020-05-08 22:34:48 +00:00
|
|
|
ps[screenpeek].SlotWin |= 4;
|
2020-10-22 20:21:40 +00:00
|
|
|
S_PlayActorSound(342, act);
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (ps[screenpeek].SlotWin & 8)
|
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.picnum = RRTILE8589 + 4;
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.picnum = RRTILE8589 + 3;
|
2020-10-22 20:21:40 +00:00
|
|
|
spawn(act, ATOMICHEALTH);
|
2020-05-08 22:34:48 +00:00
|
|
|
ps[screenpeek].SlotWin |= 8;
|
2020-10-22 20:21:40 +00:00
|
|
|
S_PlayActorSound(342, act);
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-12 20:20:56 +00:00
|
|
|
it.Reset(123);
|
2020-10-22 20:21:40 +00:00
|
|
|
while (auto act = it.Next())
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2021-12-21 17:19:45 +00:00
|
|
|
if (act->spr.lotag == 5)
|
2020-05-08 22:34:48 +00:00
|
|
|
if (!S_CheckSoundPlaying(330))
|
2020-10-22 20:21:40 +00:00
|
|
|
S_PlayActorSound(330, act);
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void rr_specialstats()
|
|
|
|
{
|
2022-11-20 20:16:24 +00:00
|
|
|
DukeStatIterator it(STAT_LUMBERMILL);
|
2020-10-22 20:24:55 +00:00
|
|
|
while (auto act = it.Next())
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
if (act->spr.hitag == 100)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2022-02-07 07:47:18 +00:00
|
|
|
act->spr.pos.Z += 4;
|
2022-08-20 18:11:01 +00:00
|
|
|
if (act->spr.pos.Z >= act->sector()->floorz + 59.25)
|
|
|
|
act->spr.pos.Z = act->sector()->floorz + 59.25;
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
|
|
|
|
2021-12-21 18:16:52 +00:00
|
|
|
if (act->spr.picnum == LUMBERBLADE)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.extra++;
|
|
|
|
if (act->spr.extra == 192)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.hitag = 0;
|
2022-08-20 18:11:01 +00:00
|
|
|
act->spr.pos.Z = act->sector()->floorz - 59.25;
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.extra = 0;
|
2022-11-20 20:16:24 +00:00
|
|
|
act->spr.picnum = LUMBERBLADE1;
|
2020-11-01 15:42:41 +00:00
|
|
|
DukeStatIterator it2(STAT_DEFAULT);
|
|
|
|
while (auto act2 = it2.Next())
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2022-11-20 20:39:56 +00:00
|
|
|
if (act2->spr.picnum == DIPSWITCH3 + 1)
|
2021-12-21 17:19:45 +00:00
|
|
|
if (act2->spr.hitag == 999)
|
2022-11-20 20:39:56 +00:00
|
|
|
act2->spr.picnum = DIPSWITCH3;
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (chickenplant)
|
|
|
|
{
|
2022-11-20 20:16:24 +00:00
|
|
|
it.Reset(STAT_CHICKENPLANT);
|
2020-10-22 20:24:55 +00:00
|
|
|
while (auto act = it.Next())
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
switch (act->spr.picnum)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2022-11-20 20:16:24 +00:00
|
|
|
case CHICKENASPAWN:
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.lotag--;
|
|
|
|
if (act->spr.lotag < 0)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2022-11-20 20:16:24 +00:00
|
|
|
spawn(act, CHICKENA)->spr.angle = act->spr.angle;
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.lotag = 128;
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
|
|
|
break;
|
2022-11-20 20:16:24 +00:00
|
|
|
case CHICKENCSPAWN:
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.lotag--;
|
|
|
|
if (act->spr.lotag < 0)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2022-11-20 20:16:24 +00:00
|
|
|
spawn(act, CHICKENC)->spr.angle = act->spr.angle;
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.lotag = 256;
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
|
|
|
break;
|
2022-11-20 20:16:24 +00:00
|
|
|
case FEATHERSPAWN:
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.lotag--;
|
|
|
|
if (act->spr.lotag < 0)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2020-10-22 20:24:55 +00:00
|
|
|
lotsoffeathers_r(act, (krand() & 3) + 4);
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.lotag = 84;
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
|
|
|
break;
|
2022-11-20 20:16:24 +00:00
|
|
|
case CHICKENHEADSPAWN:
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.lotag--;
|
|
|
|
if (act->spr.lotag < 0)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2022-11-20 20:16:24 +00:00
|
|
|
auto j = spawn(act, CHICKENHEAD);
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.lotag = 96;
|
2021-11-19 11:32:12 +00:00
|
|
|
if (j && !isRRRA()) S_PlayActorSound(472, j);
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
|
|
|
break;
|
2022-11-20 20:16:24 +00:00
|
|
|
case LOAFSPAWN:
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.lotag--;
|
|
|
|
if (act->spr.lotag < 0)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2022-11-20 20:16:24 +00:00
|
|
|
spawn(act, CHICKENLOAF)->spr.angle = act->spr.angle;
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.lotag = 448;
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
|
|
|
break;
|
2022-11-20 20:16:24 +00:00
|
|
|
case NUGGETSPAWN:
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.lotag--;
|
|
|
|
if (act->spr.lotag < 0)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2022-11-20 20:16:24 +00:00
|
|
|
spawn(act, CHICKENNUGGET)->spr.angle = act->spr.angle;
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.lotag = 64;
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
|
|
|
break;
|
2022-11-20 20:16:24 +00:00
|
|
|
case ROASTSPAWN:
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.lotag--;
|
|
|
|
if (act->spr.lotag < 0)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2022-11-20 20:16:24 +00:00
|
|
|
spawn(act, ROASTEDCHICKEN)->spr.angle = act->spr.angle;
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.lotag = 512;
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
|
|
|
break;
|
2022-11-20 20:16:24 +00:00
|
|
|
case BONELESSSPAWN:
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.lotag--;
|
|
|
|
if (act->spr.lotag < 0)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2022-11-20 20:16:24 +00:00
|
|
|
spawn(act, BONELESSCHICKEN)->spr.angle = act->spr.angle;
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.lotag = 224;
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
|
|
|
break;
|
2022-11-20 20:16:24 +00:00
|
|
|
case JIBSSPAWN:
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.lotag--;
|
|
|
|
if (act->spr.lotag < 0)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2020-10-22 20:24:55 +00:00
|
|
|
fi.guts(act, JIBS1, 1, myconnectindex);
|
|
|
|
fi.guts(act, JIBS2, 1, myconnectindex);
|
|
|
|
fi.guts(act, JIBS3, 1, myconnectindex);
|
|
|
|
fi.guts(act, JIBS4, 1, myconnectindex);
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.lotag = 256;
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-14 20:18:10 +00:00
|
|
|
it.Reset(STAT_BOWLING);
|
2020-10-22 20:24:55 +00:00
|
|
|
while (auto act = it.Next())
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
if (act->spr.picnum == BOWLINGPINSPOT)
|
|
|
|
if (act->spr.lotag == 100)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2021-12-30 15:51:56 +00:00
|
|
|
auto pst = pinsectorresetup(act->sector());
|
2020-05-08 22:34:48 +00:00
|
|
|
if (pst)
|
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.lotag = 0;
|
|
|
|
if (act->spr.extra == 1)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2021-12-30 15:51:56 +00:00
|
|
|
pst = checkpins(act->sector());
|
2020-05-08 22:34:48 +00:00
|
|
|
if (!pst)
|
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.extra = 2;
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
|
|
|
}
|
2021-12-21 18:16:52 +00:00
|
|
|
if (act->spr.extra == 2)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2021-12-21 18:16:52 +00:00
|
|
|
act->spr.extra = 0;
|
2021-12-30 15:51:56 +00:00
|
|
|
resetpins(act->sector());
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-11-20 20:39:56 +00:00
|
|
|
it.Reset(STAT_TELEPORT);
|
2020-10-22 20:24:55 +00:00
|
|
|
while (auto act = it.Next())
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2022-11-20 20:39:56 +00:00
|
|
|
if (act->spr.picnum == RRTELEPORT)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2022-09-14 20:49:01 +00:00
|
|
|
double xx;
|
|
|
|
int p = findplayer(act, &xx);
|
|
|
|
if (xx < 128)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2022-11-20 20:39:56 +00:00
|
|
|
DukeStatIterator it2(STAT_TELEPORT);
|
2020-11-01 15:42:41 +00:00
|
|
|
while (auto act2 = it2.Next())
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2022-11-20 20:39:56 +00:00
|
|
|
if (act2->spr.picnum == RRTELEPORTDEST)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2022-08-28 03:15:31 +00:00
|
|
|
ps[p].angle.ang = act2->spr.angle;
|
2022-11-15 07:22:52 +00:00
|
|
|
ps[p].posSet(act2->spr.pos.plusZ(-36));
|
2022-11-15 08:27:07 +00:00
|
|
|
ps[p].GetActor()->backuppos();
|
2022-02-05 09:51:45 +00:00
|
|
|
ps[p].setbobpos();
|
2020-10-22 20:24:55 +00:00
|
|
|
auto pact = ps[p].GetActor();
|
2021-11-26 20:52:01 +00:00
|
|
|
ChangeActorSect(pact, act2->sector());
|
2021-11-21 07:45:07 +00:00
|
|
|
ps[p].setCursector(pact->sector());
|
2020-10-22 20:24:55 +00:00
|
|
|
S_PlayActorSound(70, act2);
|
2022-11-20 18:25:23 +00:00
|
|
|
act2->Destroy();
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2020-10-22 20:18:47 +00:00
|
|
|
static void heavyhbomb(DDukeActor *actor)
|
2020-05-09 09:44:50 +00:00
|
|
|
{
|
2021-12-30 15:51:56 +00:00
|
|
|
auto sectp = actor->sector();
|
2022-09-14 20:49:01 +00:00
|
|
|
int l;
|
|
|
|
double xx;
|
2020-10-22 20:18:47 +00:00
|
|
|
auto Owner = actor->GetOwner();
|
2020-05-09 09:44:50 +00:00
|
|
|
|
2021-12-21 19:02:06 +00:00
|
|
|
if ((actor->spr.cstat & CSTAT_SPRITE_INVISIBLE))
|
2020-05-09 09:44:50 +00:00
|
|
|
{
|
2021-12-23 15:20:32 +00:00
|
|
|
actor->temp_data[2]--;
|
|
|
|
if (actor->temp_data[2] <= 0)
|
2020-05-09 09:44:50 +00:00
|
|
|
{
|
2020-10-22 20:18:47 +00:00
|
|
|
S_PlayActorSound(TELEPORTER, actor);
|
|
|
|
spawn(actor, TRANSPORTERSTAR);
|
2021-12-21 19:02:06 +00:00
|
|
|
actor->spr.cstat = CSTAT_SPRITE_BLOCK_ALL;
|
2020-05-09 09:44:50 +00:00
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2022-09-14 20:49:01 +00:00
|
|
|
int p = findplayer(actor, &xx);
|
2020-05-09 09:44:50 +00:00
|
|
|
|
2022-09-14 20:49:01 +00:00
|
|
|
if (xx < 1220 / 16.) actor->spr.cstat &= ~CSTAT_SPRITE_BLOCK_ALL;
|
2021-12-21 19:02:06 +00:00
|
|
|
else actor->spr.cstat |= CSTAT_SPRITE_BLOCK_ALL;
|
2020-05-09 09:44:50 +00:00
|
|
|
|
2021-12-23 15:20:32 +00:00
|
|
|
if (actor->temp_data[3] == 0)
|
2020-05-09 09:44:50 +00:00
|
|
|
{
|
2020-10-22 20:18:47 +00:00
|
|
|
int j = fi.ifhitbyweapon(actor);
|
2020-05-09 09:44:50 +00:00
|
|
|
if (j >= 0)
|
|
|
|
{
|
2021-12-23 15:20:32 +00:00
|
|
|
actor->temp_data[3] = 1;
|
|
|
|
actor->temp_data[4] = 0;
|
2020-05-09 09:44:50 +00:00
|
|
|
l = 0;
|
2022-09-03 08:02:25 +00:00
|
|
|
actor->vel.X = 0;
|
2020-05-09 09:44:50 +00:00
|
|
|
goto DETONATEB;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-22 20:18:47 +00:00
|
|
|
makeitfall(actor);
|
2020-05-09 09:44:50 +00:00
|
|
|
|
2022-09-01 16:15:52 +00:00
|
|
|
if (sectp->lotag != 1 && (!isRRRA() || sectp->lotag != 160) && actor->spr.pos.Z >= actor->floorz - FOURSLEIGHT_F && actor->spr.yint < 3)
|
2020-05-09 09:44:50 +00:00
|
|
|
{
|
2022-09-01 16:15:52 +00:00
|
|
|
if (actor->spr.yint > 0 || (actor->spr.yint == 0 && actor->floorz == sectp->floorz))
|
2020-05-09 09:44:50 +00:00
|
|
|
{
|
2021-12-21 19:02:06 +00:00
|
|
|
if (actor->spr.picnum != CHEERBOMB)
|
2020-10-22 20:18:47 +00:00
|
|
|
S_PlayActorSound(PIPEBOMB_BOUNCE, actor);
|
2020-05-09 09:44:50 +00:00
|
|
|
else
|
|
|
|
{
|
2021-12-23 15:20:32 +00:00
|
|
|
actor->temp_data[3] = 1;
|
|
|
|
actor->temp_data[4] = 1;
|
2020-05-09 09:44:50 +00:00
|
|
|
l = 0;
|
|
|
|
goto DETONATEB;
|
|
|
|
}
|
|
|
|
}
|
2022-09-14 17:49:38 +00:00
|
|
|
actor->vel.Z = -(4 - actor->spr.yint);
|
2021-12-30 15:51:56 +00:00
|
|
|
if (actor->sector()->lotag == 2)
|
2022-09-03 08:04:16 +00:00
|
|
|
actor->vel.Z *= 0.25;
|
2022-09-01 16:15:52 +00:00
|
|
|
actor->spr.yint++;
|
2020-05-09 09:44:50 +00:00
|
|
|
}
|
2022-02-03 23:55:12 +00:00
|
|
|
if (actor->spr.picnum != CHEERBOMB && actor->spr.pos.Z < actor->ceilingz + 16 && sectp->lotag != 2)
|
2020-05-09 09:44:50 +00:00
|
|
|
{
|
2022-02-03 23:55:12 +00:00
|
|
|
actor->spr.pos.Z = actor->ceilingz + 16;
|
2022-09-03 08:02:25 +00:00
|
|
|
actor->vel.Z = 0;
|
2020-05-09 09:44:50 +00:00
|
|
|
}
|
|
|
|
|
2020-10-22 20:18:47 +00:00
|
|
|
Collision coll;
|
2022-09-13 18:02:15 +00:00
|
|
|
movesprite_ex(actor, DVector3(actor->spr.angle.ToVector() * actor->vel.X, actor->vel.Z), CLIPMASK0, coll);
|
2020-05-09 09:44:50 +00:00
|
|
|
|
2022-09-03 08:03:30 +00:00
|
|
|
if (actor->sector()->lotag == 1 && actor->vel.Z == 0)
|
2020-05-09 09:44:50 +00:00
|
|
|
{
|
2022-02-03 23:55:12 +00:00
|
|
|
actor->spr.pos.Z += 32;
|
2021-12-23 15:20:32 +00:00
|
|
|
if (actor->temp_data[5] == 0)
|
2020-05-09 09:44:50 +00:00
|
|
|
{
|
2021-12-23 15:20:32 +00:00
|
|
|
actor->temp_data[5] = 1;
|
2020-10-22 20:18:47 +00:00
|
|
|
spawn(actor, WATERSPLASH2);
|
2021-12-21 19:02:06 +00:00
|
|
|
if (isRRRA() && actor->spr.picnum == MORTER)
|
2022-09-03 08:02:25 +00:00
|
|
|
actor->vel.X = 0;
|
2020-05-09 09:44:50 +00:00
|
|
|
}
|
|
|
|
}
|
2021-12-23 15:20:32 +00:00
|
|
|
else actor->temp_data[5] = 0;
|
2020-05-09 09:44:50 +00:00
|
|
|
|
2022-09-14 20:49:01 +00:00
|
|
|
if (actor->temp_data[3] == 0 && actor->spr.picnum == MORTER && (coll.type || xx < 844 / 16.))
|
2020-05-09 09:44:50 +00:00
|
|
|
{
|
2021-12-23 15:20:32 +00:00
|
|
|
actor->temp_data[3] = 1;
|
|
|
|
actor->temp_data[4] = 0;
|
2020-05-09 09:44:50 +00:00
|
|
|
l = 0;
|
2022-09-03 08:02:25 +00:00
|
|
|
actor->vel.X = 0;
|
2020-05-09 09:44:50 +00:00
|
|
|
goto DETONATEB;
|
|
|
|
}
|
|
|
|
|
2022-09-14 20:49:01 +00:00
|
|
|
if (actor->temp_data[3] == 0 && actor->spr.picnum == CHEERBOMB && (coll.type || xx < 844 / 16.))
|
2020-05-09 09:44:50 +00:00
|
|
|
{
|
2021-12-23 15:20:32 +00:00
|
|
|
actor->temp_data[3] = 1;
|
|
|
|
actor->temp_data[4] = 0;
|
2020-05-09 09:44:50 +00:00
|
|
|
l = 0;
|
2022-09-03 08:02:25 +00:00
|
|
|
actor->vel.X = 0;
|
2020-05-09 09:44:50 +00:00
|
|
|
goto DETONATEB;
|
|
|
|
}
|
|
|
|
|
2021-12-21 17:19:45 +00:00
|
|
|
if (Owner && Owner->spr.picnum == APLAYER)
|
2020-10-22 20:18:47 +00:00
|
|
|
l = Owner->PlayerIndex();
|
2020-05-09 09:44:50 +00:00
|
|
|
else l = -1;
|
|
|
|
|
2022-09-03 08:03:30 +00:00
|
|
|
if(actor->vel.X > 0)
|
2020-05-09 09:44:50 +00:00
|
|
|
{
|
2022-09-11 17:28:45 +00:00
|
|
|
actor->vel.X -= 5. / 16;
|
2021-11-06 23:09:37 +00:00
|
|
|
if (sectp->lotag == 2)
|
2022-09-11 17:28:45 +00:00
|
|
|
actor->vel.X -= 10. / 16;
|
2020-05-09 09:44:50 +00:00
|
|
|
|
2022-09-03 08:03:30 +00:00
|
|
|
if(actor->vel.X < 0)
|
2022-09-03 08:02:25 +00:00
|
|
|
actor->vel.X = 0;
|
2022-09-03 08:03:30 +00:00
|
|
|
if (int(actor->vel.X * 16) & 8) actor->spr.cstat ^= CSTAT_SPRITE_XFLIP;
|
2020-05-09 09:44:50 +00:00
|
|
|
}
|
|
|
|
|
2020-10-22 20:18:47 +00:00
|
|
|
if (coll.type == kHitWall)
|
2020-05-09 09:44:50 +00:00
|
|
|
{
|
2021-11-26 12:41:15 +00:00
|
|
|
auto wal = coll.hitWall;
|
2022-08-23 20:39:07 +00:00
|
|
|
fi.checkhitwall(actor, wal, actor->spr.pos, actor->spr.picnum);
|
2020-05-09 09:44:50 +00:00
|
|
|
|
2021-12-21 19:02:06 +00:00
|
|
|
if (actor->spr.picnum == CHEERBOMB)
|
2020-05-09 09:44:50 +00:00
|
|
|
{
|
2021-12-23 15:20:32 +00:00
|
|
|
actor->temp_data[3] = 1;
|
|
|
|
actor->temp_data[4] = 0;
|
2020-05-09 09:44:50 +00:00
|
|
|
l = 0;
|
2022-09-03 08:02:25 +00:00
|
|
|
actor->vel.X = 0;
|
2020-05-09 09:44:50 +00:00
|
|
|
goto DETONATEB;
|
|
|
|
}
|
2022-09-30 11:39:39 +00:00
|
|
|
DAngle k = wal->delta().Angle();
|
2022-09-14 20:57:42 +00:00
|
|
|
actor->spr.angle = k * 2 - actor->spr.angle;
|
2022-09-03 08:04:16 +00:00
|
|
|
actor->vel.X *= 0.5;
|
2020-05-09 09:44:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
DETONATEB:
|
|
|
|
|
2021-12-23 15:20:32 +00:00
|
|
|
if ((l >= 0 && ps[l].hbomb_on == 0) || actor->temp_data[3] == 1)
|
2020-05-09 09:44:50 +00:00
|
|
|
{
|
2021-12-23 15:20:32 +00:00
|
|
|
actor->temp_data[4]++;
|
2020-05-09 09:44:50 +00:00
|
|
|
|
2021-12-23 15:20:32 +00:00
|
|
|
if (actor->temp_data[4] == 2)
|
2020-05-09 09:44:50 +00:00
|
|
|
{
|
2022-09-14 20:49:01 +00:00
|
|
|
int x = actor->spr.extra;
|
2020-05-09 09:44:50 +00:00
|
|
|
int m = 0;
|
2021-12-21 19:02:06 +00:00
|
|
|
switch (actor->spr.picnum)
|
2020-05-09 09:44:50 +00:00
|
|
|
{
|
2022-01-19 09:48:18 +00:00
|
|
|
case POWDERKEG: m = gs.tripbombblastradius; break; // powder keg
|
2022-10-17 16:22:38 +00:00
|
|
|
case DYNAMITE: m = gs.pipebombblastradius; break;
|
2020-11-29 12:54:58 +00:00
|
|
|
case HBOMBAMMO: m = gs.pipebombblastradius; break;
|
|
|
|
case MORTER: m = gs.morterblastradius; break;
|
|
|
|
case CHEERBOMB: m = gs.morterblastradius; break;
|
2020-05-09 09:44:50 +00:00
|
|
|
}
|
|
|
|
|
2021-12-30 15:51:56 +00:00
|
|
|
if (actor->sector()->lotag != 800)
|
2020-05-09 09:44:50 +00:00
|
|
|
{
|
2020-10-22 20:18:47 +00:00
|
|
|
fi.hitradius(actor, m, x >> 2, x >> 1, x - (x >> 2), x);
|
|
|
|
spawn(actor, EXPLOSION2);
|
2021-12-21 19:02:06 +00:00
|
|
|
if (actor->spr.picnum == CHEERBOMB)
|
2020-10-22 20:18:47 +00:00
|
|
|
spawn(actor, BURNING);
|
|
|
|
S_PlayActorSound(PIPEBOMB_EXPLODE, actor);
|
2020-05-09 09:44:50 +00:00
|
|
|
for (x = 0; x < 8; x++)
|
2020-10-22 20:18:47 +00:00
|
|
|
RANDOMSCRAP(actor);
|
2020-05-09 09:44:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-07 21:33:37 +00:00
|
|
|
if (actor->spr.scale.Y)
|
2020-05-09 09:44:50 +00:00
|
|
|
{
|
2022-10-07 21:46:28 +00:00
|
|
|
actor->spr.scale.Y = (0);
|
2020-05-09 09:44:50 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-12-23 15:20:32 +00:00
|
|
|
if (actor->temp_data[4] > 20)
|
2020-05-09 09:44:50 +00:00
|
|
|
{
|
2022-11-20 18:25:23 +00:00
|
|
|
actor->Destroy();
|
2020-05-09 09:44:50 +00:00
|
|
|
return;
|
|
|
|
}
|
2021-12-21 19:02:06 +00:00
|
|
|
if (actor->spr.picnum == CHEERBOMB)
|
2020-05-09 09:44:50 +00:00
|
|
|
{
|
2020-10-22 20:18:47 +00:00
|
|
|
spawn(actor, BURNING);
|
2022-11-20 18:25:23 +00:00
|
|
|
actor->Destroy();
|
2020-05-09 09:44:50 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
2022-10-17 16:22:38 +00:00
|
|
|
else if (actor->spr.picnum == DYNAMITE && xx < 788 / 16. && actor->temp_data[0] > 7 && actor->vel.X == 0)
|
2022-11-15 07:23:11 +00:00
|
|
|
if (cansee(actor->spr.pos.plusZ(-8), actor->sector(), ps[p].posGet(), ps[p].cursector))
|
2020-11-29 12:54:58 +00:00
|
|
|
if (ps[p].ammo_amount[DYNAMITE_WEAPON] < gs.max_ammo_amount[DYNAMITE_WEAPON])
|
2021-12-21 19:02:06 +00:00
|
|
|
if (actor->spr.pal == 0)
|
2020-05-09 09:44:50 +00:00
|
|
|
{
|
|
|
|
if (ud.coop >= 1)
|
|
|
|
{
|
2020-10-22 20:18:47 +00:00
|
|
|
for (int j = 0; j < ps[p].weapreccnt; j++)
|
2021-12-21 19:02:06 +00:00
|
|
|
if (ps[p].weaprecs[j] == actor->spr.picnum)
|
2020-05-09 09:44:50 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
if (ps[p].weapreccnt < 255)
|
2021-12-21 19:02:06 +00:00
|
|
|
ps[p].weaprecs[ps[p].weapreccnt++] = actor->spr.picnum;
|
2020-05-09 09:44:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
addammo(DYNAMITE_WEAPON, &ps[p], 1);
|
|
|
|
addammo(CROSSBOW_WEAPON, &ps[p], 1);
|
2020-10-22 20:18:47 +00:00
|
|
|
S_PlayActorSound(DUKE_GET, ps[p].GetActor());
|
2020-05-09 09:44:50 +00:00
|
|
|
|
2020-10-22 20:18:47 +00:00
|
|
|
if (ps[p].gotweapon[DYNAMITE_WEAPON] == 0 || Owner == ps[p].GetActor())
|
2022-11-12 08:33:33 +00:00
|
|
|
fi.addweapon(&ps[p], DYNAMITE_WEAPON, true);
|
2020-05-09 09:44:50 +00:00
|
|
|
|
2021-12-21 17:19:45 +00:00
|
|
|
if (!Owner || Owner->spr.picnum != APLAYER)
|
2020-05-09 09:44:50 +00:00
|
|
|
{
|
|
|
|
SetPlayerPal(&ps[p], PalEntry(32, 0, 32, 0));
|
|
|
|
}
|
|
|
|
|
2022-10-17 16:22:38 +00:00
|
|
|
if (Owner && (Owner->attackertype != DYNAMITE || ud.respawn_items == 0 || Owner->spr.picnum == APLAYER))
|
2020-05-09 09:44:50 +00:00
|
|
|
{
|
2022-10-17 16:22:38 +00:00
|
|
|
if (actor->spr.picnum == DYNAMITE && Owner->spr.picnum != APLAYER && ud.coop)
|
2020-05-09 09:44:50 +00:00
|
|
|
return;
|
2022-11-20 18:25:23 +00:00
|
|
|
actor->Destroy();
|
2020-05-09 09:44:50 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-12-23 15:20:32 +00:00
|
|
|
actor->temp_data[2] = gs.respawnitemtime;
|
2020-10-22 20:18:47 +00:00
|
|
|
spawn(actor, RESPAWNMARKERRED);
|
2021-12-21 19:02:06 +00:00
|
|
|
actor->spr.cstat = CSTAT_SPRITE_INVISIBLE;
|
2020-05-09 09:44:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-12-23 15:20:32 +00:00
|
|
|
if (actor->temp_data[0] < 8) actor->temp_data[0]++;
|
2020-05-09 09:44:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2020-10-22 20:31:10 +00:00
|
|
|
static int henstand(DDukeActor *actor)
|
2020-05-09 09:44:50 +00:00
|
|
|
{
|
2021-12-21 19:02:06 +00:00
|
|
|
if (actor->spr.picnum == HENSTAND || actor->spr.picnum == HENSTAND + 1)
|
2020-05-09 09:44:50 +00:00
|
|
|
{
|
2021-12-21 19:02:06 +00:00
|
|
|
actor->spr.lotag--;
|
|
|
|
if (actor->spr.lotag == 0)
|
2020-05-09 09:44:50 +00:00
|
|
|
{
|
2020-10-22 20:31:10 +00:00
|
|
|
spawn(actor, HEN);
|
2022-12-02 11:46:11 +00:00
|
|
|
actor->spr.scale.Zero();
|
|
|
|
ChangeActorStat(actor, STAT_MISC);
|
2020-05-09 09:44:50 +00:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
2021-12-30 15:51:56 +00:00
|
|
|
if (actor->sector()->lotag == 900)
|
2022-09-03 08:02:25 +00:00
|
|
|
actor->vel.X = 0;
|
2022-09-03 08:03:30 +00:00
|
|
|
if(actor->vel.X != 0)
|
2020-05-09 09:44:50 +00:00
|
|
|
{
|
2020-10-22 20:31:10 +00:00
|
|
|
makeitfall(actor);
|
|
|
|
Collision coll;
|
2022-09-13 18:02:15 +00:00
|
|
|
movesprite_ex(actor, DVector3(actor->spr.angle.ToVector() * actor->vel.X, actor->vel.Z), CLIPMASK0, coll);
|
2020-10-22 20:31:10 +00:00
|
|
|
if (coll.type)
|
2020-05-09 09:44:50 +00:00
|
|
|
{
|
2020-10-22 20:31:10 +00:00
|
|
|
if (coll.type == kHitWall)
|
2020-05-09 09:44:50 +00:00
|
|
|
{
|
2022-09-30 11:39:39 +00:00
|
|
|
DAngle k = coll.hitWall->delta().Angle();
|
2022-09-14 20:57:42 +00:00
|
|
|
actor->spr.angle = k * 2 - actor->spr.angle;
|
2020-05-09 09:44:50 +00:00
|
|
|
}
|
2020-10-22 20:31:10 +00:00
|
|
|
else if (coll.type == kHitSprite)
|
2020-05-09 09:44:50 +00:00
|
|
|
{
|
2021-11-26 12:41:15 +00:00
|
|
|
auto hitact = coll.actor();
|
2020-10-24 05:15:10 +00:00
|
|
|
fi.checkhitsprite(actor, hitact);
|
2021-12-21 17:19:45 +00:00
|
|
|
if (hitact->spr.picnum == HEN)
|
2020-05-09 09:44:50 +00:00
|
|
|
{
|
2020-10-22 20:31:10 +00:00
|
|
|
auto ns = spawn(hitact, HENSTAND);
|
2022-12-02 11:46:11 +00:00
|
|
|
hitact->spr.scale.Zero();
|
|
|
|
ChangeActorStat(hitact, STAT_MISC);
|
2021-11-19 11:32:12 +00:00
|
|
|
if (ns)
|
|
|
|
{
|
2022-09-03 08:05:20 +00:00
|
|
|
ns->vel.X = 2;
|
2021-12-21 17:19:45 +00:00
|
|
|
ns->spr.lotag = 40;
|
2022-08-28 03:15:31 +00:00
|
|
|
ns->spr.angle = actor->spr.angle;
|
2021-11-19 11:32:12 +00:00
|
|
|
}
|
2020-05-09 09:44:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-09-11 17:28:45 +00:00
|
|
|
actor->vel.X -= 1/16.;
|
2022-09-03 08:03:30 +00:00
|
|
|
if(actor->vel.X < 0) actor->vel.X = 0;
|
2021-12-21 19:02:06 +00:00
|
|
|
actor->spr.cstat = CSTAT_SPRITE_BLOCK_ALL;
|
|
|
|
if (actor->spr.picnum == BOWLINGPIN)
|
2020-05-09 09:44:50 +00:00
|
|
|
{
|
2022-09-03 08:03:30 +00:00
|
|
|
actor->spr.cstat |= CSTAT_SPRITE_XFLIP & ESpriteFlags::FromInt(int(actor->vel.X * 16));
|
|
|
|
actor->spr.cstat |= CSTAT_SPRITE_YFLIP & ESpriteFlags::FromInt(int(actor->vel.X * 16));
|
2020-05-09 09:44:50 +00:00
|
|
|
if (krand() & 1)
|
2021-12-21 19:02:06 +00:00
|
|
|
actor->spr.picnum = BOWLINGPIN + 1;
|
2020-05-09 09:44:50 +00:00
|
|
|
}
|
2021-12-21 19:02:06 +00:00
|
|
|
else if (actor->spr.picnum == HENSTAND)
|
2020-05-09 09:44:50 +00:00
|
|
|
{
|
2022-09-03 08:03:30 +00:00
|
|
|
actor->spr.cstat |= CSTAT_SPRITE_XFLIP & ESpriteFlags::FromInt(int(actor->vel.X * 16));
|
|
|
|
actor->spr.cstat |= CSTAT_SPRITE_YFLIP & ESpriteFlags::FromInt(int(actor->vel.X * 16));
|
2020-05-09 09:44:50 +00:00
|
|
|
if (krand() & 1)
|
2021-12-21 19:02:06 +00:00
|
|
|
actor->spr.picnum = HENSTAND + 1;
|
2022-09-14 17:29:29 +00:00
|
|
|
if (actor->vel.X == 0)
|
2022-11-20 18:25:23 +00:00
|
|
|
return 2;//actor->Destroy(); still needs to run a script but should not do on a deleted object
|
2020-05-09 09:44:50 +00:00
|
|
|
}
|
2022-09-14 17:29:29 +00:00
|
|
|
if (actor->spr.picnum == BOWLINGPIN || (actor->spr.picnum == BOWLINGPIN + 1 && actor->vel.X == 0))
|
2020-05-09 09:44:50 +00:00
|
|
|
{
|
2022-11-20 18:25:23 +00:00
|
|
|
return 2;//actor->Destroy(); still needs to run a script but should not do on a deleted object
|
2020-05-09 09:44:50 +00:00
|
|
|
}
|
|
|
|
}
|
2021-12-30 15:51:56 +00:00
|
|
|
else if (actor->sector()->lotag == 900)
|
2020-05-09 09:44:50 +00:00
|
|
|
{
|
2021-12-21 19:02:06 +00:00
|
|
|
if (actor->spr.picnum == BOWLINGBALL)
|
2020-10-22 20:31:10 +00:00
|
|
|
ballreturn(actor);
|
2022-11-20 18:25:23 +00:00
|
|
|
actor->Destroy();
|
2020-05-09 09:44:50 +00:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
2020-05-09 18:27:06 +00:00
|
|
|
|
2020-05-09 09:44:50 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2020-05-08 22:34:48 +00:00
|
|
|
void moveactors_r(void)
|
|
|
|
{
|
2022-09-14 20:49:01 +00:00
|
|
|
double xx;
|
2020-10-22 20:48:51 +00:00
|
|
|
int p;
|
|
|
|
Collision coll;
|
2021-12-30 09:30:21 +00:00
|
|
|
|
2020-05-12 11:43:24 +00:00
|
|
|
dojaildoor();
|
|
|
|
moveminecart();
|
2020-05-08 22:34:48 +00:00
|
|
|
|
|
|
|
if (isRRRA())
|
|
|
|
{
|
|
|
|
rrra_specialstats();
|
|
|
|
}
|
|
|
|
rr_specialstats();
|
|
|
|
|
2020-10-22 20:48:51 +00:00
|
|
|
DukeStatIterator it(STAT_ACTOR);
|
|
|
|
while (auto act = it.Next())
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2020-05-09 09:44:50 +00:00
|
|
|
bool deleteafterexecute = false; // taking a cue here from RedNukem to not run scripts on deleted sprites.
|
2020-05-08 22:34:48 +00:00
|
|
|
|
2022-11-20 18:25:23 +00:00
|
|
|
if( act->spr.scale.X == 0 || !act->insector() || actorflag(act, SFLAG2_DIENOW))
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2022-11-20 18:25:23 +00:00
|
|
|
act->Destroy();
|
2020-05-08 22:34:48 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2021-12-30 15:51:56 +00:00
|
|
|
auto sectp = act->sector();
|
2021-12-30 09:30:21 +00:00
|
|
|
|
2022-01-21 00:04:08 +00:00
|
|
|
if (act->GetClass() != RUNTIME_CLASS(DDukeActor))
|
|
|
|
{
|
|
|
|
CallTick(act);
|
|
|
|
}
|
|
|
|
else switch(act->spr.picnum)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
|
|
|
case RESPAWNMARKERRED:
|
|
|
|
case RESPAWNMARKERYELLOW:
|
|
|
|
case RESPAWNMARKERGREEN:
|
2020-10-22 20:48:51 +00:00
|
|
|
if (!respawnmarker(act, RESPAWNMARKERYELLOW, RESPAWNMARKERGREEN)) continue;
|
2020-05-08 22:34:48 +00:00
|
|
|
break;
|
2020-05-12 11:43:24 +00:00
|
|
|
case RAT:
|
2020-10-22 20:48:51 +00:00
|
|
|
if (!rat(act, !isRRRA())) continue;
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
2022-11-20 20:16:24 +00:00
|
|
|
case CHICKENA:
|
|
|
|
case CHICKENB:
|
|
|
|
case CHICKENC:
|
2020-10-22 20:48:51 +00:00
|
|
|
if (!chickenplant)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2022-11-20 18:25:23 +00:00
|
|
|
act->Destroy();
|
2020-05-08 22:34:48 +00:00
|
|
|
continue;
|
|
|
|
}
|
2021-11-06 23:09:37 +00:00
|
|
|
if (sectp->lotag == 903)
|
2020-10-22 20:48:51 +00:00
|
|
|
makeitfall(act);
|
2022-09-03 16:41:25 +00:00
|
|
|
movesprite_ex(act, DVector3(act->spr.angle.ToVector() * act->vel.X, act->vel.Z), CLIPMASK0, coll);
|
2021-11-06 23:09:37 +00:00
|
|
|
switch (sectp->lotag)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
|
|
|
case 901:
|
2022-11-20 20:16:24 +00:00
|
|
|
act->spr.picnum = CHICKENB;
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case 902:
|
2022-11-20 20:16:24 +00:00
|
|
|
act->spr.picnum = CHICKENC;
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case 903:
|
2022-08-20 18:11:01 +00:00
|
|
|
if (act->spr.pos.Z >= sectp->floorz - 8)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2022-11-20 18:25:23 +00:00
|
|
|
act->Destroy();
|
2020-05-08 22:34:48 +00:00
|
|
|
continue;
|
|
|
|
}
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case 904:
|
2022-11-20 18:25:23 +00:00
|
|
|
act->Destroy();
|
2020-05-08 22:34:48 +00:00
|
|
|
continue;
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
}
|
2020-10-22 20:48:51 +00:00
|
|
|
if (coll.type > kHitSector)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2022-11-20 18:25:23 +00:00
|
|
|
act->Destroy();
|
2020-05-08 22:34:48 +00:00
|
|
|
continue;
|
|
|
|
}
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
2020-05-08 22:34:48 +00:00
|
|
|
|
2022-11-20 20:16:24 +00:00
|
|
|
case CHICKENLOAF:
|
|
|
|
case CHICKENNUGGET:
|
|
|
|
case ROASTEDCHICKEN:
|
|
|
|
case BONELESSCHICKEN:
|
2020-10-22 20:48:51 +00:00
|
|
|
if (!chickenplant)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2022-11-20 18:25:23 +00:00
|
|
|
act->Destroy();
|
2020-05-08 22:34:48 +00:00
|
|
|
continue;
|
|
|
|
}
|
2020-10-22 20:48:51 +00:00
|
|
|
makeitfall(act);
|
2022-09-03 16:41:25 +00:00
|
|
|
movesprite_ex(act, DVector3(act->spr.angle.ToVector() * act->vel.X, act->vel.Z), CLIPMASK0, coll);
|
2020-10-22 20:48:51 +00:00
|
|
|
if (coll.type > kHitSector)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2022-11-20 18:25:23 +00:00
|
|
|
act->Destroy();
|
2020-05-08 22:34:48 +00:00
|
|
|
continue;
|
|
|
|
}
|
2021-11-06 23:09:37 +00:00
|
|
|
if (sectp->lotag == 903)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2022-08-20 18:11:01 +00:00
|
|
|
if (act->spr.pos.Z >= sectp->floorz - 4)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2022-11-20 18:25:23 +00:00
|
|
|
act->Destroy();
|
2020-05-08 22:34:48 +00:00
|
|
|
continue;
|
|
|
|
}
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
2021-11-06 23:09:37 +00:00
|
|
|
else if (sectp->lotag == 904)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2022-11-20 18:25:23 +00:00
|
|
|
act->Destroy();
|
2020-05-08 22:34:48 +00:00
|
|
|
continue;
|
|
|
|
}
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
2020-05-08 22:34:48 +00:00
|
|
|
|
2022-11-20 20:16:24 +00:00
|
|
|
case CHICKENHEAD:
|
2020-10-22 20:48:51 +00:00
|
|
|
if (!chickenplant)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2022-11-20 18:25:23 +00:00
|
|
|
act->Destroy();
|
2020-05-08 22:34:48 +00:00
|
|
|
continue;
|
|
|
|
}
|
2020-10-22 20:48:51 +00:00
|
|
|
makeitfall(act);
|
2022-09-03 16:41:25 +00:00
|
|
|
movesprite_ex(act, DVector3(act->spr.angle.ToVector() * act->vel.X, act->vel.Z), CLIPMASK0, coll);
|
2022-08-20 18:11:01 +00:00
|
|
|
if (act->spr.pos.Z >= sectp->floorz - 8)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2021-11-06 23:09:37 +00:00
|
|
|
if (sectp->lotag == 1)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2020-10-22 20:48:51 +00:00
|
|
|
auto j = spawn(act, WATERSPLASH2);
|
2022-08-20 18:11:01 +00:00
|
|
|
if (j) j->spr.pos.Z = j->sector()->floorz;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
2022-11-20 18:25:23 +00:00
|
|
|
act->Destroy();
|
2020-05-08 22:34:48 +00:00
|
|
|
continue;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case BOWLINGBALL:
|
2022-09-03 16:41:25 +00:00
|
|
|
if (act->vel.X != 0)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
|
|
|
if(!S_CheckSoundPlaying(356))
|
2020-10-22 20:48:51 +00:00
|
|
|
S_PlayActorSound(356,act);
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-10-22 20:48:51 +00:00
|
|
|
spawn(act,BOWLINGBALLSPRITE);
|
2022-11-20 18:25:23 +00:00
|
|
|
act->Destroy();
|
2020-05-08 22:34:48 +00:00
|
|
|
continue;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
2021-12-30 15:51:56 +00:00
|
|
|
if (act->sector()->lotag == 900)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2020-11-02 21:59:37 +00:00
|
|
|
S_StopSound(356, nullptr);
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
2021-11-14 11:25:25 +00:00
|
|
|
[[fallthrough]];
|
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:
|
2020-05-09 09:44:50 +00:00
|
|
|
{
|
2020-10-22 20:48:51 +00:00
|
|
|
int todo = henstand(act);
|
2020-05-09 09:44:50 +00:00
|
|
|
if (todo == 2) deleteafterexecute = true;
|
|
|
|
if (todo == 1) continue;
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
2020-05-09 09:44:50 +00:00
|
|
|
}
|
2020-05-08 22:34:48 +00:00
|
|
|
|
2020-05-12 11:43:24 +00:00
|
|
|
case QUEBALL:
|
|
|
|
case STRIPEBALL:
|
2020-10-22 20:48:51 +00:00
|
|
|
if (!queball(act, POCKET, QUEBALL, STRIPEBALL)) continue;
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
|
|
|
case FORCESPHERE:
|
2020-10-22 20:48:51 +00:00
|
|
|
forcesphere(act, FORCESPHERE);
|
2020-05-12 11:43:24 +00:00
|
|
|
continue;
|
|
|
|
|
|
|
|
case RECON:
|
|
|
|
case UFO1_RR:
|
|
|
|
case UFO2:
|
|
|
|
case UFO3:
|
|
|
|
case UFO4:
|
|
|
|
case UFO5:
|
2022-02-05 14:32:15 +00:00
|
|
|
recon(act, EXPLOSION2, FIRELASER, -1, -1, 457, 1, [](DDukeActor* act) ->int
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
|
|
|
if (isRRRA() && ufospawnsminion)
|
|
|
|
return MINION;
|
2021-12-21 19:02:06 +00:00
|
|
|
else if (act->spr.picnum == UFO1_RR)
|
2020-05-08 22:34:48 +00:00
|
|
|
return HEN;
|
2021-12-21 19:02:06 +00:00
|
|
|
else if (act->spr.picnum == UFO2)
|
2020-05-08 22:34:48 +00:00
|
|
|
return COOT;
|
2021-12-21 19:02:06 +00:00
|
|
|
else if (act->spr.picnum == UFO3)
|
2020-05-08 22:34:48 +00:00
|
|
|
return COW;
|
2021-12-21 19:02:06 +00:00
|
|
|
else if (act->spr.picnum == UFO4)
|
2020-05-08 22:34:48 +00:00
|
|
|
return PIG;
|
2021-12-21 19:02:06 +00:00
|
|
|
else if (act->spr.picnum == UFO5)
|
2020-05-08 22:34:48 +00:00
|
|
|
return BILLYRAY;
|
2020-05-09 09:44:50 +00:00
|
|
|
else return -1;
|
2020-05-08 22:34:48 +00:00
|
|
|
});
|
2020-05-12 11:43:24 +00:00
|
|
|
continue;
|
2020-05-08 22:34:48 +00:00
|
|
|
|
2020-05-12 11:43:24 +00:00
|
|
|
case OOZ:
|
2020-10-22 20:48:51 +00:00
|
|
|
ooz(act);
|
2020-05-12 11:43:24 +00:00
|
|
|
continue;
|
2020-05-08 22:34:48 +00:00
|
|
|
|
2020-05-12 11:43:24 +00:00
|
|
|
case EMPTYBIKE:
|
2020-05-08 22:34:48 +00:00
|
|
|
if (!isRRRA()) break;
|
2020-10-22 20:48:51 +00:00
|
|
|
makeitfall(act);
|
|
|
|
getglobalz(act);
|
2021-11-06 23:09:37 +00:00
|
|
|
if (sectp->lotag == 1)
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
2022-02-05 09:51:45 +00:00
|
|
|
SetActor(act, DVector3(act->spr.pos.X, act->spr.pos.Y, act->floorz + 16));
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case EMPTYBOAT:
|
2020-05-08 22:34:48 +00:00
|
|
|
if (!isRRRA()) break;
|
2020-10-22 20:48:51 +00:00
|
|
|
makeitfall(act);
|
|
|
|
getglobalz(act);
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
2020-05-08 22:34:48 +00:00
|
|
|
|
2022-01-19 09:48:18 +00:00
|
|
|
case POWDERKEG:
|
2021-11-06 23:09:37 +00:00
|
|
|
if (!isRRRA() || (sectp->lotag != 1 && sectp->lotag != 160))
|
2022-09-03 16:41:25 +00:00
|
|
|
if (act->vel.X != 0)
|
2020-05-08 22:34:48 +00:00
|
|
|
{
|
2022-09-03 16:41:25 +00:00
|
|
|
movesprite_ex(act, DVector3(act->spr.angle.ToVector()* act->vel.X, act->vel.Z), CLIPMASK0, coll);
|
|
|
|
act->vel.X -= 1. / 16.;
|
2020-05-08 22:34:48 +00:00
|
|
|
}
|
2020-05-12 11:43:24 +00:00
|
|
|
break;
|
2020-05-08 22:34:48 +00:00
|
|
|
|
|
|
|
case CHEERBOMB:
|
|
|
|
if (!isRRRA()) break;
|
2021-11-14 11:25:25 +00:00
|
|
|
[[fallthrough]];
|
2020-05-08 22:34:48 +00:00
|
|
|
case MORTER:
|
2022-10-17 16:22:38 +00:00
|
|
|
case DYNAMITE:
|
2020-10-22 20:48:51 +00:00
|
|
|
heavyhbomb(act);
|
2020-05-12 11:43:24 +00:00
|
|
|
continue;
|
2021-12-30 09:30:21 +00:00
|
|
|
|
2020-05-12 11:43:24 +00:00
|
|
|
case REACTORBURNT:
|
|
|
|
case REACTOR2BURNT:
|
|
|
|
continue;
|
|
|
|
|
|
|
|
case REACTOR:
|
|
|
|
case REACTOR2:
|
2020-10-22 20:48:51 +00:00
|
|
|
reactor(act, REACTOR, REACTOR2, REACTORBURNT, REACTOR2BURNT, REACTORSPARK, REACTOR2SPARK);
|
2020-05-12 11:43:24 +00:00
|
|
|
continue;
|
|
|
|
}
|
2020-05-08 22:34:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
// #ifndef VOLOMEONE
|
2020-10-22 20:48:51 +00:00
|
|
|
if( ud.multimode < 2 && badguy(act) )
|
2020-05-12 11:43:24 +00:00
|
|
|
{
|
|
|
|
if( actor_tog == 1)
|
|
|
|
{
|
2021-12-21 19:02:06 +00:00
|
|
|
act->spr.cstat = CSTAT_SPRITE_INVISIBLE;
|
2020-05-12 11:43:24 +00:00
|
|
|
continue;
|
|
|
|
}
|
2021-12-21 19:02:06 +00:00
|
|
|
else if(actor_tog == 2) act->spr.cstat = CSTAT_SPRITE_BLOCK_ALL;
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
2020-05-08 22:34:48 +00:00
|
|
|
// #endif
|
|
|
|
|
2022-09-14 20:49:01 +00:00
|
|
|
p = findplayer(act, &xx);
|
2020-05-08 22:34:48 +00:00
|
|
|
|
2022-09-14 20:49:01 +00:00
|
|
|
execute(act,p,xx);
|
2022-11-20 18:25:23 +00:00
|
|
|
if (deleteafterexecute) act->Destroy();
|
2020-05-12 11:43:24 +00:00
|
|
|
}
|
2020-05-08 22:34:48 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2020-05-09 18:27:06 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void moveexplosions_r(void) // STATNUM 5
|
|
|
|
{
|
2021-11-06 23:09:37 +00:00
|
|
|
int p;
|
2022-09-14 20:49:01 +00:00
|
|
|
int * t;
|
|
|
|
double xx;
|
2020-05-09 18:27:06 +00:00
|
|
|
|
2021-12-30 09:30:21 +00:00
|
|
|
|
2020-10-22 20:51:51 +00:00
|
|
|
DukeStatIterator it(STAT_MISC);
|
|
|
|
while (auto act = it.Next())
|
2020-05-09 18:27:06 +00:00
|
|
|
{
|
2020-10-22 20:51:51 +00:00
|
|
|
t = &act->temp_data[0];
|
2021-12-30 15:51:56 +00:00
|
|
|
auto sectp = act->sector();
|
2020-05-09 18:27:06 +00:00
|
|
|
|
2022-10-07 21:33:37 +00:00
|
|
|
if (!act->insector() || act->spr.scale.X == 0)
|
2020-05-09 18:27:06 +00:00
|
|
|
{
|
2022-11-20 18:25:23 +00:00
|
|
|
act->Destroy();
|
2020-05-09 18:27:06 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2022-11-14 22:55:46 +00:00
|
|
|
if (act->GetClass() != RUNTIME_CLASS(DDukeActor))
|
|
|
|
{
|
|
|
|
CallTick(act);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2021-12-21 19:02:06 +00:00
|
|
|
switch (act->spr.picnum)
|
2020-05-09 18:27:06 +00:00
|
|
|
{
|
|
|
|
case SHOTGUNSPRITE:
|
2021-12-30 15:51:56 +00:00
|
|
|
if (act->sector()->lotag == 800)
|
2022-08-20 18:11:01 +00:00
|
|
|
if (act->spr.pos.Z >= act->sector()->floorz - 8)
|
2020-05-09 18:27:06 +00:00
|
|
|
{
|
2022-11-20 18:25:23 +00:00
|
|
|
act->Destroy();
|
2020-05-09 18:27:06 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case NEON1:
|
|
|
|
case NEON2:
|
|
|
|
case NEON3:
|
|
|
|
case NEON4:
|
|
|
|
case NEON5:
|
|
|
|
case NEON6:
|
|
|
|
|
2021-12-21 19:02:06 +00:00
|
|
|
if ((global_random / (act->spr.lotag + 1) & 31) > 4) act->spr.shade = -127;
|
|
|
|
else act->spr.shade = 127;
|
2020-05-09 18:27:06 +00:00
|
|
|
continue;
|
|
|
|
|
|
|
|
case BLOODSPLAT1:
|
|
|
|
case BLOODSPLAT2:
|
|
|
|
case BLOODSPLAT3:
|
|
|
|
case BLOODSPLAT4:
|
|
|
|
|
2022-10-24 07:00:31 +00:00
|
|
|
bloodsplats(act);
|
2020-05-09 18:27:06 +00:00
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
|
case FORCESPHERE:
|
2020-10-22 20:51:51 +00:00
|
|
|
forcesphereexplode(act);
|
2020-05-09 18:27:06 +00:00
|
|
|
continue;
|
|
|
|
|
|
|
|
case MUD:
|
|
|
|
|
2021-12-23 15:20:32 +00:00
|
|
|
act->temp_data[0]++;
|
|
|
|
if (act->temp_data[0] == 1)
|
2020-05-09 18:27:06 +00:00
|
|
|
{
|
2021-11-06 23:09:37 +00:00
|
|
|
if (sectp->floorpicnum != 3073)
|
2020-05-09 18:27:06 +00:00
|
|
|
{
|
2022-11-20 18:25:23 +00:00
|
|
|
act->Destroy();
|
2020-05-09 18:27:06 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if (S_CheckSoundPlaying(22))
|
2020-10-22 20:51:51 +00:00
|
|
|
S_PlayActorSound(22, act);
|
2020-05-09 18:27:06 +00:00
|
|
|
}
|
2021-12-23 15:20:32 +00:00
|
|
|
if (act->temp_data[0] == 3)
|
2020-05-09 18:27:06 +00:00
|
|
|
{
|
2021-12-23 15:20:32 +00:00
|
|
|
act->temp_data[0] = 0;
|
|
|
|
act->temp_data[1]++;
|
2020-05-09 18:27:06 +00:00
|
|
|
}
|
2021-12-23 15:20:32 +00:00
|
|
|
if (act->temp_data[1] == 5)
|
2022-11-20 18:25:23 +00:00
|
|
|
act->Destroy();
|
2020-05-09 18:27:06 +00:00
|
|
|
continue;
|
|
|
|
|
|
|
|
case WATERSPLASH2:
|
2020-10-22 20:51:51 +00:00
|
|
|
watersplash2(act);
|
2020-05-09 18:27:06 +00:00
|
|
|
continue;
|
|
|
|
|
|
|
|
case FRAMEEFFECT1:
|
2020-10-22 20:51:51 +00:00
|
|
|
frameeffect1(act);
|
2020-05-09 18:27:06 +00:00
|
|
|
continue;
|
|
|
|
case COOLEXPLOSION1:
|
|
|
|
case FIRELASER:
|
|
|
|
case OWHIP:
|
|
|
|
case UWHIP:
|
2021-12-21 19:02:06 +00:00
|
|
|
if (act->spr.extra != 999)
|
|
|
|
act->spr.extra = 999;
|
2020-05-09 18:27:06 +00:00
|
|
|
else
|
|
|
|
{
|
2022-11-20 18:25:23 +00:00
|
|
|
act->Destroy();
|
2020-05-09 18:27:06 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
break;
|
2020-10-22 20:51:51 +00:00
|
|
|
case FEATHER + 1: // feather
|
2022-09-27 11:59:57 +00:00
|
|
|
act->spr.pos.Z = act->floorz = getflorzofslopeptr(act->sector(), act->spr.pos.X, act->spr.pos.Y);
|
2021-12-30 15:51:56 +00:00
|
|
|
if (act->sector()->lotag == 800)
|
2020-05-09 18:27:06 +00:00
|
|
|
{
|
2022-11-20 18:25:23 +00:00
|
|
|
act->Destroy();
|
2020-05-09 18:27:06 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
break;
|
2020-10-22 20:51:51 +00:00
|
|
|
case FEATHER:
|
|
|
|
if (!money(act, BLOODPOOL)) continue;
|
2020-05-09 18:27:06 +00:00
|
|
|
|
2021-12-30 15:51:56 +00:00
|
|
|
if (act->sector()->lotag == 800)
|
2022-02-03 23:45:00 +00:00
|
|
|
if (act->spr.pos.Z >= act->sector()->floorz - 8)
|
2020-05-09 18:27:06 +00:00
|
|
|
{
|
2022-11-20 18:25:23 +00:00
|
|
|
act->Destroy();
|
2020-05-09 18:27:06 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case RRTILE2460:
|
|
|
|
case RRTILE2465:
|
|
|
|
case BIKEJIBA:
|
|
|
|
case BIKEJIBB:
|
|
|
|
case BIKEJIBC:
|
|
|
|
case BIKERJIBA:
|
|
|
|
case BIKERJIBB:
|
|
|
|
case BIKERJIBC:
|
|
|
|
case BIKERJIBD:
|
|
|
|
case CHEERJIBA:
|
|
|
|
case CHEERJIBB:
|
|
|
|
case CHEERJIBC:
|
|
|
|
case CHEERJIBD:
|
|
|
|
case FBOATJIBA:
|
|
|
|
case FBOATJIBB:
|
|
|
|
case RABBITJIBA:
|
|
|
|
case RABBITJIBB:
|
|
|
|
case RABBITJIBC:
|
|
|
|
case MAMAJIBA:
|
|
|
|
case MAMAJIBB:
|
|
|
|
if (!isRRRA()) break;
|
2021-11-14 11:25:25 +00:00
|
|
|
[[fallthrough]];
|
2020-05-09 18:27:06 +00:00
|
|
|
|
|
|
|
case BILLYJIBA:
|
|
|
|
case BILLYJIBB:
|
|
|
|
case HULKJIBA:
|
|
|
|
case HULKJIBB:
|
|
|
|
case HULKJIBC:
|
|
|
|
case MINJIBA:
|
|
|
|
case MINJIBB:
|
|
|
|
case MINJIBC:
|
|
|
|
case COOTJIBA:
|
|
|
|
case COOTJIBB:
|
|
|
|
case COOTJIBC:
|
|
|
|
case JIBS1:
|
|
|
|
case JIBS2:
|
|
|
|
case JIBS3:
|
|
|
|
case JIBS4:
|
|
|
|
case JIBS5:
|
|
|
|
case JIBS6:
|
|
|
|
case DUKETORSO:
|
|
|
|
case DUKEGUN:
|
|
|
|
case DUKELEG:
|
2021-12-21 19:02:06 +00:00
|
|
|
if (!jibs(act, JIBS6, false, true, true, act->spr.picnum == DUKELEG || act->spr.picnum == DUKETORSO || act->spr.picnum == DUKEGUN,
|
|
|
|
isRRRA() && (act->spr.picnum == RRTILE2465 || act->spr.picnum == RRTILE2560))) continue;
|
2021-12-30 09:30:21 +00:00
|
|
|
|
2021-12-30 15:51:56 +00:00
|
|
|
if (act->sector()->lotag == 800)
|
2022-08-20 18:11:01 +00:00
|
|
|
if (act->spr.pos.Z >= act->sector()->floorz - 8)
|
2020-05-09 18:27:06 +00:00
|
|
|
{
|
2022-11-20 18:25:23 +00:00
|
|
|
act->Destroy();
|
2020-05-09 18:27:06 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
case BLOODPOOL:
|
2022-01-26 23:41:33 +00:00
|
|
|
if (!bloodpool(act, false)) continue;
|
2020-05-09 18:27:06 +00:00
|
|
|
|
2021-12-30 15:51:56 +00:00
|
|
|
if (act->sector()->lotag == 800)
|
2022-08-20 18:11:01 +00:00
|
|
|
if (act->spr.pos.Z >= act->sector()->floorz - 8)
|
2020-05-09 18:27:06 +00:00
|
|
|
{
|
2022-11-20 18:25:23 +00:00
|
|
|
act->Destroy();
|
2020-05-09 18:27:06 +00:00
|
|
|
}
|
|
|
|
continue;
|
|
|
|
|
|
|
|
case BURNING:
|
|
|
|
case WATERBUBBLE:
|
|
|
|
case SMALLSMOKE:
|
|
|
|
case EXPLOSION2:
|
|
|
|
case EXPLOSION3:
|
|
|
|
case BLOOD:
|
|
|
|
case FORCERIPPLE:
|
|
|
|
case TRANSPORTERSTAR:
|
|
|
|
case TRANSPORTERBEAM:
|
2022-09-14 20:49:01 +00:00
|
|
|
p = findplayer(act, &xx);
|
|
|
|
execute(act, p, xx);
|
2020-05-09 18:27:06 +00:00
|
|
|
continue;
|
|
|
|
|
|
|
|
case SHELL:
|
|
|
|
case SHOTGUNSHELL:
|
2020-10-22 20:51:51 +00:00
|
|
|
shell(act, false);
|
2020-05-09 18:27:06 +00:00
|
|
|
continue;
|
|
|
|
|
|
|
|
case GLASSPIECES:
|
|
|
|
case GLASSPIECES + 1:
|
|
|
|
case GLASSPIECES + 2:
|
|
|
|
case POPCORN:
|
2020-10-22 20:51:51 +00:00
|
|
|
glasspieces(act);
|
2020-05-09 18:27:06 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-05-10 07:08:02 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2020-10-22 20:55:53 +00:00
|
|
|
void handle_se06_r(DDukeActor *actor)
|
|
|
|
{
|
2021-11-20 23:33:17 +00:00
|
|
|
auto sc = actor->sector();
|
2021-12-21 19:02:06 +00:00
|
|
|
int sh = actor->spr.hitag;
|
2020-10-22 20:55:53 +00:00
|
|
|
|
|
|
|
int k = sc->extra;
|
|
|
|
|
2021-12-23 15:20:32 +00:00
|
|
|
if (actor->temp_data[4] > 0)
|
2020-10-22 20:55:53 +00:00
|
|
|
{
|
2021-12-23 15:20:32 +00:00
|
|
|
actor->temp_data[4]--;
|
|
|
|
if (actor->temp_data[4] >= (k - (k >> 3)))
|
2022-09-11 19:01:38 +00:00
|
|
|
actor->vel.X -= (k >> 5) / 16.;
|
2021-12-23 15:20:32 +00:00
|
|
|
if (actor->temp_data[4] > ((k >> 1) - 1) && actor->temp_data[4] < (k - (k >> 3)))
|
2022-09-03 08:02:25 +00:00
|
|
|
actor->vel.X = 0;
|
2021-12-23 15:20:32 +00:00
|
|
|
if (actor->temp_data[4] < (k >> 1))
|
2022-09-11 19:01:38 +00:00
|
|
|
actor->vel.X += (k >> 5) / 16.;
|
2021-12-23 15:20:32 +00:00
|
|
|
if (actor->temp_data[4] < ((k >> 1) - (k >> 3)))
|
2020-10-22 20:55:53 +00:00
|
|
|
{
|
2021-12-23 15:20:32 +00:00
|
|
|
actor->temp_data[4] = 0;
|
2022-09-11 19:01:38 +00:00
|
|
|
actor->vel.X = k / 16.;
|
2020-10-22 20:55:53 +00:00
|
|
|
if ((!isRRRA() || lastlevel) && hulkspawn)
|
|
|
|
{
|
|
|
|
hulkspawn--;
|
|
|
|
auto ns = spawn(actor, HULK);
|
2021-11-19 11:32:12 +00:00
|
|
|
if (ns)
|
|
|
|
{
|
2022-08-20 18:57:54 +00:00
|
|
|
ns->spr.pos.Z = ns->sector()->ceilingz;
|
2021-12-21 17:19:45 +00:00
|
|
|
ns->spr.pal = 33;
|
2021-11-19 11:32:12 +00:00
|
|
|
}
|
2020-10-22 20:55:53 +00:00
|
|
|
if (!hulkspawn)
|
|
|
|
{
|
2022-10-07 16:51:29 +00:00
|
|
|
ns = CreateActor(actor->sector(), DVector3(actor->spr.pos.XY(), actor->sector()->ceilingz + 466.5), 3677, -8, DVector2(0.25, 0.25), nullAngle, 0., 0., actor, 5);
|
2021-11-19 08:47:17 +00:00
|
|
|
if (ns)
|
|
|
|
{
|
2021-12-21 17:19:45 +00:00
|
|
|
ns->spr.cstat = CSTAT_SPRITE_TRANS_FLIP | CSTAT_SPRITE_TRANSLUCENT;
|
|
|
|
ns->spr.pal = 7;
|
2022-10-07 21:52:29 +00:00
|
|
|
ns->spr.scale = DVector2(1.25, 3.984375);
|
2021-11-19 08:47:17 +00:00
|
|
|
}
|
2020-10-22 20:55:53 +00:00
|
|
|
ns = spawn(actor, 296);
|
2021-11-19 11:32:12 +00:00
|
|
|
if (ns)
|
|
|
|
{
|
2021-12-21 17:19:45 +00:00
|
|
|
ns->spr.cstat = 0;
|
|
|
|
ns->spr.cstat |= CSTAT_SPRITE_INVISIBLE;
|
2022-08-20 18:11:01 +00:00
|
|
|
ns->spr.pos.Z = actor->sector()->floorz - 24;
|
2021-11-19 11:32:12 +00:00
|
|
|
}
|
2022-11-20 18:25:23 +00:00
|
|
|
actor->Destroy();
|
2020-10-22 20:55:53 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-09-11 19:01:38 +00:00
|
|
|
actor->vel.X = k / 16.;
|
2021-11-20 23:41:52 +00:00
|
|
|
DukeSectIterator it(actor->sector());
|
2020-10-22 20:55:53 +00:00
|
|
|
while (auto a2 = it.Next())
|
|
|
|
{
|
2021-12-21 17:19:45 +00:00
|
|
|
if (a2->spr.picnum == UFOBEAM && ufospawn && ++ufocnt == 64)
|
2020-10-22 20:55:53 +00:00
|
|
|
{
|
|
|
|
int pn;
|
|
|
|
ufocnt = 0;
|
|
|
|
ufospawn--;
|
|
|
|
if (!isRRRA())
|
|
|
|
{
|
|
|
|
switch (krand() & 3)
|
|
|
|
{
|
|
|
|
default:
|
|
|
|
case 0:
|
|
|
|
pn = UFO1_RR;
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
pn = UFO2;
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
pn = UFO3;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
pn = UFO4;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else pn = UFO1_RRRA;
|
|
|
|
auto ns = spawn(actor, pn);
|
2022-08-20 18:57:54 +00:00
|
|
|
if (ns) ns->spr.pos.Z = ns->sector()->ceilingz;
|
2020-10-22 20:55:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
DukeStatIterator it(STAT_EFFECTOR);
|
|
|
|
while (auto act2 = it.Next())
|
|
|
|
{
|
2022-09-11 18:46:21 +00:00
|
|
|
if ((act2->spr.lotag == SE_14_SUBWAY_CAR) && (sh == act2->spr.hitag) && (act2->temp_data[0] == actor->temp_data[0]))
|
2020-10-22 20:55:53 +00:00
|
|
|
{
|
2022-09-11 18:46:21 +00:00
|
|
|
act2->vel.X = actor->vel.X;
|
|
|
|
//if( actor->temp_data[4] == 1 )
|
2020-10-22 20:55:53 +00:00
|
|
|
{
|
2022-09-11 19:01:38 +00:00
|
|
|
if (act2->temp_pos.X == 0)
|
|
|
|
act2->temp_pos.X = (act2->spr.pos - actor->spr.pos).LengthSquared();
|
|
|
|
int x = Sgn((act2->spr.pos - actor->spr.pos).LengthSquared() - act2->temp_pos.X);
|
2021-12-21 17:19:45 +00:00
|
|
|
if (act2->spr.extra) x = -x;
|
2022-09-11 18:46:21 +00:00
|
|
|
actor->vel.X += x / 16.;
|
2020-10-22 20:55:53 +00:00
|
|
|
}
|
2021-12-23 15:20:32 +00:00
|
|
|
act2->temp_data[4] = actor->temp_data[4];
|
2020-10-22 20:55:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
handle_se14(actor, false, RPG, JIBS6);
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2020-05-10 07:08:02 +00:00
|
|
|
void moveeffectors_r(void) //STATNUM 3
|
|
|
|
{
|
|
|
|
clearfriction();
|
|
|
|
|
2020-10-22 21:17:51 +00:00
|
|
|
DukeStatIterator it(STAT_EFFECTOR);
|
|
|
|
while (auto act = it.Next())
|
2020-05-10 07:08:02 +00:00
|
|
|
{
|
2021-11-20 23:33:17 +00:00
|
|
|
auto sc = act->sector();
|
2021-12-21 17:19:45 +00:00
|
|
|
int st = act->spr.lotag;
|
2020-05-10 07:08:02 +00:00
|
|
|
|
|
|
|
switch (st)
|
|
|
|
{
|
|
|
|
case SE_0_ROTATING_SECTOR:
|
2022-01-19 09:48:18 +00:00
|
|
|
handle_se00(act);
|
2020-05-10 07:08:02 +00:00
|
|
|
break;
|
2021-12-30 09:30:21 +00:00
|
|
|
|
2020-05-10 07:08:02 +00:00
|
|
|
case SE_1_PIVOT: //Nothing for now used as the pivot
|
2020-10-22 21:17:51 +00:00
|
|
|
handle_se01(act);
|
2020-05-10 07:08:02 +00:00
|
|
|
break;
|
2021-12-30 09:30:21 +00:00
|
|
|
|
2020-05-10 07:08:02 +00:00
|
|
|
case SE_6_SUBWAY:
|
2020-10-22 21:17:51 +00:00
|
|
|
handle_se06_r(act);
|
2020-11-03 19:21:30 +00:00
|
|
|
break;
|
2020-05-10 07:08:02 +00:00
|
|
|
|
|
|
|
case SE_14_SUBWAY_CAR:
|
2020-10-22 21:17:51 +00:00
|
|
|
handle_se14(act, false, RPG, JIBS6);
|
2020-05-10 07:08:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case SE_30_TWO_WAY_TRAIN:
|
2020-10-22 21:17:51 +00:00
|
|
|
handle_se30(act, JIBS6);
|
2020-05-10 07:08:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case SE_2_EARTHQUAKE:
|
2020-10-22 21:17:51 +00:00
|
|
|
handle_se02(act);
|
2020-05-10 07:08:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
//Flashing sector lights after reactor EXPLOSION2
|
|
|
|
case SE_3_RANDOM_LIGHTS_AFTER_SHOT_OUT:
|
2020-10-22 21:17:51 +00:00
|
|
|
handle_se03(act);
|
2020-05-10 07:08:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case SE_4_RANDOM_LIGHTS:
|
2020-10-22 21:17:51 +00:00
|
|
|
handle_se04(act);
|
2020-05-10 07:08:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
//BOSS
|
|
|
|
case SE_5_BOSS:
|
2020-10-22 21:17:51 +00:00
|
|
|
handle_se05(act, FIRELASER);
|
2020-05-10 07:08:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case SE_8_UP_OPEN_DOOR_LIGHTS:
|
|
|
|
case SE_9_DOWN_OPEN_DOOR_LIGHTS:
|
2020-10-22 21:17:51 +00:00
|
|
|
handle_se08(act, true);
|
2020-05-10 07:08:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case SE_10_DOOR_AUTO_CLOSE:
|
2020-10-22 21:17:51 +00:00
|
|
|
handle_se10(act, nullptr);
|
2020-05-10 07:08:02 +00:00
|
|
|
break;
|
2020-10-22 21:17:51 +00:00
|
|
|
|
2020-05-10 07:08:02 +00:00
|
|
|
case SE_11_SWINGING_DOOR:
|
2020-10-22 21:17:51 +00:00
|
|
|
handle_se11(act);
|
2020-05-10 07:08:02 +00:00
|
|
|
break;
|
2021-12-30 09:30:21 +00:00
|
|
|
|
2020-05-10 07:08:02 +00:00
|
|
|
case SE_12_LIGHT_SWITCH:
|
2020-10-22 21:17:51 +00:00
|
|
|
handle_se12(act);
|
2020-05-10 07:08:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case SE_47_LIGHT_SWITCH:
|
2020-10-22 21:17:51 +00:00
|
|
|
if (isRRRA()) handle_se12(act, 1);
|
2020-05-10 07:08:02 +00:00
|
|
|
break;
|
2021-12-30 09:30:21 +00:00
|
|
|
|
2020-05-10 07:08:02 +00:00
|
|
|
case SE_48_LIGHT_SWITCH:
|
2020-10-22 21:17:51 +00:00
|
|
|
if (isRRRA()) handle_se12(act, 2);
|
2020-05-10 07:08:02 +00:00
|
|
|
break;
|
2021-12-30 09:30:21 +00:00
|
|
|
|
2020-05-10 07:08:02 +00:00
|
|
|
|
|
|
|
case SE_13_EXPLOSIVE:
|
2020-10-22 21:17:51 +00:00
|
|
|
handle_se13(act);
|
2020-05-10 07:08:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case SE_15_SLIDING_DOOR:
|
2020-10-22 21:17:51 +00:00
|
|
|
handle_se15(act);
|
2020-05-10 07:08:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case SE_16_REACTOR:
|
2020-10-22 21:17:51 +00:00
|
|
|
handle_se16(act, REACTOR, REACTOR2);
|
2020-05-10 07:08:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case SE_17_WARP_ELEVATOR:
|
2020-10-22 21:17:51 +00:00
|
|
|
handle_se17(act);
|
2020-05-10 07:08:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case SE_18_INCREMENTAL_SECTOR_RISE_FALL:
|
2020-10-22 21:17:51 +00:00
|
|
|
handle_se18(act, true);
|
2020-05-10 07:08:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case SE_19_EXPLOSION_LOWERS_CEILING:
|
2020-10-22 21:17:51 +00:00
|
|
|
handle_se19(act, BIGFORCE);
|
2020-05-10 07:08:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case SE_20_STRETCH_BRIDGE:
|
2020-10-22 21:17:51 +00:00
|
|
|
handle_se20(act);
|
2020-05-10 07:08:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case SE_21_DROP_FLOOR:
|
2020-10-22 21:17:51 +00:00
|
|
|
handle_se21(act);
|
2020-05-10 07:08:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case SE_22_TEETH_DOOR:
|
2020-10-22 21:17:51 +00:00
|
|
|
handle_se22(act);
|
2020-05-10 07:08:02 +00:00
|
|
|
break;
|
|
|
|
|
2022-09-12 19:59:34 +00:00
|
|
|
case SE_156_CONVEYOR_NOSCROLL:
|
2020-05-10 07:08:02 +00:00
|
|
|
if (!isRRRA()) break;
|
2021-11-14 11:25:25 +00:00
|
|
|
[[fallthrough]];
|
2020-05-10 07:08:02 +00:00
|
|
|
case SE_24_CONVEYOR:
|
2020-11-27 19:06:38 +00:00
|
|
|
case SE_34:
|
2020-10-14 18:49:43 +00:00
|
|
|
{
|
2022-09-12 19:59:34 +00:00
|
|
|
handle_se24(act, st != SE_156_CONVEYOR_NOSCROLL, 0.5);
|
2020-05-10 07:08:02 +00:00
|
|
|
break;
|
2020-10-14 18:49:43 +00:00
|
|
|
}
|
2020-10-21 22:50:01 +00:00
|
|
|
|
2020-11-27 19:06:38 +00:00
|
|
|
case SE_35:
|
2020-10-22 21:17:51 +00:00
|
|
|
handle_se35(act, SMALLSMOKE, EXPLOSION2);
|
2020-05-10 07:08:02 +00:00
|
|
|
break;
|
|
|
|
|
2020-11-27 19:06:38 +00:00
|
|
|
case SE_25_PISTON: //PISTONS
|
2021-12-23 15:20:32 +00:00
|
|
|
if (act->temp_data[4] == 0) break;
|
2022-09-12 21:35:48 +00:00
|
|
|
handle_se25(act, isRRRA() ? 371 : -1, isRRRA() ? 167 : -1);
|
2020-05-10 07:08:02 +00:00
|
|
|
break;
|
|
|
|
|
2020-11-27 19:06:38 +00:00
|
|
|
case SE_26:
|
2020-10-22 21:17:51 +00:00
|
|
|
handle_se26(act);
|
2020-05-10 07:08:02 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case SE_27_DEMO_CAM:
|
2020-10-22 21:17:51 +00:00
|
|
|
handle_se27(act);
|
2020-05-10 07:08:02 +00:00
|
|
|
break;
|
|
|
|
|
2020-11-27 19:06:38 +00:00
|
|
|
case SE_29_WAVES:
|
2022-09-11 21:51:48 +00:00
|
|
|
handle_se29(act);
|
2020-05-10 07:08:02 +00:00
|
|
|
break;
|
|
|
|
|
2020-11-27 19:06:38 +00:00
|
|
|
case SE_31_FLOOR_RISE_FALL: // True Drop Floor
|
2020-10-22 21:17:51 +00:00
|
|
|
handle_se31(act, false);
|
2020-05-10 07:08:02 +00:00
|
|
|
break;
|
|
|
|
|
2020-11-27 19:06:38 +00:00
|
|
|
case SE_32_CEILING_RISE_FALL: // True Drop Ceiling
|
2020-10-22 21:17:51 +00:00
|
|
|
handle_se32(act);
|
2020-05-10 07:08:02 +00:00
|
|
|
break;
|
|
|
|
|
2020-11-27 19:06:38 +00:00
|
|
|
case SE_33_QUAKE_DEBRIS:
|
2020-05-10 07:08:02 +00:00
|
|
|
if (earthquaketime > 0 && (krand() & 7) == 0)
|
2020-10-22 21:17:51 +00:00
|
|
|
RANDOMSCRAP(act);
|
2020-05-10 07:08:02 +00:00
|
|
|
break;
|
2020-11-27 19:06:38 +00:00
|
|
|
case SE_36_PROJ_SHOOTER:
|
2020-05-10 07:08:02 +00:00
|
|
|
|
2021-12-23 15:20:32 +00:00
|
|
|
if (act->temp_data[0])
|
2020-05-10 07:08:02 +00:00
|
|
|
{
|
2021-12-23 15:20:32 +00:00
|
|
|
if (act->temp_data[0] == 1)
|
2020-10-24 05:34:39 +00:00
|
|
|
fi.shoot(act, sc->extra);
|
2021-12-23 15:20:32 +00:00
|
|
|
else if (act->temp_data[0] == 26 * 5)
|
|
|
|
act->temp_data[0] = 0;
|
|
|
|
act->temp_data[0]++;
|
2020-05-10 07:08:02 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2021-11-15 22:32:41 +00:00
|
|
|
case SE_128_GLASS_BREAKING:
|
2020-10-22 21:17:51 +00:00
|
|
|
handle_se128(act);
|
2020-05-10 07:08:02 +00:00
|
|
|
break;
|
|
|
|
|
2020-11-27 19:06:38 +00:00
|
|
|
case SE_130:
|
2020-10-22 21:17:51 +00:00
|
|
|
handle_se130(act, 80, EXPLOSION2);
|
2020-05-10 07:08:02 +00:00
|
|
|
break;
|
2020-11-27 19:06:38 +00:00
|
|
|
case SE_131:
|
2020-10-22 21:17:51 +00:00
|
|
|
handle_se130(act, 40, EXPLOSION2);
|
2020-05-10 07:08:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//Sloped sin-wave floors!
|
2020-10-14 18:24:31 +00:00
|
|
|
it.Reset(STAT_EFFECTOR);
|
2020-10-22 21:17:51 +00:00
|
|
|
while (auto act = it.Next())
|
2020-05-10 07:08:02 +00:00
|
|
|
{
|
2021-12-21 17:19:45 +00:00
|
|
|
if (act->spr.lotag != SE_29_WAVES) continue;
|
2021-11-20 23:33:17 +00:00
|
|
|
auto sc = act->sector();
|
2022-11-15 13:59:28 +00:00
|
|
|
if (sc->walls.Size() != 4) continue;
|
2022-11-15 14:31:52 +00:00
|
|
|
auto wal = &sc->walls[2];
|
2022-09-12 19:26:17 +00:00
|
|
|
if (wal->nextSector()) alignflorslope(act->sector(), DVector3(wal->pos, wal->nextSector()->floorz));
|
2020-05-10 07:08:02 +00:00
|
|
|
}
|
|
|
|
}
|
2020-05-07 12:55:04 +00:00
|
|
|
|
2020-05-13 22:04:14 +00:00
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// game specific part of makeitfall.
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2022-09-11 22:34:18 +00:00
|
|
|
double adjustfall(DDukeActor *actor, double c)
|
2020-05-13 22:04:14 +00:00
|
|
|
{
|
2021-12-21 17:19:45 +00:00
|
|
|
if ((actor->spr.picnum == BIKERB || actor->spr.picnum == CHEERB) && c == gs.gravity)
|
2022-09-11 22:34:18 +00:00
|
|
|
c = gs.gravity * 0.25;
|
2021-12-21 17:19:45 +00:00
|
|
|
else if (actor->spr.picnum == BIKERBV2 && c == gs.gravity)
|
2022-09-11 22:34:18 +00:00
|
|
|
c = gs.gravity * 0.125;
|
2020-05-13 22:04:14 +00:00
|
|
|
return c;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2020-11-01 14:56:50 +00:00
|
|
|
void move_r(DDukeActor *actor, int pnum, int xvel)
|
2020-05-13 22:04:14 +00:00
|
|
|
{
|
2022-09-15 15:39:01 +00:00
|
|
|
DAngle goalang, angdif;
|
|
|
|
double daxvel;
|
2020-05-13 22:04:14 +00:00
|
|
|
|
2021-12-21 19:02:06 +00:00
|
|
|
int a = actor->spr.hitag;
|
2020-05-13 22:04:14 +00:00
|
|
|
|
|
|
|
if (a == -1) a = 0;
|
|
|
|
|
2021-12-23 15:20:32 +00:00
|
|
|
actor->temp_data[0]++;
|
2020-05-13 22:04:14 +00:00
|
|
|
|
|
|
|
if (a & face_player)
|
|
|
|
{
|
2020-11-02 23:20:51 +00:00
|
|
|
if (ps[pnum].newOwner != nullptr)
|
2022-11-15 07:29:51 +00:00
|
|
|
goalang = (ps[pnum].posoldXY() - actor->spr.pos.XY()).Angle();
|
2022-11-15 06:40:04 +00:00
|
|
|
else goalang = (ps[pnum].posXY() - actor->spr.pos.XY()).Angle();
|
2022-09-15 15:39:01 +00:00
|
|
|
angdif = deltaangle(actor->spr.angle, goalang) * 0.25;
|
2022-11-24 12:08:28 +00:00
|
|
|
if (angdif > -DAngle22_5 / 16 && angdif < nullAngle) angdif = nullAngle;
|
2022-09-15 15:39:01 +00:00
|
|
|
actor->spr.angle += angdif;
|
2020-05-13 22:04:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (a & spin)
|
2022-09-15 16:12:09 +00:00
|
|
|
actor->spr.angle += DAngle45 * BobVal(actor->temp_data[0] << 3);
|
2020-05-13 22:04:14 +00:00
|
|
|
|
|
|
|
if (a & face_player_slow)
|
|
|
|
{
|
2020-11-02 23:20:51 +00:00
|
|
|
if (ps[pnum].newOwner != nullptr)
|
2022-11-15 07:29:51 +00:00
|
|
|
goalang = (ps[pnum].posoldXY() - actor->spr.pos.XY()).Angle();
|
2022-11-15 06:40:04 +00:00
|
|
|
else goalang = (ps[pnum].posXY() - actor->spr.pos.XY()).Angle();
|
2022-09-15 15:39:01 +00:00
|
|
|
angdif = DAngle22_5 * 0.25 * Sgn(deltaangle(actor->spr.angle, goalang).Degrees()); // this looks very wrong...
|
|
|
|
actor->spr.angle += angdif;
|
2020-05-13 22:04:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (isRRRA())
|
|
|
|
{
|
|
|
|
if (a & antifaceplayerslow)
|
|
|
|
{
|
2020-11-02 23:20:51 +00:00
|
|
|
if (ps[pnum].newOwner != nullptr)
|
2022-11-15 07:29:51 +00:00
|
|
|
goalang = ((ps[pnum].posoldXY() - actor->spr.pos.XY()).Angle() + DAngle180);
|
2022-11-15 06:40:04 +00:00
|
|
|
else goalang = ((ps[pnum].posXY() - actor->spr.pos.XY()).Angle() + DAngle180);
|
2022-09-15 15:39:01 +00:00
|
|
|
angdif = DAngle22_5 * 0.25 * Sgn(deltaangle(actor->spr.angle, goalang).Degrees()); // this looks very wrong...
|
|
|
|
actor->spr.angle += angdif;
|
2020-05-13 22:04:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if ((a & jumptoplayer) == jumptoplayer)
|
|
|
|
{
|
2021-12-21 19:02:06 +00:00
|
|
|
if (actor->spr.picnum == CHEER)
|
2020-05-13 22:04:14 +00:00
|
|
|
{
|
2021-12-23 15:20:32 +00:00
|
|
|
if (actor->temp_data[0] < 16)
|
2022-09-13 18:17:50 +00:00
|
|
|
actor->vel.Z -= BobVal(512 + (actor->temp_data[0] << 4)) * 1.6;
|
2020-05-13 22:04:14 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-12-23 15:20:32 +00:00
|
|
|
if (actor->temp_data[0] < 16)
|
2022-09-13 18:17:50 +00:00
|
|
|
actor->vel.Z -= BobVal(512 + (actor->temp_data[0] << 4)) * 2;
|
2020-05-13 22:04:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if (a & justjump1)
|
|
|
|
{
|
2021-12-21 19:02:06 +00:00
|
|
|
if (actor->spr.picnum == RABBIT)
|
2020-05-13 22:04:14 +00:00
|
|
|
{
|
2021-12-23 15:20:32 +00:00
|
|
|
if (actor->temp_data[0] < 8)
|
2022-09-13 18:17:50 +00:00
|
|
|
actor->vel.Z -= BobVal(512 + (actor->temp_data[0] << 4)) * 2.133;
|
2020-05-13 22:04:14 +00:00
|
|
|
}
|
2021-12-21 19:02:06 +00:00
|
|
|
else if (actor->spr.picnum == MAMA)
|
2020-05-13 22:04:14 +00:00
|
|
|
{
|
2021-12-23 15:20:32 +00:00
|
|
|
if (actor->temp_data[0] < 8)
|
2022-09-13 18:17:50 +00:00
|
|
|
actor->vel.Z -= BobVal(512 + (actor->temp_data[0] << 4)) * 1.83;
|
2020-05-13 22:04:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if (a & justjump2)
|
|
|
|
{
|
2021-12-21 19:02:06 +00:00
|
|
|
if (actor->spr.picnum == RABBIT)
|
2020-05-13 22:04:14 +00:00
|
|
|
{
|
2021-12-23 15:20:32 +00:00
|
|
|
if (actor->temp_data[0] < 8)
|
2022-09-13 18:17:50 +00:00
|
|
|
actor->vel.Z -= BobVal(512 + (actor->temp_data[0] << 4)) * 2.667;
|
2020-05-13 22:04:14 +00:00
|
|
|
}
|
2021-12-21 19:02:06 +00:00
|
|
|
else if (actor->spr.picnum == MAMA)
|
2020-05-13 22:04:14 +00:00
|
|
|
{
|
2021-12-23 15:20:32 +00:00
|
|
|
if (actor->temp_data[0] < 8)
|
2022-09-13 18:17:50 +00:00
|
|
|
actor->vel.Z -= BobVal(512 + (actor->temp_data[0] << 4)) * 2.286;
|
2020-05-13 22:04:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if (a & windang)
|
|
|
|
{
|
2021-12-23 15:20:32 +00:00
|
|
|
if (actor->temp_data[0] < 8)
|
2022-09-13 18:17:50 +00:00
|
|
|
actor->vel.Z -= BobVal(512 + (actor->temp_data[0] << 4) * 2.667);
|
2020-05-13 22:04:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ((a & jumptoplayer) == jumptoplayer)
|
|
|
|
{
|
2021-12-23 15:20:32 +00:00
|
|
|
if (actor->temp_data[0] < 16)
|
2022-09-13 18:17:50 +00:00
|
|
|
actor->vel.Z -= BobVal(512 + (actor->temp_data[0] << 4)) * 2;
|
2020-05-13 22:04:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (a & face_player_smart)
|
|
|
|
{
|
2022-11-15 06:40:04 +00:00
|
|
|
DVector2 newpos = ps[pnum].posXY() + (ps[pnum].vel.XY() * (4. / 3.));
|
2022-09-30 11:38:21 +00:00
|
|
|
goalang = (newpos - actor->spr.pos.XY()).Angle();
|
2022-09-15 15:39:01 +00:00
|
|
|
angdif = deltaangle(actor->spr.angle, goalang) * 0.25;
|
|
|
|
if (angdif > -DAngle22_5 / 16 && angdif < nullAngle) angdif = nullAngle;
|
2022-10-24 20:08:42 +00:00
|
|
|
actor->spr.angle += angdif;
|
2020-05-13 22:04:14 +00:00
|
|
|
}
|
|
|
|
|
2021-12-23 15:20:32 +00:00
|
|
|
if (actor->temp_data[1] == 0 || a == 0)
|
2020-05-13 22:04:14 +00:00
|
|
|
{
|
2022-02-03 21:06:09 +00:00
|
|
|
if ((badguy(actor) && actor->spr.extra <= 0) || (actor->opos.X != actor->spr.pos.X) || (actor->opos.Y != actor->spr.pos.Y))
|
2020-05-13 22:04:14 +00:00
|
|
|
{
|
2022-11-15 10:25:13 +00:00
|
|
|
if (actor->spr.picnum != APLAYER) actor->backupvec2();
|
2022-02-06 21:45:47 +00:00
|
|
|
SetActor(actor, actor->spr.pos);
|
2020-05-13 22:04:14 +00:00
|
|
|
}
|
2021-12-21 19:02:06 +00:00
|
|
|
if (badguy(actor) && actor->spr.extra <= 0)
|
2020-05-13 22:04:14 +00:00
|
|
|
{
|
2021-12-30 15:51:56 +00:00
|
|
|
if (actor->sector()->ceilingstat & CSTAT_SECTOR_SKY)
|
2020-05-13 22:04:14 +00:00
|
|
|
{
|
2021-12-30 15:51:56 +00:00
|
|
|
if (actor->sector()->shadedsector == 1)
|
2020-05-13 22:04:14 +00:00
|
|
|
{
|
2021-12-21 19:02:06 +00:00
|
|
|
actor->spr.shade += (16 - actor->spr.shade) >> 1;
|
2020-05-13 22:04:14 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-12-30 15:51:56 +00:00
|
|
|
actor->spr.shade += (actor->sector()->ceilingshade - actor->spr.shade) >> 1;
|
2020-05-13 22:04:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-12-30 15:51:56 +00:00
|
|
|
actor->spr.shade += (actor->sector()->floorshade - actor->spr.shade) >> 1;
|
2020-05-13 22:04:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-12-23 15:20:32 +00:00
|
|
|
auto moveptr = &ScriptCode[actor->temp_data[1]];
|
2020-05-13 22:04:14 +00:00
|
|
|
|
2022-11-14 17:48:31 +00:00
|
|
|
if (a & geth) actor->vel.X += (moveptr[0] / 16. - actor->vel.X) * 0.5;
|
|
|
|
if (a & getv) actor->vel.Z += (moveptr[1] / 16. - actor->vel.Z) * 0.5;
|
2020-05-13 22:04:14 +00:00
|
|
|
|
|
|
|
if (a & dodgebullet)
|
2020-10-22 21:41:07 +00:00
|
|
|
dodge(actor);
|
2020-05-13 22:04:14 +00:00
|
|
|
|
2021-12-21 19:02:06 +00:00
|
|
|
if (actor->spr.picnum != APLAYER)
|
2020-11-01 14:56:50 +00:00
|
|
|
alterang(a, actor, pnum);
|
2020-05-13 22:04:14 +00:00
|
|
|
|
2022-09-11 20:57:56 +00:00
|
|
|
if (abs(actor->vel.X) < 6 / 16.) actor->vel.X = 0;
|
2020-05-13 22:04:14 +00:00
|
|
|
|
2020-10-22 21:41:07 +00:00
|
|
|
a = badguy(actor);
|
2020-05-13 22:04:14 +00:00
|
|
|
|
2022-09-03 08:03:30 +00:00
|
|
|
if (actor->vel.X != 0 || actor->vel.Z != 0)
|
2020-05-13 22:04:14 +00:00
|
|
|
{
|
|
|
|
if (a)
|
|
|
|
{
|
2021-12-21 19:02:06 +00:00
|
|
|
if (actor->spr.picnum == DRONE && actor->spr.extra > 0)
|
2020-05-13 22:04:14 +00:00
|
|
|
{
|
2022-09-03 08:03:30 +00:00
|
|
|
if (actor->vel.Z > 0)
|
2020-05-13 22:04:14 +00:00
|
|
|
{
|
2022-02-03 23:45:00 +00:00
|
|
|
double dist = isRRRA() ? 28 : 30;
|
2022-09-27 11:59:57 +00:00
|
|
|
double f = getflorzofslopeptr(actor->sector(), actor->spr.pos.X, actor->spr.pos.Y);
|
2022-02-03 23:45:00 +00:00
|
|
|
actor->floorz = f;
|
|
|
|
if (actor->spr.pos.Z > f - dist)
|
|
|
|
actor->spr.pos.Z = f - dist;
|
2020-05-13 22:04:14 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-09-27 11:59:57 +00:00
|
|
|
double c = getceilzofslopeptr(actor->sector(), actor->spr.pos.X, actor->spr.pos.Y);
|
2022-02-03 23:45:00 +00:00
|
|
|
actor->ceilingz = c;
|
|
|
|
if (actor->spr.pos.Z < c + 50)
|
2020-05-13 22:04:14 +00:00
|
|
|
{
|
2022-02-03 23:45:00 +00:00
|
|
|
actor->spr.pos.Z = c + 50;
|
2022-09-03 08:02:25 +00:00
|
|
|
actor->vel.Z = 0;
|
2020-05-13 22:04:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-09-03 08:03:30 +00:00
|
|
|
if (actor->vel.Z > 0 && actor->floorz < actor->spr.pos.Z)
|
2022-02-03 23:45:00 +00:00
|
|
|
actor->spr.pos.Z = actor->floorz;
|
2022-09-03 08:03:30 +00:00
|
|
|
if (actor->vel.Z < 0)
|
2020-05-13 22:04:14 +00:00
|
|
|
{
|
2022-09-27 11:59:57 +00:00
|
|
|
double c = getceilzofslopeptr(actor->sector(), actor->spr.pos.X, actor->spr.pos.Y);
|
2022-02-03 23:45:00 +00:00
|
|
|
if (actor->spr.pos.Z < c + 66)
|
2020-05-13 22:04:14 +00:00
|
|
|
{
|
2022-02-03 23:45:00 +00:00
|
|
|
actor->spr.pos.Z = c + 66;
|
2022-09-03 08:04:16 +00:00
|
|
|
actor->vel.Z *= 0.5;
|
2020-05-13 22:04:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-12-21 19:02:06 +00:00
|
|
|
else if (actor->spr.picnum == APLAYER)
|
2022-02-03 23:45:00 +00:00
|
|
|
if ((actor->spr.pos.Z - actor->ceilingz) < 32)
|
|
|
|
actor->spr.pos.Z = actor->ceilingz + 32;
|
2020-05-13 22:04:14 +00:00
|
|
|
|
2022-09-15 15:39:01 +00:00
|
|
|
daxvel = actor->vel.X;
|
|
|
|
angdif = actor->spr.angle;
|
2020-05-13 22:04:14 +00:00
|
|
|
|
|
|
|
if (a)
|
|
|
|
{
|
2022-10-07 21:33:37 +00:00
|
|
|
if (xvel < 960 && actor->spr.scale.X > 0.25 )
|
2020-05-13 22:04:14 +00:00
|
|
|
{
|
|
|
|
|
2022-09-15 15:39:01 +00:00
|
|
|
daxvel = -(1024 - xvel) * maptoworld;
|
2022-11-15 06:40:04 +00:00
|
|
|
angdif = (ps[pnum].posXY() - actor->spr.pos.XY()).Angle();
|
2020-05-13 22:04:14 +00:00
|
|
|
|
2020-11-01 14:56:50 +00:00
|
|
|
if (xvel < 512)
|
2020-05-13 22:04:14 +00:00
|
|
|
{
|
2022-09-11 22:08:42 +00:00
|
|
|
ps[pnum].vel.X = 0;
|
|
|
|
ps[pnum].vel.Y = 0;
|
2020-05-13 22:04:14 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2022-09-11 22:08:42 +00:00
|
|
|
ps[pnum].vel.XY() *= gs.playerfriction - 0.125;
|
2020-05-13 22:04:14 +00:00
|
|
|
}
|
|
|
|
}
|
2021-12-21 19:02:06 +00:00
|
|
|
else if ((isRRRA() && actor->spr.picnum != DRONE && actor->spr.picnum != SHARK && actor->spr.picnum != UFO1_RRRA) ||
|
|
|
|
(!isRRRA() && actor->spr.picnum != DRONE && actor->spr.picnum != SHARK && actor->spr.picnum != UFO1_RR
|
|
|
|
&& actor->spr.picnum != UFO2 && actor->spr.picnum != UFO3 && actor->spr.picnum != UFO4 && actor->spr.picnum != UFO5))
|
2020-05-13 22:04:14 +00:00
|
|
|
{
|
2021-11-12 15:53:56 +00:00
|
|
|
if (!*(moveptr + 1))
|
2020-05-13 22:04:14 +00:00
|
|
|
{
|
2022-02-03 21:06:09 +00:00
|
|
|
if (actor->opos.Z != actor->spr.pos.Z || (ud.multimode < 2 && ud.player_skill < 2))
|
2021-11-12 15:53:56 +00:00
|
|
|
{
|
|
|
|
if ((actor->temp_data[0] & 1) || ps[pnum].actorsqu == actor) return;
|
2022-09-15 15:39:01 +00:00
|
|
|
else daxvel *= 2;
|
2021-11-12 15:53:56 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if ((actor->temp_data[0] & 3) || ps[pnum].actorsqu == actor) return;
|
2022-09-15 15:39:01 +00:00
|
|
|
else daxvel *= 4;
|
2021-11-12 15:53:56 +00:00
|
|
|
}
|
2020-05-13 22:04:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (isRRRA())
|
|
|
|
{
|
2021-12-30 15:51:56 +00:00
|
|
|
if (actor->sector()->lotag != 1)
|
2020-05-13 22:04:14 +00:00
|
|
|
{
|
2021-12-21 19:02:06 +00:00
|
|
|
switch (actor->spr.picnum)
|
2020-05-13 22:04:14 +00:00
|
|
|
{
|
|
|
|
case MINIONBOAT:
|
|
|
|
case HULKBOAT:
|
|
|
|
case CHEERBOAT:
|
2022-09-15 15:39:01 +00:00
|
|
|
daxvel *= 0.5;
|
2020-05-13 22:04:14 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2021-12-30 15:51:56 +00:00
|
|
|
else if (actor->sector()->lotag == 1)
|
2020-05-13 22:04:14 +00:00
|
|
|
{
|
2021-12-21 19:02:06 +00:00
|
|
|
switch (actor->spr.picnum)
|
2020-05-13 22:04:14 +00:00
|
|
|
{
|
|
|
|
case BIKERB:
|
|
|
|
case BIKERBV2:
|
|
|
|
case CHEERB:
|
2022-09-15 15:39:01 +00:00
|
|
|
daxvel *= 0.5;
|
2020-05-13 22:04:14 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-22 21:41:07 +00:00
|
|
|
Collision coll;
|
2022-09-15 15:39:01 +00:00
|
|
|
actor->movflag = movesprite_ex(actor, DVector3(angdif.ToVector() * daxvel, actor->vel.Z), CLIPMASK0, coll);
|
2020-05-13 22:04:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (a)
|
|
|
|
{
|
2021-12-30 15:51:56 +00:00
|
|
|
if (actor->sector()->ceilingstat & CSTAT_SECTOR_SKY)
|
2020-05-13 22:04:14 +00:00
|
|
|
{
|
2021-12-30 15:51:56 +00:00
|
|
|
if (actor->sector()->shadedsector == 1)
|
2020-05-13 22:04:14 +00:00
|
|
|
{
|
2021-12-21 19:02:06 +00:00
|
|
|
actor->spr.shade += (16 - actor->spr.shade) >> 1;
|
2020-05-13 22:04:14 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-12-30 15:51:56 +00:00
|
|
|
actor->spr.shade += (actor->sector()->ceilingshade - actor->spr.shade) >> 1;
|
2020-05-13 22:04:14 +00:00
|
|
|
}
|
|
|
|
}
|
2021-12-30 15:51:56 +00:00
|
|
|
else actor->spr.shade += (actor->sector()->floorshade - actor->spr.shade) >> 1;
|
2020-05-13 22:04:14 +00:00
|
|
|
|
2021-12-30 15:51:56 +00:00
|
|
|
if (actor->sector()->floorpicnum == MIRROR)
|
2022-11-20 18:25:23 +00:00
|
|
|
actor->Destroy();
|
2020-05-13 22:04:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-01 16:57:40 +00:00
|
|
|
void fakebubbaspawn(DDukeActor *actor, int g_p)
|
2020-05-14 07:07:07 +00:00
|
|
|
{
|
|
|
|
fakebubba_spawn++;
|
|
|
|
switch (fakebubba_spawn)
|
|
|
|
{
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
case 1:
|
2020-11-01 16:57:40 +00:00
|
|
|
spawn(actor, PIG);
|
2020-05-14 07:07:07 +00:00
|
|
|
break;
|
|
|
|
case 2:
|
2020-11-01 16:57:40 +00:00
|
|
|
spawn(actor, MINION);
|
2020-05-14 07:07:07 +00:00
|
|
|
break;
|
|
|
|
case 3:
|
2020-11-01 16:57:40 +00:00
|
|
|
spawn(actor, CHEER);
|
2020-05-14 07:07:07 +00:00
|
|
|
break;
|
|
|
|
case 4:
|
2020-11-01 16:57:40 +00:00
|
|
|
spawn(actor, VIXEN);
|
2022-11-19 14:40:35 +00:00
|
|
|
operateactivators(666, &ps[g_p]);
|
2020-05-14 07:07:07 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
2020-05-17 16:04:45 +00:00
|
|
|
// special checks in fall that only apply to RR.
|
2020-05-14 07:07:07 +00:00
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2020-11-01 09:49:50 +00:00
|
|
|
static int fallspecial(DDukeActor *actor, int playernum)
|
2020-05-14 07:07:07 +00:00
|
|
|
{
|
|
|
|
int sphit = 0;
|
|
|
|
if (isRRRA())
|
|
|
|
{
|
2021-12-30 15:51:56 +00:00
|
|
|
if (actor->sector()->lotag == 801)
|
2020-05-14 07:07:07 +00:00
|
|
|
{
|
2021-12-21 19:02:06 +00:00
|
|
|
if (actor->spr.picnum == ROCK)
|
2020-05-14 07:07:07 +00:00
|
|
|
{
|
2020-10-22 16:51:20 +00:00
|
|
|
spawn(actor, ROCK2);
|
|
|
|
spawn(actor, ROCK2);
|
|
|
|
addspritetodelete();
|
2020-05-14 07:07:07 +00:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
2021-12-30 15:51:56 +00:00
|
|
|
else if (actor->sector()->lotag == 802)
|
2020-05-14 07:07:07 +00:00
|
|
|
{
|
2022-02-03 23:55:12 +00:00
|
|
|
if (actor->spr.picnum != APLAYER && badguy(actor) && actor->spr.pos.Z == actor->floorz - FOURSLEIGHT_F)
|
2020-05-14 07:07:07 +00:00
|
|
|
{
|
2020-10-22 17:21:21 +00:00
|
|
|
fi.guts(actor, JIBS6, 5, playernum);
|
2020-10-22 16:51:20 +00:00
|
|
|
S_PlayActorSound(SQUISHED, actor);
|
|
|
|
addspritetodelete();
|
2020-05-14 07:07:07 +00:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
2021-12-30 15:51:56 +00:00
|
|
|
else if (actor->sector()->lotag == 803)
|
2020-05-14 07:07:07 +00:00
|
|
|
{
|
2021-12-21 19:02:06 +00:00
|
|
|
if (actor->spr.picnum == ROCK2)
|
2020-10-22 16:51:20 +00:00
|
|
|
addspritetodelete();
|
2020-05-14 07:07:07 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
2021-12-30 15:51:56 +00:00
|
|
|
if (actor->sector()->lotag == 800)
|
2020-05-14 07:07:07 +00:00
|
|
|
{
|
2021-12-21 19:02:06 +00:00
|
|
|
if (actor->spr.picnum == 40)
|
2020-05-14 07:07:07 +00:00
|
|
|
{
|
2020-10-22 16:51:20 +00:00
|
|
|
addspritetodelete();
|
2020-05-14 07:07:07 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2021-12-21 19:02:06 +00:00
|
|
|
if (actor->spr.picnum != APLAYER && (badguy(actor) || actor->spr.picnum == HEN || actor->spr.picnum == COW || actor->spr.picnum == PIG || actor->spr.picnum == DOGRUN || actor->spr.picnum == RABBIT) && (!isRRRA() || actor->spriteextra < 128))
|
2020-05-14 07:07:07 +00:00
|
|
|
{
|
2022-02-03 23:55:12 +00:00
|
|
|
actor->spr.pos.Z = actor->floorz - FOURSLEIGHT_F;
|
2022-09-11 17:28:45 +00:00
|
|
|
actor->vel.Z = 8000 / 256.;
|
2021-12-21 19:02:06 +00:00
|
|
|
actor->spr.extra = 0;
|
2020-10-22 16:51:20 +00:00
|
|
|
actor->spriteextra++;
|
2020-05-14 07:07:07 +00:00
|
|
|
sphit = 1;
|
|
|
|
}
|
2021-12-21 19:02:06 +00:00
|
|
|
else if (actor->spr.picnum != APLAYER)
|
2020-05-14 07:07:07 +00:00
|
|
|
{
|
2020-10-22 16:51:20 +00:00
|
|
|
if (!actor->spriteextra)
|
|
|
|
addspritetodelete();
|
2020-05-14 07:07:07 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2021-12-27 22:52:16 +00:00
|
|
|
actor->attackertype = SHOTSPARK1;
|
2022-01-23 23:10:25 +00:00
|
|
|
actor->hitextra = 1;
|
2020-05-14 07:07:07 +00:00
|
|
|
}
|
2021-12-30 15:51:56 +00:00
|
|
|
else if (isRRRA() && (actor->sector()->floorpicnum == RRTILE7820 || actor->sector()->floorpicnum == RRTILE7768))
|
2020-05-14 07:07:07 +00:00
|
|
|
{
|
2021-12-21 19:02:06 +00:00
|
|
|
if (actor->spr.picnum != MINION && actor->spr.pal != 19)
|
2020-05-14 07:07:07 +00:00
|
|
|
{
|
|
|
|
if ((krand() & 3) == 1)
|
|
|
|
{
|
2021-12-27 22:52:16 +00:00
|
|
|
actor->attackertype = SHOTSPARK1;
|
2022-01-23 23:10:25 +00:00
|
|
|
actor->hitextra = 5;
|
2020-05-14 07:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return sphit;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2020-10-22 21:45:49 +00:00
|
|
|
void fall_r(DDukeActor* ac, int g_p)
|
2020-05-14 07:07:07 +00:00
|
|
|
{
|
2020-10-22 21:45:49 +00:00
|
|
|
fall_common(ac, g_p, JIBS6, DRONE, BLOODPOOL, SHOTSPARK1, 69, 158, fallspecial);
|
2020-05-14 07:07:07 +00:00
|
|
|
}
|
|
|
|
|
2020-05-14 10:14:03 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2020-10-22 21:41:07 +00:00
|
|
|
void destroyit(DDukeActor *actor)
|
2020-05-14 10:14:03 +00:00
|
|
|
{
|
2021-11-14 12:33:35 +00:00
|
|
|
int lotag = 0, hitag = 0;
|
2021-06-11 21:20:50 +00:00
|
|
|
DDukeActor* spr = nullptr;
|
2020-05-14 10:14:03 +00:00
|
|
|
|
2021-11-21 08:05:58 +00:00
|
|
|
DukeSectIterator it1(actor->sector());
|
2020-10-22 21:41:07 +00:00
|
|
|
while (auto a2 = it1.Next())
|
2020-05-14 10:14:03 +00:00
|
|
|
{
|
2021-12-21 17:19:45 +00:00
|
|
|
if (a2->spr.picnum == RRTILE63)
|
2020-05-14 10:14:03 +00:00
|
|
|
{
|
2021-12-21 17:19:45 +00:00
|
|
|
lotag = a2->spr.lotag;
|
2020-10-22 21:41:07 +00:00
|
|
|
spr = a2;
|
2021-12-21 17:19:45 +00:00
|
|
|
if (a2->spr.hitag)
|
|
|
|
hitag = a2->spr.hitag;
|
2020-05-14 10:14:03 +00:00
|
|
|
}
|
|
|
|
}
|
2020-10-22 21:41:07 +00:00
|
|
|
DukeStatIterator it(STAT_DESTRUCT);
|
|
|
|
while (auto a2 = it.Next())
|
2020-05-14 10:14:03 +00:00
|
|
|
{
|
2021-12-30 15:51:56 +00:00
|
|
|
auto it_sect = a2->sector();
|
2021-12-21 17:19:45 +00:00
|
|
|
if (hitag && hitag == a2->spr.hitag)
|
2020-10-22 21:41:07 +00:00
|
|
|
{
|
|
|
|
DukeSectIterator its(it_sect);
|
|
|
|
while (auto a3 = its.Next())
|
2020-05-14 10:14:03 +00:00
|
|
|
{
|
2021-12-21 17:19:45 +00:00
|
|
|
if (a3->spr.picnum == DESTRUCTO)
|
2020-05-14 10:14:03 +00:00
|
|
|
{
|
2021-12-27 22:52:16 +00:00
|
|
|
a3->attackertype = SHOTSPARK1;
|
2022-01-23 23:10:25 +00:00
|
|
|
a3->hitextra = 1;
|
2020-05-14 10:14:03 +00:00
|
|
|
}
|
|
|
|
}
|
2020-10-22 21:41:07 +00:00
|
|
|
}
|
2021-12-30 15:51:56 +00:00
|
|
|
if (spr && spr->sector() != it_sect)
|
2021-12-21 17:19:45 +00:00
|
|
|
if (lotag == a2->spr.lotag)
|
2020-05-14 10:14:03 +00:00
|
|
|
{
|
2021-12-30 15:51:56 +00:00
|
|
|
auto sect = spr->sector();
|
2021-11-06 11:54:24 +00:00
|
|
|
|
2021-11-20 23:33:17 +00:00
|
|
|
auto destsect = spr->sector();
|
2021-11-18 19:17:47 +00:00
|
|
|
auto srcsect = it_sect;
|
2021-11-06 11:54:24 +00:00
|
|
|
|
2022-11-15 14:44:33 +00:00
|
|
|
auto destwal = destsect->walls.Data();
|
|
|
|
auto srcwal = srcsect->walls.Data();
|
2022-11-15 13:59:28 +00:00
|
|
|
for (unsigned i = 0; i < destsect->walls.Size(); i++, srcwal++, destwal++)
|
2020-05-14 10:14:03 +00:00
|
|
|
{
|
2021-11-16 17:07:24 +00:00
|
|
|
destwal->picnum = srcwal->picnum;
|
|
|
|
destwal->overpicnum = srcwal->overpicnum;
|
|
|
|
destwal->shade = srcwal->shade;
|
2022-10-07 22:02:10 +00:00
|
|
|
destwal->xrepeat = srcwal->xrepeat;
|
|
|
|
destwal->yrepeat = srcwal->yrepeat;
|
2021-11-16 17:07:24 +00:00
|
|
|
destwal->xpan_ = srcwal->xpan_;
|
|
|
|
destwal->ypan_ = srcwal->ypan_;
|
2021-11-21 07:42:36 +00:00
|
|
|
if (isRRRA() && destwal->twoSided())
|
2020-05-14 10:14:03 +00:00
|
|
|
{
|
2021-11-16 17:07:24 +00:00
|
|
|
destwal->cstat = 0;
|
|
|
|
destwal->nextWall()->cstat = 0;
|
2020-05-14 10:14:03 +00:00
|
|
|
}
|
|
|
|
}
|
2022-08-20 18:11:01 +00:00
|
|
|
destsect->setfloorz(srcsect->floorz);
|
|
|
|
destsect->setceilingz(srcsect->ceilingz);
|
2021-11-06 11:54:24 +00:00
|
|
|
destsect->ceilingstat = srcsect->ceilingstat;
|
|
|
|
destsect->floorstat = srcsect->floorstat;
|
|
|
|
destsect->ceilingpicnum = srcsect->ceilingpicnum;
|
|
|
|
destsect->ceilingheinum = srcsect->ceilingheinum;
|
|
|
|
destsect->ceilingshade = srcsect->ceilingshade;
|
|
|
|
destsect->ceilingpal = srcsect->ceilingpal;
|
|
|
|
destsect->ceilingxpan_ = srcsect->ceilingxpan_;
|
|
|
|
destsect->ceilingypan_ = srcsect->ceilingypan_;
|
|
|
|
destsect->floorpicnum = srcsect->floorpicnum;
|
|
|
|
destsect->floorheinum = srcsect->floorheinum;
|
|
|
|
destsect->floorshade = srcsect->floorshade;
|
|
|
|
destsect->floorpal = srcsect->floorpal;
|
|
|
|
destsect->floorxpan_ = srcsect->floorxpan_;
|
|
|
|
destsect->floorypan_ = srcsect->floorypan_;
|
|
|
|
destsect->visibility = srcsect->visibility;
|
2021-11-20 16:46:08 +00:00
|
|
|
destsect->keyinfo = srcsect->keyinfo;
|
2021-11-06 11:54:24 +00:00
|
|
|
destsect->lotag = srcsect->lotag;
|
|
|
|
destsect->hitag = srcsect->hitag;
|
|
|
|
destsect->extra = srcsect->extra;
|
2022-11-13 17:55:32 +00:00
|
|
|
destsect->dirty = EDirty::AllDirty;
|
2020-05-14 10:14:03 +00:00
|
|
|
}
|
|
|
|
}
|
2021-12-30 15:51:56 +00:00
|
|
|
it1.Reset(actor->sector());
|
2020-11-04 20:53:56 +00:00
|
|
|
while (auto a2 = it1.Next())
|
2020-05-14 10:14:03 +00:00
|
|
|
{
|
2021-12-21 17:19:45 +00:00
|
|
|
switch (a2->spr.picnum)
|
2020-05-14 10:14:03 +00:00
|
|
|
{
|
|
|
|
case DESTRUCTO:
|
|
|
|
case RRTILE63:
|
|
|
|
case TORNADO:
|
2020-05-14 19:42:11 +00:00
|
|
|
case APLAYER:
|
2020-05-14 10:14:03 +00:00
|
|
|
case COOT:
|
|
|
|
break;
|
|
|
|
default:
|
2022-11-20 18:25:23 +00:00
|
|
|
a2->Destroy();
|
2020-05-14 10:14:03 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2020-10-22 21:45:49 +00:00
|
|
|
void mamaspawn(DDukeActor *actor)
|
2020-05-14 10:14:03 +00:00
|
|
|
{
|
|
|
|
if (mamaspawn_count)
|
|
|
|
{
|
|
|
|
mamaspawn_count--;
|
2020-10-22 21:45:49 +00:00
|
|
|
spawn(actor, RABBIT);
|
2020-05-14 10:14:03 +00:00
|
|
|
}
|
|
|
|
}
|
2020-05-14 17:23:36 +00:00
|
|
|
|
2022-11-14 22:55:46 +00:00
|
|
|
bool spawnweapondebris_r(int picnum)
|
2020-05-14 17:23:36 +00:00
|
|
|
{
|
2022-11-14 22:55:46 +00:00
|
|
|
return true;
|
2020-05-14 17:23:36 +00:00
|
|
|
}
|
|
|
|
|
2020-10-22 21:45:49 +00:00
|
|
|
void respawnhitag_r(DDukeActor *actor)
|
2020-05-14 17:23:36 +00:00
|
|
|
{
|
2021-12-21 17:19:45 +00:00
|
|
|
switch (actor->spr.picnum)
|
2020-05-14 17:23:36 +00:00
|
|
|
{
|
|
|
|
case FEM10:
|
|
|
|
case NAKED1:
|
|
|
|
case STATUE:
|
2022-11-20 10:58:19 +00:00
|
|
|
if (actor->spr.yint) operaterespawns(actor->spr.yint);
|
2020-05-14 17:23:36 +00:00
|
|
|
break;
|
|
|
|
default:
|
2022-11-20 10:58:19 +00:00
|
|
|
if (actor->spr.hitag >= 0) operaterespawns(actor->spr.hitag);
|
2020-05-14 17:23:36 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-23 19:12:15 +00:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void thunder(void);
|
|
|
|
|
|
|
|
void think_r(void)
|
|
|
|
{
|
|
|
|
thinktime.Reset();
|
|
|
|
thinktime.Clock();
|
|
|
|
|
2022-01-02 14:44:52 +00:00
|
|
|
movefta(); //ST 2
|
2020-06-23 19:12:15 +00:00
|
|
|
moveweapons_r(); //ST 4
|
|
|
|
moveplayers(); //ST 10
|
|
|
|
movefallers_r(); //ST 12
|
|
|
|
moveexplosions_r(); //ST 5
|
|
|
|
|
|
|
|
actortime.Reset();
|
|
|
|
actortime.Clock();
|
|
|
|
moveactors_r(); //ST 1
|
|
|
|
actortime.Unclock();
|
|
|
|
|
|
|
|
moveeffectors_r(); //ST 3
|
|
|
|
movestandables_r(); //ST 6
|
|
|
|
doanimations();
|
|
|
|
movefx(); //ST 11
|
|
|
|
|
|
|
|
if (numplayers < 2 && thunderon)
|
|
|
|
thunder();
|
|
|
|
|
|
|
|
thinktime.Unclock();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-05-07 12:55:04 +00:00
|
|
|
END_DUKE_NS
|