- jpalomo's A_Saw flags submission.

This commit is contained in:
Christoph Oelckers 2014-09-08 13:02:05 +02:00
parent 8f238f8d32
commit cfd24f438f
2 changed files with 22 additions and 14 deletions

View File

@ -107,6 +107,8 @@ enum SAW_Flags
SF_RANDOMLIGHTHIT = 4,
SF_NOUSEAMMOMISS = 8,
SF_NOUSEAMMO = 16,
SF_NOPULLIN = 32,
SF_NOTURN = 64,
};
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Saw)
@ -187,6 +189,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Saw)
S_Sound (self, CHAN_WEAPON, hitsound, 1, ATTN_NORM);
// turn to face target
if (!(Flags & SF_NOTURN))
{
angle = R_PointToAngle2(self->x, self->y,
linetarget->x, linetarget->y);
if (angle - self->angle > ANG180)
@ -203,6 +207,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Saw)
else
self->angle += ANG90 / 20;
}
}
if (!(Flags & SF_NOPULLIN))
self->flags |= MF_JUSTATTACKED;
}

View File

@ -14,6 +14,8 @@ const int SF_RANDOMLIGHTHIT = 4;
const int SF_RANDOMLIGHTBOTH = 6;
const int SF_NOUSEAMMOMISS = 8;
const int SF_NOUSEAMMO = 16;
const int SF_NOPULLIN = 32;
const int SF_NOTURN = 64;
// Flags for A_CustomMissile
const int CMF_AIMOFFSET = 1;