- Removed event.causedBy for demo playback compatibility

- Fixed kThingArmedRemote in triggers.cpp (OperateSprite())
- Fixed kTrapFlame in triggers.cpp (OperateSprite())

# Conflicts:
#	source/blood/src/actor.cpp
#	source/blood/src/player.h
This commit is contained in:
NoOneBlood 2020-01-12 00:07:05 +03:00 committed by Christoph Oelckers
parent 4123a9e14e
commit 2b36e53706
11 changed files with 297 additions and 316 deletions

View file

@ -3235,7 +3235,7 @@ void actKillDude(int nKillerSprite, spritetype *pSprite, DAMAGE_TYPE damageType,
gPlayer[p].fraggerId = -1;
}
if (pSprite->type != kDudeCultistBeast)
trTriggerSprite(pSprite->index, pXSprite, kCmdOff, nKillerSprite);
trTriggerSprite(pSprite->index, pXSprite, kCmdOff);
pSprite->flags |= 7;
if (VanillaMode()) {
@ -3747,7 +3747,7 @@ int actDamageSprite(int nSource, spritetype *pSprite, DAMAGE_TYPE damageType, in
break;
}
trTriggerSprite(pSprite->index, pXSprite, kCmdOff, nSource);
trTriggerSprite(pSprite->index, pXSprite, kCmdOff);
switch (pSprite->type) {
case kThingObjectGib:
@ -4501,7 +4501,7 @@ void ProcessTouchObjects(spritetype *pSprite, int nXSprite)
if (spriRangeIsFine(nHSprite) && xspriRangeIsFine(sprite[nHSprite].extra)) {
XSPRITE* pXHSprite = &xsprite[sprite[nHSprite].extra];
if (pXHSprite->Touch && !pXHSprite->isTriggered && (!pXHSprite->DudeLockout || IsPlayerSprite(pSprite)))
trTriggerSprite(nHSprite, pXHSprite, kCmdSpriteTouch, nSprite);
trTriggerSprite(nHSprite, pXHSprite, kCmdSpriteTouch);
}
// Touch walls
@ -4511,7 +4511,7 @@ void ProcessTouchObjects(spritetype *pSprite, int nXSprite)
if (wallRangeIsFine(nHWall) && xwallRangeIsFine(wall[nHWall].extra)) {
XWALL* pXHWall = &xwall[wall[nHWall].extra];
if (pXHWall->triggerTouch && !pXHWall->isTriggered && (!pXHWall->dudeLockout || IsPlayerSprite(pSprite)))
trTriggerWall(nHWall, pXHWall, kCmdWallTouch, nSprite);
trTriggerWall(nHWall, pXHWall, kCmdWallTouch);
}
}
@ -4798,10 +4798,10 @@ void MoveDude(spritetype *pSprite)
}
if (!gModernMap && pHitXSprite && pHitXSprite->Touch && !pHitXSprite->state && !pHitXSprite->isTriggered)
trTriggerSprite(nHitSprite, pHitXSprite, kCmdSpriteTouch, nSprite);
trTriggerSprite(nHitSprite, pHitXSprite, kCmdSpriteTouch);
if (pDudeInfo->lockOut && pHitXSprite && pHitXSprite->Push && !pHitXSprite->key && !pHitXSprite->DudeLockout && !pHitXSprite->state && !pHitXSprite->busy && !pPlayer)
trTriggerSprite(nHitSprite, pHitXSprite, kCmdSpritePush, nSprite);
trTriggerSprite(nHitSprite, pHitXSprite, kCmdSpritePush);
break;
}
@ -4813,7 +4813,7 @@ void MoveDude(spritetype *pSprite)
if (pHitWall->extra > 0)
pHitXWall = &xwall[pHitWall->extra];
if (pDudeInfo->lockOut && pHitXWall && pHitXWall->triggerPush && !pHitXWall->key && !pHitXWall->dudeLockout && !pHitXWall->state && !pHitXWall->busy && !pPlayer)
trTriggerWall(nHitWall, pHitXWall, kCmdWallPush, nSprite);
trTriggerWall(nHitWall, pHitXWall, kCmdWallPush);
if (pHitWall->nextsector != -1)
{
sectortype *pHitSector = &sector[pHitWall->nextsector];
@ -4821,7 +4821,7 @@ void MoveDude(spritetype *pSprite)
if (pHitSector->extra > 0)
pHitXSector = &xsector[pHitSector->extra];
if (pDudeInfo->lockOut && pHitXSector && pHitXSector->Wallpush && !pHitXSector->Key && !pHitXSector->dudeLockout && !pHitXSector->state && !pHitXSector->busy && !pPlayer)
trTriggerSector(pHitWall->nextsector, pHitXSector, kCmdSectorPush, nSprite);
trTriggerSector(pHitWall->nextsector, pHitXSector, kCmdSectorPush);
if (top < pHitSector->ceilingz || bottom > pHitSector->floorz)
{
// ???
@ -4847,7 +4847,7 @@ void MoveDude(spritetype *pSprite)
else
pXSector = NULL;
if (pXSector && pXSector->Exit && (pPlayer || !pXSector->dudeLockout))
trTriggerSector(pSprite->sectnum, pXSector, kCmdSectorExit, nSprite);
trTriggerSector(pSprite->sectnum, pXSector, kCmdSectorExit);
ChangeSpriteSect(nSprite, nSector);
nXSector = sector[nSector].extra;
@ -4856,7 +4856,7 @@ void MoveDude(spritetype *pSprite)
if (sector[nSector].type == kSectorTeleport)
pXSector->data = pPlayer ? nSprite : -1;
trTriggerSector(nSector, pXSector, kCmdSectorEnter, nSprite);
trTriggerSector(nSector, pXSector, kCmdSectorEnter);
}
nSector = pSprite->sectnum;
@ -5359,7 +5359,7 @@ int MoveMissile(spritetype *pSprite)
XWALL *pXWall = &xwall[pWall->extra];
if (pXWall->triggerVector)
{
trTriggerWall(gHitInfo.hitwall, pXWall, kCmdWallImpact, nSprite);
trTriggerWall(gHitInfo.hitwall, pXWall, kCmdWallImpact);
if (!(pWall->cstat&64))
{
vdi = -1;
@ -5428,7 +5428,7 @@ void actExplodeSprite(spritetype *pSprite)
return;
sfxKill3DSound(pSprite, -1, -1);
evKill(pSprite->index, 3);
int nType = kExplosionStandard;
int nType;
switch (pSprite->type)
{
case kMissileFireballNapam:
@ -5623,7 +5623,7 @@ void actProcessSprites(void)
if ((sprite[nAffected].flags & 32) || xsprite[sprite[nAffected].extra].health <= 0) continue;
else if (CheckProximity(&sprite[nAffected], x, y, z, sectnum, 96)) {
trTriggerSprite(index, pXProxSpr, kCmdSpriteProximity, nAffected);
trTriggerSprite(index, pXProxSpr, kCmdSpriteProximity);
break;
}
}
@ -5632,7 +5632,7 @@ void actProcessSprites(void)
for (int a = connecthead; a >= 0; a = connectpoint2[a]) {
if (gPlayer[a].pXSprite->health > 0 && CheckProximity(gPlayer[a].pSprite, x, y, z, sectnum, 96)) {
trTriggerSprite(index, pXProxSpr, kCmdSpriteProximity, gPlayer[a].pSprite->index);
trTriggerSprite(index, pXProxSpr, kCmdSpriteProximity);
break;
}
}
@ -5657,7 +5657,7 @@ void actProcessSprites(void)
for (int a = connecthead; a >= 0; a = connectpoint2[a]) {
spritetype* pPlaySprite = gPlayer[a].pSprite;
if (gPlayer[a].pXSprite->health > 0 && cansee(x, y, z, sectnum, pPlaySprite->x, pPlaySprite->y, pPlaySprite->z, pPlaySprite->sectnum)) {
trTriggerSprite(index, pXSightSpr, kCmdSpriteSight, pPlaySprite->index);
trTriggerSprite(index, pXSightSpr, kCmdSpriteSight);
break;
}
}
@ -5803,7 +5803,7 @@ void actProcessSprites(void)
break;
}
if (pSprite->owner == -1) actPropagateSpriteOwner(pSprite, pSprite2);
trTriggerSprite(nSprite, pXSprite, kCmdSpriteProximity, pSprite2->index);
trTriggerSprite(nSprite, pXSprite, kCmdSpriteProximity);
}
}
}
@ -5879,7 +5879,7 @@ void actProcessSprites(void)
{
XSPRITE *pXSprite = &xsprite[nXSprite];
if (pXSprite->Impact)
trTriggerSprite(nSprite, pXSprite, kCmdOff, -1);
trTriggerSprite(nSprite, pXSprite, kCmdOff);
switch (pSprite->type) {
case kThingDripWater:
case kThingDripBlood:
@ -5986,7 +5986,7 @@ void actProcessSprites(void)
if (nWall == -1)
break;
XWALL *pXWall = &xwall[wall[nWall].extra];
trTriggerWall(nWall, pXWall, kCmdWallImpact, nSprite);
trTriggerWall(nWall, pXWall, kCmdWallImpact);
}
for (int nSprite2 = headspritestat[kStatDude]; nSprite2 >= 0; nSprite2 = nextspritestat[nSprite2])
@ -6169,7 +6169,7 @@ void actProcessSprites(void)
pXIncarnation->triggerOff = false;
// trigger dude death before transform
trTriggerSprite(nSprite, pXSprite, kCmdOff, pSprite->owner);
trTriggerSprite(nSprite, pXSprite, kCmdOff);
pSprite->type = pIncarnation->type;
pSprite->flags = pIncarnation->flags;
@ -6257,7 +6257,7 @@ void actProcessSprites(void)
} else {
if (pXSprite->sysData1 == kGenDudeTransformStatus) pXSprite->sysData1 = 0;
// just trigger dude death
trTriggerSprite(nSprite, pXSprite, kCmdOff, pSprite->owner);
trTriggerSprite(nSprite, pXSprite, kCmdOff);
}
}
}
@ -6285,7 +6285,7 @@ void actProcessSprites(void)
XSPRITE *pXSprite2 = &xsprite[pSprite2->extra];
if ((unsigned int)pXSprite2->health > 0 && IsPlayerSprite(pSprite2)) {
if (CheckProximity(pSprite2, pSprite->x, pSprite->y, pSprite->z, pSprite->sectnum, 128))
trTriggerSprite(nSprite, pXSprite, kCmdSpriteProximity, pSprite2->index);
trTriggerSprite(nSprite, pXSprite, kCmdSpriteProximity);
}
}
}
@ -6961,7 +6961,7 @@ void actFireVector(spritetype *pShooter, int a2, int a3, int a4, int a5, int a6,
{
XWALL *pXWall = &xwall[nXWall];
if (pXWall->triggerVector)
trTriggerWall(nWall, pXWall, kCmdWallImpact, nShooter);
trTriggerWall(nWall, pXWall, kCmdWallImpact);
}
break;
}
@ -6983,7 +6983,7 @@ void actFireVector(spritetype *pShooter, int a2, int a3, int a4, int a5, int a6,
{
XSPRITE *pXSprite = &xsprite[nXSprite];
if (pXSprite->Vector)
trTriggerSprite(nSprite, pXSprite, kCmdSpriteImpact, nShooter);
trTriggerSprite(nSprite, pXSprite, kCmdSpriteImpact);
}
if (pSprite->statnum == kStatThing)
{
@ -7857,8 +7857,8 @@ void debrisMove(int listIndex) {
changespritestat(nSprite, kStatThing);
if (pXDebris->state == 1) trTriggerSprite(pSprite->xvel, pXDebris, kCmdOff, -1);
else trTriggerSprite(pSprite->xvel, pXDebris, kCmdOn, -1);
if (pXDebris->state == 1) trTriggerSprite(pSprite->xvel, pXDebris, kCmdOff);
else trTriggerSprite(pSprite->xvel, pXDebris, kCmdOn);
}
}

View file

@ -181,7 +181,7 @@ static void ThrowSeqCallback(int, int nXSprite)
if (v4)
xsprite[pMissile->extra].Impact = 1;
else
evPost(pMissile->index, 3, 120*(1+Random(2)), kCmdOn, nSprite);
evPost(pMissile->index, 3, 120*(1+Random(2)), kCmdOn);
}
static void sub_68170(int, int nXSprite)
@ -194,7 +194,7 @@ static void sub_68170(int, int nXSprite)
nMissile = kThingArmedTNTBundle;
sfxPlay3DSound(pSprite, 455, -1, 0);
spritetype *pMissile = actFireThing(pSprite, 0, 0, gDudeSlope[nXSprite]-9460, nMissile, 0x133333);
evPost(pMissile->index, 3, 120*(2+Random(2)), kCmdOn, nSprite);
evPost(pMissile->index, 3, 120*(2+Random(2)), kCmdOn);
}
static void sub_68230(int, int nXSprite)

View file

@ -400,7 +400,7 @@ static void ThrowThing(int nXIndex, bool impact) {
if (impact == true && dist <= 7680) xsprite[pThing->extra].Impact = true;
else {
xsprite[pThing->extra].Impact = false;
evPost(pThing->xvel, 3, 120 * Random(2) + 120, kCmdOn, pXSprite->reference);
evPost(pThing->xvel, 3, 120 * Random(2) + 120, kCmdOn);
}
}

View file

@ -361,7 +361,7 @@ void CounterCheck(int nSector) // 12
return;
} else {
//pXSector->waitTimeA = 0; //do not reset necessary objects counter to zero
trTriggerSector(nSector, pXSector, kCmdOn, -1);
trTriggerSector(nSector, pXSector, kCmdOn);
pXSector->locked = 1; //lock sector, so it can be opened again later
}
}
@ -489,13 +489,13 @@ void returnFlagToBase(int nSprite) // 17
XSPRITE* pXOwner = &xsprite[pOwner->extra];
switch (pSprite->type) {
case kItemFlagA:
trTriggerSprite(pOwner->index, pXOwner, kCmdOn, pOwner->index);
trTriggerSprite(pOwner->index, pXOwner, kCmdOn);
sndStartSample(8003, 255, 2, 0);
gBlueFlagDropped = false;
viewSetMessage("Blue Flag returned to base.");
break;
case kItemFlagB:
trTriggerSprite(pOwner->index, pXOwner, kCmdOn, pOwner->index);
trTriggerSprite(pOwner->index, pXOwner, kCmdOn);
sndStartSample(8002, 255, 2, 0);
gRedFlagDropped = false;
viewSetMessage("Red Flag returned to base.");

View file

@ -351,7 +351,7 @@ char evGetSourceState(int nType, int nIndex)
return 0;
}
void evSend(int nIndex, int nType, int rxId, COMMAND_ID command, short causedBy)
void evSend(int nIndex, int nType, int rxId, COMMAND_ID command)
{
@ -370,7 +370,6 @@ void evSend(int nIndex, int nType, int rxId, COMMAND_ID command, short causedBy)
event.index = nIndex;
event.type = nType;
event.cmd = command;
event.causedBy = causedBy;
switch (rxId) {
case kChannelTextOver:
@ -452,9 +451,6 @@ void evSend(int nIndex, int nType, int rxId, COMMAND_ID command, short causedBy)
if ((pPlayer = getPlayerById(i)) != NULL)
trMessageSprite(pPlayer->nSprite, event);
}
// send command on sprite which create the event sequence
} else if (rxId == kChannelEventCauser && spriRangeIsFine(event.causedBy)) {
trMessageSprite(event.causedBy, event);
}
}
@ -488,7 +484,7 @@ void evSend(int nIndex, int nType, int rxId, COMMAND_ID command, short causedBy)
}
}
void evPost(int nIndex, int nType, unsigned int nDelta, COMMAND_ID command, short causedBy) {
void evPost(int nIndex, int nType, unsigned int nDelta, COMMAND_ID command) {
dassert(command != kCmdCallback);
if (command == kCmdState) command = evGetSourceState(nType, nIndex) ? kCmdOn : kCmdOff;
else if (command == kCmdNotState) command = evGetSourceState(nType, nIndex) ? kCmdOff : kCmdOn;
@ -496,17 +492,15 @@ void evPost(int nIndex, int nType, unsigned int nDelta, COMMAND_ID command, shor
evn.index = nIndex;
evn.type = nType;
evn.cmd = command;
evn.causedBy = causedBy;
eventQ.PQueue->Insert((int)gFrameClock+nDelta, evn);
}
void evPost(int nIndex, int nType, unsigned int nDelta, CALLBACK_ID callback, short causedBy) {
void evPost(int nIndex, int nType, unsigned int nDelta, CALLBACK_ID callback) {
EVENT evn = {};
evn.index = nIndex;
evn.type = nType;
evn.cmd = kCmdCallback;
evn.funcID = callback;
evn.causedBy = causedBy;
eventQ.PQueue->Insert((int)gFrameClock+nDelta, evn);
}

View file

@ -129,14 +129,13 @@ struct EVENT {
unsigned int type: 3; // type
unsigned int cmd: 8; // cmd
unsigned int funcID: 8; // callback
signed int causedBy: 14; // by NoOne: spritenum of object which initiated this event (-1 == initiated by the game)
};
void evInit(void);
char evGetSourceState(int nType, int nIndex);
void evSend(int nIndex, int nType, int rxId, COMMAND_ID command, short causedBy);
void evPost(int nIndex, int nType, unsigned int nDelta, COMMAND_ID command, short causedBy);
void evPost(int nIndex, int nType, unsigned int nDelta, CALLBACK_ID callback, short causedBy = -1);
void evSend(int nIndex, int nType, int rxId, COMMAND_ID command);
void evPost(int nIndex, int nType, unsigned int nDelta, COMMAND_ID command);
void evPost(int nIndex, int nType, unsigned int nDelta, CALLBACK_ID callback);
void evProcess(unsigned int nTime);
void evKill(int a1, int a2);
void evKill(int a1, int a2, CALLBACK_ID a3);

View file

@ -991,7 +991,7 @@ void playerResetPosture(PLAYER* pPlayer) {
void playerResetQavScene(PLAYER* pPlayer) {
QAVSCENE* pQavScene = &gPlayerCtrl[pPlayer->nPlayer].qavScene;
pQavScene->index = pQavScene->causedBy = pPlayer->sceneQav = -1;
pQavScene->index = pQavScene->dummy = pPlayer->sceneQav = -1;
pQavScene->qavResrc = NULL;
}
@ -1062,7 +1062,7 @@ char PickupItem(PLAYER *pPlayer, spritetype *pItem) {
if ((pPlayer->hasFlag & 1) == 0 && pXItem->state) {
pPlayer->hasFlag |= 1;
pPlayer->used2[0] = pItem->index;
trTriggerSprite(pItem->index, pXItem, kCmdOff, pPlayer->nSprite);
trTriggerSprite(pItem->index, pXItem, kCmdOff);
sprintf(buffer, "%s stole Blue Flag", gProfile[pPlayer->nPlayer].name);
sndStartSample(8007, 255, 2, 0);
viewSetMessage(buffer);
@ -1074,7 +1074,7 @@ char PickupItem(PLAYER *pPlayer, spritetype *pItem) {
if ((pPlayer->hasFlag & 1) != 0 && !pXItem->state) {
pPlayer->hasFlag &= ~1;
pPlayer->used2[0] = -1;
trTriggerSprite(pItem->index, pXItem, kCmdOn, pPlayer->nSprite);
trTriggerSprite(pItem->index, pXItem, kCmdOn);
sprintf(buffer, "%s returned Blue Flag", gProfile[pPlayer->nPlayer].name);
sndStartSample(8003, 255, 2, 0);
viewSetMessage(buffer);
@ -1085,7 +1085,7 @@ char PickupItem(PLAYER *pPlayer, spritetype *pItem) {
pPlayer->used2[1] = -1;
dword_21EFB0[pPlayer->teamId] += 10;
dword_21EFD0[pPlayer->teamId] += 240;
evSend(0, 0, 81, kCmdOn, pPlayer->nSprite);
evSend(0, 0, 81, kCmdOn);
sprintf(buffer, "%s captured Red Flag!", gProfile[pPlayer->nPlayer].name);
sndStartSample(8001, 255, 2, 0);
viewSetMessage(buffer);
@ -1106,7 +1106,7 @@ char PickupItem(PLAYER *pPlayer, spritetype *pItem) {
if ((pPlayer->hasFlag & 2) == 0 && pXItem->state) {
pPlayer->hasFlag |= 2;
pPlayer->used2[1] = pItem->index;
trTriggerSprite(pItem->index, pXItem, kCmdOff, pPlayer->nSprite);
trTriggerSprite(pItem->index, pXItem, kCmdOff);
sprintf(buffer, "%s stole Red Flag", gProfile[pPlayer->nPlayer].name);
sndStartSample(8006, 255, 2, 0);
viewSetMessage(buffer);
@ -1118,7 +1118,7 @@ char PickupItem(PLAYER *pPlayer, spritetype *pItem) {
{
pPlayer->hasFlag &= ~2;
pPlayer->used2[1] = -1;
trTriggerSprite(pItem->index, pXItem, kCmdOn, pPlayer->nSprite);
trTriggerSprite(pItem->index, pXItem, kCmdOn);
sprintf(buffer, "%s returned Red Flag", gProfile[pPlayer->nPlayer].name);
sndStartSample(8002, 255, 2, 0);
viewSetMessage(buffer);
@ -1129,7 +1129,7 @@ char PickupItem(PLAYER *pPlayer, spritetype *pItem) {
pPlayer->used2[0] = -1;
dword_21EFB0[pPlayer->teamId] += 10;
dword_21EFD0[pPlayer->teamId] += 240;
evSend(0, 0, 80, kCmdOn, pPlayer->nSprite);
evSend(0, 0, 80, kCmdOn);
sprintf(buffer, "%s captured Blue Flag!", gProfile[pPlayer->nPlayer].name);
sndStartSample(8000, 255, 2, 0);
viewSetMessage(buffer);
@ -1305,7 +1305,7 @@ void PickUp(PLAYER *pPlayer, spritetype *pSprite)
else if (pSprite->extra > 0) {
XSPRITE *pXSprite = &xsprite[pSprite->extra];
if (pXSprite->Pickup)
trTriggerSprite(pSprite->index, pXSprite, kCmdSpritePickup, pPlayer->nSprite);
trTriggerSprite(pSprite->index, pXSprite, kCmdSpritePickup);
}
if (!actCheckRespawn(pSprite))
@ -1400,7 +1400,7 @@ int ActionScan(PLAYER *pPlayer, int *a2, int *a3)
zvel[*a2] += mulscale16(z, t2);
}
if (pXSprite->Push && !pXSprite->state && !pXSprite->isTriggered)
trTriggerSprite(*a2, pXSprite, kCmdSpritePush, pPlayer->nSprite);
trTriggerSprite(*a2, pXSprite, kCmdSpritePush);
}
break;
case 0:
@ -1607,7 +1607,7 @@ void ProcessInput(PLAYER *pPlayer)
sndStartSample(3062, 255, 2, 0);
}
if (!key || pPlayer->hasKey[key])
trTriggerSector(a2, pXSector, kCmdSpritePush, nSprite);
trTriggerSector(a2, pXSector, kCmdSpritePush);
else if (pPlayer == gMe)
{
viewSetMessage(GStrings("TXTB_KEY"));
@ -1625,7 +1625,7 @@ void ProcessInput(PLAYER *pPlayer)
sndStartSample(3062, 255, 2, 0);
}
if (!key || pPlayer->hasKey[key])
trTriggerWall(a2, pXWall, kCmdWallPush, pPlayer->nSprite);
trTriggerWall(a2, pXWall, kCmdWallPush);
else if (pPlayer == gMe)
{
viewSetMessage(GStrings("TXTB_KEY"));
@ -1640,7 +1640,7 @@ void ProcessInput(PLAYER *pPlayer)
if (pXSprite->locked && pPlayer == gMe && pXSprite->lockMsg)
trTextOver(pXSprite->lockMsg);
if (!key || pPlayer->hasKey[key])
trTriggerSprite(a2, pXSprite, kCmdSpritePush, pPlayer->nSprite);
trTriggerSprite(a2, pXSprite, kCmdSpritePush);
else if (pPlayer == gMe)
{
viewSetMessage(GStrings("TXTB_KEY"));
@ -2012,16 +2012,16 @@ void FragPlayer(PLAYER *pPlayer, int nSprite)
if (nTeam1 == 0)
{
if (nTeam1 != nTeam2)
evSend(0, 0, 15, kCmdToggle, pKiller->nSprite);
evSend(0, 0, 15, kCmdToggle);
else
evSend(0, 0, 16, kCmdToggle, pKiller->nSprite);
evSend(0, 0, 16, kCmdToggle);
}
else
{
if (nTeam1 == nTeam2)
evSend(0, 0, 16, kCmdToggle, pKiller->nSprite);
evSend(0, 0, 16, kCmdToggle);
else
evSend(0, 0, 15, kCmdToggle, pKiller->nSprite);
evSend(0, 0, 15, kCmdToggle);
}
}
}
@ -2203,7 +2203,7 @@ int playerDamageSprite(int nSource, PLAYER *pPlayer, DAMAGE_TYPE nDamageType, in
{
powerupClear(pPlayer);
if (nXSector > 0 && xsector[nXSector].Exit)
trTriggerSector(pSprite->sectnum, &xsector[nXSector], kCmdSectorExit, nSprite);
trTriggerSector(pSprite->sectnum, &xsector[nXSector], kCmdSectorExit);
pSprite->flags |= 7;
for (int p = connecthead; p >= 0; p = connectpoint2[p])
{
@ -2211,7 +2211,7 @@ int playerDamageSprite(int nSource, PLAYER *pPlayer, DAMAGE_TYPE nDamageType, in
gPlayer[p].fraggerId = -1;
}
FragPlayer(pPlayer, nSource);
trTriggerSprite(nSprite, pXSprite, kCmdOff, nSource);
trTriggerSprite(nSprite, pXSprite, kCmdOff);
}
dassert(gSysRes.Lookup(pDudeInfo->seqStartID + nDeathSeqID, "SEQ") != NULL);
seqSpawn(pDudeInfo->seqStartID+nDeathSeqID, 3, nXSprite, nKneelingPlayer);

View file

@ -202,8 +202,6 @@ struct PLAYER
POSTURE pPosture[kModeMax][kPostureMax];
};
struct PROFILE
{
int nAutoAim;
@ -226,21 +224,15 @@ struct POWERUPINFO
int maxTime;
};
#define kQavSceneStackSize 16
// by NoOne: this one stores qavs anims that can be played by trigger
struct QAVSCENE
{
struct QAVSCENE {
short index = -1; // index of sprite which triggered qav scene
QAV * qavResrc = NULL;
short causedBy = -1;
// TO-DO: Stack of animations which allows to pop and push (restoring previous animation instead of weapon once current animation is played)
short dummy = -1;
};
// by NoOne: this one for controlling the player using triggers (movement speed, jumps and other stuff)
struct TRPLAYERCTRL
{
struct TRPLAYERCTRL {
QAVSCENE qavScene;
};

File diff suppressed because it is too large Load diff

View file

@ -35,11 +35,11 @@ BEGIN_BLD_NS
#define kPlayerCtrlSigStart "<<<<TRPLAYERCTRL{" // save game TRPLAYERCTRL block start
#define kPlayerCtrlSigEnd "}TRPLAYERCTRL>>>>" // save game TRPLAYERCTRL block end
void trTriggerSector(unsigned int nSector, XSECTOR *pXSector, int command, short causedBy);
void trTriggerSector(unsigned int nSector, XSECTOR *pXSector, int command);
void trMessageSector(unsigned int nSector, EVENT event);
void trTriggerWall(unsigned int nWall, XWALL *pXWall, int command, short causedBy);
void trTriggerWall(unsigned int nWall, XWALL *pXWall, int command);
void trMessageWall(unsigned int nWall, EVENT event);
void trTriggerSprite(unsigned int nSprite, XSPRITE *pXSprite, int command, short causedBy);
void trTriggerSprite(unsigned int nSprite, XSPRITE *pXSprite, int command);
void trMessageSprite(unsigned int nSprite, EVENT event);
void trProcessBusy(void);
void trInit(void);
@ -69,7 +69,7 @@ void freeTargets(int nSprite);
void freeAllTargets(XSPRITE* pXSource);
bool affectedByTargetChg(XSPRITE* pXDude);
int getDataFieldOfObject(int objType, int objIndex, int dataIndex);
bool setDataValueOfObject(int objType, int objIndex, int dataIndex, int value, int causedBy);
bool setDataValueOfObject(int objType, int objIndex, int dataIndex, int value);
bool goalValueIsReached(XSPRITE* pXSprite);
bool getDudesForTargetChg(XSPRITE* pXSprite);
void stopWindOnSectors(XSPRITE* pXSource);
@ -84,7 +84,7 @@ void TeleFrag(int nKiller, int nSector);
bool valueIsBetween(int val, int min, int max);
void trPlayerCtrlLink(XSPRITE* pXSource, PLAYER* pPlayer);
void trPlayerCtrlStartScene(XSPRITE* pXSource, PLAYER* pPlayer, int causedBy);
void trPlayerCtrlStartScene(XSPRITE* pXSource, PLAYER* pPlayer);
void trPlayerCtrlStopScene(XSPRITE* pXSource, PLAYER* pPlayer);
// -------------------------------------------------------

View file

@ -1005,7 +1005,7 @@ void ThrowCan(int, PLAYER *pPlayer)
if (pSprite)
{
sfxPlay3DSound(pSprite, 441, 0, 0);
evPost(pSprite->index, 3, pPlayer->fuseTime, kCmdOn, pPlayer->nSprite);
evPost(pSprite->index, 3, pPlayer->fuseTime, kCmdOn);
int nXSprite = pSprite->extra;
XSPRITE *pXSprite = &xsprite[nXSprite];
pXSprite->Impact = 1;
@ -1020,7 +1020,7 @@ void DropCan(int, PLAYER *pPlayer)
spritetype *pSprite = playerFireThing(pPlayer, 0, 0, kThingArmedSpray, 0);
if (pSprite)
{
evPost(pSprite->index, 3, pPlayer->fuseTime, kCmdOn, pPlayer->nSprite);
evPost(pSprite->index, 3, pPlayer->fuseTime, kCmdOn);
UseAmmo(pPlayer, 6, gAmmoItemData[0].count);
}
}
@ -1029,7 +1029,7 @@ void ExplodeCan(int, PLAYER *pPlayer)
{
sfxKill3DSound(pPlayer->pSprite, -1, 441);
spritetype *pSprite = playerFireThing(pPlayer, 0, 0, kThingArmedSpray, 0);
evPost(pSprite->index, 3, 0, kCmdOn, pPlayer->nSprite);
evPost(pSprite->index, 3, 0, kCmdOn);
UseAmmo(pPlayer, 6, gAmmoItemData[0].count);
StartQAV(pPlayer, 15, -1);
pPlayer->curWeapon = 0;
@ -1047,7 +1047,7 @@ void ThrowBundle(int, PLAYER *pPlayer)
if (pPlayer->fuseTime < 0)
pXSprite->Impact = 1;
else
evPost(pSprite->index, 3, pPlayer->fuseTime, kCmdOn, pPlayer->nSprite);
evPost(pSprite->index, 3, pPlayer->fuseTime, kCmdOn);
UseAmmo(pPlayer, 5, 1);
pPlayer->throwPower = 0;
}
@ -1056,7 +1056,7 @@ void DropBundle(int, PLAYER *pPlayer)
{
sfxKill3DSound(pPlayer->pSprite, 16, -1);
spritetype *pSprite = playerFireThing(pPlayer, 0, 0, kThingArmedTNTBundle, 0);
evPost(pSprite->index, 3, pPlayer->fuseTime, kCmdOn, pPlayer->nSprite);
evPost(pSprite->index, 3, pPlayer->fuseTime, kCmdOn);
UseAmmo(pPlayer, 5, 1);
}
@ -1064,7 +1064,7 @@ void ExplodeBundle(int, PLAYER *pPlayer)
{
sfxKill3DSound(pPlayer->pSprite, 16, -1);
spritetype *pSprite = playerFireThing(pPlayer, 0, 0, kThingArmedTNTBundle, 0);
evPost(pSprite->index, 3, 0, kCmdOn, pPlayer->nSprite);
evPost(pSprite->index, 3, 0, kCmdOn);
UseAmmo(pPlayer, 5, 1);
StartQAV(pPlayer, 24, -1, 0);
pPlayer->curWeapon = 0;
@ -1076,7 +1076,7 @@ void ThrowProx(int, PLAYER *pPlayer)
int nSpeed = mulscale16(pPlayer->throwPower, 0x177777)+0x66666;
sfxPlay3DSound(pPlayer->pSprite, 455, 1, 0);
spritetype *pSprite = playerFireThing(pPlayer, 0, -9460, kThingArmedProxBomb, nSpeed);
evPost(pSprite->index, 3, 240, kCmdOn, pPlayer->nSprite);
evPost(pSprite->index, 3, 240, kCmdOn);
UseAmmo(pPlayer, 10, 1);
pPlayer->throwPower = 0;
}
@ -1084,7 +1084,7 @@ void ThrowProx(int, PLAYER *pPlayer)
void DropProx(int, PLAYER *pPlayer)
{
spritetype *pSprite = playerFireThing(pPlayer, 0, 0, kThingArmedProxBomb, 0);
evPost(pSprite->index, 3, 240, kCmdOn, pPlayer->nSprite);
evPost(pSprite->index, 3, 240, kCmdOn);
UseAmmo(pPlayer, 10, 1);
}
@ -1111,7 +1111,7 @@ void DropRemote(int, PLAYER *pPlayer)
void FireRemote(int, PLAYER *pPlayer)
{
evSend(0, 0, 90+(pPlayer->pSprite->type-kDudePlayer1), kCmdOn, pPlayer->nSprite);
evSend(0, 0, 90+(pPlayer->pSprite->type-kDudePlayer1), kCmdOn);
}
#define kMaxShotgunBarrels 4
@ -1946,9 +1946,9 @@ void WeaponProcess(PLAYER *pPlayer) {
XSPRITE* pXSprite = &xsprite[sprite[nIndex].extra];
if (pXSprite->waitTime > 0 && --pXSprite->sysData1 <= 0) {
if (pXSprite->txID > 0)
evSend(nIndex, 3, pXSprite->txID, (COMMAND_ID) pXSprite->command, pQavScene->causedBy);
evSend(nIndex, 3, pXSprite->txID, (COMMAND_ID) pXSprite->command);
if (pXSprite->locked) trPlayerCtrlStopScene(pXSprite, pPlayer);
else evPost(nIndex, 3, 0, (COMMAND_ID) (kCmdNumberic + 4), pQavScene->causedBy);
else evPost(nIndex, 3, 0, (COMMAND_ID) (kCmdNumberic + 4));
} else {
qavScenePlay(pPlayer);
pPlayer->weaponTimer = ClipLow(pPlayer->weaponTimer -= 4, 0);