From 3d0c794224bf1fdffb5b8fb44e18c3d74038bcee Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 19 Jan 2022 10:48:18 +0100 Subject: [PATCH] - two more flags for LASERLINE. --- source/games/duke/src/actors.cpp | 25 +++++++++++----------- source/games/duke/src/actors_d.cpp | 4 ++-- source/games/duke/src/actors_r.cpp | 8 +++---- source/games/duke/src/animatesprites_d.cpp | 3 ++- source/games/duke/src/constants.h | 3 ++- source/games/duke/src/dispatch.cpp | 1 - source/games/duke/src/flags_d.cpp | 3 ++- source/games/duke/src/flags_r.cpp | 3 +-- source/games/duke/src/funct.h | 2 +- source/games/duke/src/game_misc.cpp | 2 +- source/games/duke/src/namelist_r.h | 1 - source/games/duke/src/names.h | 1 - 12 files changed, 27 insertions(+), 29 deletions(-) diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index b6f399602..384349166 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -2582,7 +2582,7 @@ void gutsdir(DDukeActor* actor, int gtype, int n, int p) // //--------------------------------------------------------------------------- -void handle_se00(DDukeActor* actor, int LASERLINE) +void handle_se00(DDukeActor* actor) { sectortype *sect = actor->sector(); @@ -2713,20 +2713,19 @@ void handle_se00(DDukeActor* actor, int LASERLINE) DukeSectIterator itp(actor->sector()); while (auto act2 = itp.Next()) { - if (act2->spr.statnum != 3 && act2->spr.statnum != 4) - if (LASERLINE < 0 || act2->spr.picnum != LASERLINE) + if (act2->spr.statnum != STAT_MISC && act2->spr.statnum != STAT_PROJECTILE && !actorflag(act2, SFLAG2_NOROTATEWITHSECTOR)) + { + if (act2->isPlayer() && act2->GetOwner()) { - if (act2->isPlayer() && act2->GetOwner()) - { - continue; - } - - act2->spr.ang += (l * q); - act2->spr.ang &= 2047; - - act2->spr.pos.Z += zchange; - rotatepoint(Owner->spr.pos.vec2, act2->spr.pos.vec2, (q* l), &act2->spr.pos.vec2); + continue; } + + act2->spr.ang += (l * q); + act2->spr.ang &= 2047; + + act2->spr.pos.Z += zchange; + rotatepoint(Owner->spr.pos.vec2, act2->spr.pos.vec2, (q* l), &act2->spr.pos.vec2); + } } } diff --git a/source/games/duke/src/actors_d.cpp b/source/games/duke/src/actors_d.cpp index 11289b35f..7cce4db2c 100644 --- a/source/games/duke/src/actors_d.cpp +++ b/source/games/duke/src/actors_d.cpp @@ -928,7 +928,7 @@ static void movetripbomb(DDukeActor *actor) ChangeActorSect(actor, curSect); - // this is a hack to work around the LASERLINE sprite's art tile offset + // this is a hack to work around the laser line sprite's art tile offset ChangeActorSect(spawned, curSect); } } @@ -3340,7 +3340,7 @@ void moveeffectors_d(void) //STATNUM 3 switch (act->spr.lotag) { case SE_0_ROTATING_SECTOR: - handle_se00(act, LASERLINE); + handle_se00(act); break; case SE_1_PIVOT: //Nothing for now used as the pivot diff --git a/source/games/duke/src/actors_r.cpp b/source/games/duke/src/actors_r.cpp index 052318d44..b745abdbd 100644 --- a/source/games/duke/src/actors_r.cpp +++ b/source/games/duke/src/actors_r.cpp @@ -547,7 +547,7 @@ int ifhitbyweapon_r(DDukeActor *actor) case SEENINE: case OOZFILTER: case EXPLODINGBARREL: - case TRIPBOMBSPRITE: + case POWDERKEG: case RPG2: ps[p].vel.X += actor->hitextra * bcos(actor->hitang, 2); ps[p].vel.Y += actor->hitextra * bsin(actor->hitang, 2); @@ -2475,7 +2475,7 @@ DETONATEB: int m = 0; switch (actor->spr.picnum) { - case TRIPBOMBSPRITE: m = gs.tripbombblastradius; break; // powder keg + case POWDERKEG: m = gs.tripbombblastradius; break; // powder keg case HEAVYHBOMB: m = gs.pipebombblastradius; break; case HBOMBAMMO: m = gs.pipebombblastradius; break; case MORTER: m = gs.morterblastradius; break; @@ -2864,7 +2864,7 @@ void moveactors_r(void) getglobalz(act); break; - case TRIPBOMBSPRITE: + case POWDERKEG: if (!isRRRA() || (sectp->lotag != 1 && sectp->lotag != 160)) if (act->spr.xvel) { @@ -3289,7 +3289,7 @@ void moveeffectors_r(void) //STATNUM 3 switch (st) { case SE_0_ROTATING_SECTOR: - handle_se00(act, -1); + handle_se00(act); break; case SE_1_PIVOT: //Nothing for now used as the pivot diff --git a/source/games/duke/src/animatesprites_d.cpp b/source/games/duke/src/animatesprites_d.cpp index a4a0a7eaf..c97905e0d 100644 --- a/source/games/duke/src/animatesprites_d.cpp +++ b/source/games/duke/src/animatesprites_d.cpp @@ -631,7 +631,8 @@ void animatesprites_d(tspritetype* tsprite, int& spritesortcnt, int x, int y, in t->pos.Z = OwnerAc->spr.pos.Z - (3 << 8); if (gs.lasermode == 2 && ps[screenpeek].heat_on == 0) t->yrepeat = 0; - [[fallthrough]]; + t->shade = -127; + break; case EXPLOSION2: case EXPLOSION2BOT: case FREEZEBLAST: diff --git a/source/games/duke/src/constants.h b/source/games/duke/src/constants.h index c14200afb..9c7883376 100644 --- a/source/games/duke/src/constants.h +++ b/source/games/duke/src/constants.h @@ -326,7 +326,6 @@ enum sflags_t SFLAG_SE24_REMOVE = 0x20000000, SFLAG_BLOCK_TRIPBOMB = 0x40000000, SFLAG_NOFALLER = 0x80000000, - }; using EDukeFlags1 = TFlags; @@ -335,6 +334,8 @@ DEFINE_TFLAGS_OPERATORS(EDukeFlags1) enum sflags2_t { SFLAG2_USEACTIVATOR = 0x00000001, + SFLAG2_NOROTATEWITHSECTOR = 0x00000002, + SFLAG2_SHOWWALLSPRITEONMAP = 0x00000004, }; using EDukeFlags2 = TFlags; diff --git a/source/games/duke/src/dispatch.cpp b/source/games/duke/src/dispatch.cpp index 34a9892fc..73018cc61 100644 --- a/source/games/duke/src/dispatch.cpp +++ b/source/games/duke/src/dispatch.cpp @@ -205,7 +205,6 @@ int TILE_DRONE; int TILE_MENUSCREEN; int TILE_SCREENBORDER; int TILE_VIEWBORDER; -int TILE_LASERLINE; int TILE_APLAYERTOP; int TILE_CAMCORNER; int TILE_CAMLIGHT; diff --git a/source/games/duke/src/flags_d.cpp b/source/games/duke/src/flags_d.cpp index bb7cbf696..3476872f7 100644 --- a/source/games/duke/src/flags_d.cpp +++ b/source/games/duke/src/flags_d.cpp @@ -211,6 +211,8 @@ void initactorflags_d() setflag(SFLAG_SE24_REMOVE, { BLOODPOOL, PUKE, FOOTPRINTS, FOOTPRINTS2, FOOTPRINTS3, FOOTPRINTS4, BULLETHOLE, BLOODSPLAT1, BLOODSPLAT2, BLOODSPLAT3, BLOODSPLAT4 }); setflag(SFLAG_BLOCK_TRIPBOMB, { TRIPBOMB }); // making this a flag adds the option to let other things block placing trip bombs as well. setflag(SFLAG_NOFALLER, { CRACK1, CRACK2, CRACK3, CRACK4, SPEAKER, LETTER, DUCK, TARGET, TRIPBOMB, VIEWSCREEN, VIEWSCREEN2 }); + setflag(SFLAG2_NOROTATEWITHSECTOR, { LASERLINE }); + setflag(SFLAG2_SHOWWALLSPRITEONMAP, { LASERLINE }); if (isWorldTour()) { @@ -311,7 +313,6 @@ void initactorflags_d() TILE_MENUSCREEN = MENUSCREEN; TILE_SCREENBORDER = BIGHOLE; TILE_VIEWBORDER = VIEWBORDER; - TILE_LASERLINE = LASERLINE; TILE_APLAYERTOP = APLAYERTOP; TILE_CAMCORNER = CAMCORNER; TILE_CAMLIGHT = CAMLIGHT; diff --git a/source/games/duke/src/flags_r.cpp b/source/games/duke/src/flags_r.cpp index 3366725a1..08d8b42da 100644 --- a/source/games/duke/src/flags_r.cpp +++ b/source/games/duke/src/flags_r.cpp @@ -235,7 +235,7 @@ void initactorflags_r() setflag(SFLAG_NOFLOORFIRE, { TREE1, TREE2 }); setflag(SFLAG_HITRADIUS_FLAG1, { BOX, TREE1, TREE2, TIRE }); setflag(SFLAG_HITRADIUS_FLAG2, { QUEBALL, STRIPEBALL, BOWLINGPIN, DUKELYINGDEAD }); - setflag(SFLAG_CHECKSLEEP, { RUBBERCAN, EXPLODINGBARREL, WOODENHORSE, HORSEONSIDE, CANWITHSOMETHING, FIREBARREL, NUKEBARREL, NUKEBARRELDENTED, NUKEBARRELLEAKED, TRIPBOMB, EGG }); + setflag(SFLAG_CHECKSLEEP, { RUBBERCAN, EXPLODINGBARREL, WOODENHORSE, HORSEONSIDE, CANWITHSOMETHING, FIREBARREL, NUKEBARREL, NUKEBARRELDENTED, NUKEBARRELLEAKED, EGG }); setflag(SFLAG_NOTELEPORT, { TRANSPORTERSTAR, TRANSPORTERBEAM, BULLETHOLE, WATERSPLASH2, BURNING, FIRE, MUD }); setflag(SFLAG_SE24_NOCARRY, { BULLETHOLE, BOLT1, BOLT1 + 1,BOLT1 + 2, BOLT1 + 3, CRANE, CRANE1, CRANE2, BARBROKE }); setflag(SFLAG_SE24_REMOVE, { BLOODPOOL, PUKE, FOOTPRINTS, FOOTPRINTS2, FOOTPRINTS3 }); @@ -283,7 +283,6 @@ void initactorflags_r() TILE_MENUSCREEN = MENUSCREEN; TILE_SCREENBORDER = isRRRA()? 7629 : BIGHOLE; TILE_VIEWBORDER = VIEWBORDER; - TILE_LASERLINE = LASERLINE; TILE_APLAYERTOP = APLAYERTOP; TILE_CAMCORNER = CAMCORNER; TILE_CAMLIGHT = CAMLIGHT; diff --git a/source/games/duke/src/funct.h b/source/games/duke/src/funct.h index 36d73d16b..d10b8c2e8 100644 --- a/source/games/duke/src/funct.h +++ b/source/games/duke/src/funct.h @@ -64,7 +64,7 @@ void shell(DDukeActor* i, bool morecheck); void glasspieces(DDukeActor* i); void scrap(DDukeActor* i, int SCRAP1, int SCRAP6); -void handle_se00(DDukeActor* i, int LASERLINE); +void handle_se00(DDukeActor* i); void handle_se01(DDukeActor* i); void handle_se14(DDukeActor* i, bool checkstat, int RPG, int JIBS6); void handle_se30(DDukeActor* i, int JIBS6); diff --git a/source/games/duke/src/game_misc.cpp b/source/games/duke/src/game_misc.cpp index 14d4f2b9b..1ec1bfbdf 100644 --- a/source/games/duke/src/game_misc.cpp +++ b/source/games/duke/src/game_misc.cpp @@ -444,7 +444,7 @@ bool GameInterface::DrawAutomapPlayer(int mx, int my, int cposx, int cposy, int break; case CSTAT_SPRITE_ALIGNMENT_WALL: - if (act->spr.picnum == TILE_LASERLINE) + if (actorflag(act, SFLAG2_SHOWWALLSPRITEONMAP)) { x1 = sprx; y1 = spry; diff --git a/source/games/duke/src/namelist_r.h b/source/games/duke/src/namelist_r.h index c82444c58..ba18a3af0 100644 --- a/source/games/duke/src/namelist_r.h +++ b/source/games/duke/src/namelist_r.h @@ -533,7 +533,6 @@ x(SHOTGUNSHELL, 1704) x(RPGMUZZLEFLASH, 1714) x(CATLITE, 1721) x(HANDHOLDINGLASER, 1732) -x(TRIPBOMB, 1735) x(LASERLINE, 1736) x(HANDHOLDINGACCESS, 1737) x(HANDREMOTE, 1739) diff --git a/source/games/duke/src/names.h b/source/games/duke/src/names.h index b13b19656..0db7227e4 100644 --- a/source/games/duke/src/names.h +++ b/source/games/duke/src/names.h @@ -16,7 +16,6 @@ extern int TILE_DRONE; extern int TILE_MENUSCREEN; extern int TILE_SCREENBORDER; extern int TILE_VIEWBORDER; -extern int TILE_LASERLINE; extern int TILE_APLAYERTOP; extern int TILE_CAMCORNER; extern int TILE_CAMLIGHT;