mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-02-06 05:40:56 +00:00
- consolidated gutsdir functions by making the spawn offset for Duke's commander an actor property.
This commit is contained in:
parent
80aab4b5f7
commit
3e62550489
7 changed files with 40 additions and 74 deletions
|
@ -2596,6 +2596,38 @@ void scrap(DDukeActor* actor, int SCRAP1, int SCRAP6)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void gutsdir(DDukeActor* actor, short gtype, short n, short p)
|
||||||
|
{
|
||||||
|
int sx, sy;
|
||||||
|
|
||||||
|
if (badguy(actor) && actor->s.xrepeat < 16)
|
||||||
|
sx = sy = 8;
|
||||||
|
else sx = sy = 32;
|
||||||
|
|
||||||
|
int gutz = actor->s.z - (8 << 8);
|
||||||
|
int floorz = getflorzofslope(actor->s.sectnum, actor->s.x, actor->s.y);
|
||||||
|
|
||||||
|
if (gutz > (floorz - (8 << 8)))
|
||||||
|
gutz = floorz - (8 << 8);
|
||||||
|
|
||||||
|
gutz += actorinfo[actor->s.picnum].gutsoffset;
|
||||||
|
|
||||||
|
for (int j = 0; j < n; j++)
|
||||||
|
{
|
||||||
|
int a = krand() & 2047;
|
||||||
|
int r1 = krand();
|
||||||
|
int r2 = krand();
|
||||||
|
// TRANSITIONAL: owned by a player???
|
||||||
|
EGS(actor->s.sectnum, actor->s.x, actor->s.y, gutz, gtype, -32, sx, sy, a, 256 + (r2 & 127), -512 - (r1 & 2047), ps[p].GetActor(), 5);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// taken out of moveeffectors
|
// taken out of moveeffectors
|
||||||
|
@ -2981,7 +3013,7 @@ void handle_se14(DDukeActor* actor, bool checkstat, int RPG, int JIBS6)
|
||||||
updatesector(a2->s.x, a2->s.y, &k);
|
updatesector(a2->s.x, a2->s.y, &k);
|
||||||
if (a2->s.extra >= 0 && k == s->sectnum)
|
if (a2->s.extra >= 0 && k == s->sectnum)
|
||||||
{
|
{
|
||||||
fi.gutsdir(&a2->s, JIBS6, 72, myconnectindex);
|
gutsdir(a2, JIBS6, 72, myconnectindex);
|
||||||
S_PlayActorSound(SQUISHED, actor);
|
S_PlayActorSound(SQUISHED, actor);
|
||||||
deletesprite(a2);
|
deletesprite(a2);
|
||||||
}
|
}
|
||||||
|
@ -3171,7 +3203,7 @@ void handle_se30(DDukeActor *actor, int JIBS6)
|
||||||
updatesector(a2->s.x, a2->s.y, &k);
|
updatesector(a2->s.x, a2->s.y, &k);
|
||||||
if (a2->s.extra >= 0 && k == s->sectnum)
|
if (a2->s.extra >= 0 && k == s->sectnum)
|
||||||
{
|
{
|
||||||
fi.gutsdir(&a2->s, JIBS6, 24, myconnectindex);
|
gutsdir(a2, JIBS6, 24, myconnectindex);
|
||||||
S_PlayActorSound(SQUISHED, a2);
|
S_PlayActorSound(SQUISHED, a2);
|
||||||
deletesprite(a2);
|
deletesprite(a2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -666,8 +666,7 @@ void guts_d(spritetype* s, short gtype, short n, short p)
|
||||||
if (gutz > (floorz - (8 << 8)))
|
if (gutz > (floorz - (8 << 8)))
|
||||||
gutz = floorz - (8 << 8);
|
gutz = floorz - (8 << 8);
|
||||||
|
|
||||||
if (s->picnum == COMMANDER)
|
gutz += actorinfo[s->picnum].gutsoffset;
|
||||||
gutz -= (24 << 8);
|
|
||||||
|
|
||||||
if (badguy(s) && s->pal == 6)
|
if (badguy(s) && s->pal == 6)
|
||||||
pal = 6;
|
pal = 6;
|
||||||
|
@ -704,39 +703,6 @@ void guts_d(spritetype* s, short gtype, short n, short p)
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void gutsdir_d(spritetype* s, short gtype, short n, short p)
|
|
||||||
{
|
|
||||||
int sx, sy;
|
|
||||||
|
|
||||||
if (badguy(s) && s->xrepeat < 16)
|
|
||||||
sx = sy = 8;
|
|
||||||
else sx = sy = 32;
|
|
||||||
|
|
||||||
int gutz = s->z - (8 << 8);
|
|
||||||
int floorz = getflorzofslope(s->sectnum, s->x, s->y);
|
|
||||||
|
|
||||||
if (gutz > (floorz - (8 << 8)))
|
|
||||||
gutz = floorz - (8 << 8);
|
|
||||||
|
|
||||||
if (s->picnum == COMMANDER)
|
|
||||||
gutz -= (24 << 8);
|
|
||||||
|
|
||||||
for (int j = 0; j < n; j++)
|
|
||||||
{
|
|
||||||
int a = krand() & 2047;
|
|
||||||
int r1 = krand();
|
|
||||||
int r2 = krand();
|
|
||||||
// TRANSITIONAL: owned by a player???
|
|
||||||
EGS(s->sectnum, s->x, s->y, gutz, gtype, -32, sx, sy, a, 256 + (r2 & 127), -512 - (r1 & 2047), ps[p].i, 5);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
void movefta_d(void)
|
void movefta_d(void)
|
||||||
{
|
{
|
||||||
int x, px, py, sx, sy;
|
int x, px, py, sx, sy;
|
||||||
|
|
|
@ -486,6 +486,8 @@ void guts_r(spritetype* s, short gtype, short n, short p)
|
||||||
if (gutz > (floorz - (8 << 8)))
|
if (gutz > (floorz - (8 << 8)))
|
||||||
gutz = floorz - (8 << 8);
|
gutz = floorz - (8 << 8);
|
||||||
|
|
||||||
|
gutz += actorinfo[s->picnum].gutsoffset;
|
||||||
|
|
||||||
if (badguy(s) && s->pal == 6)
|
if (badguy(s) && s->pal == 6)
|
||||||
pal = 6;
|
pal = 6;
|
||||||
else
|
else
|
||||||
|
@ -519,38 +521,6 @@ void guts_r(spritetype* s, short gtype, short n, short p)
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void gutsdir_r(spritetype* s, short gtype, short n, short p)
|
|
||||||
{
|
|
||||||
int gutz, floorz;
|
|
||||||
short i, j;
|
|
||||||
char sx, sy;
|
|
||||||
|
|
||||||
if (badguy(s) && s->xrepeat < 16)
|
|
||||||
sx = sy = 8;
|
|
||||||
else sx = sy = 32;
|
|
||||||
|
|
||||||
gutz = s->z - (8 << 8);
|
|
||||||
floorz = getflorzofslope(s->sectnum, s->x, s->y);
|
|
||||||
|
|
||||||
if (gutz > (floorz - (8 << 8)))
|
|
||||||
gutz = floorz - (8 << 8);
|
|
||||||
|
|
||||||
for (j = 0; j < n; j++)
|
|
||||||
{
|
|
||||||
int a = krand() & 2047;
|
|
||||||
int r1 = krand();
|
|
||||||
int r2 = krand();
|
|
||||||
// TRANSITIONAL: owned by a player???
|
|
||||||
i = EGS(s->sectnum, s->x, s->y, gutz, gtype, -32, sx, sy, a, 256 + (r2 & 127), -512 - (r1 & 2047), ps[p].i, 5);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
void movefta_r(void)
|
void movefta_r(void)
|
||||||
{
|
{
|
||||||
int x, px, py, sx, sy;
|
int x, px, py, sx, sy;
|
||||||
|
|
|
@ -72,8 +72,6 @@ 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(spritetype* s, short gtype, short n, short p);
|
||||||
void guts_r(spritetype* s, short gtype, short n, short p);
|
void guts_r(spritetype* s, short gtype, short n, short p);
|
||||||
void gutsdir_d(spritetype* s, short gtype, short n, short p);
|
|
||||||
void gutsdir_r(spritetype* 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);
|
||||||
|
@ -155,7 +153,6 @@ void SetDispatcher()
|
||||||
lotsofmail_d,
|
lotsofmail_d,
|
||||||
lotsofpaper_d,
|
lotsofpaper_d,
|
||||||
guts_d,
|
guts_d,
|
||||||
gutsdir_d,
|
|
||||||
ifhitsectors_d,
|
ifhitsectors_d,
|
||||||
ifhitbyweapon_d,
|
ifhitbyweapon_d,
|
||||||
fall_d,
|
fall_d,
|
||||||
|
@ -207,7 +204,6 @@ void SetDispatcher()
|
||||||
lotsoffeathers_r,
|
lotsoffeathers_r,
|
||||||
lotsoffeathers_r,
|
lotsoffeathers_r,
|
||||||
guts_r,
|
guts_r,
|
||||||
gutsdir_r,
|
|
||||||
ifhitsectors_r,
|
ifhitsectors_r,
|
||||||
ifhitbyweapon_r,
|
ifhitbyweapon_r,
|
||||||
fall_r,
|
fall_r,
|
||||||
|
|
|
@ -93,7 +93,6 @@ struct Dispatcher
|
||||||
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)(spritetype* s, short gtype, short n, short p);
|
||||||
void (*gutsdir)(spritetype* 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);
|
||||||
|
|
|
@ -40,6 +40,8 @@ BEGIN_DUKE_NS
|
||||||
|
|
||||||
void initactorflags_d()
|
void initactorflags_d()
|
||||||
{
|
{
|
||||||
|
actorinfo[COMMANDER].gutsoffset = -(24 << 8);
|
||||||
|
|
||||||
setflag(SFLAG_INTERNAL_BADGUY, {
|
setflag(SFLAG_INTERNAL_BADGUY, {
|
||||||
SHARK,
|
SHARK,
|
||||||
RECON,
|
RECON,
|
||||||
|
|
|
@ -104,6 +104,7 @@ struct ActorInfo
|
||||||
uint32_t scriptaddress;
|
uint32_t scriptaddress;
|
||||||
uint32_t flags;
|
uint32_t flags;
|
||||||
int aimoffset;
|
int aimoffset;
|
||||||
|
int gutsoffset;
|
||||||
};
|
};
|
||||||
|
|
||||||
// for now just flags not related to actors, may get more info later.
|
// for now just flags not related to actors, may get more info later.
|
||||||
|
|
Loading…
Reference in a new issue