- checkdist

This commit is contained in:
Christoph Oelckers 2021-11-14 00:00:51 +01:00
parent 722f836869
commit 89e687f166
23 changed files with 67 additions and 67 deletions

View file

@ -499,7 +499,7 @@ void aisearch(PLAYER& plr, DWHActor* actor, boolean fly) {
else
movestat = aimove(actor->GetSpriteIndex());
if (checkdist(plr, actor->GetSpriteIndex())) {
if (checkdist(plr, actor)) {
if (plr.shadowtime > 0) {
spr.ang = (short)(((krand() & 512 - 256) + spr.ang + 1024) & 2047); // NEW
SetNewStatus(actor, FLEE);
@ -936,15 +936,15 @@ int checkmove(DWHActor* actor, int dax, int day) {
return movestat;
}
boolean checkdist(PLAYER& plr, int i) {
boolean checkdist(PLAYER& plr, DWHActor* actor) {
if (plr.invisibletime > 0 || plr.health <= 0)
return false;
return checkdist(i, plr.x, plr.y, plr.z);
return checkdist(actor, plr.x, plr.y, plr.z);
}
boolean checkdist(int i, int x, int y, int z) {
SPRITE& spr = sprite[i];
boolean checkdist(DWHActor* actor, int x, int y, int z) {
SPRITE& spr = actor->s();
int attackdist = 512;
int attackheight = 120;

View file

@ -130,8 +130,8 @@ void castspell(PLAYER& plr, int i);
void skullycastspell(PLAYER& plr, int i);
void attack(PLAYER& plr, int i);
int checkmove(DWHActor* actor, int dax, int day);
boolean checkdist(PLAYER& plr, int i);
boolean checkdist(int i, int x, int y, int z);
boolean checkdist(PLAYER& plr, DWHActor* i);
boolean checkdist(DWHActor* i, int x, int y, int z);
extern int checksight_ang;
boolean checksight(PLAYER& plr, DWHActor* i);
void monsterweapon(int i);

View file

@ -34,7 +34,7 @@ static void chasedemon(PLAYER& plr, DWHActor* actor)
checksight(plr, actor);
if (!checkdist(plr, i)) {
if (!checkdist(plr, actor)) {
checkmove(actor, dax, day);
}
else {
@ -126,7 +126,7 @@ static void facedemon(PLAYER& plr, DWHActor* actor)
else if (cansee) SetNewStatus(actor, FLEE);
}
if (checkdist(plr, i))
if (checkdist(plr, actor))
SetNewStatus(actor, ATTACK);
}

View file

@ -22,7 +22,7 @@ static void chasedevil(PLAYER& plr, DWHActor* actor)
}
else {
checksight(plr, actor);
if (!checkdist(plr, i)) {
if (!checkdist(plr, actor)) {
if ((aimove(i) & kHitTypeMask) == kHitFloor)
{
spr.ang = (short)((spr.ang + 1024) & 2047);
@ -127,7 +127,7 @@ static void facedevil(PLAYER& plr, DWHActor* actor)
else if (cansee) SetNewStatus(actor, FLEE);
}
if (checkdist(plr, i))
if (checkdist(plr, actor))
SetNewStatus(actor, ATTACK);
}

View file

@ -32,7 +32,7 @@ static void chasedragon(PLAYER& plr, DWHActor* actor)
int dax = (bcos(spr.ang) * TICSPERFRAME) << 3;
int day = (bsin(spr.ang) * TICSPERFRAME) << 3;
checksight(plr, actor);
if (!checkdist(plr, i)) {
if (!checkdist(plr, actor)) {
checkmove(actor, dax, day);
}
else {
@ -302,7 +302,7 @@ static void facedragon(PLAYER& plr, DWHActor* actor)
else if (cansee) SetNewStatus(actor, FLEE);
}
if (checkdist(plr, i))
if (checkdist(plr, actor))
SetNewStatus(actor, ATTACK);
}

View file

@ -23,7 +23,7 @@ static void chasefatwitch(PLAYER& plr, DWHActor* actor)
}
else {
checksight(plr, actor);
if (!checkdist(i, plr.x, plr.y, plr.z)) {
if (!checkdist(actor, plr.x, plr.y, plr.z)) {
int movestat = aimove(i);
if ((movestat & kHitTypeMask) == kHitFloor)
{
@ -143,7 +143,7 @@ static void facefatwitch(PLAYER& plr, DWHActor* actor)
else if (cansee) SetNewStatus(actor, FLEE);
}
if (checkdist(i, plr.x, plr.y, plr.z))
if (checkdist(actor, plr.x, plr.y, plr.z))
SetNewStatus(actor, ATTACK);
}

View file

@ -16,7 +16,7 @@ static void chasefish(PLAYER& plr, DWHActor* actor)
short osectnum = spr.sectnum;
if (cansee(plr.x, plr.y, plr.z, plr.sector, spr.x, spr.y, spr.z - (tileHeight(spr.picnum) << 7),
spr.sectnum) && plr.invisibletime < 0) {
if (checkdist(plr, i)) {
if (checkdist(plr, actor)) {
if (plr.shadowtime > 0) {
spr.ang = (short)(((krand() & 512 - 256) + spr.ang + 1024) & 2047);
SetNewStatus(actor, FLEE);
@ -104,7 +104,7 @@ static void attackfish(PLAYER& plr, DWHActor* actor)
if (spr.lotag >= 64) {
if (checksight(plr, actor))
if (checkdist(plr, i)) {
if (checkdist(plr, actor)) {
spr.ang = (short)checksight_ang;
attack(plr, i);
}
@ -183,7 +183,7 @@ static void facefish(PLAYER& plr, DWHActor* actor)
else if (cansee) SetNewStatus(actor, FLEE);
}
if (checkdist(plr, i))
if (checkdist(plr, actor))
SetNewStatus(actor, ATTACK);
}

View file

@ -18,7 +18,7 @@ static void chasefred(PLAYER& plr, DWHActor* actor)
short osectnum = spr.sectnum;
if (cansee(plr.x, plr.y, plr.z, plr.sector, spr.x, spr.y, spr.z - (tileHeight(spr.picnum) << 7),
spr.sectnum) && plr.invisibletime < 0) {
if (checkdist(plr, i)) {
if (checkdist(plr, actor)) {
if (plr.shadowtime > 0) {
spr.ang = (short)(((krand() & 512 - 256) + spr.ang + 1024) & 2047);
SetNewStatus(actor, FLEE);
@ -180,7 +180,7 @@ static void facefred(PLAYER& plr, DWHActor* actor)
else if (cansee) SetNewStatus(actor, FLEE);
}
if (checkdist(plr, i))
if (checkdist(plr, actor))
SetNewStatus(actor, ATTACK);
checkexplfred(plr, actor);
@ -208,7 +208,7 @@ static void attackfred(PLAYER& plr, DWHActor* actor)
if (spr.lotag >= 64) {
if (checksight(plr, actor))
if (checkdist(plr, i)) {
if (checkdist(plr, actor)) {
spr.ang = (short)checksight_ang;
attack(plr, i);
}

View file

@ -18,7 +18,7 @@ static void chasegoblin(PLAYER& plr, DWHActor* actor)
short osectnum = spr.sectnum;
if (cansee(plr.x, plr.y, plr.z, plr.sector, spr.x, spr.y, spr.z - (tileHeight(spr.picnum) << 7),
spr.sectnum) && plr.invisibletime < 0) {
if (checkdist(plr, i)) {
if (checkdist(plr, actor)) {
if (plr.shadowtime > 0) {
spr.ang = (short)(((krand() & 512 - 256) + spr.ang + 1024) & 2047);
SetNewStatus(actor, FLEE);
@ -157,7 +157,7 @@ static void facegoblin(PLAYER& plr, DWHActor* actor)
else if (cansee) SetNewStatus(actor, FLEE);
}
if (checkdist(plr, i))
if (checkdist(plr, actor))
SetNewStatus(actor, ATTACK);
checkexplgoblin(plr, actor);
@ -253,7 +253,7 @@ static void attackgoblin(PLAYER& plr, DWHActor* actor)
if (spr.lotag == 31) {
if (checksight(plr, actor))
if (checkdist(plr, i)) {
if (checkdist(plr, actor)) {
spr.ang = (short)checksight_ang;
attack(plr, i);
}
@ -441,7 +441,7 @@ static void goblinWar(PLAYER& plr, DWHActor* actor)
processfluid(actor, zr_florhit, false);
SetActorPos(actor, &spr.pos);
if (checkdist(i, ownerspr.x, ownerspr.y, ownerspr.z)) {
if (checkdist(actor, ownerspr.x, ownerspr.y, ownerspr.z)) {
spr.extra = 2;
}
else
@ -457,7 +457,7 @@ static void goblinWar(PLAYER& plr, DWHActor* actor)
k = spr.owner;
auto owneractor = &whActors[k];
auto& ownerspr = owneractor->s();
if (checkdist(i, ownerspr.x, ownerspr.y, ownerspr.z)) {
if (checkdist(actor, ownerspr.x, ownerspr.y, ownerspr.z)) {
if ((krand() & 1) != 0) {
// goblins are fighting
// JSA_DEMO
@ -466,7 +466,7 @@ static void goblinWar(PLAYER& plr, DWHActor* actor)
if (krand() % 10 > 6)
spritesound(S_SWORD1 + (krand() % 6), &spr);
if (checkdist(plr, i))
if (checkdist(plr, actor))
addhealth(plr, -(krand() & 5));
if (krand() % 100 > 90) { // if k is dead

View file

@ -23,7 +23,7 @@ static void chasegonzo(PLAYER& plr, DWHActor* actor)
case GONZOGSH:
if (cansee(plr.x, plr.y, plr.z, plr.sector, spr.x, spr.y, spr.z - (tileHeight(spr.picnum) << 7),
spr.sectnum) && plr.invisibletime < 0) {
if (checkdist(plr, i)) {
if (checkdist(plr, actor)) {
if (plr.shadowtime > 0) {
spr.ang = (short)(((krand() & 512 - 256) + spr.ang + 1024) & 2047);
SetNewStatus(actor, FLEE);
@ -116,7 +116,7 @@ static void chasegonzo(PLAYER& plr, DWHActor* actor)
case GONZOGSW:
if (cansee(plr.x, plr.y, plr.z, plr.sector, spr.x, spr.y, spr.z - (tileHeight(spr.picnum) << 7),
spr.sectnum) && plr.invisibletime < 0) {
if (checkdist(plr, i)) {
if (checkdist(plr, actor)) {
if (plr.shadowtime > 0) {
spr.ang = (short)(((krand() & 512 - 256) + spr.ang + 1024) & 2047);
SetNewStatus(actor, FLEE);
@ -354,7 +354,7 @@ static void facegonzo(PLAYER& plr, DWHActor* actor)
else if (cansee) SetNewStatus(actor, FLEE);
}
if (plr.invisibletime < 0 && checkdist(plr, i))
if (plr.invisibletime < 0 && checkdist(plr, actor))
SetNewStatus(actor, ATTACK);
checkexplgonzo(plr, actor);
@ -395,7 +395,7 @@ static void attackgonzo(PLAYER& plr, DWHActor* actor)
case KURTPUNCH:
if (spr.lotag == 46) {
if (checksight(plr, actor))
if (checkdist(plr, i)) {
if (checkdist(plr, actor)) {
spr.ang = (short)checksight_ang;
attack(plr, i);
}
@ -427,7 +427,7 @@ static void attackgonzo(PLAYER& plr, DWHActor* actor)
case GONZOGSHAT:
if (spr.lotag == 31) {
if (checksight(plr, actor))
if (checkdist(plr, i)) {
if (checkdist(plr, actor)) {
spr.ang = (short)checksight_ang;
attack(plr, i);
}

View file

@ -21,7 +21,7 @@ static void chasegron(PLAYER& plr, DWHActor* actor)
if (spr.picnum == GRONSW) {
if (cansee(plr.x, plr.y, plr.z, plr.sector, spr.x, spr.y, spr.z - (tileHeight(spr.picnum) << 7),
spr.sectnum) && plr.invisibletime < 0) {
if (checkdist(plr, i)) {
if (checkdist(plr, actor)) {
if (plr.shadowtime > 0) {
spr.ang = (short)(((krand() & 512 - 256) + spr.ang + 1024) & 2047);
SetNewStatus(actor, FLEE);
@ -73,7 +73,7 @@ static void chasegron(PLAYER& plr, DWHActor* actor)
}
else {
checksight(plr, actor);
if (!checkdist(plr, i)) {
if (!checkdist(plr, actor)) {
if ((aimove(i) & kHitTypeMask) == kHitFloor)
{
spr.ang = (short)((spr.ang + 1024) & 2047);
@ -281,7 +281,7 @@ static void facegron(PLAYER& plr, DWHActor* actor)
else if (cansee) SetNewStatus(actor, FLEE);
}
if (checkdist(plr, i))
if (checkdist(plr, actor))
SetNewStatus(actor, ATTACK);
checkexplgron(plr, actor);
@ -310,7 +310,7 @@ static void attackgron(PLAYER& plr, DWHActor* actor)
if (spr.lotag == 31) {
if (checksight(plr, actor))
if (checkdist(plr, i)) {
if (checkdist(plr, actor)) {
spr.ang = (short)checksight_ang;
attack(plr, i);
}

View file

@ -32,7 +32,7 @@ static void chaseguardian(PLAYER& plr, DWHActor* actor)
if (PlayClock % 100 > 70)
trailingsmoke(actor,true);
if (!checkdist(plr, i)) {
if (!checkdist(plr, actor)) {
checkmove(actor, dax, day);
}
else {
@ -147,7 +147,7 @@ static void faceguardian(PLAYER& plr, DWHActor* actor)
else if (cansee) SetNewStatus(actor, FLEE);
}
if (checkdist(plr, i))
if (checkdist(plr, actor))
SetNewStatus(actor, ATTACK);
}

View file

@ -17,7 +17,7 @@ static void chaseimp(PLAYER& plr, DWHActor* actor)
short osectnum = spr.sectnum;
if (cansee(plr.x, plr.y, plr.z, plr.sector, spr.x, spr.y, spr.z - (tileHeight(spr.picnum) << 7),
spr.sectnum) && plr.invisibletime < 0) {
if (checkdist(plr, i)) {
if (checkdist(plr, actor)) {
if (plr.shadowtime > 0) {
spr.ang = (short)(((krand() & 512 - 256) + spr.ang + 1024) & 2047);
SetNewStatus(actor, FLEE);
@ -192,7 +192,7 @@ static void faceimp(PLAYER& plr, DWHActor* actor)
else if (cansee) SetNewStatus(actor, FLEE);
}
if (checkdist(plr, i))
if (checkdist(plr, actor))
SetNewStatus(actor, ATTACK);
checkexplimp(plr, actor);
@ -257,7 +257,7 @@ static void attackimp(PLAYER& plr, DWHActor* actor)
SetActorPos(actor, &spr.pos);
if (spr.lotag == 32) { //original 64
if (checksight(plr, actor))
if (checkdist(plr, i)) {
if (checkdist(plr, actor)) {
spr.ang = (short)checksight_ang;
attack(plr, i);
}

View file

@ -33,7 +33,7 @@ static void chasejudy(PLAYER& plr, DWHActor* actor)
}
else {
checksight(plr, actor);
if (!checkdist(i, plr.x, plr.y, plr.z)) {
if (!checkdist(actor, plr.x, plr.y, plr.z)) {
int movestat = aimove(i);
if ((movestat & kHitTypeMask) == kHitFloor)
{
@ -156,7 +156,7 @@ static void facejudy(PLAYER& plr, DWHActor* actor)
else if (cansee) SetNewStatus(actor, FLEE);
}
if (checkdist(i, plr.x, plr.y, plr.z))
if (checkdist(actor, plr.x, plr.y, plr.z))
SetNewStatus(actor, ATTACK);
}

View file

@ -23,7 +23,7 @@ static void chasekatie(PLAYER& plr, DWHActor* actor)
}
else {
checksight(plr, actor);
if (!checkdist(i, plr.x, plr.y, plr.z)) {
if (!checkdist(actor, plr.x, plr.y, plr.z)) {
int movestat = aimove(i);
if ((movestat & kHitTypeMask) == kHitFloor)
{
@ -130,7 +130,7 @@ static void facekatie(PLAYER& plr, DWHActor* actor)
else if (cansee) SetNewStatus(actor, FLEE);
}
if (checkdist(i, plr.x, plr.y, plr.z))
if (checkdist(actor, plr.x, plr.y, plr.z))
SetNewStatus(actor, ATTACK);
}

View file

@ -20,7 +20,7 @@ static void chasekobold(PLAYER& plr, DWHActor* actor)
short osectnum = spr.sectnum;
if (cansee(plr.x, plr.y, plr.z, plr.sector, spr.x, spr.y, spr.z - (tileHeight(spr.picnum) << 7),
spr.sectnum) && plr.invisibletime < 0) {
if (checkdist(plr, i)) {
if (checkdist(plr, actor)) {
if (plr.shadowtime > 0) {
spr.ang = (short)(((krand() & 512 - 256) + spr.ang + 1024) & 2047);
SetNewStatus(actor, FLEE);
@ -162,7 +162,7 @@ static void facekobold(PLAYER& plr, DWHActor* actor)
else if (cansee) SetNewStatus(actor, FLEE);
}
if (checkdist(plr, i))
if (checkdist(plr, actor))
SetNewStatus(actor, ATTACK);
checkexplkobold(plr, actor);
@ -225,7 +225,7 @@ static void attackkobold(PLAYER& plr, DWHActor* actor)
if (spr.lotag == 34) {
if (checksight(plr, actor))
if (checkdist(plr, i)) {
if (checkdist(plr, actor)) {
spr.ang = (short)checksight_ang;
attack(plr, i);
}

View file

@ -17,7 +17,7 @@ static void chaseminotaur(PLAYER& plr, DWHActor* actor)
short osectnum = spr.sectnum;
if (cansee(plr.x, plr.y, plr.z, plr.sector, spr.x, spr.y, spr.z - (tileHeight(spr.picnum) << 7),
spr.sectnum) && plr.invisibletime < 0) {
if (checkdist(plr, i)) {
if (checkdist(plr, actor)) {
if (plr.shadowtime > 0) {
spr.ang = (short)(((krand() & 512 - 256) + spr.ang + 1024) & 2047);
SetNewStatus(actor, FLEE);
@ -202,7 +202,7 @@ static void faceminotaur(PLAYER& plr, DWHActor* actor)
else if (cansee) SetNewStatus(actor, FLEE);
}
if (checkdist(plr, i))
if (checkdist(plr, actor))
SetNewStatus(actor, ATTACK);
checkexplminotaur(plr, actor);
@ -230,7 +230,7 @@ static void attackminotaur(PLAYER& plr, DWHActor* actor)
if (spr.lotag == 31) {
if (checksight(plr, actor))
if (checkdist(plr, i)) {
if (checkdist(plr, actor)) {
spr.ang = (short)checksight_ang;
attack(plr, i);
}

View file

@ -34,7 +34,7 @@ static void chasenewguy(PLAYER& plr, DWHActor* actor)
short osectnum = spr.sectnum;
if (cansee(plr.x, plr.y, plr.z, plr.sector, spr.x, spr.y, spr.z - (tileHeight(spr.picnum) << 7),
spr.sectnum) && plr.invisibletime < 0) {
if (checkdist(plr, i)) {
if (checkdist(plr, actor)) {
if (plr.shadowtime > 0) {
spr.ang = (short)(((krand() & 512 - 256) + spr.ang + 1024) & 2047);
SetNewStatus(actor, FLEE);
@ -224,7 +224,7 @@ static void facenewguy(PLAYER& plr, DWHActor* actor)
else if (cansee) SetNewStatus(actor, FLEE);
}
if (checkdist(plr, i))
if (checkdist(plr, actor))
SetNewStatus(actor, ATTACK);
}
@ -300,7 +300,7 @@ static void attacknewguy(PLAYER& plr, DWHActor* actor)
case NEWGUYPUNCH:
if (spr.lotag == 31) {
if (checksight(plr, actor))
if (checkdist(plr, i)) {
if (checkdist(plr, actor)) {
spr.ang = (short)checksight_ang;
attack(plr, i);
}

View file

@ -17,7 +17,7 @@ static void chaseskeleton(PLAYER& plr, DWHActor* actor)
short osectnum = spr.sectnum;
if (cansee(plr.x, plr.y, plr.z, plr.sector, spr.x, spr.y, spr.z - (tileHeight(spr.picnum) << 7),
spr.sectnum) && plr.invisibletime < 0) {
if (checkdist(plr, i)) {
if (checkdist(plr, actor)) {
if (plr.shadowtime > 0) {
spr.ang = (short)(((krand() & 512 - 256) + spr.ang + 1024) & 2047);
SetNewStatus(actor, FLEE);
@ -140,7 +140,7 @@ static void faceskeleton(PLAYER& plr, DWHActor* actor)
else if (cansee) SetNewStatus(actor, FLEE);
}
if (checkdist(plr, i))
if (checkdist(plr, actor))
SetNewStatus(actor, ATTACK);
checkexplskeleton(plr, actor);
@ -234,7 +234,7 @@ static void attackskeleton(PLAYER& plr, DWHActor* actor)
spr.ang = getangle(plr.x - spr.x, plr.y - spr.y);
if (spr.lotag == 16) {
if (checksight(plr, actor))
if (checkdist(plr, i)) {
if (checkdist(plr, actor)) {
spr.ang = (short)checksight_ang;
attack(plr, i);
}

View file

@ -21,7 +21,7 @@ static void chaseskully(PLAYER& plr, DWHActor* actor)
}
else {
checksight(plr, actor);
if (!checkdist(plr, i)) {
if (!checkdist(plr, actor)) {
if ((aimove(i) & kHitTypeMask) == kHitFloor)
{
spr.ang = (short)((spr.ang + 1024) & 2047);
@ -142,7 +142,7 @@ static void faceskully(PLAYER& plr, DWHActor* actor)
else if (cansee) SetNewStatus(actor, FLEE);
}
if (checkdist(plr, i))
if (checkdist(plr, actor))
SetNewStatus(actor, ATTACK);
}

View file

@ -17,7 +17,7 @@ static void chasespider(PLAYER& plr, DWHActor* actor)
short osectnum = spr.sectnum;
if (cansee(plr.x, plr.y, plr.z, plr.sector, spr.x, spr.y, spr.z - (tileHeight(spr.picnum) << 7),
spr.sectnum) && plr.invisibletime < 0) {
if (checkdist(plr, i)) {
if (checkdist(plr, actor)) {
if (plr.shadowtime > 0) {
spr.ang = (short)(((krand() & 512 - 256) + spr.ang + 1024) & 2047);
SetNewStatus(actor, FLEE);
@ -181,7 +181,7 @@ static void facespider(PLAYER& plr, DWHActor* actor)
else if (cansee) SetNewStatus(actor, FLEE);
}
if (checkdist(plr, i))
if (checkdist(plr, actor))
SetNewStatus(actor, ATTACK);
checkexplspider(plr, actor);
@ -207,7 +207,7 @@ static void attackspider(PLAYER& plr, DWHActor* actor)
if (spr.lotag >= 64) {
if (checksight(plr, actor))
if (checkdist(plr, i)) {
if (checkdist(plr, actor)) {
spr.ang = (short)checksight_ang;
attack(plr, i);
if (krand() % 100 > ((plr.lvl * 7) + 20)) {

View file

@ -27,7 +27,7 @@ static void chasewillow(PLAYER& plr, DWHActor* actor)
int day = (bsin(spr.ang) * TICSPERFRAME) << 3;
checksight(plr, actor);
if (!checkdist(plr, i)) {
if (!checkdist(plr, actor)) {
checkmove(actor, dax, day);
}
else {
@ -85,7 +85,7 @@ static void attackwillow(PLAYER& plr, DWHActor* actor)
if (spr.lotag < 0) {
if (cansee(plr.x, plr.y, plr.z, plr.sector, spr.x, spr.y, spr.z - (tileHeight(spr.picnum) << 7),
spr.sectnum))
if (checkdist(plr, i)) {
if (checkdist(plr, actor)) {
if (plr.shockme < 0)
if ((krand() & 1) != 0) {
plr.shockme = 120;
@ -169,7 +169,7 @@ static void facewillow(PLAYER& plr, DWHActor* actor)
else SetNewStatus(actor, FLEE);
}
if (checkdist(plr, i))
if (checkdist(plr, actor))
SetNewStatus(actor, ATTACK);
}

View file

@ -697,7 +697,7 @@ void animateobjs(PLAYER& plr) {
}
}
if (checkdist(i, plr.x, plr.y, plr.z)) {
if (checkdist(actor, plr.x, plr.y, plr.z)) {
addhealth(plr, -1);
flashflag = 1;
startredflash(10);
@ -721,7 +721,7 @@ void animateobjs(PLAYER& plr) {
SetActorPos(actor, &spr.pos);
if (spr.picnum == FBARRELFALL || spr.picnum >= BOULDER && spr.picnum <= BOULDER + 3
&& (checkdist(i, plr.x, plr.y, plr.z))) {
&& (checkdist(actor, plr.x, plr.y, plr.z))) {
addhealth(plr, -50);
startredflash(50);
}