mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 14:51:51 +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_RANDOMLIGHTHIT = 4,
|
||||||
SF_NOUSEAMMOMISS = 8,
|
SF_NOUSEAMMOMISS = 8,
|
||||||
SF_NOUSEAMMO = 16,
|
SF_NOUSEAMMO = 16,
|
||||||
|
SF_NOPULLIN = 32,
|
||||||
|
SF_NOTURN = 64,
|
||||||
};
|
};
|
||||||
|
|
||||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Saw)
|
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);
|
S_Sound (self, CHAN_WEAPON, hitsound, 1, ATTN_NORM);
|
||||||
|
|
||||||
// turn to face target
|
// turn to face target
|
||||||
|
if (!(Flags & SF_NOTURN))
|
||||||
|
{
|
||||||
angle = R_PointToAngle2(self->x, self->y,
|
angle = R_PointToAngle2(self->x, self->y,
|
||||||
linetarget->x, linetarget->y);
|
linetarget->x, linetarget->y);
|
||||||
if (angle - self->angle > ANG180)
|
if (angle - self->angle > ANG180)
|
||||||
|
@ -203,6 +207,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Saw)
|
||||||
else
|
else
|
||||||
self->angle += ANG90 / 20;
|
self->angle += ANG90 / 20;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (!(Flags & SF_NOPULLIN))
|
||||||
self->flags |= MF_JUSTATTACKED;
|
self->flags |= MF_JUSTATTACKED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,8 @@ const int SF_RANDOMLIGHTHIT = 4;
|
||||||
const int SF_RANDOMLIGHTBOTH = 6;
|
const int SF_RANDOMLIGHTBOTH = 6;
|
||||||
const int SF_NOUSEAMMOMISS = 8;
|
const int SF_NOUSEAMMOMISS = 8;
|
||||||
const int SF_NOUSEAMMO = 16;
|
const int SF_NOUSEAMMO = 16;
|
||||||
|
const int SF_NOPULLIN = 32;
|
||||||
|
const int SF_NOTURN = 64;
|
||||||
|
|
||||||
// Flags for A_CustomMissile
|
// Flags for A_CustomMissile
|
||||||
const int CMF_AIMOFFSET = 1;
|
const int CMF_AIMOFFSET = 1;
|
||||||
|
|
Loading…
Reference in a new issue