mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-27 01:10:51 +00:00
- actFireMissile.
This commit is contained in:
parent
7eac8b71d5
commit
351dabdb90
13 changed files with 145 additions and 127 deletions
|
@ -6654,11 +6654,92 @@ DBloodActor* actFireThing(DBloodActor* actor, int a2, int a3, int a4, int thingT
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
spritetype* actFireMissile(spritetype* pSprite, int a2, int a3, int a4, int a5, int a6, int nType)
|
void actBuildMissile(DBloodActor* spawned, DBloodActor* actor)
|
||||||
|
{
|
||||||
|
auto pMissile = &spawned->s();
|
||||||
|
int nMissile = pMissile->index;
|
||||||
|
switch (pMissile->type)
|
||||||
|
{
|
||||||
|
case kMissileLifeLeechRegular:
|
||||||
|
evPost(nMissile, 3, 0, kCallbackFXFlameLick);
|
||||||
|
break;
|
||||||
|
case kMissileTeslaAlt:
|
||||||
|
evPost(nMissile, 3, 0, kCallbackFXTeslaAlt);
|
||||||
|
break;
|
||||||
|
case kMissilePukeGreen:
|
||||||
|
seqSpawn(29, spawned, -1);
|
||||||
|
break;
|
||||||
|
case kMissileButcherKnife:
|
||||||
|
pMissile->cstat |= 16;
|
||||||
|
break;
|
||||||
|
case kMissileTeslaRegular:
|
||||||
|
sfxPlay3DSound(pMissile, 251, 0, 0);
|
||||||
|
break;
|
||||||
|
case kMissileEctoSkull:
|
||||||
|
seqSpawn(2, spawned, -1);
|
||||||
|
sfxPlay3DSound(pMissile, 493, 0, 0);
|
||||||
|
break;
|
||||||
|
case kMissileFireballNapalm:
|
||||||
|
seqSpawn(61, spawned, nNapalmClient);
|
||||||
|
sfxPlay3DSound(pMissile, 441, 0, 0);
|
||||||
|
break;
|
||||||
|
case kMissileFireball:
|
||||||
|
seqSpawn(22, spawned, nFireballClient);
|
||||||
|
sfxPlay3DSound(pMissile, 441, 0, 0);
|
||||||
|
break;
|
||||||
|
case kMissileFlameHound:
|
||||||
|
seqSpawn(27, spawned, -1);
|
||||||
|
spawned->xvel() += actor->xvel() / 2 + Random2(0x11111);
|
||||||
|
spawned->yvel() += actor->yvel() / 2 + Random2(0x11111);
|
||||||
|
spawned->zvel() += actor->zvel() / 2 + Random2(0x11111);
|
||||||
|
break;
|
||||||
|
case kMissileFireballCerberus:
|
||||||
|
seqSpawn(61, spawned, dword_2192E0);
|
||||||
|
sfxPlay3DSound(pMissile, 441, 0, 0);
|
||||||
|
break;
|
||||||
|
case kMissileFireballTchernobog:
|
||||||
|
seqSpawn(23, spawned, dword_2192D8);
|
||||||
|
spawned->xvel() += actor->xvel() / 2 + Random2(0x11111);
|
||||||
|
spawned->yvel() += actor->yvel() / 2 + Random2(0x11111);
|
||||||
|
spawned->zvel() += actor->zvel() / 2 + Random2(0x11111);
|
||||||
|
break;
|
||||||
|
case kMissileFlameSpray:
|
||||||
|
if (Chance(0x8000)) seqSpawn(0, spawned, -1);
|
||||||
|
else seqSpawn(1, spawned, -1);
|
||||||
|
spawned->xvel() += actor->xvel() / 2 + Random2(0x11111);
|
||||||
|
spawned->yvel() += actor->yvel() / 2 + Random2(0x11111);
|
||||||
|
spawned->zvel() += actor->zvel() / 2 + Random2(0x11111);
|
||||||
|
break;
|
||||||
|
case kMissileFlareAlt:
|
||||||
|
evPost(spawned, 30, kCallbackFXFlareBurst);
|
||||||
|
evPost(spawned, 0, kCallbackFXFlareSpark);
|
||||||
|
sfxPlay3DSound(pMissile, 422, 0, 0);
|
||||||
|
break;
|
||||||
|
case kMissileFlareRegular:
|
||||||
|
evPost(spawned, 0, kCallbackFXFlareSpark);
|
||||||
|
sfxPlay3DSound(pMissile, 422, 0, 0);
|
||||||
|
break;
|
||||||
|
case kMissileLifeLeechAltSmall:
|
||||||
|
evPost(spawned, 0, kCallbackFXArcSpark);
|
||||||
|
break;
|
||||||
|
case kMissileArcGargoyle:
|
||||||
|
sfxPlay3DSound(pMissile, 252, 0, 0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
DBloodActor* actFireMissile(DBloodActor* actor, int a2, int a3, int a4, int a5, int a6, int nType)
|
||||||
{
|
{
|
||||||
|
|
||||||
assert(nType >= kMissileBase && nType < kMissileMax);
|
assert(nType >= kMissileBase && nType < kMissileMax);
|
||||||
char v4 = 0;
|
char v4 = 0;
|
||||||
|
auto pSprite = &actor->s();
|
||||||
int nSprite = pSprite->index;
|
int nSprite = pSprite->index;
|
||||||
const MissileType* pMissileInfo = &missileInfo[nType - kMissileBase];
|
const MissileType* pMissileInfo = &missileInfo[nType - kMissileBase];
|
||||||
int x = pSprite->x + MulScale(a2, Cos(pSprite->ang + 512), 30);
|
int x = pSprite->x + MulScale(a2, Cos(pSprite->ang + 512), 30);
|
||||||
|
@ -6682,8 +6763,8 @@ spritetype* actFireMissile(spritetype* pSprite, int a2, int a3, int a4, int a5,
|
||||||
y = gHitInfo.hity - MulScale(pMissileInfo->clipDist << 1, Sin(pSprite->ang), 28);
|
y = gHitInfo.hity - MulScale(pMissileInfo->clipDist << 1, Sin(pSprite->ang), 28);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
auto actor = actSpawnSprite(pSprite->sectnum, x, y, z, 5, 1);
|
auto spawned = actSpawnSprite(pSprite->sectnum, x, y, z, 5, 1);
|
||||||
spritetype* pMissile = &actor->s();
|
spritetype* pMissile = &spawned->s();
|
||||||
int nMissile = pMissile->index;
|
int nMissile = pMissile->index;
|
||||||
show2dsprite.Set(nMissile);
|
show2dsprite.Set(nMissile);
|
||||||
pMissile->type = nType;
|
pMissile->type = nType;
|
||||||
|
@ -6695,98 +6776,29 @@ spritetype* actFireMissile(spritetype* pSprite, int a2, int a3, int a4, int a5,
|
||||||
pMissile->yrepeat = pMissileInfo->yrepeat;
|
pMissile->yrepeat = pMissileInfo->yrepeat;
|
||||||
pMissile->picnum = pMissileInfo->picnum;
|
pMissile->picnum = pMissileInfo->picnum;
|
||||||
pMissile->ang = (pSprite->ang + pMissileInfo->angleOfs) & 2047;
|
pMissile->ang = (pSprite->ang + pMissileInfo->angleOfs) & 2047;
|
||||||
xvel[nMissile] = MulScale(pMissileInfo->velocity, a4, 14);
|
spawned->xvel() = MulScale(pMissileInfo->velocity, a4, 14);
|
||||||
yvel[nMissile] = MulScale(pMissileInfo->velocity, a5, 14);
|
spawned->yvel() = MulScale(pMissileInfo->velocity, a5, 14);
|
||||||
zvel[nMissile] = MulScale(pMissileInfo->velocity, a6, 14);
|
spawned->zvel() = MulScale(pMissileInfo->velocity, a6, 14);
|
||||||
pMissile->owner = pSprite->index;
|
pMissile->owner = pSprite->index;
|
||||||
pMissile->cstat |= 1;
|
pMissile->cstat |= 1;
|
||||||
int nXSprite = pMissile->extra;
|
spawned->SetTarget(nullptr);
|
||||||
assert(nXSprite > 0 && nXSprite < kMaxXSprites);
|
evPost(spawned, 600, kCallbackRemove);
|
||||||
xsprite[nXSprite].target_i = -1;
|
|
||||||
evPost(nMissile, 3, 600, kCallbackRemove);
|
|
||||||
|
|
||||||
actBuildMissile(pMissile, nXSprite, nSprite);
|
actBuildMissile(spawned, actor);
|
||||||
|
|
||||||
if (v4)
|
if (v4)
|
||||||
{
|
{
|
||||||
actImpactMissile(&bloodActors[pMissile->index], hit);
|
actImpactMissile(spawned, hit);
|
||||||
pMissile = NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
return pMissile;
|
return spawned;
|
||||||
}
|
}
|
||||||
|
|
||||||
void actBuildMissile(spritetype* pMissile, int nXSprite, int nSprite) {
|
//---------------------------------------------------------------------------
|
||||||
int nMissile = pMissile->index;
|
//
|
||||||
switch (pMissile->type) {
|
//
|
||||||
case kMissileLifeLeechRegular:
|
//
|
||||||
evPost(nMissile, 3, 0, kCallbackFXFlameLick);
|
//---------------------------------------------------------------------------
|
||||||
break;
|
|
||||||
case kMissileTeslaAlt:
|
|
||||||
evPost(nMissile, 3, 0, kCallbackFXTeslaAlt);
|
|
||||||
break;
|
|
||||||
case kMissilePukeGreen:
|
|
||||||
seqSpawn(29, 3, nXSprite, -1);
|
|
||||||
break;
|
|
||||||
case kMissileButcherKnife:
|
|
||||||
pMissile->cstat |= 16;
|
|
||||||
break;
|
|
||||||
case kMissileTeslaRegular:
|
|
||||||
sfxPlay3DSound(pMissile, 251, 0, 0);
|
|
||||||
break;
|
|
||||||
case kMissileEctoSkull:
|
|
||||||
seqSpawn(2, 3, nXSprite, -1);
|
|
||||||
sfxPlay3DSound(pMissile, 493, 0, 0);
|
|
||||||
break;
|
|
||||||
case kMissileFireballNapalm:
|
|
||||||
seqSpawn(61, 3, nXSprite, nNapalmClient);
|
|
||||||
sfxPlay3DSound(pMissile, 441, 0, 0);
|
|
||||||
break;
|
|
||||||
case kMissileFireball:
|
|
||||||
seqSpawn(22, 3, nXSprite, nFireballClient);
|
|
||||||
sfxPlay3DSound(pMissile, 441, 0, 0);
|
|
||||||
break;
|
|
||||||
case kMissileFlameHound:
|
|
||||||
seqSpawn(27, 3, nXSprite, -1);
|
|
||||||
xvel[nMissile] += xvel[nSprite] / 2 + Random2(0x11111);
|
|
||||||
yvel[nMissile] += yvel[nSprite] / 2 + Random2(0x11111);
|
|
||||||
zvel[nMissile] += zvel[nSprite] / 2 + Random2(0x11111);
|
|
||||||
break;
|
|
||||||
case kMissileFireballCerberus:
|
|
||||||
seqSpawn(61, 3, nXSprite, dword_2192E0);
|
|
||||||
sfxPlay3DSound(pMissile, 441, 0, 0);
|
|
||||||
break;
|
|
||||||
case kMissileFireballTchernobog:
|
|
||||||
seqSpawn(23, 3, nXSprite, dword_2192D8);
|
|
||||||
xvel[nMissile] += xvel[nSprite] / 2 + Random2(0x11111);
|
|
||||||
yvel[nMissile] += yvel[nSprite] / 2 + Random2(0x11111);
|
|
||||||
zvel[nMissile] += zvel[nSprite] / 2 + Random2(0x11111);
|
|
||||||
break;
|
|
||||||
case kMissileFlameSpray:
|
|
||||||
if (Chance(0x8000))
|
|
||||||
seqSpawn(0, 3, nXSprite, -1);
|
|
||||||
else
|
|
||||||
seqSpawn(1, 3, nXSprite, -1);
|
|
||||||
xvel[nMissile] += xvel[nSprite] + Random2(0x11111);
|
|
||||||
yvel[nMissile] += yvel[nSprite] + Random2(0x11111);
|
|
||||||
zvel[nMissile] += zvel[nSprite] + Random2(0x11111);
|
|
||||||
break;
|
|
||||||
case kMissileFlareAlt:
|
|
||||||
evPost(nMissile, 3, 30, kCallbackFXFlareBurst);
|
|
||||||
evPost(nMissile, 3, 0, kCallbackFXFlareSpark);
|
|
||||||
sfxPlay3DSound(pMissile, 422, 0, 0);
|
|
||||||
break;
|
|
||||||
case kMissileFlareRegular:
|
|
||||||
evPost(nMissile, 3, 0, kCallbackFXFlareSpark);
|
|
||||||
sfxPlay3DSound(pMissile, 422, 0, 0);
|
|
||||||
break;
|
|
||||||
case kMissileLifeLeechAltSmall:
|
|
||||||
evPost(nMissile, 3, 0, kCallbackFXArcSpark);
|
|
||||||
break;
|
|
||||||
case kMissileArcGargoyle:
|
|
||||||
sfxPlay3DSound(pMissile, 252, 0, 0);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int actGetRespawnTime(DBloodActor* actor)
|
int actGetRespawnTime(DBloodActor* actor)
|
||||||
{
|
{
|
||||||
|
|
|
@ -233,8 +233,8 @@ DBloodActor* actSpawnSprite(int nSector, int x, int y, int z, int nStat, bool a6
|
||||||
DBloodActor* actSpawnDude(DBloodActor* pSource, short nType, int a3, int a4);
|
DBloodActor* actSpawnDude(DBloodActor* pSource, short nType, int a3, int a4);
|
||||||
DBloodActor * actSpawnSprite(DBloodActor *pSource, int nStat);
|
DBloodActor * actSpawnSprite(DBloodActor *pSource, int nStat);
|
||||||
DBloodActor * actSpawnThing(int nSector, int x, int y, int z, int nThingType);
|
DBloodActor * actSpawnThing(int nSector, int x, int y, int z, int nThingType);
|
||||||
spritetype * actFireThing_(spritetype *pSprite, int a2, int a3, int a4, int thingType, int a6);
|
|
||||||
DBloodActor* actFireThing(DBloodActor* pSprite, int a2, int a3, int a4, int thingType, int a6);
|
DBloodActor* actFireThing(DBloodActor* pSprite, int a2, int a3, int a4, int thingType, int a6);
|
||||||
|
DBloodActor* actFireMissile(DBloodActor *pSprite, int a2, int a3, int a4, int a5, int a6, int nType);
|
||||||
|
|
||||||
int actGetRespawnTime(DBloodActor *pSprite);
|
int actGetRespawnTime(DBloodActor *pSprite);
|
||||||
bool actCheckRespawn(DBloodActor *pSprite);
|
bool actCheckRespawn(DBloodActor *pSprite);
|
||||||
|
@ -244,7 +244,7 @@ void actPostSprite(int nSprite, int nStatus);
|
||||||
void actPostSprite(DBloodActor* actor, int status);
|
void actPostSprite(DBloodActor* actor, int status);
|
||||||
void actPostProcess(void);
|
void actPostProcess(void);
|
||||||
void MakeSplash(DBloodActor *actor);
|
void MakeSplash(DBloodActor *actor);
|
||||||
void actBuildMissile(spritetype* pMissile, int nXSprite, int nSprite);
|
void actBuildMissile(DBloodActor* spawned, DBloodActor* actor);
|
||||||
|
|
||||||
extern const int DudeDifficulty[];
|
extern const int DudeDifficulty[];
|
||||||
|
|
||||||
|
|
|
@ -144,11 +144,11 @@ void cerberusBurnSeqCallback(int, DBloodActor* actor)
|
||||||
}
|
}
|
||||||
switch (pSprite->type) {
|
switch (pSprite->type) {
|
||||||
case kDudeCerberusTwoHead:
|
case kDudeCerberusTwoHead:
|
||||||
actFireMissile(pSprite, -350, 0, aim.dx, aim.dy, aim.dz, kMissileFireballCerberus);
|
actFireMissile(actor, -350, 0, aim.dx, aim.dy, aim.dz, kMissileFireballCerberus);
|
||||||
actFireMissile(pSprite, 350, -100, aim.dx, aim.dy, aim.dz, kMissileFireballCerberus);
|
actFireMissile(actor, 350, -100, aim.dx, aim.dy, aim.dz, kMissileFireballCerberus);
|
||||||
break;
|
break;
|
||||||
case kDudeCerberusOneHead:
|
case kDudeCerberusOneHead:
|
||||||
actFireMissile(pSprite, 350, -100, aim.dx, aim.dy, aim.dz, kMissileFireballCerberus);
|
actFireMissile(actor, 350, -100, aim.dx, aim.dy, aim.dz, kMissileFireballCerberus);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -226,11 +226,11 @@ void cerberusBurnSeqCallback2(int, DBloodActor* actor)
|
||||||
}
|
}
|
||||||
switch (pSprite->type) {
|
switch (pSprite->type) {
|
||||||
case kDudeCerberusTwoHead:
|
case kDudeCerberusTwoHead:
|
||||||
actFireMissile(pSprite, 350, -100, aim.dx, aim.dy, -aim.dz, kMissileFlameHound);
|
actFireMissile(actor, 350, -100, aim.dx, aim.dy, -aim.dz, kMissileFlameHound);
|
||||||
actFireMissile(pSprite, -350, 0, ax, ay, az, kMissileFlameHound);
|
actFireMissile(actor, -350, 0, ax, ay, az, kMissileFlameHound);
|
||||||
break;
|
break;
|
||||||
case kDudeCerberusOneHead:
|
case kDudeCerberusOneHead:
|
||||||
actFireMissile(pSprite, 350, -100, aim.dx, aim.dy, -aim.dz, kMissileFlameHound);
|
actFireMissile(actor, 350, -100, aim.dx, aim.dy, -aim.dz, kMissileFlameHound);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,7 +99,7 @@ void TeslaSeqCallback(int, DBloodActor* actor)
|
||||||
dx += Random3((5 - gGameOptions.nDifficulty) * 1000);
|
dx += Random3((5 - gGameOptions.nDifficulty) * 1000);
|
||||||
dy += Random3((5 - gGameOptions.nDifficulty) * 1000);
|
dy += Random3((5 - gGameOptions.nDifficulty) * 1000);
|
||||||
dz += Random3((5 - gGameOptions.nDifficulty) * 500);
|
dz += Random3((5 - gGameOptions.nDifficulty) * 500);
|
||||||
actFireMissile(pSprite, 0, 0, dx, dy, dz, kMissileTeslaRegular);
|
actFireMissile(actor, 0, 0, dx, dy, dz, kMissileTeslaRegular);
|
||||||
sfxPlay3DSound(actor, 470, -1, 0);
|
sfxPlay3DSound(actor, 470, -1, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -188,13 +188,13 @@ void BlastSSeqCallback(int, DBloodActor* actor)
|
||||||
#ifdef NOONE_EXTENSIONS
|
#ifdef NOONE_EXTENSIONS
|
||||||
// allow to fire missile in non-player targets
|
// allow to fire missile in non-player targets
|
||||||
if (IsPlayerSprite(pTarget) || gModernMap) {
|
if (IsPlayerSprite(pTarget) || gModernMap) {
|
||||||
actFireMissile(pSprite, -120, 0, aim.dx, aim.dy, aim.dz, kMissileArcGargoyle);
|
actFireMissile(actor, -120, 0, aim.dx, aim.dy, aim.dz, kMissileArcGargoyle);
|
||||||
actFireMissile(pSprite, 120, 0, aim.dx, aim.dy, aim.dz, kMissileArcGargoyle);
|
actFireMissile(actor, 120, 0, aim.dx, aim.dy, aim.dz, kMissileArcGargoyle);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (IsPlayerSprite(pTarget)) {
|
if (IsPlayerSprite(pTarget)) {
|
||||||
actFireMissile(pSprite, -120, 0, aim.dx, aim.dy, aim.dz, kMissileArcGargoyle);
|
actFireMissile(actor, -120, 0, aim.dx, aim.dy, aim.dz, kMissileArcGargoyle);
|
||||||
actFireMissile(pSprite, 120, 0, aim.dx, aim.dy, aim.dz, kMissileArcGargoyle);
|
actFireMissile(actor, 120, 0, aim.dx, aim.dy, aim.dz, kMissileArcGargoyle);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -172,12 +172,12 @@ void ghostBlastSeqCallback(int, DBloodActor* actor)
|
||||||
// allow fire missile in non-player targets if not a demo
|
// allow fire missile in non-player targets if not a demo
|
||||||
if (IsPlayerSprite(pTarget) || gModernMap) {
|
if (IsPlayerSprite(pTarget) || gModernMap) {
|
||||||
sfxPlay3DSound(actor, 489, 0, 0);
|
sfxPlay3DSound(actor, 489, 0, 0);
|
||||||
actFireMissile(pSprite, 0, 0, aim.dx, aim.dy, aim.dz, kMissileEctoSkull);
|
actFireMissile(actor, 0, 0, aim.dx, aim.dy, aim.dz, kMissileEctoSkull);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (IsPlayerSprite(pTarget)) {
|
if (IsPlayerSprite(pTarget)) {
|
||||||
sfxPlay3DSound(actor, 489, 0, 0);
|
sfxPlay3DSound(actor, 489, 0, 0);
|
||||||
actFireMissile(pSprite, 0, 0, aim.dx, aim.dy, aim.dz, kMissileEctoSkull);
|
actFireMissile(actor, 0, 0, aim.dx, aim.dy, aim.dz, kMissileEctoSkull);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,7 +69,7 @@ void houndBiteSeqCallback(int, DBloodActor* actor)
|
||||||
void houndBurnSeqCallback(int, DBloodActor* actor)
|
void houndBurnSeqCallback(int, DBloodActor* actor)
|
||||||
{
|
{
|
||||||
spritetype* pSprite = &actor->s();
|
spritetype* pSprite = &actor->s();
|
||||||
actFireMissile(pSprite, 0, 0, CosScale16(pSprite->ang), SinScale16(pSprite->ang), 0, kMissileFlameHound);
|
actFireMissile(actor, 0, 0, CosScale16(pSprite->ang), SinScale16(pSprite->ang), 0, kMissileFlameHound);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void houndThinkSearch(DBloodActor* actor)
|
static void houndThinkSearch(DBloodActor* actor)
|
||||||
|
|
|
@ -128,8 +128,8 @@ void sub_71BD4(int, DBloodActor* actor)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
actFireMissile(pSprite, -350, 0, aim.dx, aim.dy, aim.dz, kMissileFireballTchernobog);
|
actFireMissile(actor, -350, 0, aim.dx, aim.dy, aim.dz, kMissileFireballTchernobog);
|
||||||
actFireMissile(pSprite, 350, 0, aim.dx, aim.dy, aim.dz, kMissileFireballTchernobog);
|
actFireMissile(actor, 350, 0, aim.dx, aim.dy, aim.dz, kMissileFireballTchernobog);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_720AC(int, DBloodActor* actor)
|
void sub_720AC(int, DBloodActor* actor)
|
||||||
|
@ -203,8 +203,8 @@ void sub_720AC(int, DBloodActor* actor)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
actFireMissile(pSprite, 350, 0, aim.dx, aim.dy, -aim.dz, kMissileFireballTchernobog);
|
actFireMissile(actor, 350, 0, aim.dx, aim.dy, -aim.dz, kMissileFireballTchernobog);
|
||||||
actFireMissile(pSprite, -350, 0, ax, ay, az, kMissileFireballTchernobog);
|
actFireMissile(actor, -350, 0, ax, ay, az, kMissileFireballTchernobog);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sub_72580(DBloodActor* actor)
|
static void sub_72580(DBloodActor* actor)
|
||||||
|
|
|
@ -288,7 +288,7 @@ void genDudeAttack1(int, DBloodActor* actor)
|
||||||
// dispersal modifiers here
|
// dispersal modifiers here
|
||||||
dx += Random3(dispersion); dy += Random3(dispersion); dz += Random3(dispersion >> 1);
|
dx += Random3(dispersion); dy += Random3(dispersion); dz += Random3(dispersion >> 1);
|
||||||
|
|
||||||
actFireMissile(pSprite, 0, 0, dx, dy, dz, pExtra->curWeapon);
|
actFireMissile(actor, 0, 0, dx, dy, dz, pExtra->curWeapon);
|
||||||
if (!playGenDudeSound(pSprite, kGenDudeSndAttackNormal))
|
if (!playGenDudeSound(pSprite, kGenDudeSndAttackNormal))
|
||||||
sfxPlayMissileSound(pSprite, pExtra->curWeapon);
|
sfxPlayMissileSound(pSprite, pExtra->curWeapon);
|
||||||
}
|
}
|
||||||
|
@ -1648,6 +1648,7 @@ void dudeLeechOperate(spritetype* pSprite, XSPRITE* pXSprite, EVENT event)
|
||||||
actPostSprite(pSprite->index, kStatFree);
|
actPostSprite(pSprite->index, kStatFree);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
auto actor = &bloodActors[pSprite->index];
|
||||||
|
|
||||||
int nTarget = pXSprite->target_i;
|
int nTarget = pXSprite->target_i;
|
||||||
if (spriRangeIsFine(nTarget) && nTarget != pSprite->owner) {
|
if (spriRangeIsFine(nTarget) && nTarget != pSprite->owner) {
|
||||||
|
@ -1682,10 +1683,10 @@ void dudeLeechOperate(spritetype* pSprite, XSPRITE* pXSprite, EVENT event)
|
||||||
if (!pXSprite->data3) t2 = 120 / 10;
|
if (!pXSprite->data3) t2 = 120 / 10;
|
||||||
else t2 = (3 * 120) / 10;
|
else t2 = (3 * 120) / 10;
|
||||||
|
|
||||||
spritetype * pMissile = actFireMissile(pSprite, 0, z1, dx, dy, dz, nMissileType);
|
auto missile = actFireMissile(actor, 0, z1, dx, dy, dz, nMissileType);
|
||||||
if (pMissile)
|
if (missile)
|
||||||
{
|
{
|
||||||
pMissile->owner = pSprite->owner;
|
missile->SetOwner(actor);
|
||||||
pXSprite->stateTimer = 1;
|
pXSprite->stateTimer = 1;
|
||||||
evPost(pSprite->index, 3, t2, kCallbackLeechStateTimer);
|
evPost(pSprite->index, 3, t2, kCallbackLeechStateTimer);
|
||||||
pXSprite->data3 = ClipLow(pXSprite->data3 - 1, 0);
|
pXSprite->data3 = ClipLow(pXSprite->data3 - 1, 0);
|
||||||
|
|
|
@ -77,13 +77,13 @@ void PukeSeqCallback(int, DBloodActor* actor)
|
||||||
int dx = CosScale16(nAngle);
|
int dx = CosScale16(nAngle);
|
||||||
int dy = SinScale16(nAngle);
|
int dy = SinScale16(nAngle);
|
||||||
sfxPlay3DSound(pSprite, 1203, 1, 0);
|
sfxPlay3DSound(pSprite, 1203, 1, 0);
|
||||||
actFireMissile(pSprite, 0, -(height - height2), dx, dy, 0, kMissilePukeGreen);
|
actFireMissile(actor, 0, -(height - height2), dx, dy, 0, kMissilePukeGreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ThrowSeqCallback(int, DBloodActor* actor)
|
void ThrowSeqCallback(int, DBloodActor* actor)
|
||||||
{
|
{
|
||||||
spritetype* pSprite = &actor->s();
|
spritetype* pSprite = &actor->s();
|
||||||
actFireMissile(pSprite, 0, -getDudeInfo(pSprite->type)->eyeHeight, CosScale16(pSprite->ang), SinScale16(pSprite->ang), 0, kMissileButcherKnife);
|
actFireMissile(actor, 0, -getDudeInfo(pSprite->type)->eyeHeight, CosScale16(pSprite->ang), SinScale16(pSprite->ang), 0, kMissileButcherKnife);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void zombfThinkSearch(DBloodActor* actor)
|
static void zombfThinkSearch(DBloodActor* actor)
|
||||||
|
|
|
@ -5482,6 +5482,7 @@ void useUniMissileGen(XSPRITE* pXSource, spritetype* pSprite) {
|
||||||
spritetype* pSource = &sprite[pXSource->reference];
|
spritetype* pSource = &sprite[pXSource->reference];
|
||||||
if (pSprite == NULL)
|
if (pSprite == NULL)
|
||||||
pSprite = pSource;
|
pSprite = pSource;
|
||||||
|
auto actor = &bloodActors[pSprite->index];
|
||||||
|
|
||||||
if (pXSource->data1 < kMissileBase || pXSource->data1 >= kMissileMax)
|
if (pXSource->data1 < kMissileBase || pXSource->data1 >= kMissileMax)
|
||||||
return;
|
return;
|
||||||
|
@ -5497,9 +5498,9 @@ void useUniMissileGen(XSPRITE* pXSource, spritetype* pSprite) {
|
||||||
else if (dz < -0x10000) dz = -0x10000;
|
else if (dz < -0x10000) dz = -0x10000;
|
||||||
}
|
}
|
||||||
|
|
||||||
spritetype* pMissile = NULL;
|
auto missile = actFireMissile(actor, 0, 0, dx, dy, dz, actor->x().data1);
|
||||||
if ((pMissile = actFireMissile(pSprite, 0, 0, dx, dy, dz, pXSource->data1)) != NULL) {
|
if (missile != NULL) {
|
||||||
|
auto pMissile = &missile->s();
|
||||||
int from; // inherit some properties of the generator
|
int from; // inherit some properties of the generator
|
||||||
if ((from = (pSource->flags & kModernTypeFlag3)) > 0) {
|
if ((from = (pSource->flags & kModernTypeFlag3)) > 0) {
|
||||||
|
|
||||||
|
@ -7832,7 +7833,7 @@ void callbackUniMissileBurst(int nSprite) // 22
|
||||||
pBurst->ang = ((pSprite->ang + missileInfo[pSprite->type - kMissileBase].angleOfs) & 2047);
|
pBurst->ang = ((pSprite->ang + missileInfo[pSprite->type - kMissileBase].angleOfs) & 2047);
|
||||||
pBurst->owner = pSprite->owner;
|
pBurst->owner = pSprite->owner;
|
||||||
|
|
||||||
actBuildMissile(pBurst, pBurst->extra, pSprite->index);
|
actBuildMissile(&bloodActors[pBurst->index], &bloodActors[pSprite->index]);
|
||||||
|
|
||||||
int nAngle2 = (i << 11) / 8;
|
int nAngle2 = (i << 11) / 8;
|
||||||
int dx = 0;
|
int dx = 0;
|
||||||
|
|
|
@ -1780,13 +1780,15 @@ void playerProcess(PLAYER *pPlayer)
|
||||||
|
|
||||||
spritetype *playerFireMissile(PLAYER *pPlayer, int a2, int a3, int a4, int a5, int a6)
|
spritetype *playerFireMissile(PLAYER *pPlayer, int a2, int a3, int a4, int a5, int a6)
|
||||||
{
|
{
|
||||||
return actFireMissile(pPlayer->pSprite, a2, pPlayer->zWeapon-pPlayer->pSprite->z, a3, a4, a5, a6);
|
auto misl = actFireMissile(&bloodActors[pPlayer->pSprite->index], a2, pPlayer->zWeapon-pPlayer->pSprite->z, a3, a4, a5, a6);
|
||||||
|
return misl ? &misl->s() : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
spritetype * playerFireThing(PLAYER *pPlayer, int a2, int a3, int thingType, int a5)
|
spritetype * playerFireThing(PLAYER *pPlayer, int a2, int a3, int thingType, int a5)
|
||||||
{
|
{
|
||||||
assert(thingType >= kThingBase && thingType < kThingMax);
|
assert(thingType >= kThingBase && thingType < kThingMax);
|
||||||
return &actFireThing(&bloodActors[pPlayer->pSprite->index], a2, pPlayer->zWeapon-pPlayer->pSprite->z, pPlayer->slope+a3, thingType, a5)->s();
|
auto misl = actFireThing(&bloodActors[pPlayer->pSprite->index], a2, pPlayer->zWeapon-pPlayer->pSprite->z, pPlayer->slope+a3, thingType, a5);
|
||||||
|
return misl ? &misl->s() : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void playerFrag(PLAYER *pKiller, PLAYER *pVictim)
|
void playerFrag(PLAYER *pKiller, PLAYER *pVictim)
|
||||||
|
|
|
@ -198,6 +198,8 @@ unsigned int GetSourceBusy(EVENT a1)
|
||||||
|
|
||||||
void LifeLeechOperate(spritetype *pSprite, XSPRITE *pXSprite, EVENT event)
|
void LifeLeechOperate(spritetype *pSprite, XSPRITE *pXSprite, EVENT event)
|
||||||
{
|
{
|
||||||
|
auto actor = &bloodActors[pSprite->index];
|
||||||
|
|
||||||
switch (event.cmd) {
|
switch (event.cmd) {
|
||||||
case kCmdSpritePush:
|
case kCmdSpritePush:
|
||||||
{
|
{
|
||||||
|
@ -257,10 +259,10 @@ void LifeLeechOperate(spritetype *pSprite, XSPRITE *pXSprite, EVENT event)
|
||||||
t2 = 120 / 10;
|
t2 = 120 / 10;
|
||||||
else
|
else
|
||||||
t2 = (3*120) / 10;
|
t2 = (3*120) / 10;
|
||||||
spritetype *pMissile = actFireMissile(pSprite, 0, z1, dx, dy, dz, nMissileType);
|
auto missile = actFireMissile(actor, 0, z1, dx, dy, dz, nMissileType);
|
||||||
if (pMissile)
|
if (missile)
|
||||||
{
|
{
|
||||||
pMissile->owner = pSprite->owner;
|
missile->SetOwner(actor);
|
||||||
pXSprite->stateTimer = 1;
|
pXSprite->stateTimer = 1;
|
||||||
evPost(pSprite->index, 3, t2, kCallbackLeechStateTimer);
|
evPost(pSprite->index, 3, t2, kCallbackLeechStateTimer);
|
||||||
pXSprite->data3 = ClipLow(pXSprite->data3-1, 0);
|
pXSprite->data3 = ClipLow(pXSprite->data3-1, 0);
|
||||||
|
@ -459,9 +461,9 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event)
|
||||||
if (gGameOptions.nMonsterSettings && pXSprite->data1 >= kDudeBase && pXSprite->data1 < kDudeMax)
|
if (gGameOptions.nMonsterSettings && pXSprite->data1 >= kDudeBase && pXSprite->data1 < kDudeMax)
|
||||||
{
|
{
|
||||||
auto actor = &bloodActors[pSprite->index];
|
auto actor = &bloodActors[pSprite->index];
|
||||||
spritetype* pSpawn = &actSpawnDude(actor, pXSprite->data1, -1, 0)->s();
|
auto spawned = actSpawnDude(actor, pXSprite->data1, -1, 0);
|
||||||
if (pSpawn) {
|
if (spawned) {
|
||||||
XSPRITE *pXSpawn = &xsprite[pSpawn->extra];
|
XSPRITE *pXSpawn = &spawned->x();
|
||||||
gKillMgr.AddNewKill(1);
|
gKillMgr.AddNewKill(1);
|
||||||
switch (pXSprite->data1) {
|
switch (pXSprite->data1) {
|
||||||
case kDudeBurningInnocent:
|
case kDudeBurningInnocent:
|
||||||
|
@ -472,7 +474,7 @@ void OperateSprite(int nSprite, XSPRITE *pXSprite, EVENT event)
|
||||||
pXSpawn->health = getDudeInfo(pXSprite->data1)->startHealth << 4;
|
pXSpawn->health = getDudeInfo(pXSprite->data1)->startHealth << 4;
|
||||||
pXSpawn->burnTime = 10;
|
pXSpawn->burnTime = 10;
|
||||||
pXSpawn->target_i = -1;
|
pXSpawn->target_i = -1;
|
||||||
aiActivateDude(&bloodActors[pXSpawn->reference]);
|
aiActivateDude(spawned);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -2255,9 +2257,9 @@ void FireballTrapSeqCallback(int, DBloodActor* actor)
|
||||||
{
|
{
|
||||||
spritetype* pSprite = &actor->s();
|
spritetype* pSprite = &actor->s();
|
||||||
if (pSprite->cstat&32)
|
if (pSprite->cstat&32)
|
||||||
actFireMissile(pSprite, 0, 0, 0, 0, (pSprite->cstat&8) ? 0x4000 : -0x4000, kMissileFireball);
|
actFireMissile(actor, 0, 0, 0, 0, (pSprite->cstat&8) ? 0x4000 : -0x4000, kMissileFireball);
|
||||||
else
|
else
|
||||||
actFireMissile(pSprite, 0, 0, CosScale16(pSprite->ang), SinScale16(pSprite->ang), 0, kMissileFireball);
|
actFireMissile(actor, 0, 0, CosScale16(pSprite->ang), SinScale16(pSprite->ang), 0, kMissileFireball);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue