- Converted Strife's Programmer, Loremaster and Thingstoblowup to DECORATE.

- Fixed: Attacking a merchant in Strife didn't alert the enemies.


SVN r1121 (trunk)
This commit is contained in:
Christoph Oelckers 2008-08-06 22:59:24 +00:00
parent bf281a4372
commit 535f209560
17 changed files with 444 additions and 545 deletions

View file

@ -1,8 +1,10 @@
August 6, 2008
- The x87 precision control is now explicitly set for double precision, since
GCC defaults to extended precision instead, unlike Visual C++.
August 6, 2008
- The x87 precision control is now explicitly set for double precision, since
GCC defaults to extended precision instead, unlike Visual C++.
August 6, 2008 (Changes by Graf Zahl)
- Converted Strife's Programmer, Loremaster and Thingstoblowup to DECORATE.
- Fixed: Attacking a merchant in Strife didn't alert the enemies.
- Removed AT_GAME_SET(PowerInvulnerable) due to the problems it caused. The two
occurences in the code that depended on it were changed accordingly.
Invulnerability colormaps are now being set by the items exclusively.

View file

@ -108,6 +108,8 @@ ACTOR(CheckForReload)
ACTOR(ResetReloadCounter)
ACTOR(ClearReFire)
ACTOR(SpawnSingleItem)
ACTOR(GiveQuestItem)
ACTOR(Bang4Cloud)
ACTOR(M_Refire)
ACTOR(M_CheckAttack)
@ -280,6 +282,13 @@ ACTOR(EntityDeath)
ACTOR(EntityAttack)
ACTOR(SubEntityDeath)
ACTOR(SpawnEntity)
ACTOR(ProgrammerMelee)
ACTOR(SpawnProgrammerBase)
ACTOR(ProgrammerDeath)
ACTOR(LoremasterChain)
ACTOR(ExtraLightOff)
ACTOR(Explode512)
ACTOR(LightGoesOut)
// Special code pointers for Strife's player - not to be used elsewhere!
ACTOR(ItBurnsItBurns)

View file

@ -31,11 +31,11 @@
#define mkdir(a,b) _mkdir (a)
#else
#include <sys/stat.h>
#endif
#ifdef HAVE_FPU_CONTROL
#include <fpu_control.h>
#endif
#endif
#ifdef HAVE_FPU_CONTROL
#include <fpu_control.h>
#endif
#include <float.h>
#ifdef unix
@ -2073,20 +2073,20 @@ void D_DoomMain (void)
const IWADInfo *iwad_info;
srand(I_MSTime());
// Set the FPU precision to 53 significant bits. This is the default
// for Visual C++, but not for GCC, so some slight math variances
// might crop up if we leave it alone.
#if defined(_FPU_GETCW)
{
int cw;
_FPU_GETCW(cw);
cw = (cw & ~_FPU_EXTENDED) | _FPU_DOUBLE;
_FPU_SETCW(cw);
}
#elif defined(_PC_53)
_control87(_PC_53, _MCW_PC);
#endif
// Set the FPU precision to 53 significant bits. This is the default
// for Visual C++, but not for GCC, so some slight math variances
// might crop up if we leave it alone.
#if defined(_FPU_GETCW)
{
int cw;
_FPU_GETCW(cw);
cw = (cw & ~_FPU_EXTENDED) | _FPU_DOUBLE;
_FPU_SETCW(cw);
}
#elif defined(_PC_53)
_control87(_PC_53, _MCW_PC);
#endif
PClass::StaticInit ();
atterm (C_DeinitConsole);

View file

@ -394,6 +394,16 @@ void PClass::FreeStateList ()
}
}
const PClass *PClass::NativeClass() const
{
const PClass *cls = this;
while (cls && cls->bRuntimeClass == 1)
cls = cls->ParentClass;
return cls;
}
// Symbol tables ------------------------------------------------------------
PSymbol::~PSymbol()

View file

@ -116,6 +116,7 @@ struct PClass
void InitializeActorInfo ();
void BuildFlatPointers ();
void FreeStateList();
const PClass *NativeClass() const;
// Returns true if this type is an ancestor of (or same as) the passed type.
bool IsAncestorOf (const PClass *ti) const

View file

