2008-09-15 14:11:05 +00:00
|
|
|
/*
|
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_local.h"
|
|
|
|
#include "s_sound.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
|
|
|
|
|
|
|
// 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:
|
2012-06-29 04:21:31 +00:00
|
|
|
int DoSpecialDamage (AActor *target, int damage, FName damagetype);
|
2006-02-24 04:48:15 +00:00
|
|
|
};
|
|
|
|
|
2008-08-06 22:59:24 +00:00
|
|
|
IMPLEMENT_CLASS (ALoreShot)
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2012-06-29 04:21:31 +00:00
|
|
|
int ALoreShot::DoSpecialDamage (AActor *target, int damage, FName damagetype)
|
2006-02-24 04:48:15 +00:00
|
|
|
{
|
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));
|
|
|
|
|
2009-06-30 20:57:51 +00:00
|
|
|
target->velx += fixed_t(thrust.X);
|
|
|
|
target->vely += fixed_t(thrust.Y);
|
|
|
|
target->velz += fixed_t(thrust.Z);
|
2007-02-24 12:09:36 +00:00
|
|
|
}
|
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);
|
2009-06-30 20:57:51 +00:00
|
|
|
Spawn("LoreShot2", self->x - (self->velx >> 1), self->y - (self->vely >> 1), self->z - (self->velz >> 1), ALLOW_REPLACE);
|
|
|
|
Spawn("LoreShot2", self->x - self->velx, self->y - self->vely, self->z - self->velz, ALLOW_REPLACE);
|
2006-02-24 04:48:15 +00:00
|
|
|
}
|