- DoPlasmaFountain + InitPlasmaFountain

This commit is contained in:
Christoph Oelckers 2021-11-05 20:32:45 +01:00
parent f888375e2a
commit 7d99745cd6
3 changed files with 18 additions and 26 deletions

View file

@ -146,8 +146,8 @@ int DoActorDie(DSWActor* actor, DSWActor* weapActor, int meansofdeath)
{ {
if (sw_ninjahack) if (sw_ninjahack)
SpawnBlood(actor, actor, -1, -1, -1, -1); SpawnBlood(actor, actor, -1, -1, -1, -1);
InitPlasmaFountain(wp, sp); InitPlasmaFountain(weapActor, actor);
InitPlasmaFountain(wp, sp); InitPlasmaFountain(weapActor, actor);
PlaySound(DIGI_NINJAINHALF, actor, v3df_none); PlaySound(DIGI_NINJAINHALF, actor, v3df_none);
if (sw_ninjahack) if (sw_ninjahack)
ChangeState(actor, &s_NinjaDieSlicedHack[5]); ChangeState(actor, &s_NinjaDieSlicedHack[5]);
@ -158,7 +158,7 @@ int DoActorDie(DSWActor* actor, DSWActor* weapActor, int meansofdeath)
{ {
if (RandomRange(1000) > 500) if (RandomRange(1000) > 500)
{ {
InitPlasmaFountain(wp, sp); InitPlasmaFountain(weapActor, actor);
} }
ChangeState(actor, u->StateEnd); ChangeState(actor, u->StateEnd);
@ -257,7 +257,7 @@ int DoActorDie(DSWActor* actor, DSWActor* weapActor, int meansofdeath)
default: default:
if (RandomRange(1000) > 700) if (RandomRange(1000) > 700)
{ {
InitPlasmaFountain(wp, sp); InitPlasmaFountain(weapActor, actor);
} }
if (RandomRange(1000) > 500) if (RandomRange(1000) > 500)

View file

@ -5182,7 +5182,7 @@ ActorHealth(short SpriteNum, short amt)
u->WaitTics = SEC(1) + SEC(RandomRange(2)); u->WaitTics = SEC(1) + SEC(RandomRange(2));
u->Health = 60; u->Health = 60;
PlaySound(DIGI_NINJACHOKE, sp, v3df_follow); PlaySound(DIGI_NINJACHOKE, sp, v3df_follow);
InitPlasmaFountain(nullptr, sp); InitPlasmaFountain(nullptr, actor);
InitBloodSpray(actor,false,105); InitBloodSpray(actor,false,105);
sp->ang = NORM_ANGLE(getangle(u->targetActor->s().x - sp->x, u->targetActor->s().y - sp->y) + 1024); sp->ang = NORM_ANGLE(getangle(u->targetActor->s().x - sp->x, u->targetActor->s().y - sp->y) + 1024);
RESET(sp->cstat, CSTAT_SPRITE_YFLIP); RESET(sp->cstat, CSTAT_SPRITE_YFLIP);
@ -7119,7 +7119,7 @@ DoDamage(short SpriteNum, short Weapon)
ActorPainPlasma(SpriteNum); ActorPainPlasma(SpriteNum);
} }
InitPlasmaFountain(wp, sp); InitPlasmaFountain(weapActor, actor);
SetSuicide(weapActor); SetSuicide(weapActor);
@ -8370,41 +8370,34 @@ DoBlurExtend(int16_t Weapon, int16_t interval, int16_t blur_num)
return 0; return 0;
} }
int int InitPlasmaFountain(DSWActor* wActor, DSWActor* sActor)
InitPlasmaFountain(SPRITEp wp, SPRITEp sp)
{ {
auto sp = &sActor->s();
SPRITEp np; SPRITEp np;
USERp nu; USERp nu;
short SpriteNum;
auto sActor = &swActors[sp - sprite];
SpriteNum = SpawnSprite(STAT_MISSILE, PLASMA_FOUNTAIN, s_PlasmaFountain, sp->sectnum, auto actorNew = SpawnActor(STAT_MISSILE, PLASMA_FOUNTAIN, s_PlasmaFountain, sp->sectnum,
sp->x, sp->y, SPRITEp_BOS(sp), sp->ang, 0); sp->x, sp->y, SPRITEp_BOS(sp), sp->ang, 0);
auto actorNew = &swActors[SpriteNum]; np = &actorNew->s();
np = &sprite[SpriteNum]; nu = actorNew->u();
nu = User[SpriteNum].Data();
np->shade = -40; np->shade = -40;
if (wp) if (wActor)
SetOwner(wp->owner, SpriteNum); SetOwner(GetOwner(wActor), actorNew);
SetAttach(sActor, actorNew); SetAttach(sActor, actorNew);
np->yrepeat = 0; np->yrepeat = 0;
np->clipdist = 8>>2; np->clipdist = 8>>2;
// start off on a random frame
//nu->WaitTics = PLASMA_FOUNTAIN_TIME;
nu->WaitTics = 120+60; nu->WaitTics = 120+60;
nu->Radius = 50; nu->Radius = 50;
return 0; return 0;
} }
int int DoPlasmaFountain(DSWActor* actor)
DoPlasmaFountain(DSWActor* actor)
{ {
USER* u = actor->u(); USER* u = actor->u();
int Weapon = u->SpriteNum; SPRITEp sp = &actor->s();
SPRITEp sp = &sprite[Weapon];
SPRITEp ap; SPRITEp ap;
short bak_cstat; short bak_cstat;
@ -8420,7 +8413,7 @@ DoPlasmaFountain(DSWActor* actor)
ap = &attachActor->s(); ap = &attachActor->s();
// move with sprite // move with sprite
setspritez(Weapon, &ap->pos); SetActorZ(actor, &ap->pos);
sp->ang = ap->ang; sp->ang = ap->ang;
u->Counter++; u->Counter++;
@ -8442,7 +8435,6 @@ DoPlasmaFountain(DSWActor* actor)
bak_cstat = sp->cstat; bak_cstat = sp->cstat;
RESET(sp->cstat, CSTAT_SPRITE_BLOCK); RESET(sp->cstat, CSTAT_SPRITE_BLOCK);
//DoDamageTest(Weapon); // fountain not doing the damage an more
sp->cstat = bak_cstat; sp->cstat = bak_cstat;
KillActor(actor); KillActor(actor);

View file

@ -213,7 +213,7 @@ enum ShrapPos
int SetSuicide(DSWActor*); int SetSuicide(DSWActor*);
void UpdateSinglePlayKills(DSWActor* actor); void UpdateSinglePlayKills(DSWActor* actor);
int InitPlasmaFountain(SPRITEp wp, SPRITEp sp); int InitPlasmaFountain(DSWActor* wActor, DSWActor* sActor);
int InitCoolgDrip(DSWActor*); int InitCoolgDrip(DSWActor*);
int InitFireball(PLAYERp pp); int InitFireball(PLAYERp pp);
void InitSpellRing(PLAYERp pp); void InitSpellRing(PLAYERp pp);