- guts_d and guts_r.

This commit is contained in:
Christoph Oelckers 2020-10-22 19:21:21 +02:00
parent 90d1c5f7bb
commit 861342a278
10 changed files with 52 additions and 51 deletions

View file

@ -5327,12 +5327,12 @@ void fall_common(DDukeActor *actor, int playernum, int JIBS6, int DRONE, int BLO
goto SKIPJIBS; goto SKIPJIBS;
if (sphit) if (sphit)
{ {
fi.guts(&actor->s, JIBS6, 5, playernum); fi.guts(actor, JIBS6, 5, playernum);
S_PlayActorSound(squished, actor); S_PlayActorSound(squished, actor);
} }
else else
{ {
fi.guts(&actor->s, JIBS6, 15, playernum); fi.guts(actor, JIBS6, 15, playernum);
S_PlayActorSound(squished, actor); S_PlayActorSound(squished, actor);
spawn(actor, BLOODPOOL); spawn(actor, BLOODPOOL);
} }

View file

@ -647,14 +647,15 @@ void lotsofpaper_d(DDukeActor *actor, short n)
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void guts_d(spritetype* s, short gtype, short n, short p) void guts_d(DDukeActor* actor, short gtype, short n, short p)
{ {
auto s = &actor->s;
int gutz, floorz; int gutz, floorz;
int i=0, j; int i=0, j;
int sx, sy; int sx, sy;
uint8_t pal; uint8_t pal;
if (badguy(s) && s->xrepeat < 16) if (badguy(actor) && s->xrepeat < 16)
sx = sy = 8; sx = sy = 8;
else sx = sy = 32; else sx = sy = 32;
@ -666,7 +667,7 @@ void guts_d(spritetype* s, short gtype, short n, short p)
gutz += actorinfo[s->picnum].gutsoffset; gutz += actorinfo[s->picnum].gutsoffset;
if (badguy(s) && s->pal == 6) if (badguy(actor) && s->pal == 6)
pal = 6; pal = 6;
else if (s->picnum != LIZTROOP) // EDuke32 transfers the palette unconditionally, I'm not sure that's such a good idea. else if (s->picnum != LIZTROOP) // EDuke32 transfers the palette unconditionally, I'm not sure that's such a good idea.
pal = 0; pal = 0;
@ -683,15 +684,14 @@ void guts_d(spritetype* s, short gtype, short n, short p)
int r4 = krand(); int r4 = krand();
int r5 = krand(); int r5 = krand();
// TRANSITIONAL: owned by a player??? // TRANSITIONAL: owned by a player???
i = EGS(s->sectnum, s->x + (r5 & 255) - 128, s->y + (r4 & 255) - 128, gutz - (r3 & 8191), gtype, -32, sx, sy, a, 48 + (r2 & 31), -512 - (r1 & 2047), ps[p].i, 5); auto spawned = EGS(s->sectnum, s->x + (r5 & 255) - 128, s->y + (r4 & 255) - 128, gutz - (r3 & 8191), gtype, -32, sx, sy, a, 48 + (r2 & 31), -512 - (r1 & 2047), ps[p].GetActor(), 5);
auto si = &sprite[i]; if (spawned->s.picnum == JIBS2)
if (si->picnum == JIBS2)
{ {
si->xrepeat >>= 2; spawned->s.xrepeat >>= 2;
si->yrepeat >>= 2; spawned->s.yrepeat >>= 2;
} }
if (pal != 0) if (pal != 0)
si->pal = pal; spawned->s.pal = pal;
} }
} }

View file

