2006-02-24 04:48:15 +00:00
|
|
|
#include "actor.h"
|
|
|
|
#include "info.h"
|
|
|
|
#include "a_pickups.h"
|
|
|
|
#include "a_action.h"
|
|
|
|
#include "m_random.h"
|
|
|
|
#include "p_local.h"
|
|
|
|
#include "s_sound.h"
|
|
|
|
#include "gstrings.h"
|
2008-08-10 20:48:55 +00:00
|
|
|
#include "thingdef/thingdef.h"
|
2008-09-15 14:11:05 +00:00
|
|
|
#include "p_enemy.h"
|
|
|
|
#include "a_specialspot.h"
|
|
|
|
#include "g_level.h"
|
|
|
|
#include "a_sharedglobal.h"
|
|
|
|
#include "templates.h"
|
|
|
|
#include "r_translate.h"
|
|
|
|
#include "doomstat.h"
|
|
|
|
|
|
|
|
// Include all the other Heretic stuff here to reduce compile time
|
|
|
|
#include "a_chicken.cpp"
|
|
|
|
#include "a_dsparil.cpp"
|
|
|
|
#include "a_hereticartifacts.cpp"
|
|
|
|
#include "a_hereticimp.cpp"
|
|
|
|
#include "a_hereticweaps.cpp"
|
|
|
|
#include "a_ironlich.cpp"
|
|
|
|
#include "a_knight.cpp"
|
|
|
|
#include "a_wizard.cpp"
|
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
static FRandom pr_podpain ("PodPain");
|
|
|
|
static FRandom pr_makepod ("MakePod");
|
|
|
|
static FRandom pr_teleg ("TeleGlitter");
|
|
|
|
static FRandom pr_teleg2 ("TeleGlitter2");
|
|
|
|
static FRandom pr_volcano ("VolcanoSet");
|
|
|
|
static FRandom pr_blast ("VolcanoBlast");
|
2008-09-15 14:11:05 +00:00
|
|
|
static FRandom pr_volcimpact ("VolcBallImpact");
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// PROC A_PodPain
|
|
|
|
//
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
2009-05-09 02:31:49 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_PodPain)
|
2006-02-24 04:48:15 +00:00
|
|
|
{
|
2009-05-09 02:31:49 +00:00
|
|
|
ACTION_PARAM_START(1);
|
|
|
|
ACTION_PARAM_CLASS(gootype, 0);
|
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
int count;
|
|
|
|
int chance;
|
|
|
|
AActor *goo;
|
|
|
|
|
|
|
|
chance = pr_podpain ();
|
|
|
|
if (chance < 128)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
for (count = chance > 240 ? 2 : 1; count; count--)
|
|
|
|
{
|
2009-05-09 02:31:49 +00:00
|
|
|
goo = Spawn(gootype, self->x, self->y, self->z + 48*FRACUNIT, ALLOW_REPLACE);
|
2008-08-10 20:48:55 +00:00
|
|
|
goo->target = self;
|
2006-02-24 04:48:15 +00:00
|
|
|
goo->momx = pr_podpain.Random2() << 9;
|
|
|
|
goo->momy = pr_podpain.Random2() << 9;
|
|
|
|
goo->momz = FRACUNIT/2 + (pr_podpain() << 9);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// PROC A_RemovePod
|
|
|
|
//
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
2008-08-10 20:48:55 +00:00
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_RemovePod)
|
2006-02-24 04:48:15 +00:00
|
|
|
{
|
|
|
|
AActor *mo;
|
|
|
|
|
2008-08-10 20:48:55 +00:00
|
|
|
if ( (mo = self->master))
|
2006-02-24 04:48:15 +00:00
|
|
|
{
|
|
|
|
if (mo->special1 > 0)
|
|
|
|
{
|
|
|
|
mo->special1--;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// PROC A_MakePod
|
|
|
|
//
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#define MAX_GEN_PODS 16
|
|
|
|
|
2009-05-09 02:31:49 +00:00
|
|
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_MakePod)
|
2006-02-24 04:48:15 +00:00
|
|
|
{
|
2009-05-09 02:31:49 +00:00
|
|
|
ACTION_PARAM_START(1);
|
|
|
|
ACTION_PARAM_CLASS(podtype, 0);
|
|
|
|
|
2008-07-21 17:03:30 +00:00
|
|
|
AActor *mo;
|
2006-02-24 04:48:15 +00:00
|
|
|
fixed_t x;
|
|
|
|
fixed_t y;
|
|
|
|
fixed_t z;
|
|
|
|
|
2008-08-10 20:48:55 +00:00
|
|
|
if (self->special1 == MAX_GEN_PODS)
|
2006-02-24 04:48:15 +00:00
|
|
|
{ // Too many generated pods
|
|
|
|
return;
|
|
|
|
}
|
2008-08-10 20:48:55 +00:00
|
|
|
x = self->x;
|
|
|
|
y = self->y;
|
|
|
|
z = self->z;
|
2009-05-09 02:31:49 +00:00
|
|
|
mo = Spawn(podtype, x, y, ONFLOORZ, ALLOW_REPLACE);
|
2008-04-08 20:52:49 +00:00
|
|
|
if (!P_CheckPosition (mo, x, y))
|
2006-02-24 04:48:15 +00:00
|
|
|
{ // Didn't fit
|
|
|
|
mo->Destroy ();
|
|
|
|
return;
|
|
|
|
}
|
2008-07-21 17:03:30 +00:00
|
|
|
mo->SetState (mo->FindState("Grow"));
|
2006-02-24 04:48:15 +00:00
|
|
|
P_ThrustMobj (mo, pr_makepod()<<24, (fixed_t)(4.5*FRACUNIT));
|
2009-05-11 21:05:40 +00:00
|
|
|
S_Sound (mo, CHAN_BODY, self->AttackSound, 1, ATTN_IDLE);
|
2008-08-10 20:48:55 +00:00
|
|
|
self->special1++; // Increment generated pod count
|
|
|
|
mo->master = self; // Link the generator to the pod
|
2006-02-24 04:48:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// PROC A_AccTeleGlitter
|
|
|
|
//
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
2008-08-10 20:48:55 +00:00
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_AccTeleGlitter)
|
2006-02-24 04:48:15 +00:00
|
|
|
{
|
2008-08-10 20:48:55 +00:00
|
|
|
if (++self->health > 35)
|
2006-02-24 04:48:15 +00:00
|
|
|
{
|
2008-08-10 20:48:55 +00:00
|
|
|
self->momz += self->momz/2;
|
2006-02-24 04:48:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-11-27 21:51:36 +00:00
|
|
|
//----------------------------------------------------------------------------
|
2006-02-24 04:48:15 +00:00
|
|
|
//
|
|
|
|
// PROC A_VolcanoSet
|
|
|
|
//
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
2008-08-10 20:48:55 +00:00
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_VolcanoSet)
|
2006-02-24 04:48:15 +00:00
|
|
|
{
|
2008-08-10 20:48:55 +00:00
|
|
|
self->tics = 105 + (pr_volcano() & 127);
|
2006-02-24 04:48:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// PROC A_VolcanoBlast
|
|
|
|
//
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
2008-08-10 20:48:55 +00:00
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_VolcanoBlast)
|
2006-02-24 04:48:15 +00:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
int count;
|
|
|
|
AActor *blast;
|
|
|
|
angle_t angle;
|
|
|
|
|
|
|
|
count = 1 + (pr_blast() % 3);
|
|
|
|
for (i = 0; i < count; i++)
|
|
|
|
{
|
2008-08-10 20:48:55 +00:00
|
|
|
blast = Spawn("VolcanoBlast", self->x, self->y,
|
|
|
|
self->z + 44*FRACUNIT, ALLOW_REPLACE);
|
|
|
|
blast->target = self;
|
2006-02-24 04:48:15 +00:00
|
|
|
angle = pr_blast () << 24;
|
|
|
|
blast->angle = angle;
|
|
|
|
angle >>= ANGLETOFINESHIFT;
|
|
|
|
blast->momx = FixedMul (1*FRACUNIT, finecosine[angle]);
|
|
|
|
blast->momy = FixedMul (1*FRACUNIT, finesine[angle]);
|
|
|
|
blast->momz = (FRACUNIT*5/2) + (pr_blast() << 10);
|
2008-08-10 20:48:55 +00:00
|
|
|
S_Sound (blast, CHAN_BODY, "world/self/shoot", 1, ATTN_NORM);
|
2006-02-24 04:48:15 +00:00
|
|
|
P_CheckMissileSpawn (blast);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// PROC A_VolcBallImpact
|
|
|
|
//
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
2008-08-10 20:48:55 +00:00
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_VolcBallImpact)
|
2006-02-24 04:48:15 +00:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
AActor *tiny;
|
|
|
|
angle_t angle;
|
|
|
|
|
2008-08-10 20:48:55 +00:00
|
|
|
if (self->z <= self->floorz)
|
2006-02-24 04:48:15 +00:00
|
|
|
{
|
2008-08-10 20:48:55 +00:00
|
|
|
self->flags |= MF_NOGRAVITY;
|
|
|
|
self->gravity = FRACUNIT;
|
|
|
|
self->z += 28*FRACUNIT;
|
|
|
|
//self->momz = 3*FRACUNIT;
|
2006-02-24 04:48:15 +00:00
|
|
|
}
|
2008-08-10 20:48:55 +00:00
|
|
|
P_RadiusAttack (self, self->target, 25, 25, NAME_Fire, true);
|
2006-02-24 04:48:15 +00:00
|
|
|
for (i = 0; i < 4; i++)
|
|
|
|
{
|
2008-08-10 20:48:55 +00:00
|
|
|
tiny = Spawn("VolcanoTBlast", self->x, self->y, self->z, ALLOW_REPLACE);
|
|
|
|
tiny->target = self;
|
2006-02-24 04:48:15 +00:00
|
|
|
angle = i*ANG90;
|
|
|
|
tiny->angle = angle;
|
|
|
|
angle >>= ANGLETOFINESHIFT;
|
|
|
|
tiny->momx = FixedMul (FRACUNIT*7/10, finecosine[angle]);
|
|
|
|
tiny->momy = FixedMul (FRACUNIT*7/10, finesine[angle]);
|
2008-09-15 14:11:05 +00:00
|
|
|
tiny->momz = FRACUNIT + (pr_volcimpact() << 9);
|
2006-02-24 04:48:15 +00:00
|
|
|
P_CheckMissileSpawn (tiny);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|