- Fixed: Macil2 and the Oracle need to be immune to SpectralLightningV2 as well as V1, since

they are both created by the first-stage Sigil. AlienSpectre3 should have also been
  immune to them but was not. In addition, Macil1 was erroneously immune to V1, when he should
  not be immune to any spectral damage. (Though, since he's immortal, all that really amounts to
  is that he can enter his pain state.)

SVN r2106 (trunk)
This commit is contained in:
Randy Heit 2010-01-08 03:24:22 +00:00
parent 74a7293133
commit 6ba548511b
10 changed files with 80 additions and 18 deletions

View file

@ -982,6 +982,7 @@ inline AActor *Spawn (const PClass *type, fixed_t x, fixed_t y, fixed_t z, repla
} }
AActor *Spawn (const char *type, fixed_t x, fixed_t y, fixed_t z, replace_t allowreplacement); AActor *Spawn (const char *type, fixed_t x, fixed_t y, fixed_t z, replace_t allowreplacement);
AActor *Spawn (FName classname, fixed_t x, fixed_t y, fixed_t z, replace_t allowreplacement);
template<class T> template<class T>
inline T *Spawn (fixed_t x, fixed_t y, fixed_t z, replace_t allowreplacement) inline T *Spawn (fixed_t x, fixed_t y, fixed_t z, replace_t allowreplacement)

View file

@ -13,6 +13,20 @@
#include "doomstat.h" #include "doomstat.h"
*/ */
class AAlienSpectre1 : public ASpectralMonster
{
DECLARE_CLASS (AAlienSpectre1, ASpectralMonster)
};
IMPLEMENT_CLASS(AAlienSpectre1);
class AAlienSpectre3 : public AAlienSpectre1
{
DECLARE_CLASS (AAlienSpectre3, AAlienSpectre1)
public:
int TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, FName damagetype);
};
IMPLEMENT_CLASS(AAlienSpectre3);
static FRandom pr_spectrespawn ("AlienSpectreSpawn"); static FRandom pr_spectrespawn ("AlienSpectreSpawn");
static FRandom pr_spectrechunk ("212e4"); static FRandom pr_spectrechunk ("212e4");
@ -190,3 +204,23 @@ DEFINE_ACTION_FUNCTION(AActor, A_AlienSpectreDeath)
S_Sound (CHAN_VOICE, voc, 1, ATTN_NORM); S_Sound (CHAN_VOICE, voc, 1, ATTN_NORM);
player->player->SetLogNumber (log); player->player->SetLogNumber (log);
} }
//============================================================================
//
// AAlienSpetre3 :: TakeSpecialDamage
//
// The third spectre type (the Oracle's) is invulnerable to the first stage
// Sigil, just like the Oracle.
//
//============================================================================
int AAlienSpectre3::TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, FName damagetype)
{
if (inflictor != NULL)
{
FName name = inflictor->GetClass()->TypeName;
if (name == NAME_SpectralLightningV1 || name == NAME_SpectralLightningV2)
return -1;
}
return Super::TakeSpecialDamage(inflictor, source, damage, damagetype);
}

View file

@ -7,29 +7,41 @@
#include "a_strifeglobal.h" #include "a_strifeglobal.h"
*/ */
// Macil (version 2) --------------------------------------------------------- // Macil (version 1) ---------------------------------------------------------
class AMacil1 : public AActor class AMacil1 : public AActor
{ {
DECLARE_CLASS (AMacil1, AActor) DECLARE_CLASS (AMacil1, AActor)
};
IMPLEMENT_CLASS (AMacil1)
// Macil (version 2) ---------------------------------------------------------
class AMacil2 : public AMacil1
{
DECLARE_CLASS (AMacil2, AMacil1)
public: public:
int TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, FName damagetype); int TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, FName damagetype);
}; };
IMPLEMENT_CLASS (AMacil1) IMPLEMENT_CLASS (AMacil2)
//============================================================================ //============================================================================
// //
// AMacil2 :: TakeSpecialDamage // AMacil2 :: TakeSpecialDamage
// //
// Macil is invulnerable to the first stage Sigil. // Macil2 is invulnerable to the first stage Sigil.
// //
//============================================================================ //============================================================================
int AMacil1::TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, FName damagetype) int AMacil2::TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, FName damagetype)
{ {
if (inflictor != NULL && inflictor->GetClass()->TypeName == NAME_SpectralLightningV1) if (inflictor != NULL)
{
FName name = inflictor->GetClass()->TypeName;
if (name == NAME_SpectralLightningV1 || name == NAME_SpectralLightningV2)
return -1; return -1;
}
return Super::TakeSpecialDamage(inflictor, source, damage, damagetype); return Super::TakeSpecialDamage(inflictor, source, damage, damagetype);
} }

View file

@ -42,7 +42,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_WakeOracleSpectre)
int AOracle::TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, FName damagetype) int AOracle::TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, FName damagetype)
{ {
if (inflictor != NULL && inflictor->GetClass()->TypeName == NAME_SpectralLightningV1) if (inflictor != NULL)
{
FName name = inflictor->GetClass()->TypeName;
if (name == NAME_SpectralLightningV1 || name == NAME_SpectralLightningV2)
return -1; return -1;
}
return Super::TakeSpecialDamage(inflictor, source, damage, damagetype); return Super::TakeSpecialDamage(inflictor, source, damage, damagetype);
} }

