- Duke: added two more flags to eliminate the references to the crane's tile numbers.

This commit is contained in:
Christoph Oelckers 2022-01-25 22:26:53 +01:00
parent e3103fff02
commit 5bc8b1c2d3
14 changed files with 23 additions and 9 deletions

View file

@ -4379,7 +4379,7 @@ void handle_se27(DDukeActor* actor)
//
//---------------------------------------------------------------------------
void handle_se24(DDukeActor *actor, const int16_t *list1, const int16_t *list2, bool scroll, int TRIPBOMB, int LASERLINE, int CRANE, int shift)
void handle_se24(DDukeActor *actor, const int16_t *list1, const int16_t *list2, bool scroll, int TRIPBOMB, int LASERLINE, int shift)
{
auto testlist = [](const int16_t* list, int val) { for (int i = 0; list[i] > 0; i++) if (list[i] == val) return true; return false; };
@ -4416,7 +4416,7 @@ void handle_se24(DDukeActor *actor, const int16_t *list1, const int16_t *list2,
wallswitchcheck(a2))
break;
if (!(a2->spr.picnum >= CRANE && a2->spr.picnum <= (CRANE + 3)))
if (!(gs.actorinfo[a2->spr.picnum].flags & SFLAG_SE24_NOFLOORCHECK))
{
if (a2->spr.pos.Z > (a2->floorz - (16 << 8)))
{
@ -4426,7 +4426,7 @@ void handle_se24(DDukeActor *actor, const int16_t *list1, const int16_t *list2,
SetActor(a2, a2->spr.pos);
if (a2->sector()->floorstat & CSTAT_SECTOR_SLOPE)
if (a2->spr.statnum == 2)
if (a2->spr.statnum == STAT_ZOMBIEACTOR)
makeitfall(a2);
}
}

View file

@ -3446,7 +3446,7 @@ void moveeffectors_d(void) //STATNUM 3
{
static const int16_t list1[] = { BLOODPOOL, PUKE, FOOTPRINTS, FOOTPRINTS2, FOOTPRINTS3, FOOTPRINTS4, BULLETHOLE, BLOODSPLAT1, BLOODSPLAT2, BLOODSPLAT3, BLOODSPLAT4, -1 };
static const int16_t list2[] = { BOLT1, BOLT1 + 1,BOLT1 + 2, BOLT1 + 3, SIDEBOLT1, SIDEBOLT1 + 1, SIDEBOLT1 + 2, SIDEBOLT1 + 3, -1 };
handle_se24(act, list1, list2, true, TRIPBOMB, LASERLINE, CRANE, 2);
handle_se24(act, list1, list2, true, TRIPBOMB, LASERLINE, 2);
break;
}
case SE_35:

View file

@ -3401,7 +3401,7 @@ void moveeffectors_r(void) //STATNUM 3
{
static const int16_t list1[] = { BLOODPOOL, PUKE, FOOTPRINTS, FOOTPRINTS2, FOOTPRINTS3, -1 };
static const int16_t list2[] = { BOLT1, BOLT1 + 1,BOLT1 + 2, BOLT1 + 3, -1 };
handle_se24(act, list1, list2, st != 156, BULLETHOLE, -1, CRANE, 1);
handle_se24(act, list1, list2, st != 156, BULLETHOLE, -1, 1);
break;
}

View file

@ -171,7 +171,7 @@ void animatesprites_d(tspritetype* tsprite, int& spritesortcnt, int x, int y, in
t->pos.Z = interpolatedvalue(ps[h->spr.yvel].opos.Z, ps[h->spr.yvel].pos.Z, smoothratio);
t->pos.Z += PHEIGHT_DUKE;
}
else if (h->spr.picnum != CRANEPOLE)
else if (!(gs.actorinfo[h->spr.picnum].flags & SFLAG_NOINTERPOLATE))
{
t->pos = h->interpolatedvec3(smoothratio);
}

View file

@ -154,7 +154,7 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in
h->spr.xrepeat = 24;
h->spr.yrepeat = 17;
}
else if (h->spr.picnum != CRANEPOLE)
else if (!(gs.actorinfo[h->spr.picnum].flags & SFLAG_NOINTERPOLATE))
{
t->pos = h->interpolatedvec3(smoothratio);
}

View file

@ -313,6 +313,8 @@ enum sflags_t
SFLAG_MOVEFTA_WAKEUPCHECK = 0x00010000,
SFLAG_MOVEFTA_CHECKSEEWITHPAL8 = 0x00020000, // let's hope this can be done better later. For now this was what blocked merging the Duke and RR variants of movefta
SFLAG_NOSHADOW = 0x00040000,
SFLAG_SE24_NOFLOORCHECK = 0x00080000,
SFLAG_NOINTERPOLATE = 0x00100000,
};

