2006-02-24 04:48:15 +00:00
|
|
|
#include "actor.h"
|
|
|
|
#include "info.h"
|
|
|
|
#include "m_random.h"
|
|
|
|
#include "s_sound.h"
|
|
|
|
#include "p_local.h"
|
|
|
|
#include "p_enemy.h"
|
|
|
|
#include "gstrings.h"
|
|
|
|
#include "a_action.h"
|
2007-05-28 14:46:49 +00:00
|
|
|
#include "thingdef/thingdef.h"
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// Mancubus attack,
|
|
|
|
// firing three missiles in three different directions?
|
|
|
|
// Doesn't look like it.
|
|
|
|
//
|
|
|
|
#define FATSPREAD (ANG90/8)
|
|
|
|
|
|
|
|
void A_FatRaise (AActor *self)
|
|
|
|
{
|
|
|
|
A_FaceTarget (self);
|
|
|
|
S_Sound (self, CHAN_WEAPON, "fatso/raiseguns", 1, ATTN_NORM);
|
|
|
|
}
|
|
|
|
|
|
|
|
void A_FatAttack1 (AActor *self)
|
|
|
|
{
|
|
|
|
AActor *missile;
|
|
|
|
angle_t an;
|
|
|
|
|
|
|
|
if (!self->target)
|
|
|
|
return;
|
|
|
|
|
2006-05-10 02:40:43 +00:00
|
|
|
const PClass *spawntype = NULL;
|
2006-02-24 04:48:15 +00:00
|
|
|
int index = CheckIndex (1, NULL);
|
2006-05-10 15:07:14 +00:00
|
|
|
if (index >= 0) spawntype = PClass::FindClass ((ENamedName)StateParameters[index]);
|
2006-11-04 22:26:04 +00:00
|
|
|
if (spawntype == NULL) spawntype = PClass::FindClass("FatShot");
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
A_FaceTarget (self);
|
|
|
|
// Change direction to ...
|
|
|
|
self->angle += FATSPREAD;
|
|
|
|
P_SpawnMissile (self, self->target, spawntype);
|
|
|
|
|
|
|
|
missile = P_SpawnMissile (self, self->target, spawntype);
|
|
|
|
if (missile != NULL)
|
|
|
|
{
|
|
|
|
missile->angle += FATSPREAD;
|
|
|
|
an = missile->angle >> ANGLETOFINESHIFT;
|
|
|
|
missile->momx = FixedMul (missile->Speed, finecosine[an]);
|
|
|
|
missile->momy = FixedMul (missile->Speed, finesine[an]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void A_FatAttack2 (AActor *self)
|
|
|
|
{
|
|
|
|
AActor *missile;
|
|
|
|
angle_t an;
|
|
|
|
|
|
|
|
if (!self->target)
|
|
|
|
return;
|
|
|
|
|
2006-05-10 02:40:43 +00:00
|
|
|
const PClass *spawntype = NULL;
|
2006-02-24 04:48:15 +00:00
|
|
|
int index = CheckIndex (1, NULL);
|
2006-05-10 15:07:14 +00:00
|
|
|
if (index >= 0) spawntype = PClass::FindClass ((ENamedName)StateParameters[index]);
|
2006-11-04 22:26:04 +00:00
|
|
|
if (spawntype == NULL) spawntype = PClass::FindClass("FatShot");
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
A_FaceTarget (self);
|
|
|
|
// Now here choose opposite deviation.
|
|
|
|
self->angle -= FATSPREAD;
|
|
|
|
P_SpawnMissile (self, self->target, spawntype);
|
|
|
|
|
|
|
|
missile = P_SpawnMissile (self, self->target, spawntype);
|
|
|
|
if (missile != NULL)
|
|
|
|
{
|
|
|
|
missile->angle -= FATSPREAD*2;
|
|
|
|
an = missile->angle >> ANGLETOFINESHIFT;
|
|
|
|
missile->momx = FixedMul (missile->Speed, finecosine[an]);
|
|
|
|
missile->momy = FixedMul (missile->Speed, finesine[an]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void A_FatAttack3 (AActor *self)
|
|
|
|
{
|
|
|
|
AActor *missile;
|
|
|
|
angle_t an;
|
|
|
|
|
|
|
|
if (!self->target)
|
|
|
|
return;
|
|
|
|
|
2006-05-10 02:40:43 +00:00
|
|
|
const PClass *spawntype = NULL;
|
2006-02-24 04:48:15 +00:00
|
|
|
int index = CheckIndex (1, NULL);
|
2006-05-10 15:07:14 +00:00
|
|
|
if (index >= 0) spawntype = PClass::FindClass ((ENamedName)StateParameters[index]);
|
2006-11-04 22:26:04 +00:00
|
|
|
if (spawntype == NULL) spawntype = PClass::FindClass("FatShot");
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
A_FaceTarget (self);
|
|
|
|
|
|
|
|
missile = P_SpawnMissile (self, self->target, spawntype);
|
|
|
|
if (missile != NULL)
|
|
|
|
{
|
|
|
|
missile->angle -= FATSPREAD/2;
|
|
|
|
an = missile->angle >> ANGLETOFINESHIFT;
|
|
|
|
missile->momx = FixedMul (missile->Speed, finecosine[an]);
|
|
|
|
missile->momy = FixedMul (missile->Speed, finesine[an]);
|
|
|
|
}
|
|
|
|
|
|
|
|
missile = P_SpawnMissile (self, self->target, spawntype);
|
|
|
|
if (missile != NULL)
|
|
|
|
{
|
|
|
|
missile->angle += FATSPREAD/2;
|
|
|
|
an = missile->angle >> ANGLETOFINESHIFT;
|
|
|
|
missile->momx = FixedMul (missile->Speed, finecosine[an]);
|
|
|
|
missile->momy = FixedMul (missile->Speed, finesine[an]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// killough 9/98: a mushroom explosion effect, sorta :)
|
|
|
|
// Original idea: Linguica
|
|
|
|
//
|
|
|
|
|
|
|
|
void A_Mushroom (AActor *actor)
|
|
|
|
{
|
- Added the ACS commands
ReplaceTextures (str old_texture, str new_texture, optional bool not_lower,
optional bool not_mid, optional bool not_upper, optional bool not_floor,
optional bool not_ceiling); and
SectorDamage (int tag, int amount, str type, bool players_only, bool in_air,
str protection_item, bool subclasses_okay);
- Added the vid_nowidescreen cvar to disable widescreen aspect ratio
correction. When this is enabled, the only display ratio available is 4:3
(and 5:4 if vid_tft is set).
- Added support for setting an actor's damage property to an expression
through decorate. Just enclose it within parentheses, and the expression
will be evaluated exactly as-is without the normal Doom damage calculation.
So if you want something that does exactly 6 damage, use a "Damage (6)"
property. To deal normal Doom missile damage, you can use
"Damage (random(1,8)*6)" instead of "Damage 6".
- Moved InvFirst and InvSel into APlayerPawn so that they can be consistantly
maintained by ObtainInventory.
SVN r288 (trunk)
2006-08-12 02:30:57 +00:00
|
|
|
int i, j, n = actor->GetMissileDamage (0, 1);
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2006-05-10 02:40:43 +00:00
|
|
|
const PClass *spawntype = NULL;
|
2008-07-19 12:40:10 +00:00
|
|
|
int index = CheckIndex (2, NULL);
|
2006-02-24 04:48:15 +00:00
|
|
|
if (index >= 0)
|
|
|
|
{
|
2006-05-10 15:07:14 +00:00
|
|
|
spawntype = PClass::FindClass((ENamedName)StateParameters[index]);
|
2006-04-11 08:36:23 +00:00
|
|
|
n = EvalExpressionI (StateParameters[index+1], actor);
|
2006-02-24 04:48:15 +00:00
|
|
|
if (n == 0)
|
- Added the ACS commands
ReplaceTextures (str old_texture, str new_texture, optional bool not_lower,
optional bool not_mid, optional bool not_upper, optional bool not_floor,
optional bool not_ceiling); and
SectorDamage (int tag, int amount, str type, bool players_only, bool in_air,
str protection_item, bool subclasses_okay);
- Added the vid_nowidescreen cvar to disable widescreen aspect ratio
correction. When this is enabled, the only display ratio available is 4:3
(and 5:4 if vid_tft is set).
- Added support for setting an actor's damage property to an expression
through decorate. Just enclose it within parentheses, and the expression
will be evaluated exactly as-is without the normal Doom damage calculation.
So if you want something that does exactly 6 damage, use a "Damage (6)"
property. To deal normal Doom missile damage, you can use
"Damage (random(1,8)*6)" instead of "Damage 6".
- Moved InvFirst and InvSel into APlayerPawn so that they can be consistantly
maintained by ObtainInventory.
SVN r288 (trunk)
2006-08-12 02:30:57 +00:00
|
|
|
n = actor->GetMissileDamage (0, 1);
|
2006-02-24 04:48:15 +00:00
|
|
|
}
|
2006-11-04 22:26:04 +00:00
|
|
|
if (spawntype == NULL) spawntype = PClass::FindClass("FatShot");
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
A_Explode (actor); // First make normal explosion
|
|
|
|
|
|
|
|
// Now launch mushroom cloud
|
2008-03-20 21:12:03 +00:00
|
|
|
AActor *target = Spawn("Mapspot", 0, 0, 0, NO_REPLACE); // We need something to aim at.
|
|
|
|
target->height = actor->height;
|
2006-02-24 04:48:15 +00:00
|
|
|
for (i = -n; i <= n; i += 8)
|
|
|
|
{
|
|
|
|
for (j = -n; j <= n; j += 8)
|
|
|
|
{
|
2008-03-20 21:12:03 +00:00
|
|
|
AActor *mo;
|
|
|
|
target->x = actor->x + (i << FRACBITS); // Aim in many directions from source
|
|
|
|
target->y = actor->y + (j << FRACBITS);
|
|
|
|
target->z = actor->z + (P_AproxDistance(i,j) << (FRACBITS+2)); // Aim up fairly high
|
|
|
|
mo = P_SpawnMissile (actor, target, spawntype); // Launch fireball
|
2006-02-24 04:48:15 +00:00
|
|
|
if (mo != NULL)
|
|
|
|
{
|
|
|
|
mo->momx >>= 1;
|
|
|
|
mo->momy >>= 1; // Slow it down a bit
|
|
|
|
mo->momz >>= 1;
|
|
|
|
mo->flags &= ~MF_NOGRAVITY; // Make debris fall under gravity
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2008-03-20 21:12:03 +00:00
|
|
|
target->Destroy();
|
2006-02-24 04:48:15 +00:00
|
|
|
}
|