- IgniteSprite

This commit is contained in:
Christoph Oelckers 2021-10-17 00:01:06 +02:00
parent c1598185f7
commit 99e189fa2b
4 changed files with 9 additions and 12 deletions

View file

@ -79,7 +79,7 @@ int MoveBullet(short nBullet);
void SetBulletEnemy(short nBullet, DExhumedActor* nEnemy);
DExhumedActor* BuildBullet(DExhumedActor* pActor, int nType, int val1, int nAngle, DExhumedActor* pTarget, int val3);
void IgniteSprite(int nSprite);
void IgniteSprite(DExhumedActor* nSprite);
void FuncBullet(int, int, int, int);
void BackUpBullet(int *x, int *y, short nAngle);

View file

@ -141,7 +141,7 @@ void AIAnim::Tick(RunListEvent* ev)
if (pIgniter)
{
auto pSpriteB = &pActor->pTarget->s();
auto pSpriteB = &pIgniter->s();
pSprite->x = pSpriteB->x;
pSprite->y = pSpriteB->y;
pSprite->z = pSpriteB->z;

View file

@ -54,7 +54,7 @@ struct Bullet
FreeListArray<Bullet, kMaxBullets> BulletList;
int lasthitz, lasthitx, lasthity;
short lasthitsect, lasthitsprite, lasthitwall;
short lasthitsect;
short nRadialBullet = 0;
@ -83,6 +83,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, Bullet& w, Bullet*
("at12", w.field_12, def->field_12)
("at13", w.nDoubleDamage, def->nDoubleDamage)
("enemy", w.pEnemy, def->pEnemy)
//("owner", w.pOwner, def->pOwner)
.EndObject();
}
return arc;
@ -97,8 +98,6 @@ void SerializeBullet(FSerializer& arc)
("lasthity", lasthity)
("lasthitz", lasthitz)
("lasthitsect", lasthitsect)
("lasthitspr", lasthitsprite)
("lasthitwall", lasthitwall)
("radialbullet", nRadialBullet)
.EndObject();
}
@ -153,9 +152,9 @@ void DestroyBullet(short nBullet)
BulletList.Release(nBullet);
}
void IgniteSprite(int nSprite)
void IgniteSprite(DExhumedActor* pActor)
{
auto pSprite = &sprite[nSprite];
auto pSprite = &pActor->s();
pSprite->hitag += 2;
@ -163,7 +162,7 @@ void IgniteSprite(int nSprite)
if (pAnimActor)
{
pAnimActor->pTarget = &exhumedActors[nSprite];
pAnimActor->pTarget = pActor;
ChangeActorStat(pAnimActor, kStatIgnited);
short yRepeat = (tileHeight(pAnimActor->s().picnum) * 32) / nFlameHeight;
@ -194,7 +193,7 @@ void BulletHitsSprite(Bullet *pBullet, short nBulletSprite, short nHitSprite, in
pHitSprite->hitag++;
if (pHitSprite->hitag == 15) {
IgniteSprite(nHitSprite);
IgniteSprite(&exhumedActors[nHitSprite]);
}
if (!RandomSize(2)) {
@ -466,8 +465,6 @@ MOVEEND:
lasthity = y2;
lasthitz = z2;
lasthitsect = hitsect;
lasthitwall = hitwall;
lasthitsprite = hitactor->GetSpriteIndex();
if (hitactor)
{

View file

@ -465,7 +465,7 @@ int movespritez(short nSprite, int z, int height, int, int clipdist)
{
if (pSprite->hitag < 15)
{
IgniteSprite(nSprite);
IgniteSprite(&exhumedActors[nSprite]);
pSprite->hitag = 20;
}
nSectDamage >>= 2;