mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-03-01 06:31:13 +00:00
- spawninitdefault.
This commit is contained in:
parent
4d4cb2da9b
commit
618c739318
4 changed files with 40 additions and 35 deletions
|
@ -186,7 +186,7 @@ void checkplayerhurt_r(struct player_struct* p, const Collision& coll);
|
||||||
void addspritetodelete(int spnum=0);
|
void addspritetodelete(int spnum=0);
|
||||||
void checkavailinven(struct player_struct* p);
|
void checkavailinven(struct player_struct* p);
|
||||||
int initspriteforspawn(int j, int pn, const std::initializer_list<int> &excludes);
|
int initspriteforspawn(int j, int pn, const std::initializer_list<int> &excludes);
|
||||||
void spawninitdefault(int j, int i);
|
void spawninitdefault(DDukeActor* actj, DDukeActor* act);
|
||||||
void spawntransporter(int j, int i, bool beam);
|
void spawntransporter(int j, int i, bool beam);
|
||||||
int spawnbloodpoolpart1(int j, int i);
|
int spawnbloodpoolpart1(int j, int i);
|
||||||
void initfootprint(int j, int i);
|
void initfootprint(int j, int i);
|
||||||
|
|
|
@ -228,19 +228,18 @@ int initspriteforspawn(int j, int pn, const std::initializer_list<int> &excludes
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void spawninitdefault(int j, int i)
|
void spawninitdefault(DDukeActor* actj, DDukeActor *act)
|
||||||
{
|
{
|
||||||
auto act = &hittype[i];
|
|
||||||
auto sp = &act->s;
|
auto sp = &act->s;
|
||||||
auto sect = sp->sectnum;
|
auto sect = sp->sectnum;
|
||||||
|
|
||||||
if (actorinfo[sp->picnum].scriptaddress)
|
if (actorinfo[sp->picnum].scriptaddress)
|
||||||
{
|
{
|
||||||
if (j == -1 && sp->lotag > ud.player_skill)
|
if (actj == nullptr && sp->lotag > ud.player_skill)
|
||||||
{
|
{
|
||||||
// make it go away...
|
// make it go away...
|
||||||
sp->xrepeat = sp->yrepeat = 0;
|
sp->xrepeat = sp->yrepeat = 0;
|
||||||
changespritestat(i, STAT_MISC);
|
changespritestat(act, STAT_MISC);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -253,11 +252,11 @@ void spawninitdefault(int j, int i)
|
||||||
if (ud.monsters_off == 1)
|
if (ud.monsters_off == 1)
|
||||||
{
|
{
|
||||||
sp->xrepeat = sp->yrepeat = 0;
|
sp->xrepeat = sp->yrepeat = 0;
|
||||||
changespritestat(i, STAT_MISC);
|
changespritestat(act, STAT_MISC);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
makeitfall(i);
|
makeitfall(act);
|
||||||
|
|
||||||
if (actorflag(act, SFLAG_BADGUYSTAYPUT))
|
if (actorflag(act, SFLAG_BADGUYSTAYPUT))
|
||||||
act->actorstayput = sp->sectnum;
|
act->actorstayput = sp->sectnum;
|
||||||
|
@ -266,25 +265,25 @@ void spawninitdefault(int j, int i)
|
||||||
ps[myconnectindex].max_actors_killed++;
|
ps[myconnectindex].max_actors_killed++;
|
||||||
|
|
||||||
sp->clipdist = 80;
|
sp->clipdist = 80;
|
||||||
if (j >= 0)
|
if (actj)
|
||||||
{
|
{
|
||||||
if (sprite[j].picnum == RESPAWN)
|
if (actj->s.picnum == RESPAWN)
|
||||||
act->tempang = sp->pal = sprite[j].pal;
|
act->tempang = sp->pal = actj->s.pal;
|
||||||
changespritestat(i, STAT_ACTOR);
|
changespritestat(act, STAT_ACTOR);
|
||||||
}
|
}
|
||||||
else changespritestat(i, STAT_ZOMBIEACTOR);
|
else changespritestat(act, STAT_ZOMBIEACTOR);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sp->clipdist = 40;
|
sp->clipdist = 40;
|
||||||
sp->owner = i;
|
act->SetOwner(act);
|
||||||
changespritestat(i, STAT_ACTOR);
|
changespritestat(act, STAT_ACTOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
act->timetosleep = 0;
|
act->timetosleep = 0;
|
||||||
|
|
||||||
if (j >= 0)
|
if (actj)
|
||||||
sp->ang = sprite[j].ang;
|
sp->ang = actj->s.ang;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -298,15 +297,16 @@ void spawntransporter(int j, int i, bool beam)
|
||||||
{
|
{
|
||||||
if (j == -1) return;
|
if (j == -1) return;
|
||||||
auto sp = &sprite[i];
|
auto sp = &sprite[i];
|
||||||
|
auto spj = &sprite[j];
|
||||||
if (beam)
|
if (beam)
|
||||||
{
|
{
|
||||||
sp->xrepeat = 31;
|
sp->xrepeat = 31;
|
||||||
sp->yrepeat = 1;
|
sp->yrepeat = 1;
|
||||||
sp->z = sector[sprite[j].sectnum].floorz - (40 << 8);
|
sp->z = sector[spj->sectnum].floorz - (40 << 8);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (sprite[j].statnum == 4)
|
if (spj->statnum == 4)
|
||||||
{
|
{
|
||||||
sp->xrepeat = 8;
|
sp->xrepeat = 8;
|
||||||
sp->yrepeat = 8;
|
sp->yrepeat = 8;
|
||||||
|
@ -315,14 +315,14 @@ void spawntransporter(int j, int i, bool beam)
|
||||||
{
|
{
|
||||||
sp->xrepeat = 48;
|
sp->xrepeat = 48;
|
||||||
sp->yrepeat = 64;
|
sp->yrepeat = 64;
|
||||||
if (sprite[j].statnum == 10 || badguy(&sprite[j]))
|
if (spj->statnum == 10 || badguy(spj))
|
||||||
sp->z -= (32 << 8);
|
sp->z -= (32 << 8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sp->shade = -127;
|
sp->shade = -127;
|
||||||
sp->cstat = 128 | 2;
|
sp->cstat = 128 | 2;
|
||||||
sp->ang = sprite[j].ang;
|
sp->ang = spj->ang;
|
||||||
|
|
||||||
sp->xvel = 128;
|
sp->xvel = 128;
|
||||||
changespritestat(i, STAT_MISC);
|
changespritestat(i, STAT_MISC);
|
||||||
|
@ -961,15 +961,16 @@ void spawneffector(int i)
|
||||||
|
|
||||||
for (j = 0; j < MAXSPRITES; j++)
|
for (j = 0; j < MAXSPRITES; j++)
|
||||||
{
|
{
|
||||||
if (sprite[j].statnum < MAXSTATUS)
|
auto spr = &sprite[j];
|
||||||
if (sprite[j].picnum == SECTOREFFECTOR &&
|
if (spr->statnum < MAXSTATUS)
|
||||||
sprite[j].lotag == 1 &&
|
if (spr->picnum == SECTOREFFECTOR &&
|
||||||
sprite[j].hitag == sp->hitag)
|
spr->lotag == 1 &&
|
||||||
|
spr->hitag == sp->hitag)
|
||||||
{
|
{
|
||||||
if (sp->ang == 512)
|
if (sp->ang == 512)
|
||||||
{
|
{
|
||||||
sp->x = sprite[j].x;
|
sp->x = spr->x;
|
||||||
sp->y = sprite[j].y;
|
sp->y = spr->y;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,9 +48,11 @@ int spawn_d(int j, int pn)
|
||||||
int i = initspriteforspawn(j, pn, { CRACK1, CRACK2, CRACK3, CRACK4, SPEAKER, LETTER, DUCK, TARGET, TRIPBOMB, VIEWSCREEN, VIEWSCREEN2 });
|
int i = initspriteforspawn(j, pn, { CRACK1, CRACK2, CRACK3, CRACK4, SPEAKER, LETTER, DUCK, TARGET, TRIPBOMB, VIEWSCREEN, VIEWSCREEN2 });
|
||||||
if (!(i & 0x1000000)) return i;
|
if (!(i & 0x1000000)) return i;
|
||||||
i &= 0xffffff;
|
i &= 0xffffff;
|
||||||
auto sp = &sprite[i];
|
auto act = &hittype[i];
|
||||||
auto spj = &sprite[j];
|
auto sp = &act->s;
|
||||||
auto t = hittype[i].temp_data;
|
auto actj = &hittype[j];
|
||||||
|
auto spj = &actj->s;
|
||||||
|
auto t = act->temp_data;
|
||||||
int sect = sp->sectnum;
|
int sect = sp->sectnum;
|
||||||
|
|
||||||
|
|
||||||
|
@ -146,7 +148,7 @@ int spawn_d(int j, int pn)
|
||||||
switch(sp->picnum)
|
switch(sp->picnum)
|
||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
spawninitdefault(j, i);
|
spawninitdefault(actj, act);
|
||||||
break;
|
break;
|
||||||
case FOF:
|
case FOF:
|
||||||
sp->xrepeat = sp->yrepeat = 0;
|
sp->xrepeat = sp->yrepeat = 0;
|
||||||
|
|
|
@ -43,16 +43,18 @@ int spawn_r(int j, int pn)
|
||||||
int i = initspriteforspawn(j, pn, { CRACK1, CRACK2, CRACK3, CRACK4 });
|
int i = initspriteforspawn(j, pn, { CRACK1, CRACK2, CRACK3, CRACK4 });
|
||||||
if (!(i & 0x1000000)) return i;
|
if (!(i & 0x1000000)) return i;
|
||||||
i &= 0xffffff;
|
i &= 0xffffff;
|
||||||
auto sp = &sprite[i];
|
auto act = &hittype[i];
|
||||||
auto spj = &sprite[j];
|
auto sp = &act->s;
|
||||||
auto t = hittype[i].temp_data;
|
auto actj = j <0? nullptr : &hittype[j];
|
||||||
|
auto spj = j < 0? nullptr : &actj->s;
|
||||||
|
auto t = act->temp_data;
|
||||||
int sect = sp->sectnum;
|
int sect = sp->sectnum;
|
||||||
|
|
||||||
switch(sp->picnum)
|
switch(sp->picnum)
|
||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
default_case:
|
default_case:
|
||||||
spawninitdefault(j, i);
|
spawninitdefault(actj, act);
|
||||||
break;
|
break;
|
||||||
case RRTILE280:
|
case RRTILE280:
|
||||||
case RRTILE281:
|
case RRTILE281:
|
||||||
|
@ -1051,10 +1053,10 @@ int spawn_r(int j, int pn)
|
||||||
hittype[i].timetosleep = 0;
|
hittype[i].timetosleep = 0;
|
||||||
check_fta_sounds_r(&hittype[i]);
|
check_fta_sounds_r(&hittype[i]);
|
||||||
changespritestat(i,1);
|
changespritestat(i,1);
|
||||||
|
sp->shade = spj->shade;
|
||||||
}
|
}
|
||||||
else changespritestat(i,2);
|
else changespritestat(i,2);
|
||||||
|
|
||||||
sp->shade = spj->shade;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue