- Added DECORATE conversions for Hexen's Cleric Mace, Firedemon and fog by

Karate Chris.
- Added several type checks to the weapon slot code.
- Changed: Players no longer respawn in instant death sectors with 
  the 'Respawn where died' flag on.


SVN r1101 (trunk)
This commit is contained in:
Christoph Oelckers 2008-08-02 08:38:07 +00:00
commit fddf69e950
14 changed files with 1053 additions and 1152 deletions

View file

@ -152,6 +152,14 @@ ACTOR(FireCrossbowPL1)
ACTOR(FireCrossbowPL2)
ACTOR(GauntletAttack)
WEAPON(CMaceAttack)
ACTOR(FiredRocks)
ACTOR(FiredChase)
ACTOR(FiredAttack)
ACTOR(FiredSplotch)
ACTOR(SmBounce)
ACTOR(FogSpawn)
ACTOR(FogMove)
// Special code pointers for Strife's player - not to be used elsewhere!
ACTOR(ItBurnsItBurns)

View file

@ -1,73 +1,11 @@
#include "actor.h"
#include "gi.h"
#include "m_random.h"
#include "s_sound.h"
#include "d_player.h"
#include "a_action.h"
#include "p_local.h"
#include "p_enemy.h"
#include "a_action.h"
#include "p_pspr.h"
#include "gstrings.h"
#include "a_hexenglobal.h"
extern void AdjustPlayerAngle (AActor *pmo, AActor *linetarget);
static FRandom pr_atk ("CMaceAttack");
void A_CMaceAttack (AActor *actor);
// The Cleric's Mace --------------------------------------------------------
class ACWeapMace : public AClericWeapon
{
DECLARE_ACTOR (ACWeapMace, AClericWeapon)
};
FState ACWeapMace::States[] =
{
#define S_CMACEREADY 0
S_NORMAL (CMCE, 'A', 1, A_WeaponReady , &States[S_CMACEREADY]),
#define S_CMACEDOWN (S_CMACEREADY+1)
S_NORMAL (CMCE, 'A', 1, A_Lower , &States[S_CMACEDOWN]),
#define S_CMACEUP (S_CMACEDOWN+1)
S_NORMAL (CMCE, 'A', 1, A_Raise , &States[S_CMACEUP]),
#define S_CMACEATK (S_CMACEUP+1)
S_NORMAL2 (CMCE, 'B', 2, NULL , &States[S_CMACEATK+1], 60, 20),
S_NORMAL2 (CMCE, 'B', 1, NULL , &States[S_CMACEATK+2], 30, 33),
S_NORMAL2 (CMCE, 'B', 2, NULL , &States[S_CMACEATK+3], 8, 45),
S_NORMAL2 (CMCE, 'C', 1, NULL , &States[S_CMACEATK+4], 8, 45),
S_NORMAL2 (CMCE, 'D', 1, NULL , &States[S_CMACEATK+5], 8, 45),
S_NORMAL2 (CMCE, 'E', 1, NULL , &States[S_CMACEATK+6], 8, 45),
S_NORMAL2 (CMCE, 'E', 1, A_CMaceAttack , &States[S_CMACEATK+7], -11, 58),
S_NORMAL2 (CMCE, 'F', 1, NULL , &States[S_CMACEATK+8], 8, 45),
S_NORMAL2 (CMCE, 'F', 2, NULL , &States[S_CMACEATK+9], -8, 74),
S_NORMAL2 (CMCE, 'F', 1, NULL , &States[S_CMACEATK+10], -20, 96),
S_NORMAL2 (CMCE, 'F', 8, NULL , &States[S_CMACEATK+11], -33, 160),
S_NORMAL2 (CMCE, 'A', 2, A_ReFire , &States[S_CMACEATK+12], 8, 75),
S_NORMAL2 (CMCE, 'A', 1, NULL , &States[S_CMACEATK+13], 8, 65),
S_NORMAL2 (CMCE, 'A', 2, NULL , &States[S_CMACEATK+14], 8, 60),
S_NORMAL2 (CMCE, 'A', 1, NULL , &States[S_CMACEATK+15], 8, 55),
S_NORMAL2 (CMCE, 'A', 2, NULL , &States[S_CMACEATK+16], 8, 50),
S_NORMAL2 (CMCE, 'A', 1, NULL , &States[S_CMACEREADY], 8, 45),
};
IMPLEMENT_ACTOR (ACWeapMace, Hexen, -1, 0)
PROP_Weapon_SelectionOrder (3500)
PROP_Flags5 (MF5_BLOODSPLATTER)
PROP_Weapon_Flags (WIF_BOT_MELEE)
PROP_Weapon_UpState (S_CMACEUP)
PROP_Weapon_DownState (S_CMACEDOWN)
PROP_Weapon_ReadyState (S_CMACEREADY)
PROP_Weapon_AtkState (S_CMACEATK)
PROP_Weapon_Kickback (150)
PROP_Weapon_YAdjust (0-8)
END_DEFAULTS
//===========================================================================
//
// A_CMaceAttack

