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"
|
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
|
|
|
{
|
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 20:48:55 +00:00
|
|
|
A_UnSetReflectiveInvulnerable (self);
|
|
|
|
self->SetState (self->MeleeState);
|
2006-02-24 04:48:15 +00:00
|
|
|
}
|
|
|
|
}
|