@ -469,14 +469,15 @@ void lotsoffeathers_r(DDukeActor *actor, short n)
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void guts_r(spritetype* s, short gtype, short n, short p) void guts_r(DDukeActor* actor, short gtype, short n, short p)
{ {
auto s = &actor->s;
int gutz, floorz; int gutz, floorz;
int i=0, j; int i=0, j;
int sx, sy; int sx, sy;
uint8_t pal; uint8_t pal;
if (badguy(s) && s->xrepeat < 16) if (badguy(actor) && s->xrepeat < 16)
sx = sy = 8; sx = sy = 8;
else sx = sy = 32; else sx = sy = 32;
@ -488,7 +489,7 @@ void guts_r(spritetype* s, short gtype, short n, short p)
gutz += actorinfo[s->picnum].gutsoffset; gutz += actorinfo[s->picnum].gutsoffset;
if (badguy(s) && s->pal == 6) if (badguy(actor) && s->pal == 6)
pal = 6; pal = 6;
else else
{ {
@ -509,9 +510,9 @@ void guts_r(spritetype* s, short gtype, short n, short p)
int r4 = krand(); int r4 = krand();
int r5 = krand(); int r5 = krand();
// TRANSITIONAL: owned by a player??? // TRANSITIONAL: owned by a player???
i = EGS(s->sectnum, s->x + (r5 & 255) - 128, s->y + (r4 & 255) - 128, gutz - (r3 & 8191), gtype, -32, sx >> 1, sy >> 1, a, 48 + (r2 & 31), -512 - (r1 & 2047), ps[p].i, 5); auto spawned = EGS(s->sectnum, s->x + (r5 & 255) - 128, s->y + (r4 & 255) - 128, gutz - (r3 & 8191), gtype, -32, sx >> 1, sy >> 1, a, 48 + (r2 & 31), -512 - (r1 & 2047), ps[p].GetActor(), 5);
if (pal != 0) if (pal != 0)
sprite[i].pal = pal; spawned->s.pal = pal;
} }
} }
@ -1205,9 +1206,9 @@ static bool weaponhitsprite(int i, int j, const vec3_t &oldpos)
{ {
if (isRRRA() && sprite[s->owner].picnum == MAMA) if (isRRRA() && sprite[s->owner].picnum == MAMA)
{ {
guts_r(s, RABBITJIBA, 2, myconnectindex); guts_r(&hittype[i], RABBITJIBA, 2, myconnectindex);
guts_r(s, RABBITJIBB, 2, myconnectindex); guts_r(&hittype[i], RABBITJIBB, 2, myconnectindex);
guts_r(s, RABBITJIBC, 2, myconnectindex); guts_r(&hittype[i], RABBITJIBC, 2, myconnectindex);
} }
ps[p].horizon.addadjustment(32); ps[p].horizon.addadjustment(32);
@ -1245,9 +1246,9 @@ static bool weaponhitwall(int i, int j, const vec3_t& oldpos)
if (isRRRA() && sprite[s->owner].picnum == MAMA) if (isRRRA() && sprite[s->owner].picnum == MAMA)
{ {
guts_r(s, RABBITJIBA, 2, myconnectindex); guts_r(&hittype[i], RABBITJIBA, 2, myconnectindex);
guts_r(s, RABBITJIBB, 2, myconnectindex); guts_r(&hittype[i], RABBITJIBB, 2, myconnectindex);
guts_r(s, RABBITJIBC, 2, myconnectindex); guts_r(&hittype[i], RABBITJIBC, 2, myconnectindex);
} }
if (s->picnum != RPG && (!isRRRA() || s->picnum != RPG2) && s->picnum != FREEZEBLAST && s->picnum != SPIT && s->picnum != SHRINKSPARK && (wall[j].overpicnum == MIRROR || wall[j].picnum == MIRROR)) if (s->picnum != RPG && (!isRRRA() || s->picnum != RPG2) && s->picnum != FREEZEBLAST && s->picnum != SPIT && s->picnum != SHRINKSPARK && (wall[j].overpicnum == MIRROR || wall[j].picnum == MIRROR))
@ -1335,9 +1336,9 @@ bool weaponhitsector(int i, const vec3_t& oldpos)
if (isRRRA() && sprite[s->owner].picnum == MAMA) if (isRRRA() && sprite[s->owner].picnum == MAMA)
{ {
guts_r(s, RABBITJIBA, 2, myconnectindex); guts_r(&hittype[i], RABBITJIBA, 2, myconnectindex);
guts_r(s, RABBITJIBB, 2, myconnectindex); guts_r(&hittype[i], RABBITJIBB, 2, myconnectindex);
guts_r(s, RABBITJIBC, 2, myconnectindex); guts_r(&hittype[i], RABBITJIBC, 2, myconnectindex);
} }
if (s->zvel < 0) if (s->zvel < 0)
@ -2490,10 +2491,10 @@ void rr_specialstats()
s->lotag--; s->lotag--;
if (s->lotag < 0) if (s->lotag < 0)
{ {
guts_r(s, JIBS1, 1, myconnectindex); guts_r(&hittype[i], JIBS1, 1, myconnectindex);
guts_r(s, JIBS2, 1, myconnectindex); guts_r(&hittype[i], JIBS2, 1, myconnectindex);
guts_r(s, JIBS3, 1, myconnectindex); guts_r(&hittype[i], JIBS3, 1, myconnectindex);
guts_r(s, JIBS4, 1, myconnectindex); guts_r(&hittype[i], JIBS4, 1, myconnectindex);
s->lotag = 256; s->lotag = 256;
} }
break; break;
@ -4098,7 +4099,7 @@ static int fallspecial(DDukeActor *actor, int playernum)
{ {
if (s->picnum != APLAYER && badguy(actor) && s->z == actor->floorz - FOURSLEIGHT) if (s->picnum != APLAYER && badguy(actor) && s->z == actor->floorz - FOURSLEIGHT)
{ {
fi.guts(&actor->s, JIBS6, 5, playernum); fi.guts(actor, JIBS6, 5, playernum);
S_PlayActorSound(SQUISHED, actor); S_PlayActorSound(SQUISHED, actor);
addspritetodelete(); addspritetodelete();
} }

View file

@ -70,8 +70,8 @@ void lotsofmoney_d(DDukeActor* s, short n);
void lotsofmail_d(DDukeActor* s, short n); void lotsofmail_d(DDukeActor* s, short n);
void lotsofpaper_d(DDukeActor* s, short n); void lotsofpaper_d(DDukeActor* s, short n);
void lotsoffeathers_r(DDukeActor* s, short n); void lotsoffeathers_r(DDukeActor* s, short n);
void guts_d(spritetype* s, short gtype, short n, short p); void guts_d(DDukeActor* s, short gtype, short n, short p);
void guts_r(spritetype* s, short gtype, short n, short p); void guts_r(DDukeActor* s, short gtype, short n, short p);
int ifhitsectors_d(int sectnum); int ifhitsectors_d(int sectnum);
int ifhitsectors_r(int sectnum); int ifhitsectors_r(int sectnum);
int ifhitbyweapon_r(DDukeActor* sn); int ifhitbyweapon_r(DDukeActor* sn);

View file

@ -92,7 +92,7 @@ struct Dispatcher
void (*lotsofmoney)(DDukeActor *s, short n); void (*lotsofmoney)(DDukeActor *s, short n);
void (*lotsofmail)(DDukeActor *s, short n); void (*lotsofmail)(DDukeActor *s, short n);
void (*lotsofpaper)(DDukeActor *s, short n); void (*lotsofpaper)(DDukeActor *s, short n);
void (*guts)(spritetype* s, short gtype, short n, short p); void (*guts)(DDukeActor* s, short gtype, short n, short p);
int (*ifhitsectors)(int sectnum); int (*ifhitsectors)(int sectnum);
int (*ifhitbyweapon)(DDukeActor* sectnum); int (*ifhitbyweapon)(DDukeActor* sectnum);
void (*fall)(int g_i, int g_p); void (*fall)(int g_i, int g_p);

View file

@ -2466,7 +2466,7 @@ int ParseState::parse(void)
break; break;
case concmd_guts: case concmd_guts:
insptr += 2; insptr += 2;
fi.guts(g_sp,*(insptr-1),*insptr,g_p); fi.guts(g_ac,*(insptr-1),*insptr,g_p);
insptr++; insptr++;
break; break;
case concmd_slapplayer: case concmd_slapplayer:

View file

@ -148,7 +148,7 @@ void quickkill(struct player_struct* p)
sprite[p->i].extra = 0; sprite[p->i].extra = 0;
sprite[p->i].cstat |= 32768; sprite[p->i].cstat |= 32768;
if (ud.god == 0) fi.guts(&sprite[p->i], TILE_JIBS6, 8, myconnectindex); if (ud.god == 0) fi.guts(&hittype[p->i], TILE_JIBS6, 8, myconnectindex);
return; return;
} }
@ -420,7 +420,7 @@ void dokneeattack(int snum, int pi, const std::initializer_list<int> & respawnli
p->weapon_pos = -p->weapon_pos; p->weapon_pos = -p->weapon_pos;
if (p->actorsqu != nullptr && dist(&sprite[pi], &p->actorsqu->s) < 1400) if (p->actorsqu != nullptr && dist(&sprite[pi], &p->actorsqu->s) < 1400)
{ {
fi.guts(&p->actorsqu->s, TILE_JIBS6, 7, myconnectindex); fi.guts(p->actorsqu, TILE_JIBS6, 7, myconnectindex);
fi.spawn(p->actorsqu->GetIndex(), TILE_BLOODPOOL); fi.spawn(p->actorsqu->GetIndex(), TILE_BLOODPOOL);
S_PlayActorSound(SQUISHED, p->actorsqu); S_PlayActorSound(SQUISHED, p->actorsqu);
if (isIn(p->actorsqu->s.picnum, respawnlist)) if (isIn(p->actorsqu->s.picnum, respawnlist))

View file

@ -2633,12 +2633,12 @@ void onMotorcycleHit(int snum, int var60)
} }
} }
} }
fi.guts(&sprite[var60], RRTILE2460, 12, myconnectindex); fi.guts(&hittype[var60], RRTILE2460, 12, myconnectindex);
fi.guts(&sprite[var60], RRTILE2465, 3, myconnectindex); fi.guts(&hittype[var60], RRTILE2465, 3, myconnectindex);
} }
else else
fi.guts(&sprite[var60], RRTILE2465, 3, myconnectindex); fi.guts(&hittype[var60], RRTILE2465, 3, myconnectindex);
fi.guts(&sprite[var60], RRTILE2465, 3, myconnectindex); fi.guts(&hittype[var60], RRTILE2465, 3, myconnectindex);
s->xrepeat = 0; s->xrepeat = 0;
s->yrepeat = 0; s->yrepeat = 0;
} }

View file

@ -1334,12 +1334,12 @@ void checkhitsprite_d(int i, int sn)
fi.shoot(i, BLOODSPLAT3); fi.shoot(i, BLOODSPLAT3);
s->ang = krand() & 2047; s->ang = krand() & 2047;
fi.shoot(i, BLOODSPLAT4); fi.shoot(i, BLOODSPLAT4);
fi.guts(s, JIBS1, 1, myconnectindex); fi.guts(&hittype[i], JIBS1, 1, myconnectindex);
fi.guts(s, JIBS2, 2, myconnectindex); fi.guts(&hittype[i], JIBS2, 2, myconnectindex);
fi.guts(s, JIBS3, 3, myconnectindex); fi.guts(&hittype[i], JIBS3, 3, myconnectindex);
fi.guts(s, JIBS4, 4, myconnectindex); fi.guts(&hittype[i], JIBS4, 4, myconnectindex);
fi.guts(s, JIBS5, 1, myconnectindex); fi.guts(&hittype[i], JIBS5, 1, myconnectindex);
fi.guts(s, JIBS3, 6, myconnectindex); fi.guts(&hittype[i], JIBS3, 6, myconnectindex);
S_PlaySound(SQUISHED); S_PlaySound(SQUISHED);
deletesprite(i); deletesprite(i);
break; break;

