- lotsofcolourglass

This commit is contained in:
Christoph Oelckers 2021-11-18 00:38:20 +01:00
parent 344041167e
commit 35eb94b89a
5 changed files with 39 additions and 42 deletions

View file

@ -172,8 +172,8 @@ void OnEvent(int id, int pnum = -1, DDukeActor* snum = nullptr, int dist = -1);
DDukeActor* EGS(int whatsect, int s_x, int s_y, int s_z, int s_pn, int8_t s_s, int8_t s_xr, int8_t s_yr, int s_a, int s_ve, int s_zv, DDukeActor* s_ow, int8_t s_ss);
void ceilingglass(DDukeActor* snum, int sectnum, int cnt);
void spriteglass(DDukeActor* snum, int cnt);
void lotsofcolourglass(DDukeActor* snum, int wallNum, int cnt);
void lotsofglass(DDukeActor* snum, int wallnum, int cnt);
void lotsofcolourglass(DDukeActor* snum, walltype* wallNum, int cnt);
void lotsofglass(DDukeActor* snum, walltype* wallnum, int cnt);
void checkplayerhurt_d(struct player_struct* p, const Collision& coll);
void checkplayerhurt_r(struct player_struct* p, const Collision& coll);

View file

@ -1229,7 +1229,7 @@ void breakwall(int newpn, DDukeActor* spr, walltype* wal)
wal->picnum = newpn;
S_PlayActorSound(VENT_BUST, spr);
S_PlayActorSound(GLASS_HEAVYBREAK, spr);
lotsofglass(spr, wallnum(wal), 10);
lotsofglass(spr, wal, 10);
}
//---------------------------------------------------------------------------

View file

@ -653,7 +653,7 @@ void checkhitwall_d(DDukeActor* spr, walltype* wal, int x, int y, int z, int atw
case SEENINE:
case OOZFILTER:
case EXPLODINGBARREL:
lotsofglass(spr, wallnum(wal), 70);
lotsofglass(spr, wal, 70);
wal->cstat &= ~16;
wal->overpicnum = MIRRORBROKE;
wal->portalflags = 0;
@ -710,7 +710,7 @@ void checkhitwall_d(DDukeActor* spr, walltype* wal, int x, int y, int z, int atw
{
updatesector(x, y, &sn); if (sn < 0) return;
wal->overpicnum = GLASS2;
lotsofglass(spr, wallnum(wal), 10);
lotsofglass(spr, wal, 10);
wal->cstat = 0;
if (wal->nextwall >= 0)
@ -725,7 +725,7 @@ void checkhitwall_d(DDukeActor* spr, walltype* wal, int x, int y, int z, int atw
}
case STAINGLASS1:
updatesector(x, y, &sn); if (sn < 0) return;
lotsofcolourglass(spr, wallnum(wal), 80);
lotsofcolourglass(spr, wal, 80);
wal->cstat = 0;
if (wal->nextwall >= 0)
wal->nextWall()->cstat = 0;
@ -769,7 +769,7 @@ void checkhitwall_d(DDukeActor* spr, walltype* wal, int x, int y, int z, int atw
case SCREENBREAK19:
case BORNTOBEWILDSCREEN:
lotsofglass(spr, wallnum(wal), 30);
lotsofglass(spr, wal, 30);
wal->picnum = W_SCREENBREAK + (krand() % 3);
S_PlayActorSound(GLASS_HEAVYBREAK, spr);
return;
@ -833,7 +833,7 @@ void checkhitwall_d(DDukeActor* spr, walltype* wal, int x, int y, int z, int atw
if (rnd(128))
S_PlayActorSound(GLASS_HEAVYBREAK, spr);
else S_PlayActorSound(GLASS_BREAKING, spr);
lotsofglass(spr, wallnum(wal), 30);
lotsofglass(spr, wal, 30);
if (wal->picnum == WALLLIGHT1)
wal->picnum = WALLLIGHTBUST1;
@ -1036,7 +1036,7 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj)
if (!isWorldTour())
break;
S_PlayActorSound(GLASS_BREAKING, targ);
lotsofglass(targ, -1, 10);
lotsofglass(targ, nullptr, 10);
deletesprite(targ);
return;
@ -1067,7 +1067,7 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj)
}
else
{
lotsofglass(targ, -1, 3);
lotsofglass(targ, nullptr, 3);
deletesprite(targ);
}
}
@ -1187,21 +1187,21 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj)
fi.lotsofmoney(targ, 4 + (krand() & 3));
else if (s->picnum == STATUE || s->picnum == STATUEFLASH)
{
lotsofcolourglass(targ, -1, 40);
lotsofcolourglass(targ, nullptr, 40);
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
}
else if (s->picnum == VASE)
lotsofglass(targ, -1, 40);
lotsofglass(targ, nullptr, 40);
S_PlayActorSound(GLASS_BREAKING, targ);
s->ang = krand() & 2047;
lotsofglass(targ, -1, 8);
lotsofglass(targ, nullptr, 8);
deletesprite(targ);
break;
case FETUS:
s->picnum = FETUSBROKE;
S_PlayActorSound(GLASS_BREAKING, targ);
lotsofglass(targ, -1, 10);
lotsofglass(targ, nullptr, 10);
break;
case FETUSBROKE:
for (j = 0; j < 48; j++)
@ -1214,13 +1214,13 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj)
[[fallthrough]];
case BOTTLE7:
S_PlayActorSound(GLASS_BREAKING, targ);
lotsofglass(targ, -1, 10);
lotsofglass(targ, nullptr, 10);
deletesprite(targ);
break;
case HYDROPLANT:
s->picnum = BROKEHYDROPLANT;
S_PlayActorSound(GLASS_BREAKING, targ);
lotsofglass(targ, -1, 10);
lotsofglass(targ, nullptr, 10);
break;
case FORCESPHERE:
@ -1240,7 +1240,7 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj)
S_PlayActorSound(GLASS_BREAKING, targ);
s->z += 16 << 8;
s->cstat = 0;
lotsofglass(targ, -1, 5);
lotsofglass(targ, nullptr, 5);
}
break;