@ -25,21 +25,11 @@ static void GenericSpectreSpawn (AActor *actor, const char *type)
}
}
void A_SpawnSpectre3 (AActor *actor)
{
GenericSpectreSpawn (actor, "AlienSpectre3");
}
void A_SpawnSpectre4 (AActor *actor)
{
GenericSpectreSpawn (actor, "AlienSpectre4");
}
void A_SpawnSpectre5 (AActor *actor)
{
GenericSpectreSpawn (actor, "AlienSpectre5");
}
void A_SpectreChunkSmall (AActor *self)
{
AActor *foo = Spawn("AlienChunkSmall", self->x, self->y, self->z + 10*FRACUNIT, ALLOW_REPLACE);

View file

@ -6,144 +6,16 @@
#include "p_local.h"
#include "s_sound.h"
static FRandom pr_atk1 ("FooMelee");
void A_SentinelBob (AActor *);
void A_SpawnSpectre5 (AActor *);
void A_SpectreMelee (AActor *);
void A_LoremasterAttack (AActor *);
void A_LoremasterChain (AActor *);
// Loremaster (aka Priest) --------------------------------------------------
class ALoremaster : public AActor
{
DECLARE_ACTOR (ALoremaster, AActor)
public:
void NoBlockingSet ();
};
FState ALoremaster::States[] =
{
#define S_PRIEST_STND 0
S_NORMAL (PRST, 'A', 10, A_Look, &States[S_PRIEST_STND+1]),
S_NORMAL (PRST, 'B', 10, A_SentinelBob, &States[S_PRIEST_STND]),
#define S_PRIEST_RUN (S_PRIEST_STND+2)
S_NORMAL (PRST, 'A', 4, A_Chase, &States[S_PRIEST_RUN+1]),
S_NORMAL (PRST, 'A', 4, A_SentinelBob, &States[S_PRIEST_RUN+2]),
S_NORMAL (PRST, 'B', 4, A_Chase, &States[S_PRIEST_RUN+3]),
S_NORMAL (PRST, 'B', 4, A_SentinelBob, &States[S_PRIEST_RUN+4]),
S_NORMAL (PRST, 'C', 4, A_Chase, &States[S_PRIEST_RUN+5]),
S_NORMAL (PRST, 'C', 4, A_SentinelBob, &States[S_PRIEST_RUN+6]),
S_NORMAL (PRST, 'D', 4, A_Chase, &States[S_PRIEST_RUN+7]),
S_NORMAL (PRST, 'D', 4, A_SentinelBob, &States[S_PRIEST_RUN]),
#define S_PRIEST_MELEE (S_PRIEST_RUN+8)
S_NORMAL (PRST, 'E', 4, A_FaceTarget, &States[S_PRIEST_MELEE+1]),
S_NORMAL (PRST, 'F', 4, A_SpectreMelee, &States[S_PRIEST_MELEE+2]),
S_NORMAL (PRST, 'E', 4, A_SentinelBob, &States[S_PRIEST_RUN]),
#define S_PRIEST_MISSILE (S_PRIEST_MELEE+3)
S_NORMAL (PRST, 'E', 4, A_FaceTarget, &States[S_PRIEST_MISSILE+1]),
S_NORMAL (PRST, 'F', 4, A_LoremasterAttack, &States[S_PRIEST_MISSILE+2]),
S_NORMAL (PRST, 'E', 4, A_SentinelBob, &States[S_PRIEST_RUN]),
#define S_PRIEST_DIE (S_PRIEST_MISSILE+3)
S_NORMAL (PDED, 'A', 6, NULL, &States[S_PRIEST_DIE+1]),
S_NORMAL (PDED, 'B', 6, A_Scream, &States[S_PRIEST_DIE+2]),
S_NORMAL (PDED, 'C', 6, NULL, &States[S_PRIEST_DIE+3]),
S_NORMAL (PDED, 'D', 6, A_NoBlocking, &States[S_PRIEST_DIE+4]),
S_NORMAL (PDED, 'E', 6, NULL, &States[S_PRIEST_DIE+5]),
S_NORMAL (PDED, 'F', 5, NULL, &States[S_PRIEST_DIE+6]),
S_NORMAL (PDED, 'G', 5, NULL, &States[S_PRIEST_DIE+7]),
S_NORMAL (PDED, 'H', 5, NULL, &States[S_PRIEST_DIE+8]),
S_NORMAL (PDED, 'I', 5, NULL, &States[S_PRIEST_DIE+9]),
S_NORMAL (PDED, 'J', 5, NULL, &States[S_PRIEST_DIE+10]),
S_NORMAL (PDED, 'K', 5, NULL, &States[S_PRIEST_DIE+11]),
S_NORMAL (PDED, 'L', 5, NULL, &States[S_PRIEST_DIE+12]),
S_NORMAL (PDED, 'M', 4, NULL, &States[S_PRIEST_DIE+13]),
S_NORMAL (PDED, 'N', 4, NULL, &States[S_PRIEST_DIE+14]),
S_NORMAL (PDED, 'O', 4, NULL, &States[S_PRIEST_DIE+15]),
S_NORMAL (PDED, 'P', 4, NULL, &States[S_PRIEST_DIE+16]),
S_NORMAL (PDED, 'Q', 4, A_SpawnSpectre5, &States[S_PRIEST_DIE+17]),
S_NORMAL (PDED, 'R', 4, NULL, &States[S_PRIEST_DIE+18]),
S_NORMAL (PDED, 'S', 4, NULL, &States[S_PRIEST_DIE+19]),
S_NORMAL (PDED, 'T', -1, NULL, NULL),
};
IMPLEMENT_ACTOR (ALoremaster, Strife, 12, 0)
PROP_StrifeType (66)
PROP_StrifeTeaserType (63)
PROP_StrifeTeaserType2 (64)
PROP_SpawnHealth (800)
PROP_SpawnState (S_PRIEST_STND)
PROP_SeeState (S_PRIEST_RUN)
PROP_MeleeState (S_PRIEST_MELEE)
PROP_MissileState (S_PRIEST_MISSILE)
PROP_DeathState (S_PRIEST_DIE)
PROP_SpeedFixed (10)
PROP_RadiusFixed (15)
PROP_HeightFixed (56)
PROP_FloatSpeed (5)
PROP_Flags (MF_SOLID|MF_SHOOTABLE|MF_NOGRAVITY|MF_FLOAT|
MF_NOBLOOD|MF_COUNTKILL|MF_NOTDMATCH)
PROP_Flags2 (MF2_FLOORCLIP|MF2_PASSMOBJ|MF2_PUSHWALL|MF2_MCROSS)
PROP_Flags3 (MF3_NOBLOCKMONST)
PROP_Flags4 (MF4_INCOMBAT|MF4_LOOKALLAROUND|MF4_FIRERESIST|MF4_NOICEDEATH)
PROP_MinMissileChance (150)
PROP_Tag ("PRIEST")
PROP_SeeSound ("loremaster/sight")
PROP_AttackSound ("loremaster/attack")
PROP_PainSound ("loremaster/pain")
PROP_DeathSound ("loremaster/death")
PROP_ActiveSound ("loremaster/active")
PROP_Obituary ("$OB_LOREMASTER")
END_DEFAULTS
//============================================================================
//
// ALoremaster :: NoBlockingSet
//
//============================================================================
void ALoremaster::NoBlockingSet ()
{
P_DropItem (this, "Junk", -1, 256);
}
// Loremaster Projectile ----------------------------------------------------
class ALoreShot : public AActor
{
DECLARE_ACTOR (ALoreShot, AActor)
DECLARE_CLASS (ALoreShot, AActor)
public:
int DoSpecialDamage (AActor *target, int damage);
};
FState ALoreShot::States[] =
{
S_NORMAL (OCLW, 'A', 2, A_LoremasterChain, &States[0]),
S_NORMAL (CCLW, 'A', 6, NULL, NULL)
};
IMPLEMENT_ACTOR (ALoreShot, Strife, -1, 0)
PROP_StrifeType (97)
PROP_SpawnState (0)
PROP_DeathState (1)
PROP_SpeedFixed (20)
PROP_RadiusFixed (10)
PROP_HeightFixed (14)
PROP_Damage (2)
PROP_Flags (MF_NOBLOCKMAP|MF_NOGRAVITY|MF_DROPOFF|MF_MISSILE)
PROP_Flags2 (MF2_NOTELEPORT|MF2_IMPACT|MF2_PCROSS)
PROP_Flags4 (MF4_STRIFEDAMAGE)
PROP_MaxStepHeight (4)
PROP_SeeSound ("loremaster/chain")
PROP_ActiveSound ("loremaster/swish")
END_DEFAULTS
IMPLEMENT_CLASS (ALoreShot)
int ALoreShot::DoSpecialDamage (AActor *target, int damage)
{
@ -165,50 +37,10 @@ int ALoreShot::DoSpecialDamage (AActor *target, int damage)
return damage;
}
// Loremaster Subprojectile -------------------------------------------------
class ALoreShot2 : public AActor
{
DECLARE_ACTOR (ALoreShot2, AActor)
};
FState ALoreShot2::States[] =
{
S_NORMAL (TEND, 'A', 20, NULL, NULL)
};
IMPLEMENT_ACTOR (ALoreShot2, Strife, -1, 0)
PROP_StrifeType (98)
PROP_SpawnState (0)
PROP_Flags (MF_NOBLOCKMAP|MF_NOGRAVITY)
PROP_SeeSound ("loremaster/active")
END_DEFAULTS
void A_SpectreMelee (AActor *self)
{
int damage;
if (self->target == NULL)
return;
damage = (pr_atk1() & 9) * 5;
P_DamageMobj (self->target, self, self, damage, NAME_None);
P_TraceBleed (damage, self->target, self);
}
void A_LoremasterAttack (AActor *self)
{
if (self->target != NULL)
{
P_SpawnMissile (self, self->target, RUNTIME_CLASS(ALoreShot));
}
}
void A_LoremasterChain (AActor *self)
{
S_Sound (self, CHAN_BODY, "loremaster/active", 1, ATTN_NORM);
Spawn<ALoreShot2> (self->x, self->y, self->z, ALLOW_REPLACE);
Spawn<ALoreShot2> (self->x - (self->momx >> 1), self->y - (self->momy >> 1), self->z - (self->momz >> 1), ALLOW_REPLACE);
Spawn<ALoreShot2> (self->x - self->momx, self->y - self->momy, self->z - self->momz, ALLOW_REPLACE);
Spawn("LoreShot2", self->x, self->y, self->z, ALLOW_REPLACE);
Spawn("LoreShot2", self->x - (self->momx >> 1), self->y - (self->momy >> 1), self->z - (self->momz >> 1), ALLOW_REPLACE);
Spawn("LoreShot2", self->x - self->momx, self->y - self->momy, self->z - self->momz, ALLOW_REPLACE);
}

View file

@ -9,165 +9,18 @@
static FRandom pr_prog ("Programmer");
void A_SentinelBob (AActor *);
void A_TossGib (AActor *);
void A_Countdown (AActor *);
void A_ProgrammerMelee (AActor *);
void A_SpotLightning (AActor *);
void A_SpawnProgrammerBase (AActor *);
void A_ProgrammerDeath (AActor *);
// Programmer ---------------------------------------------------------------
class AProgrammer : public AActor
{
DECLARE_ACTOR (AProgrammer, AActor)
public:
void NoBlockingSet ();
};
FState AProgrammer::States[] =
{
#define S_PROG_STND 0
S_NORMAL (PRGR, 'A', 5, A_Look, &States[S_PROG_STND+1]),
S_NORMAL (PRGR, 'A', 1, A_SentinelBob, &States[S_PROG_STND]),
#define S_PROG_CHASE (S_PROG_STND+2)
S_NORMAL (PRGR, 'A', 160, A_SentinelBob, &States[S_PROG_CHASE+1]),
S_NORMAL (PRGR, 'B', 5, A_SentinelBob, &States[S_PROG_CHASE+2]),
S_NORMAL (PRGR, 'C', 5, A_SentinelBob, &States[S_PROG_CHASE+3]),
S_NORMAL (PRGR, 'D', 5, A_SentinelBob, &States[S_PROG_CHASE+4]),
S_NORMAL (PRGR, 'E', 2, A_SentinelBob, &States[S_PROG_CHASE+5]),
S_NORMAL (PRGR, 'F', 2, A_SentinelBob, &States[S_PROG_CHASE+6]),
S_NORMAL (PRGR, 'E', 3, A_Chase, &States[S_PROG_CHASE+7]),
S_NORMAL (PRGR, 'F', 3, A_Chase, &States[S_PROG_CHASE+4]),
#define S_PROG_MELEE (S_PROG_CHASE+8)
S_NORMAL (PRGR, 'E', 2, A_SentinelBob, &States[S_PROG_MELEE+1]),
S_NORMAL (PRGR, 'F', 3, A_SentinelBob, &States[S_PROG_MELEE+2]),
S_NORMAL (PRGR, 'E', 3, A_FaceTarget, &States[S_PROG_MELEE+4]),
S_NORMAL (PRGR, 'F', 4, A_ProgrammerMelee, &States[S_PROG_CHASE+4]),
#define S_PROG_MISSILE (S_PROG_MELEE+4)
S_NORMAL (PRGR, 'G', 5, A_FaceTarget, &States[S_PROG_MISSILE+1]),
S_NORMAL (PRGR, 'H', 5, A_SentinelBob, &States[S_PROG_MISSILE+2]),
S_BRIGHT (PRGR, 'I', 5, A_FaceTarget, &States[S_PROG_MISSILE+3]),
S_BRIGHT (PRGR, 'J', 5, A_SpotLightning, &States[S_PROG_CHASE+4]),
#define S_PROG_PAIN (S_PROG_MISSILE+4)
S_NORMAL (PRGR, 'K', 5, A_Pain, &States[S_PROG_PAIN+1]),
S_NORMAL (PRGR, 'L', 5, A_SentinelBob, &States[S_PROG_CHASE+4]),
#define S_PROG_DIE (S_PROG_PAIN+2)
S_BRIGHT (PRGR, 'L', 7, A_TossGib, &States[S_PROG_DIE+1]),
S_BRIGHT (PRGR, 'M', 7, A_Scream, &States[S_PROG_DIE+2]),
S_BRIGHT (PRGR, 'N', 7, A_TossGib, &States[S_PROG_DIE+3]),
S_BRIGHT (PRGR, 'O', 7, A_NoBlocking, &States[S_PROG_DIE+4]),
S_BRIGHT (PRGR, 'P', 7, A_TossGib, &States[S_PROG_DIE+5]),
S_BRIGHT (PRGR, 'Q', 7, A_SpawnProgrammerBase,&States[S_PROG_DIE+6]),
S_BRIGHT (PRGR, 'R', 7, NULL, &States[S_PROG_DIE+7]),
S_BRIGHT (PRGR, 'S', 6, NULL, &States[S_PROG_DIE+8]),
S_BRIGHT (PRGR, 'T', 5, NULL, &States[S_PROG_DIE+9]),
S_BRIGHT (PRGR, 'U', 5, NULL, &States[S_PROG_DIE+10]),
S_BRIGHT (PRGR, 'V', 5, NULL, &States[S_PROG_DIE+11]),
S_BRIGHT (PRGR, 'W', 5, NULL, &States[S_PROG_DIE+12]),
S_BRIGHT (PRGR, 'X', 32, NULL, &States[S_PROG_DIE+13]),
S_BRIGHT (PRGR, 'X', -1, A_ProgrammerDeath, NULL)
};
IMPLEMENT_ACTOR (AProgrammer, Strife, 71, 0)
PROP_StrifeType (95)
PROP_SpawnHealth (1100)
PROP_SpawnState (S_PROG_STND)
PROP_SeeState (S_PROG_CHASE)
PROP_PainState (S_PROG_PAIN)
PROP_PainChance (50)
PROP_MeleeState (S_PROG_MELEE)
PROP_MissileState (S_PROG_MISSILE)
PROP_DeathState (S_PROG_DIE)
PROP_SpeedFixed (26)
PROP_FloatSpeed (5)
PROP_RadiusFixed (45)
PROP_HeightFixed (60)
PROP_Mass (800)
PROP_Damage (4)
PROP_Flags (MF_SOLID|MF_SHOOTABLE|MF_NOGRAVITY|MF_FLOAT|
MF_NOBLOOD|MF_COUNTKILL|MF_NOTDMATCH)
PROP_Flags2 (MF2_PASSMOBJ|MF2_PUSHWALL|MF2_MCROSS)
PROP_Flags3 (MF3_DONTMORPH|MF3_NOBLOCKMONST)
PROP_Flags4 (MF4_LOOKALLAROUND|MF4_FIRERESIST|MF4_NOICEDEATH|MF4_NOTARGETSWITCH)
PROP_MinMissileChance (150)
PROP_AttackSound ("programmer/attack")
PROP_PainSound ("programmer/pain")
PROP_DeathSound ("programmer/death")
PROP_ActiveSound ("programmer/active")
PROP_Obituary ("$OB_PROGRAMMER")
END_DEFAULTS
//============================================================================
//
// AProgrammer :: NoBlockingSet
//
//============================================================================
void AProgrammer::NoBlockingSet ()
{
P_DropItem (this, "Sigil1", -1, 256);
}
// The Programmer's base for when he dies -----------------------------------
class AProgrammerBase : public AActor
{
DECLARE_ACTOR (AProgrammerBase, AActor)
public:
void GetExplodeParms (int &damage, int &dist, bool &hurtSource);
};
FState AProgrammerBase::States[] =
{
S_BRIGHT (BASE, 'A', 5, A_ExplodeAndAlert, &States[1]),
S_BRIGHT (BASE, 'B', 5, NULL, &States[2]),
S_BRIGHT (BASE, 'C', 5, NULL, &States[3]),
S_BRIGHT (BASE, 'D', 5, NULL, &States[4]),
S_NORMAL (BASE, 'E', 5, NULL, &States[5]),
S_NORMAL (BASE, 'F', 5, NULL, &States[6]),
S_NORMAL (BASE, 'G', 5, NULL, &States[7]),
S_NORMAL (BASE, 'H', -1, NULL, NULL)
};
IMPLEMENT_ACTOR (AProgrammerBase, Strife, -1, 0)
PROP_StrifeType (96)
PROP_SpawnState (0)
PROP_Flags (MF_NOBLOCKMAP|MF_NOCLIP|MF_NOBLOOD)
END_DEFAULTS
//============================================================================
//
// AProgrammerBase :: GetExplodeParms
//
//============================================================================
void AProgrammerBase::GetExplodeParms (int &damage, int &dist, bool &hurtSource)
{
damage = dist = 32;
}
// The Programmer level ending thing ----------------------------------------
// [RH] I took some liberties to make this "cooler" than it was in Strife.
class AProgLevelEnder : public AInventory
{
DECLARE_STATELESS_ACTOR (AProgLevelEnder, AInventory)
DECLARE_CLASS (AProgLevelEnder, AInventory)
public:
void Tick ();
PalEntry GetBlend ();
};
IMPLEMENT_STATELESS_ACTOR (AProgLevelEnder, Strife, -1, 0)
PROP_Inventory_FlagsSet (IF_UNDROPPABLE)
END_DEFAULTS
IMPLEMENT_CLASS (AProgLevelEnder)
//============================================================================
//
@ -266,7 +119,7 @@ void A_SpotLightning (AActor *self)
void A_SpawnProgrammerBase (AActor *self)
{
AActor *foo = Spawn<AProgrammerBase> (self->x, self->y, self->z + 24*FRACUNIT, ALLOW_REPLACE);
AActor *foo = Spawn("ProgrammerBase", self->x, self->y, self->z + 24*FRACUNIT, ALLOW_REPLACE);
if (foo != NULL)
{
foo->angle = self->angle + ANGLE_180 + (pr_prog.Random2() << 22);
@ -297,5 +150,4 @@ void A_ProgrammerDeath (AActor *self)
}
// the sky change scripts are now done as special actions in MAPINFO
A_BossDeath(self);
//P_StartScript (self, NULL, 250, NULL, 0, 0, 0, 0, false, false);
}

View file

@ -5,54 +5,13 @@
#include "p_enemy.h"
#include "a_action.h"
#include "gstrings.h"
#include "thingdef/thingdef.h"
static FRandom pr_bang4cloud ("Bang4Cloud");
static FRandom pr_lightout ("LightOut");
extern const PClass *QuestItemClasses[31];
void A_TossGib (AActor *);
void A_LoopActiveSound (AActor *);
void A_LightGoesOut (AActor *);
// A Cloud used for varius explosions ---------------------------------------
// This actor has no direct equivalent in strife. To create this, Strife
// spawned a spark and then changed its state to that of this explosion
// cloud. Weird.
class ABang4Cloud : public AActor
{
DECLARE_ACTOR (ABang4Cloud, AActor);
public:
void BeginPlay ()
{
momz = FRACUNIT;
}
};
FState ABang4Cloud::States[] =
{
S_BRIGHT (BNG4, 'B', 3, NULL, &States[1]),
S_BRIGHT (BNG4, 'C', 3, NULL, &States[2]),
S_BRIGHT (BNG4, 'D', 3, NULL, &States[3]),
S_BRIGHT (BNG4, 'E', 3, NULL, &States[4]),
S_BRIGHT (BNG4, 'F', 3, NULL, &States[5]),
S_BRIGHT (BNG4, 'G', 3, NULL, &States[6]),
S_BRIGHT (BNG4, 'H', 3, NULL, &States[7]),
S_BRIGHT (BNG4, 'I', 3, NULL, &States[8]),
S_BRIGHT (BNG4, 'J', 3, NULL, &States[9]),
S_BRIGHT (BNG4, 'K', 3, NULL, &States[10]),
S_BRIGHT (BNG4, 'L', 3, NULL, &States[11]),
S_BRIGHT (BNG4, 'M', 3, NULL, &States[12]),
S_BRIGHT (BNG4, 'N', 3, NULL, NULL)
};
IMPLEMENT_ACTOR (ABang4Cloud, Strife, -1, 0)
PROP_SpawnState (0)
PROP_Flags (MF_NOBLOCKMAP|MF_NOGRAVITY)
PROP_RenderStyle (STYLE_Add)
END_DEFAULTS
void A_Bang4Cloud (AActor *self)
{
fixed_t spawnx, spawny;
@ -60,14 +19,17 @@ void A_Bang4Cloud (AActor *self)
spawnx = self->x + (pr_bang4cloud.Random2() & 3) * 10240;
spawny = self->y + (pr_bang4cloud.Random2() & 3) * 10240;
Spawn<ABang4Cloud> (spawnx, spawny, self->z, ALLOW_REPLACE);
Spawn("Bang4Cloud", spawnx, spawny, self->z, ALLOW_REPLACE);
}
// Piston -------------------------------------------------------------------
// -------------------------------------------------------------------
void A_GiveQuestItem (AActor *self)
{
int questitem = (self->Speed >> FRACBITS);
int index=CheckIndex(1);
if (index<0) return;
int questitem = EvalExpressionI (StateParameters[index], self);
// Give one of these quest items to every player in the game
for (int i = 0; i < MAXPLAYERS; ++i)
@ -93,146 +55,7 @@ void A_GiveQuestItem (AActor *self)
}
}
class APiston : public AActor
{
DECLARE_ACTOR (APiston, AActor);
};
FState APiston::States[] =
{
S_NORMAL (PSTN, 'A', 8, NULL, &States[1]),
S_NORMAL (PSTN, 'B', 8, NULL, &States[0]),
S_BRIGHT (PSTN, 'A', 4, A_Scream, &States[3]),
S_BRIGHT (PSTN, 'B', 4, A_NoBlocking, &States[4]),
S_BRIGHT (PSTN, 'C', 4, A_GiveQuestItem, &States[5]),
S_BRIGHT (PSTN, 'D', 4, A_Bang4Cloud, &States[6]),
S_BRIGHT (PSTN, 'E', 4, A_TossGib, &States[7]),
S_BRIGHT (PSTN, 'F', 4, NULL, &States[8]),
S_BRIGHT (PSTN, 'G', 4, A_Bang4Cloud, &States[9]),
S_NORMAL (PSTN, 'H', 4, NULL, &States[10]),
S_NORMAL (PSTN, 'I', -1, NULL, NULL)
};
IMPLEMENT_ACTOR (APiston, Strife, 45, 0)
PROP_StrifeType (123)
PROP_SpawnHealth (100)
PROP_SpawnState (0)
PROP_DeathState (2)
PROP_SpeedFixed (16) // Was a byte in Strife
PROP_RadiusFixed (20)
PROP_HeightFixed (76)
PROP_MassLong (10000000)
PROP_Flags (MF_SOLID|MF_SHOOTABLE|MF_NOBLOOD)
PROP_Flags2 (MF2_FLOORCLIP)
PROP_Flags4 (MF4_INCOMBAT)
PROP_DeathSound ("misc/explosion")
END_DEFAULTS
// Computer -----------------------------------------------------------------
class AComputer : public AActor
{
DECLARE_ACTOR (AComputer, AActor)
};
FState AComputer::States[] =
{
S_BRIGHT (SECR, 'A', 4, NULL, &States[1]),
S_BRIGHT (SECR, 'B', 4, NULL, &States[2]),
S_BRIGHT (SECR, 'C', 4, NULL, &States[3]),
S_BRIGHT (SECR, 'D', 4, NULL, &States[0]),
S_BRIGHT (SECR, 'E', 5, A_Bang4Cloud, &States[5]),
S_BRIGHT (SECR, 'F', 5, A_NoBlocking, &States[6]),
S_BRIGHT (SECR, 'G', 5, A_GiveQuestItem, &States[7]),
S_BRIGHT (SECR, 'H', 5, A_TossGib, &States[8]),
S_BRIGHT (SECR, 'I', 5, A_Bang4Cloud, &States[9]),
S_NORMAL (SECR, 'J', 5, NULL, &States[10]),
S_NORMAL (SECR, 'K', 5, A_Bang4Cloud, &States[11]),
S_NORMAL (SECR, 'L', 5, NULL, &States[12]),
S_NORMAL (SECR, 'M', 5, A_Bang4Cloud, &States[13]),
S_NORMAL (SECR, 'N', 5, NULL, &States[14]),
S_NORMAL (SECR, 'O', 5, A_Bang4Cloud, &States[15]),
S_NORMAL (SECR, 'P',-1, NULL, NULL)
};
IMPLEMENT_ACTOR (AComputer, Strife, 182, 0)
PROP_SpawnState (0)
PROP_SpawnHealth (80)
PROP_DeathState (4)
PROP_SpeedFixed (27) // was a byte in Strife
PROP_RadiusFixed (26)
PROP_HeightFixed (128)
PROP_MassLong (100000)
PROP_Flags (MF_SOLID|MF_SHOOTABLE|MF_NOBLOOD)
PROP_Flags2 (MF2_FLOORCLIP)
PROP_Flags4 (MF4_INCOMBAT)
PROP_StrifeType (124)
PROP_DeathSound ("misc/explosion")
END_DEFAULTS
// Power Crystal ------------------------------------------------------------
void A_ExtraLightOff (AActor *);
void A_Explode512 (AActor *);
class APowerCrystal : public AActor
{
DECLARE_ACTOR (APowerCrystal, AActor)
};
FState APowerCrystal::States[] =
{
S_BRIGHT (CRYS, 'A', 16, A_LoopActiveSound, &States[1]),
S_BRIGHT (CRYS, 'B', 5, A_LoopActiveSound, &States[2]),
S_BRIGHT (CRYS, 'C', 4, A_LoopActiveSound, &States[3]),
S_BRIGHT (CRYS, 'D', 4, A_LoopActiveSound, &States[4]),
S_BRIGHT (CRYS, 'E', 4, A_LoopActiveSound, &States[5]),
S_BRIGHT (CRYS, 'F', 4, A_LoopActiveSound, &States[0]),
S_BRIGHT (BOOM, 'A', 0, A_Scream, &States[7]), // [RH] This seems like a good idea
S_BRIGHT (BOOM, 'A', 1, A_Explode512, &States[8]),
S_BRIGHT (BOOM, 'B', 3, A_GiveQuestItem, &States[9]),
S_BRIGHT (BOOM, 'C', 2, A_LightGoesOut, &States[10]),
S_BRIGHT (BOOM, 'D', 3, A_Bang4Cloud, &States[11]),
S_BRIGHT (BOOM, 'E', 3, NULL, &States[12]),
S_BRIGHT (BOOM, 'F', 3, NULL, &States[13]),
S_BRIGHT (BOOM, 'G', 3, A_Bang4Cloud, &States[14]),
S_BRIGHT (BOOM, 'H', 1, A_Explode512, &States[15]),
S_BRIGHT (BOOM, 'I', 3, NULL, &States[16]),
S_BRIGHT (BOOM, 'J', 3, A_Bang4Cloud, &States[17]),
S_BRIGHT (BOOM, 'K', 3, A_Bang4Cloud, &States[18]),
S_BRIGHT (BOOM, 'L', 3, A_Bang4Cloud, &States[19]),
S_BRIGHT (BOOM, 'M', 3, NULL, &States[20]),
S_BRIGHT (BOOM, 'N', 3, NULL, &States[21]),
S_BRIGHT (BOOM, 'O', 3, A_Bang4Cloud, &States[22]),
S_BRIGHT (BOOM, 'P', 3, NULL, &States[23]),
S_BRIGHT (BOOM, 'Q', 3, NULL, &States[24]),
S_BRIGHT (BOOM, 'R', 3, NULL, &States[25]),
S_BRIGHT (BOOM, 'S', 3, NULL, &States[26]),
S_BRIGHT (BOOM, 'T', 3, NULL, &States[27]),
S_BRIGHT (BOOM, 'U', 3, A_ExtraLightOff, &States[28]),
S_BRIGHT (BOOM, 'V', 3, NULL, &States[29]),
S_BRIGHT (BOOM, 'W', 3, NULL, &States[30]),
S_BRIGHT (BOOM, 'X', 3, NULL, &States[31]),
S_BRIGHT (BOOM, 'Y', 3, NULL, NULL)
};
IMPLEMENT_ACTOR (APowerCrystal, Strife, 92, 0)
PROP_SpawnState (0)
PROP_SpawnHealth (50)
PROP_DeathState (6)
PROP_SpeedFixed (14) // Was a byte in Strife
PROP_RadiusFixed (20) // This size seems odd, but that's what the mobjinfo says
PROP_HeightFixed (16)
PROP_MassLong (99999999)
PROP_Flags (MF_SOLID|MF_SHOOTABLE|MF_NOGRAVITY|MF_NOBLOOD)
PROP_Flags2 (MF2_FLOORCLIP)
PROP_StrifeType (201)
PROP_DeathSound ("misc/explosion")
PROP_ActiveSound ("misc/reactor")
END_DEFAULTS
// PowerCrystal -------------------------------------------------------------------
void A_ExtraLightOff (AActor *self)
{

View file

@ -393,7 +393,7 @@ static FActorInfo *CreateNewActor(FScanner &sc, FActorInfo **parentc, Baggage *b
{
sc.ScriptError("Unknown native class '%s'", typeName.GetChars());
}
else if (ti->ParentClass != parent)
else if (ti->ParentClass->NativeClass() != parent->NativeClass())
{
sc.ScriptError("Native class '%s' does not inherit from '%s'",
typeName.GetChars(),parent->TypeName.GetChars());

View file

@ -288,7 +288,7 @@ void FPalette::MakeRemap (const DWORD *colors, BYTE *remap, const BYTE *useful,
{
remap[workspace[i].PalEntry] = BestColor ((DWORD *)BaseColors,
RPART(workspace[i].Color), GPART(workspace[i].Color), BPART(workspace[i].Color),
0, 255);
1, 255);
}
}
}

View file

@ -182,6 +182,8 @@ class Actor extends Thinker
action native A_ClassBossHealth();
action native A_ShootGun();
action native A_RocketInFlight();
action native A_Bang4Cloud();
action native A_GiveQuestItem(eval int itemno);
}
class Inventory extends Actor

