- added some options to A_CustomPunch, including calling Strife's dagger alert function.

SVN r2367 (trunk)
This commit is contained in:
Christoph Oelckers 2010-06-13 09:06:12 +00:00
commit ec44397881
4 changed files with 21 additions and 3 deletions

View file

@ -1125,12 +1125,20 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FireCustomMissile)
// Berserk is not handled here. That can be done with A_CheckIfInventory
//
//==========================================================================
enum
{
CPF_USEAMMO = 1,
CPF_DAGGER = 2,
CPF_PULLIN = 4,
};
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomPunch)
{
ACTION_PARAM_START(5);
ACTION_PARAM_INT(Damage, 0);
ACTION_PARAM_BOOL(norandom, 1);
ACTION_PARAM_BOOL(UseAmmo, 2);
ACTION_PARAM_INT(flags, 2);
ACTION_PARAM_CLASS(PuffType, 3);
ACTION_PARAM_FIXED(Range, 4);
ACTION_PARAM_FIXED(LifeSteal, 5);
@ -1152,7 +1160,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomPunch)
pitch = P_AimLineAttack (self, angle, Range, &linetarget);
// only use ammo when actually hitting something!
if (UseAmmo && linetarget && weapon)
if ((flags & CPF_USEAMMO) && linetarget && weapon)
{
if (!weapon->DepleteAmmo(weapon->bAltFire, true)) return; // out of ammo
}
@ -1173,6 +1181,10 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomPunch)
self->y,
linetarget->x,
linetarget->y);
if (flags & CPF_PULLIN) self->flags |= MF_JUSTATTACKED;
if (flags & CPF_DAGGER) P_DaggerAlert (self, linetarget);
}
}