mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2025-02-08 14:01:49 +00:00
can perform based on the amount of damage actually taken after all modifications are done to it. However, if the damage is canceled away, blood will still spawn for the original damage amount rather than the modified amount. SVN r4012 (trunk)
26 lines
584 B
C++
26 lines
584 B
C++
/*
|
|
#include "actor.h"
|
|
#include "info.h"
|
|
#include "m_random.h"
|
|
#include "p_local.h"
|
|
#include "p_enemy.h"
|
|
#include "gstrings.h"
|
|
#include "a_action.h"
|
|
#include "thingdef/thingdef.h"
|
|
*/
|
|
|
|
static FRandom pr_sargattack ("SargAttack");
|
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_SargAttack)
|
|
{
|
|
if (!self->target)
|
|
return;
|
|
|
|
A_FaceTarget (self);
|
|
if (self->CheckMeleeRange ())
|
|
{
|
|
int damage = ((pr_sargattack()%10)+1)*4;
|
|
int newdam = P_DamageMobj (self->target, self, self, damage, NAME_Melee);
|
|
P_TraceBleed (newdam > 0 ? newdam : damage, self->target, self);
|
|
}
|
|
}
|