View file

@ -0,0 +1,117 @@
// Loremaster (aka Priest) --------------------------------------------------
ACTOR Loremaster 12
{
Game Strife
ConversationID 66, 63, 64
Health 800
Speed 10
Radius 15
Height 56
FloatSpeed 5
Monster
+FLOAT
+NOBLOOD
+NOGRAVITY
+NOTDMATCH
+FLOORCLIP
+NOBLOCKMONST
+INCOMBAT
+LOOKALLAROUND
+FIRERESIST
+NOICEDEATH
MinMissileChance 150
Tag "PRIEST"
SeeSound "loremaster/sight"
AttackSound "loremaster/attack"
PainSound "loremaster/pain"
DeathSound "loremaster/death"
ActiveSound "loremaster/active"
Obituary "$OB_LOREMASTER"
DropItem "Junk"
states
{
Spawn:
PRST A 10 A_Look
PRST B 10 A_SentinelBob
Loop
See:
PRST A 4 A_Chase
PRST A 4 A_SentinelBob
PRST B 4 A_Chase
PRST B 4 A_SentinelBob
PRST C 4 A_Chase
PRST C 4 A_SentinelBob
PRST D 4 A_Chase
PRST D 4 A_SentinelBob
Loop
Melee:
PRST E 4 A_FaceTarget
PRST F 4 A_CustomMeleeAttack((random[SpectreMelee](0,255)&9)*5)
PRST E 4 A_SentinelBob
Goto See
Missile:
PRST E 4 A_FaceTarget
PRST F 4 A_CustomMissile("LoreShot", 32, 0)
PRST E 4 A_SentinelBob
Goto See
Death:
PDED A 6
PDED B 6 A_Scream
PDED C 6
PDED D 6 A_Fall
PDED E 6
PDED FGHIJIJIJKL 5
PDED MNOP 4
PDED Q 4 A_SpawnItemEx("AlienSpectre5", 0, 0, 0, 0, 0, random[spectrespawn](0,255)*0.0078125, 0, SXF_NOCHECKPOSITION)
PDED RS 4
PDED T -1
Stop
}
}
// Loremaster Projectile ----------------------------------------------------
ACTOR LoreShot native
{
ConversationID 97,-1,-1
Speed 20
Height 14
Radius 10
Projectile
+STRIFEDAMAGE
Damage 2
MaxStepHeight 4
SeeSound "loremaster/chain"
ActiveSound "loremaster/swish"
action native A_LoremasterChain ();
States
{
Spawn:
OCLW A 2 A_LoremasterChain
Loop
Death:
OCLW A 6
Stop
}
}
// Loremaster Subprojectile -------------------------------------------------
ACTOR LoreShot2
{
ConversationID 98,-1,-1
+NOBLOCKMAP
+NOGRAVITY
States
{
Spawn:
TEND A 20
Stop
}
}