View file

@ -27,303 +27,6 @@ void A_FiredChase (AActor *);
void A_FiredAttack (AActor *);
void A_FiredSplotch (AActor *);
// FireDemon ----------------------------------------------------------------
class AFireDemon : public AActor
{
DECLARE_ACTOR (AFireDemon, AActor)
};
FState AFireDemon::States[] =
{
#define S_FIRED_SPAWN1 0
S_BRIGHT (FDMN, 'X', 5, NULL , &States[S_FIRED_SPAWN1+1]),
#define S_FIRED_LOOK1 (S_FIRED_SPAWN1+1)
S_BRIGHT (FDMN, 'E', 10, A_Look , &States[S_FIRED_LOOK1+1]),
S_BRIGHT (FDMN, 'F', 10, A_Look , &States[S_FIRED_LOOK1+2]),
S_BRIGHT (FDMN, 'G', 10, A_Look , &States[S_FIRED_LOOK1+0]),
S_BRIGHT (FDMN, 'E', 8, NULL , &States[S_FIRED_LOOK1+4]),
S_BRIGHT (FDMN, 'F', 6, NULL , &States[S_FIRED_LOOK1+5]),
S_BRIGHT (FDMN, 'G', 5, NULL , &States[S_FIRED_LOOK1+6]),
S_BRIGHT (FDMN, 'F', 8, NULL , &States[S_FIRED_LOOK1+7]),
S_BRIGHT (FDMN, 'E', 6, NULL , &States[S_FIRED_LOOK1+8]),
S_BRIGHT (FDMN, 'F', 7, A_FiredRocks , &States[S_FIRED_LOOK1+9]),
S_BRIGHT (FDMN, 'H', 5, NULL , &States[S_FIRED_LOOK1+10]),
S_BRIGHT (FDMN, 'I', 5, NULL , &States[S_FIRED_LOOK1+11]),
S_BRIGHT (FDMN, 'J', 5, A_UnSetInvulnerable , &States[S_FIRED_LOOK1+12]),
#define S_FIRED_WALK1 (S_FIRED_LOOK1+12)
S_BRIGHT (FDMN, 'A', 5, A_FiredChase , &States[S_FIRED_WALK1+1]),
S_BRIGHT (FDMN, 'B', 5, A_FiredChase , &States[S_FIRED_WALK1+2]),
S_BRIGHT (FDMN, 'C', 5, A_FiredChase , &States[S_FIRED_WALK1+0]),
#define S_FIRED_PAIN1 (S_FIRED_WALK1+3)
S_BRIGHT (FDMN, 'D', 6, A_Pain , &States[S_FIRED_WALK1]),
#define S_FIRED_ATTACK1 (S_FIRED_PAIN1+1)
S_BRIGHT (FDMN, 'K', 3, A_FaceTarget , &States[S_FIRED_ATTACK1+1]),
S_BRIGHT (FDMN, 'K', 5, A_FiredAttack , &States[S_FIRED_ATTACK1+2]),
S_BRIGHT (FDMN, 'K', 5, A_FiredAttack , &States[S_FIRED_ATTACK1+3]),
S_BRIGHT (FDMN, 'K', 5, A_FiredAttack , &States[S_FIRED_WALK1]),
#define S_FIRED_DEATH1 (S_FIRED_ATTACK1+4)
S_BRIGHT (FDMN, 'D', 4, A_FaceTarget , &States[S_FIRED_DEATH1+1]),
S_BRIGHT (FDMN, 'L', 4, A_Scream , &States[S_FIRED_DEATH1+2]),
S_BRIGHT (FDMN, 'L', 4, A_NoBlocking , &States[S_FIRED_DEATH1+3]),
S_BRIGHT (FDMN, 'L', 200, NULL , NULL),
#define S_FIRED_XDEATH1 (S_FIRED_DEATH1+4)
S_NORMAL (FDMN, 'M', 5, A_FaceTarget , &States[S_FIRED_XDEATH1+1]),
S_NORMAL (FDMN, 'N', 5, A_NoBlocking , &States[S_FIRED_XDEATH1+2]),
S_NORMAL (FDMN, 'O', 5, A_FiredSplotch , NULL),
#define S_FIRED_ICE1 (S_FIRED_XDEATH1+3)
S_NORMAL (FDMN, 'R', 5, A_FreezeDeath , &States[S_FIRED_ICE1+1]),
S_NORMAL (FDMN, 'R', 1, A_FreezeDeathChunks , &States[S_FIRED_ICE1+1])
};
IMPLEMENT_ACTOR (AFireDemon, Hexen, 10060, 5)
PROP_SpawnHealth (80)
PROP_ReactionTime (8)
PROP_PainChance (1)
PROP_SpeedFixed (13)
PROP_RadiusFixed (20)
PROP_HeightFixed (68)
PROP_Mass (75)
PROP_Damage (1)
PROP_Flags (MF_SOLID|MF_SHOOTABLE|MF_COUNTKILL|MF_DROPOFF|MF_NOGRAVITY|MF_FLOAT)
PROP_Flags2 (MF2_FLOORCLIP|MF2_PASSMOBJ|MF2_PUSHWALL|MF2_INVULNERABLE|MF2_MCROSS|MF2_TELESTOMP)
PROP_SpawnState (S_FIRED_SPAWN1)
PROP_SeeState (S_FIRED_LOOK1+3)
PROP_PainState (S_FIRED_PAIN1)
PROP_MissileState (S_FIRED_ATTACK1)
PROP_CrashState (S_FIRED_XDEATH1)
PROP_DeathState (S_FIRED_DEATH1)
PROP_XDeathState (S_FIRED_XDEATH1)
PROP_IDeathState (S_FIRED_ICE1)
PROP_SeeSound ("FireDemonSpawn")
PROP_PainSound ("FireDemonPain")
PROP_DeathSound ("FireDemonDeath")
PROP_ActiveSound ("FireDemonActive")
PROP_Obituary("$OB_FIREDEMON")
END_DEFAULTS
// AFireDemonSplotch1 -------------------------------------------------------
class AFireDemonSplotch1 : public AActor
{
DECLARE_ACTOR (AFireDemonSplotch1, AActor)
};
FState AFireDemonSplotch1::States[] =
{
S_NORMAL (FDMN, 'P', 3, NULL , &States[1]),
S_NORMAL (FDMN, 'P', 6, A_QueueCorpse , &States[2]),
S_NORMAL (FDMN, 'Y', -1, NULL , NULL)
};
IMPLEMENT_ACTOR (AFireDemonSplotch1, Hexen, -1, 0)
PROP_SpawnHealth (1000)
PROP_ReactionTime (8)
PROP_PainChance (0)
PROP_SpeedFixed (0)
PROP_RadiusFixed (3)
PROP_HeightFixed (16)
PROP_Mass (100)
PROP_Damage (0)
PROP_Flags (MF_DROPOFF|MF_CORPSE)
PROP_Flags2 (MF2_NOTELEPORT|MF2_FLOORCLIP)
PROP_SpawnState (0)
END_DEFAULTS
// AFireDemonSplotch2 -------------------------------------------------------
class AFireDemonSplotch2 : public AFireDemonSplotch1
{
DECLARE_ACTOR (AFireDemonSplotch2, AFireDemonSplotch1)
};
FState AFireDemonSplotch2::States[] =
{
S_NORMAL (FDMN, 'Q', 3, NULL , &States[1]),
S_NORMAL (FDMN, 'Q', 6, A_QueueCorpse , &States[2]),
S_NORMAL (FDMN, 'Z', -1, NULL , NULL)
};
IMPLEMENT_ACTOR (AFireDemonSplotch2, Hexen, -1, 0)
PROP_SpawnState (0)
END_DEFAULTS
// AFireDemonRock1 ------------------------------------------------------------
class AFireDemonRock1 : public AActor
{
DECLARE_ACTOR (AFireDemonRock1, AActor)
};
FState AFireDemonRock1::States[] =
{
#define S_FIRED_RDROP1 0
S_NORMAL (FDMN, 'S', 4, NULL , &States[S_FIRED_RDROP1]),
#define S_FIRED_RDEAD1 (S_FIRED_RDROP1+1)
S_NORMAL (FDMN, 'S', 5, A_SmBounce , &States[S_FIRED_RDEAD1+1]),
S_NORMAL (FDMN, 'S', 200, NULL , NULL)
};
IMPLEMENT_ACTOR (AFireDemonRock1, Hexen, -1, 0)
PROP_SpawnHealth (1000)
PROP_ReactionTime (8)
PROP_PainChance (0)
PROP_SpeedFixed (0)
PROP_RadiusFixed (3)
PROP_HeightFixed (5)
PROP_Mass (16)
PROP_Damage (0)
PROP_Flags (MF_NOBLOCKMAP|MF_DROPOFF|MF_MISSILE)
PROP_Flags2 (MF2_NOTELEPORT)
PROP_SpawnState (S_FIRED_RDROP1)
PROP_DeathState (S_FIRED_RDEAD1)
PROP_XDeathState (S_FIRED_RDEAD1+1)
END_DEFAULTS
// AFireDemonRock2 ------------------------------------------------------------
class AFireDemonRock2 : public AFireDemonRock1
{
DECLARE_ACTOR (AFireDemonRock2, AActor)
};
FState AFireDemonRock2::States[] =
{
#define S_FIRED_RDROP2 0
S_NORMAL (FDMN, 'T', 4, NULL , &States[S_FIRED_RDROP2]),
#define S_FIRED_RDEAD2 (S_FIRED_RDROP2+1)
S_NORMAL (FDMN, 'T', 5, A_SmBounce , &States[S_FIRED_RDEAD2+1]),
S_NORMAL (FDMN, 'T', 200, NULL , NULL)
};
IMPLEMENT_ACTOR (AFireDemonRock2, Hexen, -1, 0)
PROP_SpawnState (S_FIRED_RDROP2)
PROP_DeathState (S_FIRED_RDEAD2)
PROP_XDeathState (S_FIRED_RDEAD2+1)
END_DEFAULTS
// AFireDemonRock3 ------------------------------------------------------------
class AFireDemonRock3 : public AFireDemonRock1
{
DECLARE_ACTOR (AFireDemonRock3, AFireDemonRock1)
};
FState AFireDemonRock3::States[] =
{
#define S_FIRED_RDROP3 0
S_NORMAL (FDMN, 'U', 4, NULL , &States[S_FIRED_RDROP3]),
#define S_FIRED_RDEAD3 (S_FIRED_RDROP3+1)
S_NORMAL (FDMN, 'U', 5, A_SmBounce , &States[S_FIRED_RDEAD3+1]),
S_NORMAL (FDMN, 'U', 200, NULL , NULL)
};
IMPLEMENT_ACTOR (AFireDemonRock3, Hexen, -1, 0)
PROP_SpawnState (S_FIRED_RDROP3)
PROP_DeathState (S_FIRED_RDEAD3)
PROP_XDeathState (S_FIRED_RDEAD3+1)
END_DEFAULTS
// AFireDemonRock4 ------------------------------------------------------------
class AFireDemonRock4 : public AFireDemonRock1
{
DECLARE_ACTOR (AFireDemonRock4, AFireDemonRock1)
};
FState AFireDemonRock4::States[] =
{
#define S_FIRED_RDROP4 0
S_NORMAL (FDMN, 'V', 4, NULL , &States[S_FIRED_RDROP4]),
#define S_FIRED_RDEAD4 (S_FIRED_RDROP4+1)
S_NORMAL (FDMN, 'V', 5, A_SmBounce , &States[S_FIRED_RDEAD4+1]),
S_NORMAL (FDMN, 'V', 200, NULL , NULL)
};
IMPLEMENT_ACTOR (AFireDemonRock4, Hexen, -1, 0)
PROP_SpawnState (S_FIRED_RDROP4)
PROP_DeathState (S_FIRED_RDEAD4)
PROP_XDeathState (S_FIRED_RDEAD4+1)
END_DEFAULTS
// AFireDemonRock5 ------------------------------------------------------------
class AFireDemonRock5 : public AFireDemonRock1
{
DECLARE_ACTOR (AFireDemonRock5, AActor)
};
FState AFireDemonRock5::States[] =
{
#define S_FIRED_RDROP5 0
S_NORMAL (FDMN, 'W', 4, NULL , &States[S_FIRED_RDROP5]),
#define S_FIRED_RDEAD5 (S_FIRED_RDROP5+1)
S_NORMAL (FDMN, 'W', 5, A_SmBounce , &States[S_FIRED_RDEAD5+1]),
S_NORMAL (FDMN, 'W', 200, NULL , NULL)
};
IMPLEMENT_ACTOR (AFireDemonRock5, Hexen, -1, 0)
PROP_SpawnState (S_FIRED_RDROP5)
PROP_DeathState (S_FIRED_RDEAD5)
PROP_XDeathState (S_FIRED_RDEAD5+1)
END_DEFAULTS
// AFireDemonMissile -----------------------------------------------------------
class AFireDemonMissile : public AActor
{
DECLARE_ACTOR (AFireDemonMissile, AActor)
};
FState AFireDemonMissile::States[] =
{
#define S_FIRED_FX6_1 0
S_BRIGHT (FDMB, 'A', 5, NULL , &States[S_FIRED_FX6_1]),
#define S_FIRED_FX6_2 (S_FIRED_FX6_1+1)
S_BRIGHT (FDMB, 'B', 5, NULL , &States[S_FIRED_FX6_2+1]),
S_BRIGHT (FDMB, 'C', 5, NULL , &States[S_FIRED_FX6_2+2]),
S_BRIGHT (FDMB, 'D', 5, NULL , &States[S_FIRED_FX6_2+3]),
S_BRIGHT (FDMB, 'E', 5, NULL , NULL)
};
IMPLEMENT_ACTOR (AFireDemonMissile, Hexen, -1, 0)
PROP_SpawnHealth (1000)
PROP_ReactionTime (8)
PROP_PainChance (0)
PROP_SpeedFixed (10)
PROP_RadiusFixed (10)
PROP_HeightFixed (6)
PROP_Mass (15)
PROP_Damage (1)
PROP_DamageType (NAME_Fire)
PROP_Flags (MF_NOBLOCKMAP|MF_NOGRAVITY|MF_DROPOFF|MF_MISSILE)
PROP_Flags2 (MF2_NOTELEPORT|MF2_IMPACT|MF2_PCROSS|MF2_FLOORCLIP)
PROP_RenderStyle (STYLE_Add)
PROP_SpawnState (S_FIRED_FX6_1)
PROP_DeathState (S_FIRED_FX6_2)
PROP_DeathSound ("FireDemonMissileHit")
END_DEFAULTS
//============================================================================
//
// A_FiredRocks
@ -354,20 +57,20 @@ void A_FiredSpawnRock (AActor *actor)
switch (pr_firedemonrock() % 5)
{
case 0:
rtype = RUNTIME_CLASS (AFireDemonRock1);
rtype = PClass::FindClass ("FireDemonRock1");
break;
case 1:
rtype = RUNTIME_CLASS (AFireDemonRock2);
rtype = PClass::FindClass ("FireDemonRock2");
break;
case 2:
rtype = RUNTIME_CLASS (AFireDemonRock3);
rtype = PClass::FindClass ("FireDemonRock3");
break;
case 3:
rtype = RUNTIME_CLASS (AFireDemonRock4);
rtype = PClass::FindClass ("FireDemonRock4");
break;
case 4:
default:
rtype = RUNTIME_CLASS (AFireDemonRock5);
rtype = PClass::FindClass ("FireDemonRock5");
break;
}
@ -414,7 +117,7 @@ void A_FiredAttack (AActor *actor)
{
if (actor->target == NULL)
return;
AActor *mo = P_SpawnMissile (actor, actor->target, RUNTIME_CLASS(AFireDemonMissile));
AActor *mo = P_SpawnMissile (actor, actor->target, PClass::FindClass ("FireDemonMissile"));
if (mo) S_Sound (actor, CHAN_BODY, "FireDemonAttack", 1, ATTN_NORM);
}
@ -520,14 +223,14 @@ void A_FiredSplotch (AActor *actor)
{
AActor *mo;
mo = Spawn<AFireDemonSplotch1> (actor->x, actor->y, actor->z, ALLOW_REPLACE);
mo = Spawn ("FireDemonSplotch1", actor->x, actor->y, actor->z, ALLOW_REPLACE);
if (mo)
{
mo->momx = (pr_firedemonsplotch() - 128) << 11;
mo->momy = (pr_firedemonsplotch() - 128) << 11;
mo->momz = (pr_firedemonsplotch() << 10) + FRACUNIT*3;
}
mo = Spawn<AFireDemonSplotch2> (actor->x, actor->y, actor->z, ALLOW_REPLACE);
mo = Spawn ("FireDemonSplotch2", actor->x, actor->y, actor->z, ALLOW_REPLACE);
if (mo)
{
mo->momx = (pr_firedemonsplotch() - 128) << 11;

View file

@ -1,135 +1,8 @@
#include "actor.h"
#include "info.h"
#include "m_random.h"
#include "p_local.h"
static FRandom pr_fogspawn ("FogSpawn");
void A_FogSpawn (AActor *);
void A_FogMove (AActor *);
// Fog Spawner --------------------------------------------------------------
class AFogSpawner : public AActor
{
DECLARE_ACTOR (AFogSpawner, AActor)
};
FState AFogSpawner::States[] =
{
#define S_SPAWNFOG1 0
S_NORMAL (TNT1, 'A', 20, A_FogSpawn , &States[S_SPAWNFOG1]),
};
IMPLEMENT_ACTOR (AFogSpawner, Hexen, 10000, 0)
PROP_Flags (MF_NOSECTOR|MF_NOBLOCKMAP)
PROP_Flags2 (MF2_FLOATBOB)
PROP_RenderFlags (RF_INVISIBLE)
PROP_SpawnState (S_SPAWNFOG1)
END_DEFAULTS
// Small Fog Patch ----------------------------------------------------------
class AFogPatchSmall : public AActor
{
DECLARE_ACTOR (AFogPatchSmall, AActor)
};
FState AFogPatchSmall::States[] =
{
#define S_FOGPATCHS1 0
S_NORMAL (FOGS, 'A', 7, A_FogMove , &States[S_FOGPATCHS1+1]),
S_NORMAL (FOGS, 'B', 7, A_FogMove , &States[S_FOGPATCHS1+2]),
S_NORMAL (FOGS, 'C', 7, A_FogMove , &States[S_FOGPATCHS1+3]),
S_NORMAL (FOGS, 'D', 7, A_FogMove , &States[S_FOGPATCHS1+4]),
S_NORMAL (FOGS, 'E', 7, A_FogMove , &States[S_FOGPATCHS1]),
#define S_FOGPATCHS0 (S_FOGPATCHS1+5)
S_NORMAL (FOGS, 'E', 5, NULL , NULL),
};
IMPLEMENT_ACTOR (AFogPatchSmall, Hexen, 10001, 0)
PROP_SpeedFixed (1)
PROP_Flags (MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIP|MF_FLOAT)
PROP_Flags2 (MF2_NOTELEPORT)
PROP_RenderStyle (STYLE_Translucent)
PROP_Alpha (HX_SHADOW)
PROP_SpawnState (S_FOGPATCHS1)
PROP_DeathState (S_FOGPATCHS0)
END_DEFAULTS
// Medium Fog Patch ---------------------------------------------------------
class AFogPatchMedium : public AActor
{
DECLARE_ACTOR (AFogPatchMedium, AActor)
};
FState AFogPatchMedium::States[] =
{
#define S_FOGPATCHM1 0
S_NORMAL (FOGM, 'A', 7, A_FogMove , &States[S_FOGPATCHM1+1]),
S_NORMAL (FOGM, 'B', 7, A_FogMove , &States[S_FOGPATCHM1+2]),
S_NORMAL (FOGM, 'C', 7, A_FogMove , &States[S_FOGPATCHM1+3]),
S_NORMAL (FOGM, 'D', 7, A_FogMove , &States[S_FOGPATCHM1+4]),
S_NORMAL (FOGM, 'E', 7, A_FogMove , &States[S_FOGPATCHM1]),
#define S_FOGPATCHM0 (S_FOGPATCHM1+5)
S_NORMAL (FOGS, 'A', 5, NULL , &States[S_FOGPATCHM0+1]),
S_NORMAL (FOGS, 'B', 5, NULL , &States[S_FOGPATCHM0+2]),
S_NORMAL (FOGS, 'C', 5, NULL , &States[S_FOGPATCHM0+3]),
S_NORMAL (FOGS, 'D', 5, NULL , &States[S_FOGPATCHM0+4]),
S_NORMAL (FOGS, 'E', 5, NULL , &AFogPatchSmall::States[S_FOGPATCHS0]),
};
IMPLEMENT_ACTOR (AFogPatchMedium, Hexen, 10002, 0)
PROP_SpeedFixed (1)
PROP_Flags (MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIP|MF_FLOAT)
PROP_Flags2 (MF2_NOTELEPORT)
PROP_RenderStyle (STYLE_Translucent)
PROP_Alpha (HX_SHADOW)
PROP_SpawnState (S_FOGPATCHM1)
PROP_DeathState (S_FOGPATCHM0)
END_DEFAULTS
// Large Fog Patch ----------------------------------------------------------
class AFogPatchLarge : public AActor
{
DECLARE_ACTOR (AFogPatchLarge, AActor)
};
FState AFogPatchLarge::States[] =
{
#define S_FOGPATCHL1 0
S_NORMAL (FOGL, 'A', 7, A_FogMove , &States[S_FOGPATCHL1+1]),
S_NORMAL (FOGL, 'B', 7, A_FogMove , &States[S_FOGPATCHL1+2]),
S_NORMAL (FOGL, 'C', 7, A_FogMove , &States[S_FOGPATCHL1+3]),
S_NORMAL (FOGL, 'D', 7, A_FogMove , &States[S_FOGPATCHL1+4]),
S_NORMAL (FOGL, 'E', 7, A_FogMove , &States[S_FOGPATCHL1]),
#define S_FOGPATCHL0 (S_FOGPATCHL1+5)
S_NORMAL (FOGM, 'A', 4, NULL , &States[S_FOGPATCHL0+1]),
S_NORMAL (FOGM, 'B', 4, NULL , &States[S_FOGPATCHL0+2]),
S_NORMAL (FOGM, 'C', 4, NULL , &States[S_FOGPATCHL0+3]),
S_NORMAL (FOGM, 'D', 4, NULL , &States[S_FOGPATCHL0+4]),
S_NORMAL (FOGM, 'E', 4, NULL , &AFogPatchMedium::States[S_FOGPATCHM0]),
};
IMPLEMENT_ACTOR (AFogPatchLarge, Hexen, 10003, 0)
PROP_SpeedFixed (1)
PROP_Flags (MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIP|MF_FLOAT)
PROP_Flags2 (MF2_NOTELEPORT)
PROP_RenderStyle (STYLE_Translucent)
PROP_Alpha (HX_SHADOW)
PROP_SpawnState (S_FOGPATCHL1)
PROP_DeathState (S_FOGPATCHL0)
END_DEFAULTS
//==========================================================================
// Fog Variables:
//
@ -153,9 +26,9 @@ void A_FogSpawn (AActor *actor)
{
static const PClass *fogs[3] =
{
RUNTIME_CLASS(AFogPatchSmall),
RUNTIME_CLASS(AFogPatchMedium),
RUNTIME_CLASS(AFogPatchLarge)
PClass::FindClass ("FogPatchSmall"),
PClass::FindClass ("FogPatchMedium"),
PClass::FindClass ("FogPatchLarge")
};
AActor *mo=NULL;

View file

@ -335,7 +335,7 @@ AWeapon *AWeapon::AddWeapon (const PClass *weapontype)
{
AWeapon *weap;
if (weapontype == NULL)
if (weapontype == NULL || !weapontype->IsDescendantOf(RUNTIME_CLASS(AWeapon)))
{
return NULL;
}
@ -604,6 +604,17 @@ bool FWeaponSlot::AddWeapon (const char *type)
bool FWeaponSlot::AddWeapon (const PClass *type)
{
int i;
if (type == NULL)
{
return false;
}
if (!type->IsDescendantOf(RUNTIME_CLASS(AWeapon)))
{
Printf("Can't add non-weapon %s to weapon slots\n", type->TypeName.GetChars());
return false;
}
for (i = 0; i < MAX_WEAPONS_PER_SLOT; i++)
{
@ -639,7 +650,7 @@ AWeapon *FWeaponSlot::PickWeapon (player_t *player)
{
AWeapon *weap = static_cast<AWeapon *> (player->mo->FindInventory (Weapons[j]));
if (weap != NULL && weap->CheckAmmo (AWeapon::EitherFire, false))
if (weap != NULL && weap->IsKindOf(RUNTIME_CLASS(AWeapon)) && weap->CheckAmmo (AWeapon::EitherFire, false))
{
return weap;
}
@ -651,7 +662,7 @@ AWeapon *FWeaponSlot::PickWeapon (player_t *player)
{
AWeapon *weap = static_cast<AWeapon *> (player->mo->FindInventory (Weapons[i]));
if (weap != NULL && weap->CheckAmmo (AWeapon::EitherFire, false))
if (weap != NULL && weap->IsKindOf(RUNTIME_CLASS(AWeapon)) && weap->CheckAmmo (AWeapon::EitherFire, false))
{
return weap;
}

View file

@ -1168,18 +1168,18 @@ void DSBarInfo::DrawGraphic(FTexture* texture, int x, int y, int xOffset, int yO
y -= (texture->GetHeight()/2)-texture->TopOffset;
}
// I'll handle the conversion from fixed to int myself for more control
fixed_t fx = (x + ST_X + xOffset) << FRACBITS;
fixed_t fy = (y + ST_Y + yOffset) << FRACBITS;
fixed_t fw = texture->GetScaledWidth() << FRACBITS;
fixed_t fh = texture->GetScaledHeight() << FRACBITS;
// I'll handle the conversion from fixed to int myself for more control
fixed_t fx = (x + ST_X + xOffset) << FRACBITS;
fixed_t fy = (y + ST_Y + yOffset) << FRACBITS;
fixed_t fw = texture->GetScaledWidth() << FRACBITS;
fixed_t fh = texture->GetScaledHeight() << FRACBITS;
if(Scaled)
screen->VirtualToRealCoords(fx, fy, fw, fh, 320, 200, true);
x = fx >> FRACBITS;
y = fy >> FRACBITS;
// Round to nearest
int w = (fw + (FRACUNIT>>1)) >> FRACBITS;
int h = (fh + (FRACUNIT>>1)) >> FRACBITS;
screen->VirtualToRealCoords(fx, fy, fw, fh, 320, 200, true);
x = fx >> FRACBITS;
y = fy >> FRACBITS;
// Round to nearest
int w = (fw + (FRACUNIT>>1)) >> FRACBITS;
int h = (fh + (FRACUNIT>>1)) >> FRACBITS;
screen->DrawTexture(texture, x, y,
DTA_DestWidth, w,
DTA_DestHeight, h,

View file

@ -3538,7 +3538,8 @@ APlayerPawn *P_SpawnPlayer (FMapThing *mthing, bool tempplayer)
( p->playerstate == PST_REBORN ) &&
( deathmatch == false ) &&
( gameaction != ga_worlddone ) &&
( p->mo != NULL ))
( p->mo != NULL ) &&
( (p->mo->Sector->special & 255) != Damage_InstantDeath ))
{
spawn_x = p->mo->x;
spawn_y = p->mo->y;

File diff suppressed because it is too large Load diff