mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2025-02-03 11:50:57 +00:00
bc63b70d88
Conflicts: src/actor.h src/fragglescript/t_func.cpp src/g_doom/a_bossbrain.cpp src/g_doom/a_revenant.cpp src/g_heretic/a_hereticartifacts.cpp src/g_heretic/a_hereticweaps.cpp src/g_heretic/a_knight.cpp src/g_hexen/a_bishop.cpp src/g_hexen/a_clericholy.cpp src/g_hexen/a_dragon.cpp src/g_hexen/a_firedemon.cpp src/g_hexen/a_flechette.cpp src/g_hexen/a_heresiarch.cpp src/g_hexen/a_hexenspecialdecs.cpp src/g_hexen/a_iceguy.cpp src/g_hexen/a_korax.cpp src/g_hexen/a_magelightning.cpp src/g_hexen/a_serpent.cpp src/g_hexen/a_spike.cpp src/g_hexen/a_wraith.cpp src/g_raven/a_minotaur.cpp src/g_shared/a_bridge.cpp src/g_shared/a_pickups.cpp src/g_shared/a_randomspawner.cpp src/g_strife/a_alienspectres.cpp src/g_strife/a_crusader.cpp src/g_strife/a_entityboss.cpp src/g_strife/a_inquisitor.cpp src/g_strife/a_loremaster.cpp src/g_strife/a_programmer.cpp src/g_strife/a_sentinel.cpp src/g_strife/a_spectral.cpp src/g_strife/a_strifestuff.cpp src/g_strife/a_strifeweapons.cpp src/g_strife/a_thingstoblowup.cpp src/p_local.h src/r_utility.cpp
70 lines
1.8 KiB
C++
70 lines
1.8 KiB
C++
/*
|
|
#include "actor.h"
|
|
#include "info.h"
|
|
#include "m_random.h"
|
|
#include "s_sound.h"
|
|
#include "p_local.h"
|
|
#include "a_action.h"
|
|
#include "a_sharedglobal.h"
|
|
#include "gstrings.h"
|
|
#include "thingdef/thingdef.h"
|
|
*/
|
|
|
|
static FRandom pr_dripblood ("DripBlood");
|
|
static FRandom pr_knightatk ("KnightAttack");
|
|
|
|
//----------------------------------------------------------------------------
|
|
//
|
|
// PROC A_DripBlood
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_DripBlood)
|
|
{
|
|
PARAM_ACTION_PROLOGUE;
|
|
|
|
AActor *mo;
|
|
|
|
fixedvec3 pos = self->Vec3Offset(
|
|
(pr_dripblood.Random2 () << 11),
|
|
(pr_dripblood.Random2 () << 11), 0);
|
|
mo = Spawn ("Blood", pos, ALLOW_REPLACE);
|
|
mo->velx = pr_dripblood.Random2 () << 10;
|
|
mo->vely = pr_dripblood.Random2 () << 10;
|
|
mo->gravity = FRACUNIT/8;
|
|
return 0;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
//
|
|
// PROC A_KnightAttack
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_KnightAttack)
|
|
{
|
|
PARAM_ACTION_PROLOGUE;
|
|
|
|
if (!self->target)
|
|
{
|
|
return 0;
|
|
}
|
|
if (self->CheckMeleeRange ())
|
|
{
|
|
int damage = pr_knightatk.HitDice (3);
|
|
int newdam = P_DamageMobj (self->target, self, self, damage, NAME_Melee);
|
|
P_TraceBleed (newdam > 0 ? newdam : damage, self->target, self);
|
|
S_Sound (self, CHAN_BODY, "hknight/melee", 1, ATTN_NORM);
|
|
return 0;
|
|
}
|
|
// Throw axe
|
|
S_Sound (self, CHAN_BODY, self->AttackSound, 1, ATTN_NORM);
|
|
if (self->flags & MF_SHADOW || pr_knightatk () < 40)
|
|
{ // Red axe
|
|
P_SpawnMissileZ (self, self->Z() + 36*FRACUNIT, self->target, PClass::FindActor("RedAxe"));
|
|
return;
|
|
}
|
|
// Green axe
|
|
P_SpawnMissileZ (self, self->Z() + 36*FRACUNIT, self->target, PClass::FindActor("KnightAxe"));
|
|
}
|
|
|