mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 23:02:03 +00:00
- guts_d and guts_r.
This commit is contained in:
parent
90d1c5f7bb
commit
861342a278
10 changed files with 52 additions and 51 deletions
|
@ -5327,12 +5327,12 @@ void fall_common(DDukeActor *actor, int playernum, int JIBS6, int DRONE, int BLO
|
|||
goto SKIPJIBS;
|
||||
if (sphit)
|
||||
{
|
||||
fi.guts(&actor->s, JIBS6, 5, playernum);
|
||||
fi.guts(actor, JIBS6, 5, playernum);
|
||||
S_PlayActorSound(squished, actor);
|
||||
}
|
||||
else
|
||||
{
|
||||
fi.guts(&actor->s, JIBS6, 15, playernum);
|
||||
fi.guts(actor, JIBS6, 15, playernum);
|
||||
S_PlayActorSound(squished, actor);
|
||||
spawn(actor, BLOODPOOL);
|
||||
}
|
||||
|
|
|
@ -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 i=0, j;
|
||||
int sx, sy;
|
||||
uint8_t pal;
|
||||
|
||||
if (badguy(s) && s->xrepeat < 16)
|
||||
if (badguy(actor) && s->xrepeat < 16)
|
||||
sx = sy = 8;
|
||||
else sx = sy = 32;
|
||||
|
||||
|
@ -666,7 +667,7 @@ void guts_d(spritetype* s, short gtype, short n, short p)
|
|||
|
||||
gutz += actorinfo[s->picnum].gutsoffset;
|
||||
|
||||
if (badguy(s) && s->pal == 6)
|
||||
if (badguy(actor) && s->pal == 6)
|
||||
pal = 6;
|
||||
else if (s->picnum != LIZTROOP) // EDuke32 transfers the palette unconditionally, I'm not sure that's such a good idea.
|
||||
pal = 0;
|
||||
|
@ -683,15 +684,14 @@ void guts_d(spritetype* s, short gtype, short n, short p)
|
|||
int r4 = krand();
|
||||
int r5 = krand();
|
||||
// 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 si = &sprite[i];
|
||||
if (si->picnum == JIBS2)
|
||||
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);
|
||||
if (spawned->s.picnum == JIBS2)
|
||||
{
|
||||
si->xrepeat >>= 2;
|
||||
si->yrepeat >>= 2;
|
||||
spawned->s.xrepeat >>= 2;
|
||||
spawned->s.yrepeat >>= 2;
|
||||
}
|
||||
if (pal != 0)
|
||||
si->pal = pal;
|
||||
spawned->s.pal = pal;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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 i=0, j;
|
||||
int sx, sy;
|
||||
uint8_t pal;
|
||||
|
||||
if (badguy(s) && s->xrepeat < 16)
|
||||
if (badguy(actor) && s->xrepeat < 16)
|
||||
sx = sy = 8;
|
||||
else sx = sy = 32;
|
||||
|
||||
|
@ -488,7 +489,7 @@ void guts_r(spritetype* s, short gtype, short n, short p)
|
|||
|
||||
gutz += actorinfo[s->picnum].gutsoffset;
|
||||
|
||||
if (badguy(s) && s->pal == 6)
|
||||
if (badguy(actor) && s->pal == 6)
|
||||
pal = 6;
|
||||
else
|
||||
{
|
||||
|
@ -509,9 +510,9 @@ void guts_r(spritetype* s, short gtype, short n, short p)
|
|||
int r4 = krand();
|
||||
int r5 = krand();
|
||||
// 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)
|
||||
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)
|
||||
{
|
||||
guts_r(s, RABBITJIBA, 2, myconnectindex);
|
||||
guts_r(s, RABBITJIBB, 2, myconnectindex);
|
||||
guts_r(s, RABBITJIBC, 2, myconnectindex);
|
||||
guts_r(&hittype[i], RABBITJIBA, 2, myconnectindex);
|
||||
guts_r(&hittype[i], RABBITJIBB, 2, myconnectindex);
|
||||
guts_r(&hittype[i], RABBITJIBC, 2, myconnectindex);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
guts_r(s, RABBITJIBA, 2, myconnectindex);
|
||||
guts_r(s, RABBITJIBB, 2, myconnectindex);
|
||||
guts_r(s, RABBITJIBC, 2, myconnectindex);
|
||||
guts_r(&hittype[i], RABBITJIBA, 2, myconnectindex);
|
||||
guts_r(&hittype[i], RABBITJIBB, 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))
|
||||
|
@ -1335,9 +1336,9 @@ bool weaponhitsector(int i, const vec3_t& oldpos)
|
|||
|
||||
if (isRRRA() && sprite[s->owner].picnum == MAMA)
|
||||
{
|
||||
guts_r(s, RABBITJIBA, 2, myconnectindex);
|
||||
guts_r(s, RABBITJIBB, 2, myconnectindex);
|
||||
guts_r(s, RABBITJIBC, 2, myconnectindex);
|
||||
guts_r(&hittype[i], RABBITJIBA, 2, myconnectindex);
|
||||
guts_r(&hittype[i], RABBITJIBB, 2, myconnectindex);
|
||||
guts_r(&hittype[i], RABBITJIBC, 2, myconnectindex);
|
||||
}
|
||||
|
||||
if (s->zvel < 0)
|
||||
|
@ -2490,10 +2491,10 @@ void rr_specialstats()
|
|||
s->lotag--;
|
||||
if (s->lotag < 0)
|
||||
{
|
||||
guts_r(s, JIBS1, 1, myconnectindex);
|
||||
guts_r(s, JIBS2, 1, myconnectindex);
|
||||
guts_r(s, JIBS3, 1, myconnectindex);
|
||||
guts_r(s, JIBS4, 1, myconnectindex);
|
||||
guts_r(&hittype[i], JIBS1, 1, myconnectindex);
|
||||
guts_r(&hittype[i], JIBS2, 1, myconnectindex);
|
||||
guts_r(&hittype[i], JIBS3, 1, myconnectindex);
|
||||
guts_r(&hittype[i], JIBS4, 1, myconnectindex);
|
||||
s->lotag = 256;
|
||||
}
|
||||
break;
|
||||
|
@ -4098,7 +4099,7 @@ static int fallspecial(DDukeActor *actor, int playernum)
|
|||
{
|
||||
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);
|
||||
addspritetodelete();
|
||||
}
|
||||
|
|
|
@ -70,8 +70,8 @@ void lotsofmoney_d(DDukeActor* s, short n);
|
|||
void lotsofmail_d(DDukeActor* s, short n);
|
||||
void lotsofpaper_d(DDukeActor* s, short n);
|
||||
void lotsoffeathers_r(DDukeActor* s, short n);
|
||||
void guts_d(spritetype* s, short gtype, short n, short p);
|
||||
void guts_r(spritetype* s, short gtype, short n, short p);
|
||||
void guts_d(DDukeActor* 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_r(int sectnum);
|
||||
int ifhitbyweapon_r(DDukeActor* sn);
|
||||
|
|
|
@ -92,7 +92,7 @@ struct Dispatcher
|
|||
void (*lotsofmoney)(DDukeActor *s, short n);
|
||||
void (*lotsofmail)(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 (*ifhitbyweapon)(DDukeActor* sectnum);
|
||||
void (*fall)(int g_i, int g_p);
|
||||
|
|
|
@ -2466,7 +2466,7 @@ int ParseState::parse(void)
|
|||
break;
|
||||
case concmd_guts:
|
||||
insptr += 2;
|
||||
fi.guts(g_sp,*(insptr-1),*insptr,g_p);
|
||||
fi.guts(g_ac,*(insptr-1),*insptr,g_p);
|
||||
insptr++;
|
||||
break;
|
||||
case concmd_slapplayer:
|
||||
|
|
|
@ -148,7 +148,7 @@ void quickkill(struct player_struct* p)
|
|||
|
||||
sprite[p->i].extra = 0;
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -420,7 +420,7 @@ void dokneeattack(int snum, int pi, const std::initializer_list<int> & respawnli
|
|||
p->weapon_pos = -p->weapon_pos;
|
||||
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);
|
||||
S_PlayActorSound(SQUISHED, p->actorsqu);
|
||||
if (isIn(p->actorsqu->s.picnum, respawnlist))
|
||||
|
|
|
@ -2633,12 +2633,12 @@ void onMotorcycleHit(int snum, int var60)
|
|||
}
|
||||
}
|
||||
}
|
||||
fi.guts(&sprite[var60], RRTILE2460, 12, myconnectindex);
|
||||
fi.guts(&sprite[var60], RRTILE2465, 3, myconnectindex);
|
||||
fi.guts(&hittype[var60], RRTILE2460, 12, myconnectindex);
|
||||
fi.guts(&hittype[var60], RRTILE2465, 3, myconnectindex);
|
||||
}
|
||||
else
|
||||
fi.guts(&sprite[var60], RRTILE2465, 3, myconnectindex);
|
||||
fi.guts(&sprite[var60], RRTILE2465, 3, myconnectindex);
|
||||
fi.guts(&hittype[var60], RRTILE2465, 3, myconnectindex);
|
||||
fi.guts(&hittype[var60], RRTILE2465, 3, myconnectindex);
|
||||
s->xrepeat = 0;
|
||||
s->yrepeat = 0;
|
||||
}
|
||||
|
|
|
@ -1334,12 +1334,12 @@ void checkhitsprite_d(int i, int sn)
|
|||
fi.shoot(i, BLOODSPLAT3);
|
||||
s->ang = krand() & 2047;
|
||||
fi.shoot(i, BLOODSPLAT4);
|
||||
fi.guts(s, JIBS1, 1, myconnectindex);
|
||||
fi.guts(s, JIBS2, 2, myconnectindex);
|
||||
fi.guts(s, JIBS3, 3, myconnectindex);
|
||||
fi.guts(s, JIBS4, 4, myconnectindex);
|
||||
fi.guts(s, JIBS5, 1, myconnectindex);
|
||||
fi.guts(s, JIBS3, 6, myconnectindex);
|
||||
fi.guts(&hittype[i], JIBS1, 1, myconnectindex);
|
||||
fi.guts(&hittype[i], JIBS2, 2, myconnectindex);
|
||||
fi.guts(&hittype[i], JIBS3, 3, myconnectindex);
|
||||
fi.guts(&hittype[i], JIBS4, 4, myconnectindex);
|
||||
fi.guts(&hittype[i], JIBS5, 1, myconnectindex);
|
||||
fi.guts(&hittype[i], JIBS3, 6, myconnectindex);
|
||||
S_PlaySound(SQUISHED);
|
||||
deletesprite(i);
|
||||
break;
|
||||
|
|
|
@ -1965,7 +1965,7 @@ void checkhitsprite_r(int i, int sn)
|
|||
break;
|
||||
case RRTILE2455:
|
||||
S_PlayActorSound(SQUISHED, i);
|
||||
fi.guts(&sprite[i], RRTILE2465, 3, myconnectindex);
|
||||
fi.guts(&hittype[i], RRTILE2465, 3, myconnectindex);
|
||||
deletesprite(i);
|
||||
break;
|
||||
case RRTILE2451:
|
||||
|
@ -1981,8 +1981,8 @@ void checkhitsprite_r(int i, int sn)
|
|||
{
|
||||
if (s->lotag == sprite[j].lotag)
|
||||
{
|
||||
fi.guts(&sprite[i], RRTILE2460, 12, myconnectindex);
|
||||
fi.guts(&sprite[i], RRTILE2465, 3, myconnectindex);
|
||||
fi.guts(&hittype[i], RRTILE2460, 12, myconnectindex);
|
||||
fi.guts(&hittype[i], RRTILE2465, 3, myconnectindex);
|
||||
sprite[j].xrepeat = 0;
|
||||
sprite[j].yrepeat = 0;
|
||||
s->xrepeat = 0;
|
||||
|
@ -1993,8 +1993,8 @@ void checkhitsprite_r(int i, int sn)
|
|||
}
|
||||
else
|
||||
{
|
||||
fi.guts(&sprite[i], RRTILE2460, 12, myconnectindex);
|
||||
fi.guts(&sprite[i], RRTILE2465, 3, myconnectindex);
|
||||
fi.guts(&hittype[i], RRTILE2460, 12, myconnectindex);
|
||||
fi.guts(&hittype[i], RRTILE2465, 3, myconnectindex);
|
||||
s->xrepeat = 0;
|
||||
s->yrepeat = 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue