2008-09-15 14:11:05 +00:00
|
|
|
/*
|
2006-02-24 04:48:15 +00:00
|
|
|
#include "actor.h"
|
|
|
|
#include "p_enemy.h"
|
|
|
|
#include "a_action.h"
|
|
|
|
#include "m_random.h"
|
2008-08-10 20:48:55 +00:00
|
|
|
#include "thingdef/thingdef.h"
|
2008-09-15 14:11:05 +00:00
|
|
|
*/
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
static FRandom pr_centaurdefend ("CentaurDefend");
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
//
|
|
|
|
// A_CentaurDefend
|
|
|
|
//
|
|
|
|
//============================================================================
|
|
|
|
|
2008-08-10 20:48:55 +00:00
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_CentaurDefend)
|
2006-02-24 04:48:15 +00:00
|
|
|
{
|
2010-02-12 06:04:57 +00:00
|
|
|
PARAM_ACTION_PROLOGUE;
|
|
|
|
|
2008-08-10 20:48:55 +00:00
|
|
|
A_FaceTarget (self);
|
|
|
|
if (self->CheckMeleeRange() && pr_centaurdefend() < 32)
|
2006-02-24 04:48:15 +00:00
|
|
|
{
|
|
|
|
// This should unset REFLECTIVE as well
|
|
|
|
// (unless you want the Centaur to reflect projectiles forever!)
|
2008-08-10 22:48:37 +00:00
|
|
|
self->flags2&=~(MF2_REFLECTIVE|MF2_INVULNERABLE);
|
2008-08-10 20:48:55 +00:00
|
|
|
self->SetState (self->MeleeState);
|
2006-02-24 04:48:15 +00:00
|
|
|
}
|
2010-02-12 06:04:57 +00:00
|
|
|
return 0;
|
2006-02-24 04:48:15 +00:00
|
|
|
}
|