mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-08 05:51:26 +00:00
153a2a4c2c
failed to start the demo. - Added a MF5_BRIGHT flag to always render an actor fullbright. - Fixed: Calling Door_Animated with a non-zero tag created a new thinker for each two-sided line of the sector. - Added Karate Chris's submission for making 'spray' a cheat. - Added CO2's default parameter additions for several Doom code pointers submission. - Added CO2's A_RemoveMaster/A_RemoveChildren submission. - Added Blzut3's SBARINFO replacement for the Doom statusbar. - Fixed: SBarInfo still displayed the wrong bar for height 0 - Added A_KillSiblings and A_DamageSiblings code pointers. - added MaxAbsorb and MaxFullAbsorb properties for Armor. SVN r1304 (trunk)
135 lines
2.5 KiB
C++
135 lines
2.5 KiB
C++
/*
|
|
#include "actor.h"
|
|
#include "info.h"
|
|
#include "p_local.h"
|
|
#include "s_sound.h"
|
|
#include "p_enemy.h"
|
|
#include "gstrings.h"
|
|
#include "a_action.h"
|
|
#include "thingdef/thingdef.h"
|
|
*/
|
|
|
|
//
|
|
// PIT_VileCheck
|
|
// Detect a corpse that could be raised.
|
|
//
|
|
void A_Fire(AActor *self, int height);
|
|
|
|
|
|
//
|
|
// A_VileStart
|
|
//
|
|
DEFINE_ACTION_FUNCTION(AActor, A_VileStart)
|
|
{
|
|
S_Sound (self, CHAN_VOICE, "vile/start", 1, ATTN_NORM);
|
|
}
|
|
|
|
|
|
//
|
|
// A_Fire
|
|
// Keep fire in front of player unless out of sight
|
|
//
|
|
DEFINE_ACTION_FUNCTION(AActor, A_StartFire)
|
|
{
|
|
S_Sound (self, CHAN_BODY, "vile/firestrt", 1, ATTN_NORM);
|
|
A_Fire (self, 0);
|
|
}
|
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_FireCrackle)
|
|
{
|
|
S_Sound (self, CHAN_BODY, "vile/firecrkl", 1, ATTN_NORM);
|
|
A_Fire (self, 0);
|
|
}
|
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Fire)
|
|
{
|
|
ACTION_PARAM_START(1);
|
|
ACTION_PARAM_FIXED(height,0);
|
|
|
|
A_Fire(self, height);
|
|
}
|
|
|
|
void A_Fire(AActor *self, int height)
|
|
{
|
|
AActor *dest;
|
|
angle_t an;
|
|
|
|
dest = self->tracer;
|
|
if (!dest)
|
|
return;
|
|
|
|
// don't move it if the vile lost sight
|
|
if (!P_CheckSight (self->target, dest, 0) )
|
|
return;
|
|
|
|
an = dest->angle >> ANGLETOFINESHIFT;
|
|
|
|
self->SetOrigin (dest->x + FixedMul (24*FRACUNIT, finecosine[an]),
|
|
dest->y + FixedMul (24*FRACUNIT, finesine[an]),
|
|
dest->z + height);
|
|
}
|
|
|
|
|
|
|
|
//
|
|
// A_VileTarget
|
|
// Spawn the hellfire
|
|
//
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_VileTarget)
|
|
{
|
|
ACTION_PARAM_START(1);
|
|
ACTION_PARAM_CLASS(fire,0);
|
|
AActor *fog;
|
|
|
|
if (!self->target)
|
|
return;
|
|
|
|
A_FaceTarget (self);
|
|
|
|
fog = Spawn (fire, self->target->x, self->target->y,
|
|
self->target->z, ALLOW_REPLACE);
|
|
|
|
self->tracer = fog;
|
|
fog->target = self;
|
|
fog->tracer = self->target;
|
|
A_Fire(fog, 0);
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
// A_VileAttack
|
|
//
|
|
DEFINE_ACTION_FUNCTION(AActor, A_VileAttack)
|
|
{
|
|
AActor *fire;
|
|
int an;
|
|
|
|
if (!self->target)
|
|
return;
|
|
|
|
A_FaceTarget (self);
|
|
|
|
if (!P_CheckSight (self, self->target, 0) )
|
|
return;
|
|
|
|
S_Sound (self, CHAN_WEAPON, "vile/stop", 1, ATTN_NORM);
|
|
P_DamageMobj (self->target, self, self, 20, NAME_None);
|
|
P_TraceBleed (20, self->target);
|
|
self->target->momz = 1000 * FRACUNIT / self->target->Mass;
|
|
|
|
an = self->angle >> ANGLETOFINESHIFT;
|
|
|
|
fire = self->tracer;
|
|
|
|
if (!fire)
|
|
return;
|
|
|
|
// move the fire between the vile and the player
|
|
fire->SetOrigin (self->target->x - FixedMul (24*FRACUNIT, finecosine[an]),
|
|
self->target->y - FixedMul (24*FRACUNIT, finesine[an]),
|
|
self->target->z);
|
|
|
|
P_RadiusAttack (fire, self, 70, 70, NAME_Fire, false);
|
|
}
|