View file

@ -1965,7 +1965,7 @@ void checkhitsprite_r(int i, int sn)
break; break;
case RRTILE2455: case RRTILE2455:
S_PlayActorSound(SQUISHED, i); S_PlayActorSound(SQUISHED, i);
fi.guts(&sprite[i], RRTILE2465, 3, myconnectindex); fi.guts(&hittype[i], RRTILE2465, 3, myconnectindex);
deletesprite(i); deletesprite(i);
break; break;
case RRTILE2451: case RRTILE2451:
@ -1981,8 +1981,8 @@ void checkhitsprite_r(int i, int sn)
{ {
if (s->lotag == sprite[j].lotag) if (s->lotag == sprite[j].lotag)
{ {
fi.guts(&sprite[i], RRTILE2460, 12, myconnectindex); fi.guts(&hittype[i], RRTILE2460, 12, myconnectindex);
fi.guts(&sprite[i], RRTILE2465, 3, myconnectindex); fi.guts(&hittype[i], RRTILE2465, 3, myconnectindex);
sprite[j].xrepeat = 0; sprite[j].xrepeat = 0;
sprite[j].yrepeat = 0; sprite[j].yrepeat = 0;
s->xrepeat = 0; s->xrepeat = 0;
@ -1993,8 +1993,8 @@ void checkhitsprite_r(int i, int sn)
} }
else else
{ {
fi.guts(&sprite[i], RRTILE2460, 12, myconnectindex); fi.guts(&hittype[i], RRTILE2460, 12, myconnectindex);
fi.guts(&sprite[i], RRTILE2465, 3, myconnectindex); fi.guts(&hittype[i], RRTILE2465, 3, myconnectindex);
s->xrepeat = 0; s->xrepeat = 0;
s->yrepeat = 0; s->yrepeat = 0;
} }