View file

@ -64,14 +64,14 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpectralLightning)
x = self->x + pr_zap5.Random2(3) * FRACUNIT * 50; x = self->x + pr_zap5.Random2(3) * FRACUNIT * 50;
y = self->y + pr_zap5.Random2(3) * FRACUNIT * 50; y = self->y + pr_zap5.Random2(3) * FRACUNIT * 50;
flash = Spawn (self->threshold > 25 ? PClass::FindClass("SpectralLightningV2") : flash = Spawn (self->threshold > 25 ? PClass::FindClass(NAME_SpectralLightningV2) :
PClass::FindClass("SpectralLightningV1"), x, y, ONCEILINGZ, ALLOW_REPLACE); PClass::FindClass(NAME_SpectralLightningV1), x, y, ONCEILINGZ, ALLOW_REPLACE);
flash->target = self->target; flash->target = self->target;
flash->velz = -18*FRACUNIT; flash->velz = -18*FRACUNIT;
flash->health = self->health; flash->health = self->health;
flash = Spawn("SpectralLightningV2", self->x, self->y, ONCEILINGZ, ALLOW_REPLACE); flash = Spawn(NAME_SpectralLightningV2, self->x, self->y, ONCEILINGZ, ALLOW_REPLACE);
flash->target = self->target; flash->target = self->target;
flash->velz = -18*FRACUNIT; flash->velz = -18*FRACUNIT;

View file

@ -21,6 +21,7 @@
// Include all the other Strife stuff here to reduce compile time // Include all the other Strife stuff here to reduce compile time
#include "a_acolyte.cpp" #include "a_acolyte.cpp"
#include "a_spectral.cpp"
#include "a_alienspectres.cpp" #include "a_alienspectres.cpp"
#include "a_coin.cpp" #include "a_coin.cpp"
#include "a_crusader.cpp" #include "a_crusader.cpp"
@ -33,7 +34,6 @@
#include "a_reaver.cpp" #include "a_reaver.cpp"
#include "a_rebels.cpp" #include "a_rebels.cpp"
#include "a_sentinel.cpp" #include "a_sentinel.cpp"
#include "a_spectral.cpp"
#include "a_stalker.cpp" #include "a_stalker.cpp"
#include "a_strifeitems.cpp" #include "a_strifeitems.cpp"
#include "a_strifeweapons.cpp" #include "a_strifeweapons.cpp"

View file

@ -153,6 +153,7 @@ xx(Mauler)
xx(AcolyteBlue) xx(AcolyteBlue)
xx(SpectralLightningV1) xx(SpectralLightningV1)
xx(SpectralLightningV2)
xx(TeleportDest) xx(TeleportDest)
xx(TeleportDest2) xx(TeleportDest2)

View file

@ -3674,11 +3674,21 @@ AActor *AActor::StaticSpawn (const PClass *type, fixed_t ix, fixed_t iy, fixed_t
AActor *Spawn (const char *type, fixed_t x, fixed_t y, fixed_t z, replace_t allowreplacement) AActor *Spawn (const char *type, fixed_t x, fixed_t y, fixed_t z, replace_t allowreplacement)
{ {
const PClass *cls = PClass::FindClass(type); FName classname(type, true);
if (cls == NULL) if (classname == NAME_None)
{ {
I_Error("Attempt to spawn actor of unknown type '%s'\n", type); I_Error("Attempt to spawn actor of unknown type '%s'\n", type);
} }
return Spawn(classname, x, y, z, allowreplacement);
}
AActor *Spawn (FName classname, fixed_t x, fixed_t y, fixed_t z, replace_t allowreplacement)
{
const PClass *cls = PClass::FindClass(classname);
if (cls == NULL)
{
I_Error("Attempt to spawn actor of unknown type '%s'\n", classname.GetChars());
}
return AActor::StaticSpawn (cls, x, y, z, allowreplacement); return AActor::StaticSpawn (cls, x, y, z, allowreplacement);
} }

View file

@ -1,7 +1,7 @@
// Alien Spectre 1 ----------------------------------------------------------- // Alien Spectre 1 -----------------------------------------------------------
ACTOR AlienSpectre1 : SpectralMonster 129 ACTOR AlienSpectre1 : SpectralMonster 129 native
{ {
Game Strife Game Strife
ConversationID 67,-1,-1 ConversationID 67,-1,-1
@ -100,7 +100,7 @@ ACTOR AlienSpectre2 : AlienSpectre1 75
// Alien Spectre 3 ---------------------------------------------------------- // Alien Spectre 3 ----------------------------------------------------------
// This is the Oracle's personal spectre, so it's a little different. // This is the Oracle's personal spectre, so it's a little different.
ACTOR AlienSpectre3 : AlienSpectre1 76 ACTOR AlienSpectre3 : AlienSpectre1 76 native
{ {
Game Strife Game Strife
ConversationID 71,-1,-1 ConversationID 71,-1,-1

View file

@ -56,7 +56,7 @@ ACTOR Macil1 64 native
// Macil (version 2) --------------------------------------------------------- // Macil (version 2) ---------------------------------------------------------
ACTOR Macil2 : Macil1 200 ACTOR Macil2 : Macil1 200 native
{ {
Game Strife Game Strife
ConversationID 50, 49, 50 ConversationID 50, 49, 50