View file

@ -27,7 +27,8 @@ ACTOR Merchant
Loop
See:
Pain:
MRPN A 3 A_AlertMonsters
MRPN A 1
MRPN A 2 A_AlertMonsters
MRPN B 3 A_Pain
MRPN C 3
MRPN D 9 Door_CloseWaitOpen(999, 64, 960)

View file

@ -0,0 +1,110 @@
// Programmer ---------------------------------------------------------------
ACTOR Programmer 71
{
Game Strife
ConversationID 95, -1, -1
Health 1100
PainChance 50
Speed 26
FloatSpeed 5
Radius 45
Height 60
Mass 800
Damage 4
Monster
+NOGRAVITY
+FLOAT
+NOBLOOD
+NOTDMATCH
+DONTMORPH
+NOBLOCKMONST
+LOOKALLAROUND
+FIRERESIST
+NOICEDEATH
+NOTARGETSWITCH
MinMissileChance 150
AttackSound "programmer/attack"
PainSound "programmer/pain"
DeathSound "programmer/death"
ActiveSound "programmer/active"
Obituary "$OB_PROGRAMMER"
DropItem "Sigil1"
action native A_ProgrammerMelee ();
action native A_SpawnProgrammerBase ();
action native A_ProgrammerDeath ();
action native A_SpotLightning();
States
{
Spawn:
PRGR A 5 A_Look
PRGR A 1 A_SentinelBob
Loop
See:
PRGR A 160 A_SentinelBob
PRGR BCD 5 A_SentinelBob
PRGR EF 2 A_SentinelBob
PRGR EF 3 A_Chase
Goto See+4
Melee:
PRGR E 2 A_SentinelBob
PRGR F 3 A_SentinelBob
PRGR E 3 A_FaceTarget
PRGR F 4 A_ProgrammerMelee
Goto See+4
Missile:
PRGR G 5 A_FaceTarget
PRGR H 5 A_SentinelBob
PRGR I 5 Bright A_FaceTarget
PRGR J 5 Bright A_SpotLightning
Goto See+4
Pain:
PRGR K 5 A_Pain
PRGR L 5 A_SentinelBob
Goto See+4
Death:
PRGR L 7 Bright A_TossGib
PRGR M 7 Bright A_Scream
PRGR N 7 Bright A_TossGib
PRGR O 7 Bright A_NoBlocking
PRGR P 7 Bright A_TossGib
PRGR Q 7 Bright A_SpawnProgrammerBase
PRGR R 7 Bright
PRGR S 6 Bright
PRGR TUVW 5 Bright
PRGR X 32 Bright
PRGR Y -1 Bright A_ProgrammerDeath
Stop
}
}
// The Programmer's base for when he dies -----------------------------------
ACTOR ProgrammerBase
{
ConversationID 96,-1,-1
+NOBLOCKMAP
+NOCLIP
+NOBLOOD
states
{
Spawn:
BASE A 5 Bright A_Explode(32,32,1,1)
BASE BCD 5 Bright
BASE EFG 5
BASE H -1
Stop
}
}
// The Programmer level ending thing ----------------------------------------
ACTOR ProgLevelEnder : Inventory native
{
+INVENTORY.UNDROPPABLE
}

