- flags for the bolts.

This commit is contained in:
Christoph Oelckers 2022-01-21 14:02:59 +01:00
parent 82898e42a6
commit 8487d693f5
11 changed files with 18 additions and 21 deletions

View file

@ -1101,7 +1101,7 @@ CLEAR_THE_BOLT2:
}
actor->spr.picnum++;
if ((krand() & 1) && sectp->floorpicnum == HURTRAIL)
if ((krand() & 1) && (gs.tileinfo[sectp->floorpicnum].flags & TFLAG_ELECTRIC))
S_PlayActorSound(SHORT_CIRCUIT, actor);
if (actor->spr.picnum == SIDEBOLT1 + 4) actor->spr.picnum = SIDEBOLT1;
@ -1152,7 +1152,7 @@ CLEAR_THE_BOLT:
if (l & 1) actor->spr.cstat ^= CSTAT_SPRITE_TRANSLUCENT;
if (actor->spr.picnum == (BOLT1+1) && (krand()&7) == 0 && sectp->floorpicnum == HURTRAIL)
if (actor->spr.picnum == (BOLT1+1) && (krand()&7) == 0 && (gs.tileinfo[sectp->floorpicnum].flags & TFLAG_ELECTRIC))
S_PlayActorSound(SHORT_CIRCUIT,actor);
if (actor->spr.picnum==BOLT1+4) actor->spr.picnum=BOLT1;

View file

@ -794,7 +794,7 @@ CLEAR_THE_BOLT:
if (l & 1) actor->spr.cstat ^= CSTAT_SPRITE_TRANSLUCENT;
if (actor->spr.picnum == (BOLT1 + 1) && (krand() & 1) && sectp->floorpicnum == HURTRAIL)
if (actor->spr.picnum == (BOLT1 + 1) && (krand() & 1) && (gs.tileinfo[sectp->floorpicnum].flags & TFLAG_ELECTRIC))
S_PlayActorSound(SHORT_CIRCUIT, actor);
if (actor->spr.picnum == BOLT1 + 4) actor->spr.picnum = BOLT1;

View file

@ -349,8 +349,11 @@ DEFINE_TFLAGS_OPERATORS(EDukeFlags2)
enum
{
TFLAG_WALLSWITCH = 1,
TFLAG_ADULT = 2,
TFLAG_WALLSWITCH = 1,
TFLAG_ADULT = 2,
TFLAG_ELECTRIC = 4,
TFLAG_CLEARINVENTORY = 8, // really dumb Duke stuff...
TFLAG_SLIME = 16,
};
enum

View file

@ -212,7 +212,6 @@ int TILE_BOTTOMSTATUSBAR;
int TILE_THREEDEE;
int TILE_INGAMEDUKETHREEDEE;
int TILE_ATOMICHEALTH;
int TILE_FLOORSLIME;
int TILE_JIBS6;
int TILE_FIRE;
int TILE_WATERBUBBLE;
@ -237,8 +236,6 @@ int TILE_LA;
int TILE_LOADSCREEN;
int TILE_CROSSHAIR;
int TILE_BIGORBIT1;
int TILE_HURTRAIL;
int TILE_FLOORPLASMA;
int TILE_EGG;
END_DUKE_NS

View file

@ -144,6 +144,9 @@ void initactorflags_d()
4498,
4957 });
settileflag(TFLAG_ELECTRIC, { HURTRAIL });
settileflag(TFLAG_CLEARINVENTORY, { HURTRAIL, FLOORSLIME, FLOORPLASMA });
settileflag(TFLAG_SLIME, { FLOORSLIME, FLOORSLIME + 1, FLOORSLIME + 2 });
gs.actorinfo[COMMANDER].gutsoffset = -(24 << 8);
@ -324,7 +327,6 @@ void initactorflags_d()
TILE_STATIC = STATIC;
TILE_BOTTOMSTATUSBAR = isWorldTour()? WIDESCREENSTATUSBAR : BOTTOMSTATUSBAR;
TILE_ATOMICHEALTH = ATOMICHEALTH;
TILE_FLOORSLIME = FLOORSLIME;
TILE_JIBS6 = JIBS6;
TILE_FIRE = FIRE;
TILE_WATERBUBBLE = WATERBUBBLE;
@ -347,8 +349,6 @@ void initactorflags_d()
TILE_LOADSCREEN = LOADSCREEN;
TILE_CROSSHAIR = CROSSHAIR;
TILE_BIGORBIT1 = BIGORBIT1;
TILE_HURTRAIL = HURTRAIL;
TILE_FLOORPLASMA = FLOORPLASMA;
TILE_EGG = EGG;
}

