2006-02-24 04:48:15 +00:00
|
|
|
#include "actor.h"
|
|
|
|
#include "a_action.h"
|
|
|
|
#include "a_strifeglobal.h"
|
|
|
|
#include "m_random.h"
|
|
|
|
#include "p_enemy.h"
|
|
|
|
#include "p_local.h"
|
|
|
|
#include "s_sound.h"
|
2008-08-10 20:48:55 +00:00
|
|
|
#include "thingdef/thingdef.h"
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
// Loremaster (aka Priest) --------------------------------------------------
|
|
|
|
|
|
|
|
class ALoreShot : public AActor
|
|
|
|
{
|
2008-08-06 22:59:24 +00:00
|
|
|
DECLARE_CLASS (ALoreShot, AActor)
|
2006-02-24 04:48:15 +00:00
|
|
|
public:
|
|
|
|
int DoSpecialDamage (AActor *target, int damage);
|
|
|
|
};
|
|
|
|
|
2008-08-06 22:59:24 +00:00
|
|
|
IMPLEMENT_CLASS (ALoreShot)
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
int ALoreShot::DoSpecialDamage (AActor *target, int damage)
|
|
|
|
{
|
2007-01-19 02:00:39 +00:00
|
|
|
FVector3 thrust;
|
2007-02-24 12:09:36 +00:00
|
|
|
|
|
|
|
if (this->target != NULL)
|
|
|
|
{
|
|
|
|
thrust.X = float(this->target->x - target->x);
|
|
|
|
thrust.Y = float(this->target->y - target->y);
|
|
|
|
thrust.Z = float(this->target->z - target->z);
|
|
|
|
|
|
|
|
thrust.MakeUnit();
|
|
|
|
thrust *= float((255*50*FRACUNIT) / (target->Mass ? target->Mass : 1));
|
|
|
|
|
|
|
|
target->momx += fixed_t(thrust.X);
|
|
|
|
target->momy += fixed_t(thrust.Y);
|
|
|
|
target->momz += fixed_t(thrust.Z);
|
|
|
|
}
|
2006-02-24 04:48:15 +00:00
|
|
|
return damage;
|
|
|
|
}
|
|
|
|
|
2008-08-10 20:48:55 +00:00
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_LoremasterChain)
|
2006-02-24 04:48:15 +00:00
|
|
|
{
|
|
|
|
S_Sound (self, CHAN_BODY, "loremaster/active", 1, ATTN_NORM);
|
2008-08-06 22:59:24 +00:00
|
|
|
Spawn("LoreShot2", self->x, self->y, self->z, ALLOW_REPLACE);
|
|
|
|
Spawn("LoreShot2", self->x - (self->momx >> 1), self->y - (self->momy >> 1), self->z - (self->momz >> 1), ALLOW_REPLACE);
|
|
|
|
Spawn("LoreShot2", self->x - self->momx, self->y - self->momy, self->z - self->momz, ALLOW_REPLACE);
|
2006-02-24 04:48:15 +00:00
|
|
|
}
|