View file

@ -0,0 +1,147 @@
// A Cloud used for varius explosions ---------------------------------------
// This actor has no direct equivalent in strife. To create this, Strife
// spawned a spark and then changed its state to that of this explosion
// cloud. Weird.
ACTOR Bang4Cloud
{
+NOBLOCKMAP
+NOGRAVITY
RenderStyle Add
VSpeed 1
States
{
Spawn:
BNG4 BCDEFGHIJKLMN 3 Bright
Stop
}
}
// Piston -------------------------------------------------------------------
ACTOR Piston 45
{
Game Strife
ConversationID 123,-1,-1
Health 100
Speed 16
Radius 16
Height 76
Mass 10000000
+SOLID
+SHOOTABLE
+NOBLOOD
+FLOORCLIP
+INCOMBAT
DeathSound "misc/explosion"
states
{
Spawn:
PSTN AB 8
Loop
Death:
PSTN A 4 Bright A_Scream
PSTN B 4 Bright A_NoBlocking
PSTN C 4 Bright A_GiveQuestItem(16)
PSTN D 4 Bright A_Bang4Cloud
PSTN E 4 Bright A_TossGib
PSTN F 4 Bright
PSTN G 4 Bright A_Bang4Cloud
PSTN H 4
PSTN I -1
Stop
}
}
// Computer -----------------------------------------------------------------
ACTOR Computer 182
{
Game Strife
ConversationID 128,-1,-1
Health 80
Speed 27
Radius 26
Height 128
Mass 10000000
+SOLID
+SHOOTABLE
+NOBLOOD
+FLOORCLIP
+INCOMBAT
DeathSound "misc/explosion"
states
{
Spawn:
SECR ABCD 4 Bright
Loop
Death:
SECR E 5 Bright A_Bang4Cloud
SECR F 5 Bright A_NoBlocking
SECR G 5 Bright A_GiveQuestItem(27)
SECR H 5 Bright A_TossGib
SECR I 5 Bright A_Bang4Cloud
SECR J 5
SECR K 5 A_Bang4Cloud
SECR L 5
SECR M 5 A_Bang4Cloud
SECR N 5
SECR O 5 A_Bang4Cloud
SECR P -1
Stop
}
}
// Power Crystal ------------------------------------------------------------
ACTOR PowerCrystal 92
{
Game Strife
ConversationID 201,-1,-1
Health 50
Speed 14
Radius 20
Height 16
Mass 99999999
+SOLID
+SHOOTABLE
+NOGRAVITY
+NOBLOOD
+FLOORCLIP
DeathSound "misc/explosion"
ActiveSound "misc/reactor"
action native A_ExtraLightOff ();
action native A_Explode512 ();
action native A_LightGoesOut ();
States
{
Spawn:
CRYS A 16 A_LoopActiveSound
CRYS B 5 A_LoopActiveSound
CRYS CDEF 4 A_LoopActiveSound
Loop
Death:
BOOM A 0 Bright A_Scream
BOOM A 1 Bright A_Explode512
BOOM B 3 Bright A_GiveQuestItem(14)
BOOM C 2 Bright A_LightGoesOut
BOOM D 3 Bright A_Bang4Cloud
BOOM EF 3 Bright
BOOM G 3 Bright A_Bang4Cloud
BOOM H 1 Bright A_Explode512
BOOM I 3 Bright
BOOM JKL 3 Bright A_Bang4Cloud
BOOM MN 3 Bright
BOOM O 3 Bright A_Bang4Cloud
BOOM PQRST 3 Bright
BOOM U 3 Bright A_ExtraLightOff
BOOM VWXY 3 Bright
Stop
}
}

View file

@ -105,9 +105,11 @@
#include "actors/strife/crusader.txt"
#include "actors/strife/entityboss.txt"
#include "actors/strife/inquisitor.txt"
#include "actors/strife/loremaster.txt"
#include "actors/strife/merchants.txt"
#include "actors/strife/peasants.txt"
#include "actors/strife/strifebishop.txt"
#include "actors/strife/programmer.txt"
#include "actors/strife/questitems.txt"
#include "actors/strife/ratbuddy.txt"
#include "actors/strife/rebels.txt"
@ -118,5 +120,6 @@
#include "actors/strife/strifeitems.txt"
#include "actors/strife/strifekeys.txt"
#include "actors/strife/strifestuff.txt"
#include "actors/strife/thingstoblowup.txt"
#include "actors/strife/templar.txt"
#include "actors/strife/zombie.txt"