View file

@ -106,6 +106,9 @@ void initactorflags_r()
DOLPHIN2,
TOUGHGAL });
settileflag(TFLAG_ELECTRIC, { HURTRAIL });
settileflag(TFLAG_CLEARINVENTORY, { HURTRAIL, FLOORSLIME, FLOORPLASMA });
settileflag(TFLAG_SLIME, { FLOORSLIME, FLOORSLIME + 1, FLOORSLIME + 2 });
for (auto& fa : gs.actorinfo)
{
@ -296,7 +299,6 @@ void initactorflags_r()
TILE_STATIC = STATIC;
TILE_BOTTOMSTATUSBAR = BOTTOMSTATUSBAR;
TILE_ATOMICHEALTH = ATOMICHEALTH;
TILE_FLOORSLIME = FLOORSLIME;
TILE_JIBS6 = JIBS6;
TILE_FIRE = FIRE;
TILE_WATERBUBBLE = WATERBUBBLE;
@ -319,8 +321,6 @@ void initactorflags_r()
TILE_LOADSCREEN = LOADSCREEN;
TILE_CROSSHAIR = CROSSHAIR;
TILE_BIGORBIT1 = BIGORBIT1;
TILE_HURTRAIL = HURTRAIL;
TILE_FLOORPLASMA = FLOORPLASMA;
TILE_EGG = EGG;
gs.playerheight = PHEIGHT_RR;

View file

@ -21,7 +21,6 @@ extern int TILE_CAMLIGHT;
extern int TILE_STATIC;
extern int TILE_BOTTOMSTATUSBAR;
extern int TILE_ATOMICHEALTH;
extern int TILE_FLOORSLIME;
extern int TILE_JIBS6;
extern int TILE_FIRE;
extern int TILE_WATERBUBBLE;
@ -46,8 +45,6 @@ extern int TILE_LA;
extern int TILE_LOADSCREEN;
extern int TILE_CROSSHAIR;
extern int TILE_BIGORBIT1;
extern int TILE_HURTRAIL;
extern int TILE_FLOORPLASMA;
extern int TILE_EGG;

View file

@ -84,7 +84,7 @@ int setpal(struct player_struct* p)
if (p->DrugMode) palette = DRUGPAL;
else if (p->heat_on) palette = SLIMEPAL;
else if (!p->insector()) palette = BASEPAL; // don't crash if out of range.
else if (p->cursector->ceilingpicnum >= TILE_FLOORSLIME && p->cursector->ceilingpicnum <= TILE_FLOORSLIME + 2) palette = SLIMEPAL;
else if (gs.tileinfo[p->cursector->ceilingpicnum].flags & TFLAG_SLIME) palette = SLIMEPAL;
else if (p->cursector->lotag == ST_2_UNDERWATER) palette = WATERPAL;
else palette = BASEPAL;
return palette;

View file

@ -2920,7 +2920,7 @@ void processinput_d(int snum)
if (p->on_ground && truefdist <= gs.playerheight + (16 << 8))
{
int whichsound = j == HURTRAIL ? 0 : j == FLOORSLIME ? 1 : j == FLOORPLASMA ? 2 : -1;
int whichsound = (gs.tileinfo[j].flags & TFLAG_ELECTRIC) ? 0 : j == FLOORSLIME ? 1 : j == FLOORPLASMA ? 2 : -1;
if (j >= 0) k = makepainsounds(snum, whichsound);
}

View file

@ -3630,7 +3630,7 @@ void processinput_r(int snum)
if (p->on_ground && truefdist <= gs.playerheight + (16 << 8))
{
int whichsound = j == HURTRAIL ? 0 : j == FLOORSLIME ? 1 : j == FLOORPLASMA ? 2 :
int whichsound = (gs.tileinfo[j].flags & TFLAG_ELECTRIC) ? 0 : j == FLOORSLIME ? 1 : j == FLOORPLASMA ? 2 :
(isRRRA() && (j == RRTILE7768 || j == RRTILE7820) ? 3 : -1);
if (j >= 0) k = makepainsounds(snum, whichsound);
}

View file

@ -1049,7 +1049,7 @@ void enterlevel(MapRecord *mi, int gamemode)
{
bool clearweapon = !!(currentLevel->flags & LEVEL_CLEARWEAPONS);
int pn = ps[i].GetActor()->sector()->floorpicnum;
if (pn == TILE_HURTRAIL || pn == TILE_FLOORSLIME || pn == TILE_FLOORPLASMA)
if (gs.tileinfo[pn].flags & TFLAG_CLEARINVENTORY)
{
resetinventory(i);
clearweapon = true;