View file

@ -198,6 +198,8 @@ void initactorflags_d()
if (isWorldTour()) setflag(SFLAG_BOSS, { BOSS2STAYPUT, BOSS3STAYPUT, BOSS5, BOSS5STAYPUT });
setflag(SFLAG_NOWATERDIP, { OCTABRAIN, COMMANDER, DRONE });
setflag(SFLAG_GREENSLIMEFOOD, { LIZTROOP, LIZMAN, PIGCOP, NEWBEAST });
setflag(SFLAG_SE24_NOFLOORCHECK, { CRANE, CRANE1, CRANE2, BARBROKE });
setflag(SFLAG_NOINTERPOLATE, { CRANEPOLE });
if (isWorldTour())
{

View file

@ -228,6 +228,9 @@ void initactorflags_r()
NUKEBARRELLEAKED
});
setflag(SFLAG_SE24_NOFLOORCHECK, { CRANE, CRANE1, CRANE2, BARBROKE });
setflag(SFLAG_NOINTERPOLATE, { CRANEPOLE });
// Animals were not supposed to have this, but due to a coding bug the logic was unconditional for everything in the game.
for (auto& ainf : gs.actorinfo)
{

View file

@ -85,7 +85,7 @@ void handle_se19(DDukeActor* i, int BIGFORCE);
void handle_se20(DDukeActor* i);
void handle_se21(DDukeActor* i);
void handle_se22(DDukeActor* i);
void handle_se24(DDukeActor* actor, const int16_t* list1, const int16_t* list2, bool scroll, int TRIPBOMB, int LASERLINE, int CRANE, int shift);
void handle_se24(DDukeActor* actor, const int16_t* list1, const int16_t* list2, bool scroll, int TRIPBOMB, int LASERLINE, int shift);
void handle_se25(DDukeActor* a, int t_index, int snd1, int snd2);
void handle_se26(DDukeActor* i);
void handle_se27(DDukeActor* i);

View file

@ -323,6 +323,8 @@ x(COLAMACHINE, 1215)
x(COLAMACHINEBROKE, 1217)
x(CRANEPOLE, 1221)
x(CRANE, 1222)
x(CRANE1, 1223)
x(CRANE2, 1224)
x(BARBROKE, 1225)
x(BLOODPOOL, 1226)
x(NUKEBARREL, 1227)

View file

@ -390,6 +390,8 @@ x(COLAMACHINE, 1294)
x(COLAMACHINEBROKE, 1296)
x(CRANEPOLE, 1298)
x(CRANE, 1299)
x(CRANE1, 1300)
x(CRANE2, 1301)
x(BARBROKE, 1302)
x(BLOODPOOL, 1303)
x(NUKEBARREL, 1304)

View file

@ -305,6 +305,7 @@ void DDukeActor::Serialize(FSerializer& arc)
("tempang", tempang)
("actorstayput", actorstayput)
("dispicnum", dispicnum)
("basepicnum", basepicnum)
("timetosleep", timetosleep)
("floorz", floorz)
("ceilingz", ceilingz)

View file

@ -36,7 +36,7 @@ public:
uint8_t cgg;
uint8_t spriteextra; // moved here for easier maintenance. This was originally a hacked in field in the sprite structure called 'filler'.
short attackertype, hitang, hitextra, movflag;
short tempang, dispicnum;
short tempang, dispicnum, basepicnum;
short timetosleep;
vec2_t ovel;
int floorz, ceilingz;

View file

@ -36,5 +36,7 @@ class DukeActor : CoreActor native
//flagdef MoveFTA_WakeupCheck: flags1, 16; // this one needs to be auto-set for RR, not for Duke, should not be exposed unless the feature becomes generally available.
flagdef CheckSeeWithPal8: flags1, 17;
flagdef NoShadow: flags1, 18;
flagdef SE24_NoFloorCheck: flags1, 19;
flagdef NoInterpolate: flags1, 20;
}