mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-01-31 04:20:34 +00:00
- jpalomo's A_Saw flags submission.
This commit is contained in:
parent
8f238f8d32
commit
cfd24f438f
2 changed files with 22 additions and 14 deletions
|
@ -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,23 +189,27 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Saw)
|
|||
S_Sound (self, CHAN_WEAPON, hitsound, 1, ATTN_NORM);
|
||||
|
||||
// turn to face target
|
||||
angle = R_PointToAngle2 (self->x, self->y,
|
||||
linetarget->x, linetarget->y);
|
||||
if (angle - self->angle > ANG180)
|
||||
if (!(Flags & SF_NOTURN))
|
||||
{
|
||||
if (angle - self->angle < (angle_t)(-ANG90/20))
|
||||
self->angle = angle + ANG90/21;
|
||||
angle = R_PointToAngle2(self->x, self->y,
|
||||
linetarget->x, linetarget->y);
|
||||
if (angle - self->angle > ANG180)
|
||||
{
|
||||
if (angle - self->angle < (angle_t)(-ANG90 / 20))
|
||||
self->angle = angle + ANG90 / 21;
|
||||
else
|
||||
self->angle -= ANG90 / 20;
|
||||
}
|
||||
else
|
||||
self->angle -= ANG90/20;
|
||||
{
|
||||
if (angle - self->angle > ANG90 / 20)
|
||||
self->angle = angle - ANG90 / 21;
|
||||
else
|
||||
self->angle += ANG90 / 20;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (angle - self->angle > ANG90/20)
|
||||
self->angle = angle - ANG90/21;
|
||||
else
|
||||
self->angle += ANG90/20;
|
||||
}
|
||||
self->flags |= MF_JUSTATTACKED;
|
||||
if (!(Flags & SF_NOPULLIN))
|
||||
self->flags |= MF_JUSTATTACKED;
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue