mirror of
https://github.com/DrBeef/Raze.git
synced 2025-02-01 13:30:50 +00:00
- owner stuff
This commit is contained in:
parent
a69a45523f
commit
4231119717
8 changed files with 28 additions and 29 deletions
|
@ -305,9 +305,6 @@ int CanHitPlayer(DSWActor* actor)
|
||||||
if (hitinfo.sprite == u->targetActor->GetSpriteIndex())
|
if (hitinfo.sprite == u->targetActor->GetSpriteIndex())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
////DSPRINTF(ds,"CanHit %s",ret ? "true" : "false");
|
|
||||||
//MONO_PRINT(ds);
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1197,7 +1197,7 @@ void BunnyHatch(short Weapon)
|
||||||
np->x = sp->x;
|
np->x = sp->x;
|
||||||
np->y = sp->y;
|
np->y = sp->y;
|
||||||
np->z = sp->z;
|
np->z = sp->z;
|
||||||
np->owner = -1;
|
ClearOwner(actorNew);
|
||||||
np->xrepeat = 30; // Baby size
|
np->xrepeat = 30; // Baby size
|
||||||
np->yrepeat = 24;
|
np->yrepeat = 24;
|
||||||
np->ang = rip_ang[i];
|
np->ang = rip_ang[i];
|
||||||
|
@ -1267,7 +1267,7 @@ int BunnyHatch2(short Weapon)
|
||||||
np->x = wp->x;
|
np->x = wp->x;
|
||||||
np->y = wp->y;
|
np->y = wp->y;
|
||||||
np->z = wp->z;
|
np->z = wp->z;
|
||||||
np->owner = -1;
|
ClearOwner(actorNew);
|
||||||
np->xrepeat = 30; // Baby size
|
np->xrepeat = 30; // Baby size
|
||||||
np->yrepeat = 24;
|
np->yrepeat = 24;
|
||||||
np->ang = RANDOM_P2(2048);
|
np->ang = RANDOM_P2(2048);
|
||||||
|
|
|
@ -1978,6 +1978,7 @@ void change_actor_stat(DSWActor* actor, int stat);
|
||||||
void SetOwner(DSWActor*, DSWActor*);
|
void SetOwner(DSWActor*, DSWActor*);
|
||||||
void SetOwner(int a, int b); // we still need this...
|
void SetOwner(int a, int b); // we still need this...
|
||||||
void ClearOwner(DSWActor* ownr);
|
void ClearOwner(DSWActor* ownr);
|
||||||
|
DSWActor* GetOwner(DSWActor* child);
|
||||||
void SetAttach(DSWActor*, DSWActor*);
|
void SetAttach(DSWActor*, DSWActor*);
|
||||||
void analyzesprites(spritetype* tsprite, int& spritesortcnt, int viewx, int viewy, int viewz, int camang);
|
void analyzesprites(spritetype* tsprite, int& spritesortcnt, int viewx, int viewy, int viewz, int camang);
|
||||||
void ChangeSpriteState(short SpriteNum, STATEp statep);
|
void ChangeSpriteState(short SpriteNum, STATEp statep);
|
||||||
|
|
|
@ -54,11 +54,8 @@ BEGIN_SW_NS
|
||||||
|
|
||||||
short CopyQuakeSpotToOn(SPRITEp sp)
|
short CopyQuakeSpotToOn(SPRITEp sp)
|
||||||
{
|
{
|
||||||
short New;
|
auto actorNew = InsertActor(sp->sectnum, STAT_QUAKE_SPOT);
|
||||||
SPRITEp np;
|
auto np = &actorNew->s();
|
||||||
|
|
||||||
New = COVERinsertsprite(sp->sectnum, STAT_QUAKE_SPOT);
|
|
||||||
np = &sprite[New];
|
|
||||||
|
|
||||||
memcpy(np, sp, sizeof(SPRITE));
|
memcpy(np, sp, sizeof(SPRITE));
|
||||||
|
|
||||||
|
@ -67,13 +64,13 @@ short CopyQuakeSpotToOn(SPRITEp sp)
|
||||||
|
|
||||||
np->cstat = 0;
|
np->cstat = 0;
|
||||||
np->extra = 0;
|
np->extra = 0;
|
||||||
np->owner = -1;
|
ClearOwner(actorNew);
|
||||||
|
|
||||||
change_sprite_stat(New, STAT_QUAKE_ON);
|
change_actor_stat(actorNew, STAT_QUAKE_ON);
|
||||||
|
|
||||||
QUAKE_Duration(np) *= 120;
|
QUAKE_Duration(np) *= 120;
|
||||||
|
|
||||||
return New;
|
return actorNew->GetSpriteIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -249,19 +246,15 @@ void QuakeViewChange(PLAYERp pp, int *z_diff, int *x_diff, int *y_diff, short *a
|
||||||
int SpawnQuake(short sectnum, int x, int y, int z,
|
int SpawnQuake(short sectnum, int x, int y, int z,
|
||||||
short tics, short amt, int radius)
|
short tics, short amt, int radius)
|
||||||
{
|
{
|
||||||
short SpriteNum;
|
|
||||||
SPRITEp sp;
|
|
||||||
|
|
||||||
SpriteNum = COVERinsertsprite(sectnum, STAT_QUAKE_ON);
|
auto actorNew = InsertActor(sectnum, STAT_QUAKE_ON);
|
||||||
sp = &sprite[SpriteNum];
|
auto sp = &actorNew->s();
|
||||||
|
|
||||||
ASSERT(SpriteNum >= 0);
|
|
||||||
|
|
||||||
sp->x = x;
|
sp->x = x;
|
||||||
sp->y = y;
|
sp->y = y;
|
||||||
sp->z = z;
|
sp->z = z;
|
||||||
sp->cstat = 0;
|
sp->cstat = 0;
|
||||||
sp->owner = -1;
|
ClearOwner(actorNew);
|
||||||
sp->extra = 0;
|
sp->extra = 0;
|
||||||
|
|
||||||
QUAKE_Match(sp) = -1;
|
QUAKE_Match(sp) = -1;
|
||||||
|
@ -272,9 +265,9 @@ int SpawnQuake(short sectnum, int x, int y, int z,
|
||||||
QUAKE_PosAmt(sp) = 0;
|
QUAKE_PosAmt(sp) = 0;
|
||||||
|
|
||||||
PlaySound(DIGI_ERUPTION, sp, v3df_follow|v3df_dontpan);
|
PlaySound(DIGI_ERUPTION, sp, v3df_follow|v3df_dontpan);
|
||||||
Set3DSoundOwner(SpriteNum);
|
Set3DSoundOwner(actorNew->GetSpriteIndex());
|
||||||
|
|
||||||
return SpriteNum;
|
return actorNew->GetSpriteIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
|
@ -1263,7 +1263,7 @@ void RipperHatch(short Weapon)
|
||||||
np->x = wp->x;
|
np->x = wp->x;
|
||||||
np->y = wp->y;
|
np->y = wp->y;
|
||||||
np->z = wp->z;
|
np->z = wp->z;
|
||||||
np->owner = -1;
|
ClearOwner(actorNew);
|
||||||
//np->xrepeat = np->yrepeat = 36;
|
//np->xrepeat = np->yrepeat = 36;
|
||||||
np->xrepeat = np->yrepeat = 64;
|
np->xrepeat = np->yrepeat = 64;
|
||||||
np->ang = rip_ang[i];
|
np->ang = rip_ang[i];
|
||||||
|
|
|
@ -1274,7 +1274,7 @@ void Ripper2Hatch(short Weapon)
|
||||||
np->x = wp->x;
|
np->x = wp->x;
|
||||||
np->y = wp->y;
|
np->y = wp->y;
|
||||||
np->z = wp->z;
|
np->z = wp->z;
|
||||||
np->owner = -1;
|
ClearOwner(actorNew);
|
||||||
//np->xrepeat = np->yrepeat = 36;
|
//np->xrepeat = np->yrepeat = 36;
|
||||||
np->xrepeat = np->yrepeat = 64;
|
np->xrepeat = np->yrepeat = 64;
|
||||||
np->ang = rip_ang[i];
|
np->ang = rip_ang[i];
|
||||||
|
|
|
@ -596,6 +596,12 @@ void SetOwner(DSWActor* ownr, DSWActor* child)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
DSWActor* GetOwner(DSWActor* child)
|
||||||
|
{
|
||||||
|
if (!child || child->s().owner < 0) return nullptr;
|
||||||
|
return &swActors[child->s().owner];
|
||||||
|
}
|
||||||
|
|
||||||
void ClearOwner(DSWActor* child)
|
void ClearOwner(DSWActor* child)
|
||||||
{
|
{
|
||||||
if (child) child->s().owner = -1;
|
if (child) child->s().owner = -1;
|
||||||
|
|
|
@ -11712,7 +11712,7 @@ SpawnSectorExp(int16_t Weapon)
|
||||||
eu = User[explosion].Data();
|
eu = User[explosion].Data();
|
||||||
|
|
||||||
exp->hitag = LUMINOUS; //Always full brightness
|
exp->hitag = LUMINOUS; //Always full brightness
|
||||||
exp->owner = -1;
|
ClearOwner(expActor);
|
||||||
exp->shade = -40;
|
exp->shade = -40;
|
||||||
exp->xrepeat = 90; // was 40,40
|
exp->xrepeat = 90; // was 40,40
|
||||||
exp->yrepeat = 90;
|
exp->yrepeat = 90;
|
||||||
|
@ -11745,7 +11745,7 @@ SpawnLargeExp(int16_t Weapon)
|
||||||
eu = User[explosion].Data();
|
eu = User[explosion].Data();
|
||||||
|
|
||||||
exp->hitag = LUMINOUS; //Always full brightness
|
exp->hitag = LUMINOUS; //Always full brightness
|
||||||
exp->owner = -1;
|
ClearOwner(expActor);
|
||||||
exp->shade = -40;
|
exp->shade = -40;
|
||||||
exp->xrepeat = 90; // was 40,40
|
exp->xrepeat = 90; // was 40,40
|
||||||
exp->yrepeat = 90;
|
exp->yrepeat = 90;
|
||||||
|
@ -11788,11 +11788,12 @@ SpawnMeteorExp(int16_t Weapon)
|
||||||
sp->x, sp->y, sp->z, sp->ang, 0);
|
sp->x, sp->y, sp->z, sp->ang, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto expActor = &swActors[explosion];
|
||||||
exp = &sprite[explosion];
|
exp = &sprite[explosion];
|
||||||
eu = User[explosion].Data();
|
eu = User[explosion].Data();
|
||||||
|
|
||||||
exp->hitag = LUMINOUS; //Always full brightness
|
exp->hitag = LUMINOUS; //Always full brightness
|
||||||
exp->owner = -1;
|
ClearOwner(expActor);
|
||||||
exp->shade = -40;
|
exp->shade = -40;
|
||||||
if (sp->yrepeat < 64)
|
if (sp->yrepeat < 64)
|
||||||
{
|
{
|
||||||
|
@ -11830,7 +11831,7 @@ SpawnLittleExp(int16_t Weapon)
|
||||||
eu = User[explosion].Data();
|
eu = User[explosion].Data();
|
||||||
|
|
||||||
exp->hitag = LUMINOUS; //Always full brightness
|
exp->hitag = LUMINOUS; //Always full brightness
|
||||||
exp->owner = -1;
|
ClearOwner(expActor);
|
||||||
exp->shade = -127;
|
exp->shade = -127;
|
||||||
|
|
||||||
SET(exp->cstat, CSTAT_SPRITE_YCENTER);
|
SET(exp->cstat, CSTAT_SPRITE_YCENTER);
|
||||||
|
@ -16048,11 +16049,12 @@ SpawnDemonFist(int16_t Weapon)
|
||||||
explosion = SpawnSprite(STAT_MISSILE, 0, s_TeleportEffect, sp->sectnum,
|
explosion = SpawnSprite(STAT_MISSILE, 0, s_TeleportEffect, sp->sectnum,
|
||||||
sp->x, sp->y, SPRITEp_MID(sp), sp->ang, 0);
|
sp->x, sp->y, SPRITEp_MID(sp), sp->ang, 0);
|
||||||
|
|
||||||
|
auto expActor = &swActors[explosion];
|
||||||
exp = &sprite[explosion];
|
exp = &sprite[explosion];
|
||||||
eu = User[explosion].Data();
|
eu = User[explosion].Data();
|
||||||
|
|
||||||
exp->hitag = LUMINOUS; //Always full brightness
|
exp->hitag = LUMINOUS; //Always full brightness
|
||||||
exp->owner = -1;
|
ClearOwner(expActor);
|
||||||
exp->shade = -40;
|
exp->shade = -40;
|
||||||
exp->xrepeat = 32;
|
exp->xrepeat = 32;
|
||||||
exp->yrepeat = 32;
|
exp->yrepeat = 32;
|
||||||
|
|
Loading…
Reference in a new issue