mirror of
https://github.com/DrBeef/Raze.git
synced 2025-02-01 05:20:43 +00:00
- InitChemBomb + PlayerInitFlashBomb
This commit is contained in:
parent
0e1e29d768
commit
3d04e332fc
4 changed files with 22 additions and 30 deletions
|
@ -1450,15 +1450,13 @@ int InitSpriteChemBomb(DSWActor* actor)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int InitChemBomb(DSWActor* actor)
|
||||||
InitChemBomb(short SpriteNum)
|
|
||||||
{
|
{
|
||||||
SPRITEp sp = &sprite[SpriteNum];
|
SPRITEp sp = &actor->s();
|
||||||
USERp u = User[SpriteNum].Data();
|
USERp u = actor->u();
|
||||||
USERp wu;
|
USERp wu;
|
||||||
SPRITEp wp;
|
SPRITEp wp;
|
||||||
int nx, ny, nz;
|
int nx, ny, nz;
|
||||||
short w;
|
|
||||||
|
|
||||||
|
|
||||||
// Need to make it take away from inventory weapon list
|
// Need to make it take away from inventory weapon list
|
||||||
|
@ -1470,19 +1468,15 @@ InitChemBomb(short SpriteNum)
|
||||||
|
|
||||||
// Spawn a shot
|
// Spawn a shot
|
||||||
// Inserting and setting up variables
|
// Inserting and setting up variables
|
||||||
w = SpawnSprite(STAT_MISSILE, MUSHROOM_CLOUD, s_ChemBomb, sp->sectnum,
|
auto actorNew = SpawnActor(STAT_MISSILE, MUSHROOM_CLOUD, s_ChemBomb, sp->sectnum,
|
||||||
nx, ny, nz, sp->ang, CHEMBOMB_VELOCITY);
|
nx, ny, nz, sp->ang, CHEMBOMB_VELOCITY);
|
||||||
|
|
||||||
wp = &sprite[w];
|
wp = &actorNew->s();
|
||||||
wu = User[w].Data();
|
wu = actorNew->u();
|
||||||
|
|
||||||
// wu->RotNum = 5;
|
|
||||||
// NewStateGroup_(w, &sg_ChemBomb);
|
|
||||||
SET(wu->Flags, SPR_XFLIP_TOGGLE);
|
SET(wu->Flags, SPR_XFLIP_TOGGLE);
|
||||||
|
|
||||||
// SetOwner(SpriteNum, w);
|
SetOwner(GetOwner(actor), actorNew);
|
||||||
// SetOwner(-1, w);
|
|
||||||
SetOwner(sp->owner, w); // !FRANK
|
|
||||||
wp->yrepeat = 32;
|
wp->yrepeat = 32;
|
||||||
wp->xrepeat = 32;
|
wp->xrepeat = 32;
|
||||||
wp->shade = -15;
|
wp->shade = -15;
|
||||||
|
@ -1527,14 +1521,13 @@ InitChemBomb(short SpriteNum)
|
||||||
// Inventory Flash Bombs
|
// Inventory Flash Bombs
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////
|
//////////////////////////////////////////////
|
||||||
int
|
|
||||||
PlayerInitFlashBomb(PLAYERp pp)
|
int PlayerInitFlashBomb(PLAYERp pp)
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
unsigned int stat;
|
unsigned int stat;
|
||||||
int dist, tx, ty, tmin;
|
int dist, tx, ty, tmin;
|
||||||
short damage;
|
short damage;
|
||||||
SPRITEp sp = pp->SpriteP, hp;
|
SPRITEp sp = &pp->Actor()->s(), hp;
|
||||||
USERp hu;
|
USERp hu;
|
||||||
|
|
||||||
PlaySound(DIGI_GASPOP, pp, v3df_dontpan | v3df_doppler);
|
PlaySound(DIGI_GASPOP, pp, v3df_dontpan | v3df_doppler);
|
||||||
|
@ -1544,14 +1537,13 @@ PlayerInitFlashBomb(PLAYERp pp)
|
||||||
|
|
||||||
for (stat = 0; stat < SIZ(StatDamageList); stat++)
|
for (stat = 0; stat < SIZ(StatDamageList); stat++)
|
||||||
{
|
{
|
||||||
StatIterator it(StatDamageList[stat]);
|
SWStatIterator it(StatDamageList[stat]);
|
||||||
while ((i = it.NextIndex()) >= 0)
|
while (auto itActor = it.Next())
|
||||||
{
|
{
|
||||||
auto itActor = &swActors[i];
|
hp = &itActor->s();
|
||||||
hp = &sprite[i];
|
hu = itActor->u();
|
||||||
hu = User[i].Data();
|
|
||||||
|
|
||||||
if (i == pp->PlayerSprite)
|
if (itActor == pp->Actor())
|
||||||
break;
|
break;
|
||||||
|
|
||||||
DISTANCE(hp->x, hp->y, sp->x, sp->y, dist, tx, ty, tmin);
|
DISTANCE(hp->x, hp->y, sp->x, sp->y, dist, tx, ty, tmin);
|
||||||
|
@ -1564,7 +1556,7 @@ PlayerInitFlashBomb(PLAYERp pp)
|
||||||
if (!FAFcansee(hp->x, hp->y, hp->z, hp->sectnum, sp->x, sp->y, sp->z - SPRITEp_SIZE_Z(sp), sp->sectnum))
|
if (!FAFcansee(hp->x, hp->y, hp->z, hp->sectnum, sp->x, sp->y, sp->z - SPRITEp_SIZE_Z(sp), sp->sectnum))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
damage = GetDamage(i, pp->PlayerSprite, DMG_FLASHBOMB);
|
damage = GetDamage(itActor->GetSpriteIndex(), pp->PlayerSprite, DMG_FLASHBOMB);
|
||||||
|
|
||||||
if (hu->sop_parent)
|
if (hu->sop_parent)
|
||||||
{
|
{
|
||||||
|
@ -1589,7 +1581,7 @@ PlayerInitFlashBomb(PLAYERp pp)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ActorPain(i);
|
ActorPain(itActor->GetSpriteIndex());
|
||||||
SpawnFlashBombOnActor(itActor);
|
SpawnFlashBombOnActor(itActor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -737,7 +737,7 @@ int InitSumoFart(DSWActor* actor)
|
||||||
|
|
||||||
PlaySound(DIGI_SUMOFART, sp, v3df_follow);
|
PlaySound(DIGI_SUMOFART, sp, v3df_follow);
|
||||||
|
|
||||||
InitChemBomb(SpriteNum);
|
InitChemBomb(actor);
|
||||||
|
|
||||||
SetSumoFartQuake(SpriteNum);
|
SetSumoFartQuake(SpriteNum);
|
||||||
InitSumoNapalm(SpriteNum);
|
InitSumoNapalm(SpriteNum);
|
||||||
|
@ -783,7 +783,7 @@ int DoSumoDeathMelt(DSWActor* actor)
|
||||||
PlaySound(DIGI_SUMOFART, sp, v3df_follow);
|
PlaySound(DIGI_SUMOFART, sp, v3df_follow);
|
||||||
|
|
||||||
u->ID = SUMO_RUN_R0;
|
u->ID = SUMO_RUN_R0;
|
||||||
InitChemBomb(SpriteNum);
|
InitChemBomb(actor);
|
||||||
u->ID = 0;
|
u->ID = 0;
|
||||||
|
|
||||||
DoMatchEverything(nullptr, sp->lotag, ON);
|
DoMatchEverything(nullptr, sp->lotag, ON);
|
||||||
|
|
|
@ -11137,7 +11137,7 @@ SpawnNuclearSecondaryExp(int16_t Weapon, short ang)
|
||||||
|
|
||||||
SpawnExpZadjust(Weapon, exp, Z(50), Z(10));
|
SpawnExpZadjust(Weapon, exp, Z(50), Z(10));
|
||||||
|
|
||||||
InitChemBomb(explosion);
|
InitChemBomb(&swActors[explosion]);
|
||||||
|
|
||||||
return explosion;
|
return explosion;
|
||||||
}
|
}
|
||||||
|
@ -11188,7 +11188,7 @@ SpawnNuclearExp(int16_t Weapon)
|
||||||
RESET(exp->cstat, CSTAT_SPRITE_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN);
|
RESET(exp->cstat, CSTAT_SPRITE_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN);
|
||||||
eu->spal = exp->pal = PALETTE_PLAYER1; // Set nuke puff to gray
|
eu->spal = exp->pal = PALETTE_PLAYER1; // Set nuke puff to gray
|
||||||
|
|
||||||
InitChemBomb(explosion);
|
InitChemBomb(&swActors[explosion]);
|
||||||
|
|
||||||
|
|
||||||
// Do central explosion
|
// Do central explosion
|
||||||
|
|
|
@ -177,7 +177,7 @@ void WallBounce(short SpriteNum, short ang);
|
||||||
#define PHOSPHORUS 1397
|
#define PHOSPHORUS 1397
|
||||||
|
|
||||||
int PlayerInitChemBomb(PLAYERp pp);
|
int PlayerInitChemBomb(PLAYERp pp);
|
||||||
int InitChemBomb(short SpriteNum);
|
int InitChemBomb(DSWActor*);
|
||||||
int PlayerInitCaltrops(PLAYERp pp);
|
int PlayerInitCaltrops(PLAYERp pp);
|
||||||
int InitBloodSpray(int16_t SpriteNum, bool dogib, short velocity);
|
int InitBloodSpray(int16_t SpriteNum, bool dogib, short velocity);
|
||||||
int SpawnBunnyExp(int16_t Weapon);
|
int SpawnBunnyExp(int16_t Weapon);
|
||||||
|
|
Loading…
Reference in a new issue