View file

@ -998,7 +998,7 @@ void checkhitwall_r(DDukeActor* spr, walltype* wal, int x, int y, int z, int atw
case SEENINE:
case OOZFILTER:
case EXPLODINGBARREL:
lotsofglass(spr, wallnum(wal), 70);
lotsofglass(spr, wal, 70);
wal->cstat &= ~16;
wal->overpicnum = MIRRORBROKE;
wal->portalflags = 0;
@ -1045,7 +1045,7 @@ void checkhitwall_r(DDukeActor* spr, walltype* wal, int x, int y, int z, int atw
{
updatesector(x, y, &sn); if (sn < 0) return;
wal->overpicnum = GLASS2;
lotsofglass(spr, wallnum(wal), 10);
lotsofglass(spr, wal, 10);
wal->cstat = 0;
if (wal->nextwall >= 0)
@ -1060,7 +1060,7 @@ void checkhitwall_r(DDukeActor* spr, walltype* wal, int x, int y, int z, int atw
}
case STAINGLASS1:
updatesector(x, y, &sn); if (sn < 0) return;
lotsofcolourglass(spr, wallnum(wal), 80);
lotsofcolourglass(spr, wal, 80);
wal->cstat = 0;
if (wal->nextwall >= 0)
wal->nextWall()->cstat = 0;
@ -1250,7 +1250,7 @@ void checkhitwall_r(DDukeActor* spr, walltype* wal, int x, int y, int z, int atw
case SCREENBREAK7:
case SCREENBREAK8:
lotsofglass(spr, wallnum(wal), 30);
lotsofglass(spr, wal, 30);
wal->picnum = W_SCREENBREAK + (krand() % (isRRRA() ? 2 : 3));
S_PlayActorSound(GLASS_HEAVYBREAK, spr);
return;
@ -1284,7 +1284,7 @@ void checkhitwall_r(DDukeActor* spr, walltype* wal, int x, int y, int z, int atw
if (rnd(128))
S_PlayActorSound(GLASS_HEAVYBREAK, spr);
else S_PlayActorSound(GLASS_BREAKING, spr);
lotsofglass(spr, wallnum(wal), 30);
lotsofglass(spr, wal, 30);
if (wal->picnum == RRTILE1814)
wal->picnum = RRTILE1817;
@ -1892,12 +1892,12 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
case RRTILE2123:
s->picnum = RRTILE2124;
S_PlayActorSound(GLASS_BREAKING, targ);
lotsofglass(targ, -1, 10);
lotsofglass(targ, nullptr, 10);
break;
case RRTILE3773:
s->picnum = RRTILE8651;
S_PlayActorSound(GLASS_BREAKING, targ);
lotsofglass(targ, -1, 10);
lotsofglass(targ, nullptr, 10);
break;
case RRTILE7533:
s->picnum = RRTILE5035;
@ -2034,7 +2034,7 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
case RRTILE2030:
s->picnum = RRTILE2034;
S_PlayActorSound(GLASS_BREAKING, targ);
lotsofglass(targ, -1, 10);
lotsofglass(targ, nullptr, 10);
break;
case RRTILE2893:
case RRTILE2915:
@ -2056,7 +2056,7 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
break;
}
S_PlayActorSound(GLASS_BREAKING, targ);
lotsofglass(targ, -1, 10);
lotsofglass(targ, nullptr, 10);
break;
case RRTILE2156:
case RRTILE2158:
@ -2064,13 +2064,13 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
case RRTILE2175:
s->picnum++;
S_PlayActorSound(GLASS_BREAKING, targ);
lotsofglass(targ, -1, 10);
lotsofglass(targ, nullptr, 10);
break;
case RRTILE2137:
case RRTILE2151:
case RRTILE2152:
S_PlayActorSound(GLASS_BREAKING, targ);
lotsofglass(targ, -1, 10);
lotsofglass(targ, nullptr, 10);
s->picnum++;
for (k = 0; k < 6; k++)
EGS(s->sectnum, s->x, s->y, s->z - (8 << 8), SCRAP6 + (krand() & 15), -8, 48, 48, krand() & 2047, (krand() & 63) + 64, -(krand() & 4095) - (s->zvel >> 2), targ, 5);
@ -2238,15 +2238,15 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
fi.lotsofmoney(targ, 4 + (krand() & 3));
else if (s->picnum == STATUE || s->picnum == STATUEFLASH)
{
lotsofcolourglass(targ, -1, 40);
lotsofcolourglass(targ, nullptr, 40);
S_PlayActorSound(GLASS_HEAVYBREAK, targ);
}
else if (s->picnum == VASE)
lotsofglass(targ, -1, 40);
lotsofglass(targ, nullptr, 40);
S_PlayActorSound(GLASS_BREAKING, targ);
s->ang = krand() & 2047;
lotsofglass(targ, -1, 8);
lotsofglass(targ, nullptr, 8);
deletesprite(targ);
break;
case RRTILE2654:
@ -2256,7 +2256,7 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
[[fallthrough]];
case BOTTLE7:
S_PlayActorSound(GLASS_BREAKING, targ);
lotsofglass(targ, -1, 10);
lotsofglass(targ, nullptr, 10);
deletesprite(targ);
break;
case FORCESPHERE:

View file

@ -1091,7 +1091,7 @@ void spawneffector(DDukeActor* actor)
//
//---------------------------------------------------------------------------
void lotsofglass(DDukeActor *actor, int wallnum, int n)
void lotsofglass(DDukeActor *actor, walltype* wal, int n)
{
int j, z, a;
int sect;
@ -1099,7 +1099,7 @@ void lotsofglass(DDukeActor *actor, int wallnum, int n)
sect = -1;
if (wallnum < 0)
if (wal == nullptr)
{
for (j = n - 1; j >= 0; j--)
{
@ -1109,7 +1109,6 @@ void lotsofglass(DDukeActor *actor, int wallnum, int n)
return;
}
auto wal = &wall[wallnum];
int x1 = wal->x;
int y1 = wal->y;
auto delta = wal->delta() / (n + 1);
@ -1189,14 +1188,14 @@ void ceilingglass(DDukeActor* actor, int sectnum, int n)
//
//---------------------------------------------------------------------------
void lotsofcolourglass(DDukeActor* actor, int wallnum, int n)
void lotsofcolourglass(DDukeActor* actor, walltype* wal, int n)
{
int j, z;
int sect = -1;
int a;;
auto sp = actor->s;
if (wallnum < 0)
if (wal == nullptr)
{
for (j = n - 1; j >= 0; j--)
{
@ -1207,12 +1206,10 @@ void lotsofcolourglass(DDukeActor* actor, int wallnum, int n)
return;
}
auto& wal = wall[wallnum];
int x1 = wal->x;
int y1 = wal->y;
int x1 = wal.x;
int y1 = wal.y;
auto delta = wal.delta() / (n + 1);
auto delta = wal->delta() / (n + 1);
for (j = n; j > 0; j--)
{