mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-03-09 19:01:09 +00:00
- Converted P_MovePlayer and all associated variables to floating point because this wasn't working well with a mixture between float and fixed. Like the angle commit this has just been patched up to compile, the bulk of work is yet to be done.
43 lines
1.2 KiB
C++
43 lines
1.2 KiB
C++
/*
|
|
#include "actor.h"
|
|
#include "a_action.h"
|
|
#include "a_strifeglobal.h"
|
|
#include "m_random.h"
|
|
#include "p_local.h"
|
|
#include "s_sound.h"
|
|
#include "thingdef/thingdef.h"
|
|
*/
|
|
|
|
// Loremaster (aka Priest) --------------------------------------------------
|
|
|
|
class ALoreShot : public AActor
|
|
{
|
|
DECLARE_CLASS (ALoreShot, AActor)
|
|
public:
|
|
int DoSpecialDamage (AActor *victim, int damage, FName damagetype);
|
|
};
|
|
|
|
IMPLEMENT_CLASS (ALoreShot)
|
|
|
|
int ALoreShot::DoSpecialDamage (AActor *victim, int damage, FName damagetype)
|
|
{
|
|
|
|
if (victim != NULL && target != NULL && !(victim->flags7 & MF7_DONTTHRUST))
|
|
{
|
|
DVector3 thrust = victim->Vec3To(target);
|
|
thrust.MakeResize(255. * 50 / MAX<int>(victim->Mass, 1));
|
|
victim->Vel += thrust;
|
|
}
|
|
return damage;
|
|
}
|
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_LoremasterChain)
|
|
{
|
|
PARAM_ACTION_PROLOGUE;
|
|
|
|
S_Sound (self, CHAN_BODY, "loremaster/active", 1, ATTN_NORM);
|
|
Spawn("LoreShot2", self->Pos(), ALLOW_REPLACE);
|
|
Spawn("LoreShot2", self->Vec3Offset(-(self->_f_velx() >> 1), -(self->_f_vely() >> 1), -(self->_f_velz() >> 1)), ALLOW_REPLACE);
|
|
Spawn("LoreShot2", self->Vec3Offset(-self->_f_velx(), -self->_f_vely(), -self->_f_velz()), ALLOW_REPLACE);
|
|
return 0;
|
|
}
|