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:
|
2015-01-24 13:04:06 +00:00
|
|
|
int DoSpecialDamage (AActor *victim, 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
|
|
|
|
2015-01-24 13:04:06 +00:00
|
|
|
int ALoreShot::DoSpecialDamage (AActor *victim, 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
|
|
|
|
2015-01-24 13:04:06 +00:00
|
|
|
if (victim != NULL && target != NULL && !(victim->flags7 & MF7_DONTTHRUST))
|
2007-02-24 12:09:36 +00:00
|
|
|
{
|
2015-01-24 13:04:06 +00:00
|
|
|
thrust.X = float(target->x - victim->x);
|
|
|
|
thrust.Y = float(target->y - victim->y);
|
|
|
|
thrust.Z = float(target->z - victim->z);
|
2007-02-24 12:09:36 +00:00
|
|
|
|
|
|
|
thrust.MakeUnit();
|
2015-01-24 13:17:47 +00:00
|
|
|
thrust *= float((255*50*FRACUNIT) / (victim->Mass ? victim->Mass : 1));
|
2007-02-24 12:09:36 +00:00
|
|
|
|
2015-01-24 13:04:06 +00:00
|
|
|
victim->velx += fixed_t(thrust.X);
|
|
|
|
victim->vely += fixed_t(thrust.Y);
|
|
|
|
victim->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
|
|
|
}
|