SVN r71 (trunk)

This commit is contained in:
Christoph Oelckers 2006-04-30 21:49:18 +00:00
commit 29cd024aba
31 changed files with 1718 additions and 1105 deletions

View file

@ -77,44 +77,9 @@ struct FExtraInfo
bool ExplosionShooterImmune;
};
class ADecoration : public AActor
class ASimpleProjectile : public AActor
{
DECLARE_STATELESS_ACTOR (ADecoration, AActor);
};
IMPLEMENT_ABSTRACT_ACTOR (ADecoration)
class ABreakableDecoration : public ADecoration
{
DECLARE_STATELESS_ACTOR (ABreakableDecoration, ADecoration);
public:
void Serialize (FArchive &arc)
{
Super::Serialize (arc);
arc << DeathHeight << BurnHeight;
}
void Die (AActor *source, AActor *inflictor)
{
Super::Die (source, inflictor);
flags &= ~MF_CORPSE; // Don't be a corpse
if (DamageType == MOD_FIRE)
{
height = BurnHeight; // Use burn height
}
else
{
height = DeathHeight; // Use death height
}
};
fixed_t DeathHeight;
fixed_t BurnHeight;
};
IMPLEMENT_ABSTRACT_ACTOR (ABreakableDecoration)
class ASimpleProjectile : public ADecoration
{
DECLARE_STATELESS_ACTOR (ASimpleProjectile, ADecoration);
DECLARE_STATELESS_ACTOR (ASimpleProjectile, AActor);
public:
void Serialize (FArchive &arc)
{
@ -363,10 +328,32 @@ static void ParseDecorate (void (*process)(FState *, int))
EDefinitionType def;
FActorInfo *info;
char *typeName;
int recursion=0;
// Get actor class name. The A prefix is added automatically.
while (SC_GetString ())
while (true)
{
if (!SC_GetString ())
{
if (recursion==0) return;
SC_RestoreScriptState();
recursion--;
continue;
}
if (SC_Compare ("#include"))
{
int lump;
SC_MustGetString();
// This is not using SC_Open because it can print a more useful error message when done here
lump = Wads.CheckNumForFullName(sc_String);
if (lump==-1) lump = Wads.CheckNumForName(sc_String);
if (lump==-1) SC_ScriptError("Lump '%s' not found", sc_String);
SC_SaveScriptState();
SC_OpenLumpNum(lump, sc_String);
recursion++;
continue;
}
if (SC_Compare ("Actor"))
{
ProcessActor (process);
@ -380,7 +367,7 @@ static void ParseDecorate (void (*process)(FState *, int))
}
else if (SC_Compare ("Breakable"))
{
parent = RUNTIME_CLASS(ABreakableDecoration);
parent = RUNTIME_CLASS(AActor);
def = DEF_BreakableDecoration;
SC_MustGetString ();
}
@ -392,7 +379,7 @@ static void ParseDecorate (void (*process)(FState *, int))
}
else
{
parent = RUNTIME_CLASS(ADecoration);
parent = RUNTIME_CLASS(AActor);
def = DEF_Decoration;
}
@ -424,6 +411,10 @@ static void ParseDecorate (void (*process)(FState *, int))
{
info->GameFilter |= GAME_Raven;
}
else if (SC_Compare ("Strife"))
{
info->GameFilter |= GAME_Strife;
}
else if (SC_Compare ("Any"))
{
info->GameFilter = GAME_Any;
@ -534,15 +525,8 @@ static void ParseDecorate (void (*process)(FState *, int))
info->OwnedStates[extra.DeathStart].Action = A_ScreamAndUnblock;
}
if (extra.DeathHeight == 0)
{
((ABreakableDecoration *)(info->Defaults))->DeathHeight =
((ABreakableDecoration *)(info->Defaults))->height;
}
else
{
((ABreakableDecoration *)(info->Defaults))->DeathHeight = extra.DeathHeight;
}
if (extra.DeathHeight == 0) extra.DeathHeight = ((AActor*)(info->Defaults))->height;
info->Class->Meta.SetMetaFixed (AMETA_DeathHeight, extra.DeathHeight);
}
((AActor *)(info->Defaults))->DeathState = &info->OwnedStates[extra.DeathStart];
}
@ -580,15 +564,9 @@ static void ParseDecorate (void (*process)(FState *, int))
info->OwnedStates[extra.FireDeathStart].Action = A_ActiveAndUnblock;
}
if (extra.BurnHeight == 0)
{
((ABreakableDecoration *)(info->Defaults))->BurnHeight =
((ABreakableDecoration *)(info->Defaults))->height;
}
else
{
((ABreakableDecoration *)(info->Defaults))->BurnHeight = extra.BurnHeight;
}
if (extra.BurnHeight == 0) extra.BurnHeight = ((AActor*)(info->Defaults))->height;
info->Class->Meta.SetMetaFixed (AMETA_BurnHeight, extra.BurnHeight);
((AActor *)(info->Defaults))->BDeathState = &info->OwnedStates[extra.FireDeathStart];
}

View file

@ -1,102 +0,0 @@
#include "info.h"
#include "a_pickups.h"
#include "d_player.h"
#include "p_local.h"
#include "gstrings.h"
#include "gi.h"
// Armor bonus --------------------------------------------------------------
class AArmorBonus : public ABasicArmorBonus
{
DECLARE_ACTOR (AArmorBonus, ABasicArmorBonus)
protected:
virtual const char *PickupMessage ()
{
return GStrings("GOTARMBONUS");
}
};
FState AArmorBonus::States[] =
{
S_NORMAL (BON2, 'A', 6, NULL , &States[1]),
S_NORMAL (BON2, 'B', 6, NULL , &States[2]),
S_NORMAL (BON2, 'C', 6, NULL , &States[3]),
S_NORMAL (BON2, 'D', 6, NULL , &States[4]),
S_NORMAL (BON2, 'C', 6, NULL , &States[5]),
S_NORMAL (BON2, 'B', 6, NULL , &States[0])
};
IMPLEMENT_ACTOR (AArmorBonus, Doom, 2015, 22)
PROP_RadiusFixed (20)
PROP_HeightFixed (16)
PROP_Flags (MF_SPECIAL|MF_COUNTITEM)
PROP_BasicArmorBonus_SavePercent (FRACUNIT/3)
PROP_BasicArmorBonus_SaveAmount (1)
PROP_BasicArmorBonus_MaxSaveAmount (200) // deh.MaxArmor
PROP_Inventory_FlagsSet (IF_ALWAYSPICKUP)
PROP_SpawnState (0)
PROP_Inventory_Icon ("ARM1A0")
END_DEFAULTS
// Green armor --------------------------------------------------------------
class AGreenArmor : public ABasicArmorPickup
{
DECLARE_ACTOR (AGreenArmor, ABasicArmorPickup)
protected:
virtual const char *PickupMessage ()
{
return GStrings("GOTARMOR");
}
};
FState AGreenArmor::States[] =
{
S_NORMAL (ARM1, 'A', 6, NULL , &States[1]),
S_BRIGHT (ARM1, 'B', 7, NULL , &States[0])
};
IMPLEMENT_ACTOR (AGreenArmor, Doom, 2018, 68)
PROP_RadiusFixed (20)
PROP_HeightFixed (16)
PROP_Flags (MF_SPECIAL)
PROP_BasicArmorPickup_SavePercent (FRACUNIT/3)
PROP_BasicArmorPickup_SaveAmount (100) // 100*deh.GreenAC
PROP_SpawnState (0)
PROP_Inventory_Icon ("ARM1A0")
END_DEFAULTS
// Blue armor ---------------------------------------------------------------
class ABlueArmor : public ABasicArmorPickup
{
DECLARE_ACTOR (ABlueArmor, ABasicArmorPickup)
protected:
virtual const char *PickupMessage ()
{
return GStrings("GOTMEGA");
}
};
FState ABlueArmor::States[] =
{
S_NORMAL (ARM2, 'A', 6, NULL , &States[1]),
S_BRIGHT (ARM2, 'B', 6, NULL , &States[0])
};
IMPLEMENT_ACTOR (ABlueArmor, Doom, 2019, 69)
PROP_RadiusFixed (20)
PROP_HeightFixed (16)
PROP_Flags (MF_SPECIAL)
PROP_BasicArmorPickup_SavePercent (FRACUNIT/2)
PROP_BasicArmorPickup_SaveAmount (200) // 100*deh.BlueAC
PROP_SpawnState (0)
PROP_Inventory_Icon ("ARM2A0")
END_DEFAULTS

View file

@ -1,403 +0,0 @@
#include "actor.h"
#include "info.h"
/********** Decorations ***********/
#define _DECCOMMON(cls,ednum,rad,hi,ns,id) \
class cls : public AActor { DECLARE_STATELESS_ACTOR (cls, AActor) static FState States[ns]; }; \
IMPLEMENT_ACTOR (cls, Doom, ednum, id) \
PROP_SpawnState(0) \
PROP_RadiusFixed(rad) \
PROP_HeightFixed(hi)
#define _DECSTARTSTATES(cls,ns) \
FState cls::States[ns] =
#define DECID(cls,ednum,id,rad,hi,ns) \
_DECCOMMON(cls,ednum,rad,hi,ns,id) \
PROP_Flags (MF_SOLID) \
END_DEFAULTS \
_DECSTARTSTATES(cls,ns)
#define DEC(cls,ednum,rad,hi,ns) \
DECID(cls,ednum,0,rad,hi,ns)
#define DECNSOLID(cls,ednum,rad,hi,ns) \
_DECCOMMON(cls,ednum,rad,hi,ns,0) \
END_DEFAULTS \
_DECSTARTSTATES(cls,ns)
#define DECHANG(cls,ednum,rad,hi,ns) \
_DECCOMMON(cls,ednum,rad,hi,ns,0) \
PROP_Flags (MF_SOLID|MF_SPAWNCEILING|MF_NOGRAVITY) \
END_DEFAULTS \
_DECSTARTSTATES(cls,ns)
#define DECHANGNS(cls,ednum,rad,hi,ns) \
_DECCOMMON(cls,ednum,rad,hi,ns,0) \
PROP_Flags (MF_SPAWNCEILING|MF_NOGRAVITY) \
END_DEFAULTS \
_DECSTARTSTATES(cls,ns)
#define DECNBLOCKID(cls,ednum,id,rad,hi,ns) \
_DECCOMMON(cls,ednum,rad,hi,ns,id) \
/*PROP_Flags (MF_NOBLOCKMAP)*/ \
END_DEFAULTS \
_DECSTARTSTATES(cls,ns)
#define SUBCLASS_NS(cls,super,ednum,rad,hi) \
class cls : public super { DECLARE_STATELESS_ACTOR (cls, super) }; \
IMPLEMENT_STATELESS_ACTOR (cls, Doom, ednum, 0) \
PROP_RadiusFixed (rad) \
PROP_HeightFixed (hi) \
PROP_FlagsClear (MF_SOLID) \
END_DEFAULTS
// Tech lamp ---------------------------------------------------------------
DEC (ATechLamp, 85, 16, 80, 4)
{
S_BRIGHT (TLMP, 'A', 4, NULL, &States[1]),
S_BRIGHT (TLMP, 'B', 4, NULL, &States[2]),
S_BRIGHT (TLMP, 'C', 4, NULL, &States[3]),
S_BRIGHT (TLMP, 'D', 4, NULL, &States[0])
};
// Tech lamp 2 -------------------------------------------------------------
DEC (ATechLamp2, 86, 16, 60, 4)
{
S_BRIGHT (TLP2, 'A', 4, NULL, &States[1]),
S_BRIGHT (TLP2, 'B', 4, NULL, &States[2]),
S_BRIGHT (TLP2, 'C', 4, NULL, &States[3]),
S_BRIGHT (TLP2, 'D', 4, NULL, &States[0])
};
// Column ------------------------------------------------------------------
DEC (AColumn, 2028, 16, 48, 1)
{
S_BRIGHT (COLU, 'A', -1, NULL, NULL)
};
// Tall green column -------------------------------------------------------
DEC (ATallGreenColumn, 30, 16, 52, 1)
{
S_NORMAL (COL1, 'A', -1, NULL, NULL)
};
// Short green column ------------------------------------------------------
DEC (AShortGreenColumn, 31, 16, 40, 1)
{
S_NORMAL (COL2, 'A', -1, NULL, NULL)
};
// Tall red column ---------------------------------------------------------
DEC (ATallRedColumn, 32, 16, 52, 1)
{
S_NORMAL (COL3, 'A', -1, NULL, NULL)
};
// Short red column --------------------------------------------------------
DEC (AShortRedColumn, 33, 16, 40, 1)
{
S_NORMAL (COL4, 'A', -1, NULL, NULL)
};
// Skull column ------------------------------------------------------------
DEC (ASkullColumn, 37, 16, 40, 1)
{
S_NORMAL (COL6, 'A', -1, NULL, NULL)
};
// Heart column ------------------------------------------------------------
DEC (AHeartColumn, 36, 16, 40, 2)
{
S_NORMAL (COL5, 'A', 14, NULL, &States[1]),
S_NORMAL (COL5, 'B', 14, NULL, &States[0])
};
// Evil eye ----------------------------------------------------------------
DEC (AEvilEye, 41, 16, 54, 4)
{
S_BRIGHT (CEYE, 'A', 6, NULL, &States[1]),
S_BRIGHT (CEYE, 'B', 6, NULL, &States[2]),
S_BRIGHT (CEYE, 'C', 6, NULL, &States[3]),
S_BRIGHT (CEYE, 'B', 6, NULL, &States[0])
};
// Floating skull ----------------------------------------------------------
DEC (AFloatingSkull, 42, 16, 26, 3)
{
S_BRIGHT (FSKU, 'A', 6, NULL, &States[1]),
S_BRIGHT (FSKU, 'B', 6, NULL, &States[2]),
S_BRIGHT (FSKU, 'C', 6, NULL, &States[0])
};
// Torch tree --------------------------------------------------------------
DEC (ATorchTree, 43, 16, 56, 1)
{
S_NORMAL (TRE1, 'A', -1, NULL, NULL)
};
// Blue torch --------------------------------------------------------------
DEC (ABlueTorch, 44, 16, 68, 4)
{
S_BRIGHT (TBLU, 'A', 4, NULL, &States[1]),
S_BRIGHT (TBLU, 'B', 4, NULL, &States[2]),
S_BRIGHT (TBLU, 'C', 4, NULL, &States[3]),
S_BRIGHT (TBLU, 'D', 4, NULL, &States[0])
};
// Green torch -------------------------------------------------------------
DEC (AGreenTorch, 45, 16, 68, 4)
{
S_BRIGHT (TGRN, 'A', 4, NULL, &States[1]),
S_BRIGHT (TGRN, 'B', 4, NULL, &States[2]),
S_BRIGHT (TGRN, 'C', 4, NULL, &States[3]),
S_BRIGHT (TGRN, 'D', 4, NULL, &States[0])
};
// Red torch ---------------------------------------------------------------
DEC (ARedTorch, 46, 16, 68, 4)
{
S_BRIGHT (TRED, 'A', 4, NULL, &States[1]),
S_BRIGHT (TRED, 'B', 4, NULL, &States[2]),
S_BRIGHT (TRED, 'C', 4, NULL, &States[3]),
S_BRIGHT (TRED, 'D', 4, NULL, &States[0])
};
// Short blue torch --------------------------------------------------------
DEC (AShortBlueTorch, 55, 16, 37, 4)
{
S_BRIGHT (SMBT, 'A', 4, NULL, &States[1]),
S_BRIGHT (SMBT, 'B', 4, NULL, &States[2]),
S_BRIGHT (SMBT, 'C', 4, NULL, &States[3]),
S_BRIGHT (SMBT, 'D', 4, NULL, &States[0])
};
// Short green torch -------------------------------------------------------
DEC (AShortGreenTorch, 56, 16, 37, 4)
{
S_BRIGHT (SMGT, 'A', 4, NULL, &States[1]),
S_BRIGHT (SMGT, 'B', 4, NULL, &States[2]),
S_BRIGHT (SMGT, 'C', 4, NULL, &States[3]),
S_BRIGHT (SMGT, 'D', 4, NULL, &States[0])
};
// Short red torch ---------------------------------------------------------
DEC (AShortRedTorch, 57, 16, 37, 4)
{
S_BRIGHT (SMRT, 'A', 4, NULL, &States[1]),
S_BRIGHT (SMRT, 'B', 4, NULL, &States[2]),
S_BRIGHT (SMRT, 'C', 4, NULL, &States[3]),
S_BRIGHT (SMRT, 'D', 4, NULL, &States[0])
};
// Stalagtite --------------------------------------------------------------
DEC (AStalagtite, 47, 16, 40, 1)
{
S_NORMAL (SMIT, 'A', -1, NULL, NULL)
};
// Tech pillar -------------------------------------------------------------
DEC (ATechPillar, 48, 16, 128, 1)
{
S_NORMAL (ELEC, 'A', -1, NULL, NULL)
};
// Candle stick ------------------------------------------------------------
DECNSOLID (ACandlestick, 34, 20, 14, 1)
{
S_BRIGHT (CAND, 'A', -1, NULL, NULL)
};
// Candelabra --------------------------------------------------------------
DEC (ACandelabra, 35, 16, 60, 1)
{
S_BRIGHT (CBRA, 'A', -1, NULL, NULL)
};
// Bloody twitch -----------------------------------------------------------
DECHANG (ABloodyTwitch, 49, 16, 68, 4)
{
S_NORMAL (GOR1, 'A', 10, NULL, &States[1]),
S_NORMAL (GOR1, 'B', 15, NULL, &States[2]),
S_NORMAL (GOR1, 'C', 8, NULL, &States[3]),
S_NORMAL (GOR1, 'B', 6, NULL, &States[0])
};
// Meat 2 ------------------------------------------------------------------
DECHANG (AMeat2, 50, 16, 84, 1)
{
S_NORMAL (GOR2, 'A', -1, NULL, NULL)
};
// Meat 3 ------------------------------------------------------------------
DECHANG (AMeat3, 51, 16, 84, 1)
{
S_NORMAL (GOR3, 'A', -1, NULL, NULL)
};
// Meat 4 ------------------------------------------------------------------
DECHANG (AMeat4, 52, 16, 68, 1)
{
S_NORMAL (GOR4, 'A', -1, NULL, NULL)
};
// Meat 5 ------------------------------------------------------------------
DECHANG (AMeat5, 53, 16, 52, 1)
{
S_NORMAL (GOR5, 'A', -1, NULL, NULL)
};
// Nonsolid meat -----------------------------------------------------------
SUBCLASS_NS (ANonsolidMeat2, AMeat2, 59, 20, 84)
SUBCLASS_NS (ANonsolidMeat3, AMeat3, 61, 20, 52)
SUBCLASS_NS (ANonsolidMeat4, AMeat4, 60, 20, 68)
SUBCLASS_NS (ANonsolidMeat5, AMeat5, 62, 20, 52)
// Nonsolid bloody twitch --------------------------------------------------
SUBCLASS_NS (ANonsolidTwitch, ABloodyTwitch, 63, 20, 68)
// Head on a stick ---------------------------------------------------------
DEC (AHeadOnAStick, 27, 16, 56, 1)
{
S_NORMAL (POL4, 'A', -1, NULL, NULL)
};
// Heads (plural!) on a stick ----------------------------------------------
DEC (AHeadsOnAStick, 28, 16, 64, 1)
{
S_NORMAL (POL2, 'A', -1, NULL, NULL)
};
// Head candles ------------------------------------------------------------
DEC (AHeadCandles, 29, 16, 42, 2)
{
S_BRIGHT (POL3, 'A', 6, NULL, &States[1]),
S_BRIGHT (POL3, 'B', 6, NULL, &States[0])
};
// Dead on a stick ---------------------------------------------------------
DEC (ADeadStick, 25, 16, 64, 1)
{
S_NORMAL (POL1, 'A', -1, NULL, NULL)
};
// Still alive on a stick --------------------------------------------------
DEC (ALiveStick, 26, 16, 64, 2)
{
S_NORMAL (POL6, 'A', 6, NULL, &States[1]),
S_NORMAL (POL6, 'B', 8, NULL, &States[0])
};
// Big tree ----------------------------------------------------------------
DEC (ABigTree, 54, 32, 108, 1)
{
S_NORMAL (TRE2, 'A', -1, NULL, NULL)
};
// Burning barrel ----------------------------------------------------------
DECID (ABurningBarrel, 70, 149, 16, 32, 3)
{
S_BRIGHT (FCAN, 'A', 4, NULL, &States[1]),
S_BRIGHT (FCAN, 'B', 4, NULL, &States[2]),
S_BRIGHT (FCAN, 'C', 4, NULL, &States[0])
};
// Hanging with no guts ----------------------------------------------------
DECHANG (AHangNoGuts, 73, 16, 88, 1)
{
S_NORMAL (HDB1, 'A', -1, NULL, NULL)
};
// Hanging from bottom with no brain ---------------------------------------
DECHANG (AHangBNoBrain, 74, 16, 88, 1)
{
S_NORMAL (HDB2, 'A', -1, NULL, NULL)
};
// Hanging from top, looking down ------------------------------------------
DECHANG (AHangTLookingDown, 75, 16, 64, 1)
{
S_NORMAL (HDB3, 'A', -1, NULL, NULL)
};
// Hanging from top, looking up --------------------------------------------
DECHANG (AHangTLookingUp, 77, 16, 64, 1)
{
S_NORMAL (HDB5, 'A', -1, NULL, NULL)
};
// Hanging from top, skully ------------------------------------------------
DECHANG (AHangTSkull, 76, 16, 64, 1)
{
S_NORMAL (HDB4, 'A', -1, NULL, NULL)
};
// Hanging from top without a brain ----------------------------------------
DECHANG (AHangTNoBrain, 78, 16, 64, 1)
{
S_NORMAL (HDB6, 'A', -1, NULL, NULL)
};
// Colon gibs --------------------------------------------------------------
DECNBLOCKID (AColonGibs, 79, 147, 20, 4, 1)
{
S_NORMAL (POB1, 'A', -1, NULL, NULL)
};
// Small pool o' blood -----------------------------------------------------
DECNBLOCKID (ASmallBloodPool, 80, 148, 20, 1, 1)
{
S_NORMAL (POB2, 'A', -1, NULL, NULL)
};
// brain stem lying on the ground ------------------------------------------
DECNBLOCKID (ABrainStem, 81, 150, 20, 4, 1)
{
S_NORMAL (BRS1, 'A', -1, NULL, NULL)
};

View file

@ -1,164 +0,0 @@
#include "info.h"
#include "a_pickups.h"
#include "d_player.h"
#include "gstrings.h"
#include "p_local.h"
#include "a_keys.h"
#include "gstrings.h"
IMPLEMENT_STATELESS_ACTOR (ADoomKey, Doom, -1, 0)
PROP_RadiusFixed (20)
PROP_HeightFixed (16)
PROP_Flags (MF_SPECIAL|MF_NOTDMATCH)
END_DEFAULTS
// Blue key card ------------------------------------------------------------
class ABlueCard : public ADoomKey
{
DECLARE_ACTOR (ABlueCard, ADoomKey)
public:
const char *PickupMessage ();
};
FState ABlueCard::States[] =
{
S_NORMAL (BKEY, 'A', 10, NULL , &States[1]),
S_BRIGHT (BKEY, 'B', 10, NULL , &States[0])
};
IMPLEMENT_ACTOR (ABlueCard, Doom, 5, 85)
PROP_SpawnState (0)
PROP_Inventory_Icon ("STKEYS0")
END_DEFAULTS
const char *ABlueCard::PickupMessage ()
{
return GStrings("GOTBLUECARD");
}
// Yellow key card ----------------------------------------------------------
class AYellowCard : public ADoomKey
{
DECLARE_ACTOR (AYellowCard, ADoomKey)
public:
const char *PickupMessage ();
};
FState AYellowCard::States[] =
{
S_NORMAL (YKEY, 'A', 10, NULL , &States[1]),
S_BRIGHT (YKEY, 'B', 10, NULL , &States[0])
};
IMPLEMENT_ACTOR (AYellowCard, Doom, 6, 87)
PROP_SpawnState (0)
PROP_Inventory_Icon ("STKEYS1")
END_DEFAULTS
const char *AYellowCard::PickupMessage ()
{
return GStrings("GOTYELWCARD");
}
// Red key card -------------------------------------------------------------
class ARedCard : public ADoomKey
{
DECLARE_ACTOR (ARedCard, ADoomKey)
public:
const char *PickupMessage ();
};
FState ARedCard::States[] =
{
S_NORMAL (RKEY, 'A', 10, NULL , &States[1]),
S_BRIGHT (RKEY, 'B', 10, NULL , &States[0])
};
IMPLEMENT_ACTOR (ARedCard, Doom, 13, 86)
PROP_SpawnState (0)
PROP_Inventory_Icon ("STKEYS2")
END_DEFAULTS
const char *ARedCard::PickupMessage ()
{
return GStrings("GOTREDCARD");
}
// Blue skull key -----------------------------------------------------------
class ABlueSkull : public ADoomKey
{
DECLARE_ACTOR (ABlueSkull, ADoomKey)
public:
const char *PickupMessage ();
};
FState ABlueSkull::States[] =
{
S_NORMAL (BSKU, 'A', 10, NULL , &States[1]),
S_BRIGHT (BSKU, 'B', 10, NULL , &States[0])
};
IMPLEMENT_ACTOR (ABlueSkull, Doom, 40, 90)
PROP_SpawnState (0)
PROP_Inventory_Icon ("STKEYS3")
END_DEFAULTS
const char *ABlueSkull::PickupMessage ()
{
return GStrings("GOTBLUESKUL");
}
// Yellow skull key ---------------------------------------------------------
class AYellowSkull : public ADoomKey
{
DECLARE_ACTOR (AYellowSkull, ADoomKey)
public:
const char *PickupMessage ();
};
FState AYellowSkull::States[] =
{
S_NORMAL (YSKU, 'A', 10, NULL , &States[1]),
S_BRIGHT (YSKU, 'B', 10, NULL , &States[0])
};
IMPLEMENT_ACTOR (AYellowSkull, Doom, 39, 88)
PROP_SpawnState (0)
PROP_Inventory_Icon ("STKEYS4")
END_DEFAULTS
const char *AYellowSkull::PickupMessage ()
{
return GStrings("GOTYELWSKUL");
}
// Red skull key ------------------------------------------------------------
class ARedSkull : public ADoomKey
{
DECLARE_ACTOR (ARedSkull, ADoomKey)
public:
const char *PickupMessage ();
};
FState ARedSkull::States[] =
{
S_NORMAL (RSKU, 'A', 10, NULL , &States[1]),
S_BRIGHT (RSKU, 'B', 10, NULL , &States[0])
};
IMPLEMENT_ACTOR (ARedSkull, Doom, 38, 89)
PROP_SpawnState (0)
PROP_Inventory_Icon ("STKEYS5")
END_DEFAULTS
const char *ARedSkull::PickupMessage ()
{
return GStrings("GOTREDSKUL");
}

View file

@ -634,7 +634,7 @@ private:
TAG_DONE);
DrBNumberOuter (ammo1->Amount, -67, -4 - BigHeight);
ammotop = -4 - BigHeight;
if (ammo2 != NULL)
if (ammo2 != NULL && ammo2!=ammo1)
{
// Draw secondary ammo just above the primary ammo
int y = MIN (-6 - BigHeight, -6 - (ammoIcon != NULL ? ammoIcon->GetHeight() : 0));

View file

@ -1,147 +0,0 @@
#include "actor.h"
#include "info.h"
/********** Decorations ***********/
#define _DECCOMMON(cls,ednum,rad,hi,ns) \
class cls : public AActor { DECLARE_STATELESS_ACTOR (cls, AActor) static FState States[ns]; }; \
IMPLEMENT_ACTOR (cls, Heretic, ednum, 0) \
PROP_SpawnState (0) \
PROP_RadiusFixed (rad) \
PROP_HeightFixed (hi)
#define _DECSTARTSTATES(cls,ns) \
FState cls::States[ns] =
#define DECF(cls,ednum,rad,hi,ns,fl) \
_DECCOMMON(cls,ednum,rad,hi,ns) \
PROP_Flags (fl) \
END_DEFAULTS \
_DECSTARTSTATES(cls,ns)
#define DEC(cls,ednum,rad,hi,ns) \
DECF(cls,ednum,rad,hi,ns,MF_SOLID)
#define DECNSOLID(cls,ednum,rad,hi,ns) \
_DECCOMMON(cls,ednum,rad,hi,ns) END_DEFAULTS _DECSTARTSTATES(cls,ns)
#define DECHANG(cls,ednum,rad,hi,ns) \
DECF(cls,ednum,rad,hi,ns,MF_SOLID|MF_SPAWNCEILING|MF_NOGRAVITY)
#define DECHANGNS(cls,ednum,rad,hi,ns) \
DECF(cls,ednum,rad,hi,ns,MF_SPAWNCEILING|MF_NOGRAVITY)
#define DECFLOATNS(cls,ednum,rad,hi,ns) \
DECF(cls,ednum,rad,hi,ns,MF_NOGRAVITY)
#define DECNBLOCK(cls,ednum,rad,hi,ns) \
DECF(cls,ednum,rad,hi,ns,MF_NOBLOCKMAP)
DECHANGNS (ASkullHang70, 17, 20, 70, 1)
{
S_NORMAL (SKH1, 'A', -1, NULL, NULL)
};
DECHANGNS (ASkullHang60, 24, 20, 60, 1)
{
S_NORMAL (SKH2, 'A', -1, NULL, NULL)
};
DECHANGNS (ASkullHang45, 25, 20, 45, 1)
{
S_NORMAL (SKH3, 'A', -1, NULL, NULL)
};
DECHANGNS (ASkullHang35, 26, 20, 35, 1)
{
S_NORMAL (SKH4, 'A', -1, NULL, NULL)
};
DECHANGNS (AChandelier, 28, 20, 60, 3)
{
S_NORMAL (CHDL, 'A', 4, NULL, &States[1]),
S_NORMAL (CHDL, 'B', 4, NULL, &States[2]),
S_NORMAL (CHDL, 'C', 4, NULL, &States[0])
};
DEC (ASerpentTorch, 27, 12, 54, 3)
{
S_NORMAL (SRTC, 'A', 4, NULL, &States[1]),
S_NORMAL (SRTC, 'B', 4, NULL, &States[2]),
S_NORMAL (SRTC, 'C', 4, NULL, &States[0])
};
DEC (ASmallPillar, 29, 16, 34, 1)
{
S_NORMAL (SMPL, 'A', -1, NULL, NULL)
};
DEC (AStalagmiteSmall, 37, 8, 32, 1)
{
S_NORMAL (STGS, 'A', -1, NULL, NULL)
};
DEC (AStalagmiteLarge, 38, 12, 64, 1)
{
S_NORMAL (STGL, 'A', -1, NULL, NULL)
};
DECHANG (AStalactiteSmall, 39, 8, 36, 1)
{
S_NORMAL (STCS, 'A', -1, NULL, NULL)
};
DECHANG (AStalactiteLarge, 40, 12, 68, 1)
{
S_NORMAL (STCL, 'A', -1, NULL, NULL)
};
DEC (AFireBrazier, 76, 16, 44, 8)
{
S_BRIGHT (KFR1, 'A', 3, NULL, &States[1]),
S_BRIGHT (KFR1, 'B', 3, NULL, &States[2]),
S_BRIGHT (KFR1, 'C', 3, NULL, &States[3]),
S_BRIGHT (KFR1, 'D', 3, NULL, &States[4]),
S_BRIGHT (KFR1, 'E', 3, NULL, &States[5]),
S_BRIGHT (KFR1, 'F', 3, NULL, &States[6]),
S_BRIGHT (KFR1, 'G', 3, NULL, &States[7]),
S_BRIGHT (KFR1, 'H', 3, NULL, &States[0])
};
DEC (ABarrel, 44, 12, 32, 1)
{
S_NORMAL (BARL, 'A', -1, NULL, NULL)
};
DEC (ABrownPillar, 47, 14, 128, 1)
{
S_NORMAL (BRPL, 'A', -1, NULL, NULL)
};
DECHANGNS (AMoss1, 48, 20, 23, 1)
{
S_NORMAL (MOS1, 'A', -1, NULL, NULL)
};
DECHANGNS (AMoss2, 49, 20, 27, 1)
{
S_NORMAL (MOS2, 'A', -1, NULL, NULL)
};
/*DECFLOATNS (AWallTorch, 50, 20, 16, 3)*/
_DECCOMMON(AWallTorch, 50, 20, 16, 3)
PROP_Flags (MF_NOGRAVITY)
PROP_Flags4 (MF4_FIXMAPTHINGPOS)
END_DEFAULTS
_DECSTARTSTATES(AWallTorch, 3)
{
S_BRIGHT (WTRH, 'A', 6, NULL, &States[1]),
S_BRIGHT (WTRH, 'B', 6, NULL, &States[2]),
S_BRIGHT (WTRH, 'C', 6, NULL, &States[0])
};
DECHANG (AHangingCorpse, 51, 8, 104, 1)
{
S_NORMAL (HCOR, 'A', -1, NULL, NULL)
};

View file

@ -408,6 +408,11 @@ private:
// Ammo
GetCurrentAmmo (ammo1, ammo2, ammocount1, ammocount2);
if (ammo1==ammo2)
{
// Don't show the same ammo twice.
ammo2=NULL;
}
if (oldammo1 != ammo1 || oldammo2 != ammo2 ||
oldammocount1 != ammocount1 || oldammocount2 != ammocount2)
{
@ -600,7 +605,7 @@ private:
DTA_HUDRules, HUD_Normal,
DTA_CenterBottomOffset, true,
TAG_DONE);
if (ammo2 != NULL)
if (ammo2 != NULL && ammo2!=ammo1)
{
// Draw secondary ammo just above the primary ammo
DrINumberOuter (ammo2->Amount, -29, -56);

View file

@ -448,6 +448,11 @@ private:
int drawbar;
GetCurrentAmmo (ammo1, ammo2, ammocount1, ammocount2);
if (ammo1==ammo2)
{
// Don't show the same ammo twice.
ammo2=NULL;
}
// If the weapon uses some ammo that is not mana, do not draw
// the mana bars; draw the specific used ammo instead.

View file

@ -1735,6 +1735,7 @@ void G_DoLoadLevel (int position, bool autosave)
}
level.starttime = gametic;
level.maptime = 0;
G_UnSnapshotLevel (!savegamerestore); // [RH] Restore the state of the level.
G_FinishTravel ();
if (players[consoleplayer].camera == NULL ||

View file

@ -331,45 +331,6 @@ void DCorpsePointer::Serialize (FArchive &arc)
arc << Corpse << Count;
}
// Pointers to members cannot be assigned to single array elements,
// so this class is deprecated. It exists now only for compatibility with
// old savegames.
class DCorpseQueue : public DThinker
{
DECLARE_CLASS (DCorpseQueue, DThinker)
HAS_OBJECT_POINTERS
public:
void Serialize (FArchive &arc);
void Tick ();
protected:
AActor *CorpseQueue[CORPSEQUEUESIZE];
};
IMPLEMENT_CLASS(DCorpseQueue)
void DCorpseQueue::Serialize (FArchive &arc)
{
int foo = 0;
int i;
Super::Serialize (arc);
for (i = 0; i < CORPSEQUEUESIZE; ++i)
arc << CorpseQueue[i];
arc << foo;
}
void DCorpseQueue::Tick ()
{
for (int i = 0; i < CORPSEQUEUESIZE; ++i)
{
if (CorpseQueue[i] != NULL)
{
new DCorpsePointer (CorpseQueue[i]);
}
}
Destroy ();
}
// throw another corpse on the queue
void A_QueueCorpse (AActor *actor)

View file

@ -812,6 +812,40 @@ void AInventory::Hide ()
}
}
//===========================================================================
//
//
//===========================================================================
static void PrintPickupMessage (const char *str)
{
if (str != NULL)
{
string temp;
if (strchr (str, '$'))
{
// The message or part of it is from the LANGUAGE lump
string name;
size_t part1 = strcspn (str, "$");
temp = string(str, part1);
size_t part2 = strcspn (str + part1 + 1, "$");
name = string(str + part1 + 1, part2);
temp += GStrings(name.GetChars());
if (str[part1 + 1 + part2] == '$')
{
temp += str + part1 + part2 + 2;
}
str = temp.GetChars();
}
Printf (PRINT_LOW, "%s\n", str);
}
}
//===========================================================================
//
// AInventory :: Touch
@ -845,7 +879,7 @@ void AInventory::Touch (AActor *toucher)
{
StaticLastMessageTic = gametic;
StaticLastMessage = message;
Printf (PRINT_LOW, "%s\n", message);
PrintPickupMessage (message);
StatusBar->FlashCrosshair ();
}
@ -860,7 +894,7 @@ void AInventory::Touch (AActor *toucher)
{
PlayPickupSound (toucher);
}
}
}
// [RH] Execute an attached special (if any)
DoPickupSpecial (toucher);

View file

@ -478,7 +478,7 @@ private:
DTA_HUDRules, HUD_Normal,
DTA_CenterBottomOffset, true,
TAG_DONE);
if (ammo2 != NULL)
if (ammo2 != NULL && ammo1!=ammo2)
{
// Draw secondary ammo just above the primary ammo
DrINumberOuter (ammo2->Amount, -23, -48, false, 7);

View file

@ -101,6 +101,7 @@ static bool r_showviewer;
CVAR (String, r_viewsize, "", CVAR_NOSET)
CVAR (Int, r_polymost, 0, 0)
CVAR (Bool, r_deathcamera, false, CVAR_ARCHIVE)
fixed_t r_BaseVisibility;
fixed_t r_WallVisibility;
@ -993,7 +994,7 @@ void R_SetupFrame (AActor *actor)
}
if (player != NULL &&
((player->cheats & CF_CHASECAM)/* || (camera->health <= 0)*/) &&
((player->cheats & CF_CHASECAM) || (r_deathcamera && camera->health <= 0)) &&
(camera->RenderStyle != STYLE_None) &&
!(camera->renderflags & RF_INVISIBLE) &&
camera->sprite != 0) // Sprite 0 is always TNT1

View file

@ -62,7 +62,7 @@ char *sc_ScriptsDir = "";
// PRIVATE DATA DEFINITIONS ------------------------------------------------
static char ScriptName[128];
static string ScriptName;
static char *ScriptBuffer;
static char *ScriptPtr;
static char *ScriptEndPtr;
@ -86,7 +86,9 @@ static bool Escape=true;
void SC_Open (const char *name)
{
SC_OpenLumpNum (Wads.GetNumForName (name), name);
int lump = Wads.CheckNumForFullName(name);
if (lump==-1) lump = Wads.GetNumForName(name);
SC_OpenLumpNum(lump, name);
}
//==========================================================================
@ -102,7 +104,8 @@ void SC_OpenFile (const char *name)
{
SC_Close ();
ScriptSize = M_ReadFile (name, (byte **)&ScriptBuffer);
ExtractFileBase (name, ScriptName);
ScriptName = name; // This is used for error messages so the full file name is preferable
//ExtractFileBase (name, ScriptName);
FreeScript = true;
SC_PrepareScript ();
}
@ -121,7 +124,7 @@ void SC_OpenMem (const char *name, char *buffer, int size)
SC_Close ();
ScriptSize = size;
ScriptBuffer = buffer;
strcpy (ScriptName, name);
ScriptName = name;
FreeScript = false;
SC_PrepareScript ();
}
@ -140,7 +143,7 @@ void SC_OpenLumpNum (int lump, const char *name)
ScriptSize = Wads.LumpLength (lump);
ScriptBuffer = new char[ScriptSize];
Wads.ReadLump (lump, ScriptBuffer);
strcpy (ScriptName, name);
ScriptName = name;
FreeScript = true;
SC_PrepareScript ();
}
@ -164,6 +167,7 @@ static void SC_PrepareScript (void)
AlreadyGot = false;
SavedScriptPtr = NULL;
CMode = false;
Escape = true;
}
//==========================================================================
@ -596,7 +600,7 @@ BOOL SC_GetFloat (void)
if (*stopper != 0)
{
I_Error ("SC_GetFloat: Bad numeric constant \"%s\".\n"
"Script %s, Line %d\n", sc_String, ScriptName, sc_Line);
"Script %s, Line %d\n", sc_String, ScriptName.GetChars(), sc_Line);
}
sc_Number = (int)sc_Float;
return true;
@ -747,7 +751,7 @@ void STACK_ARGS SC_ScriptError (const char *message, ...)
va_end (arglist);
}
I_Error ("Script error, \"%s\" line %d:\n%s\n", ScriptName,
I_Error ("Script error, \"%s\" line %d:\n%s\n", ScriptName.GetChars(),
sc_Line, composed.GetChars());
}
@ -764,3 +768,86 @@ static void CheckOpen(void)
I_FatalError ("SC_ call before SC_Open().");
}
}
//==========================================================================
//
// Script state saving
// This allows recursive script execution
// This does not save the last token!
//
//==========================================================================
struct SavedScript
{
int sc_Line;
BOOL sc_End;
BOOL sc_Crossed;
BOOL sc_FileScripts;
string * ScriptName;
char *ScriptBuffer;
char *ScriptPtr;
char *ScriptEndPtr;
bool ScriptOpen;
int ScriptSize;
bool FreeScript;
char *SavedScriptPtr;
int SavedScriptLine;
bool CMode;
bool Escape;
};
static TArray<SavedScript> SavedScripts;
void SC_SaveScriptState()
{
SavedScript ss;
ss.sc_Line = sc_Line;
ss.sc_End = sc_End;
ss.sc_Crossed = sc_Crossed;
ss.sc_FileScripts = sc_FileScripts;
ss.ScriptName = ::new string(ScriptName);
ss.ScriptBuffer = ScriptBuffer;
ss.ScriptPtr = ScriptPtr;
ss.ScriptEndPtr = ScriptEndPtr;
ss.ScriptOpen = ScriptOpen;
ss.ScriptSize = ScriptSize;
ss.FreeScript = FreeScript;
ss.SavedScriptPtr = SavedScriptPtr;
ss.SavedScriptLine = SavedScriptLine;
ss.CMode = CMode;
ss.Escape = Escape;
SavedScripts.Push(ss);
ScriptOpen = false;
}
void SC_RestoreScriptState()
{
if (SavedScripts.Size()>0)
{
SavedScript ss;
SavedScripts.Pop(ss);
sc_Line = ss.sc_Line;
sc_End = ss.sc_End;
sc_Crossed = ss.sc_Crossed;
sc_FileScripts = ss.sc_FileScripts;
ScriptName = *ss.ScriptName;
delete ss.ScriptName;
ScriptBuffer = ss.ScriptBuffer;
ScriptPtr = ss.ScriptPtr;
ScriptEndPtr = ss.ScriptEndPtr;
ScriptOpen = ss.ScriptOpen;
ScriptSize = ss.ScriptSize;
FreeScript = ss.FreeScript;
SavedScriptPtr = ss.SavedScriptPtr;
SavedScriptLine = ss.SavedScriptLine;
CMode = ss.CMode;
Escape = ss.Escape;
SavedScripts.ShrinkToFit();
AlreadyGot = false;
}
}

View file

@ -26,6 +26,8 @@ BOOL SC_Compare (const char *text);
int SC_MatchString (const char **strings);
int SC_MustMatchString (const char **strings);
void STACK_ARGS SC_ScriptError (const char *message, ...);
void SC_SaveScriptState();
void SC_RestoreScriptState();
extern char *sc_String;
extern int sc_StringLen;

View file

@ -2073,6 +2073,42 @@ static void ActorSkipSuper (AActor *defaults, Baggage &bag)
ResetActor(defaults, &bag);
}
//==========================================================================
//
//==========================================================================
static void ActorGame (AActor *defaults, Baggage &bag)
{
SC_MustGetString ();
if (SC_Compare ("Doom"))
{
bag.Info->GameFilter |= GAME_Doom;
}
else if (SC_Compare ("Heretic"))
{
bag.Info->GameFilter |= GAME_Heretic;
}
else if (SC_Compare ("Hexen"))
{
bag.Info->GameFilter |= GAME_Hexen;
}
else if (SC_Compare ("Raven"))
{
bag.Info->GameFilter |= GAME_Raven;
}
else if (SC_Compare ("Strife"))
{
bag.Info->GameFilter |= GAME_Strife;
}
else if (SC_Compare ("Any"))
{
bag.Info->GameFilter = GAME_Any;
}
else
{
SC_ScriptError ("Unknown game type %s", sc_String);
}
}
//==========================================================================
//
//==========================================================================
@ -2890,7 +2926,8 @@ static void InventoryIcon (AInventory *defaults, Baggage &bag)
defaults->Icon = TexMan.AddPatch (sc_String, ns_sprites);
if (defaults->Icon<=0)
{
Printf("Icon '%s' for '%s' not found\n", sc_String, bag.Info->Class->Name+1);
if (bag.Info->GameFilter == GAME_Any || bag.Info->GameFilter & gameinfo.gametype)
Printf("Icon '%s' for '%s' not found\n", sc_String, bag.Info->Class->Name+1);
}
}
}
@ -3239,6 +3276,7 @@ static const ActorProps props[] =
{ "dropitem", ActorDropItem, RUNTIME_CLASS(AActor) },
{ "explosiondamage", ActorExplosionDamage, RUNTIME_CLASS(AActor) },
{ "explosionradius", ActorExplosionRadius, RUNTIME_CLASS(AActor) },
{ "game", ActorGame, RUNTIME_CLASS(AActor) },
{ "gibhealth", ActorGibHealth, RUNTIME_CLASS(AActor) },
{ "greetings", ActorGreetingsState, RUNTIME_CLASS(AActor) },
{ "heal", ActorHealState, RUNTIME_CLASS(AActor) },

View file

@ -126,44 +126,6 @@ FWadCollection Wads;
// CODE --------------------------------------------------------------------
//==========================================================================
//
// strupr
//
// Suprisingly, glibc lacks this
//==========================================================================
#ifdef NEED_STRUPR
void strupr (char *s)
{
while (*s) {
*s = toupper (*s);
++s;
}
}
#endif
//==========================================================================
//
// filelength
//
// Suprisingly, glibc lacks this
//==========================================================================
#ifdef NEED_FILELENGTH
int filelength (int handle)
{
struct stat fileinfo;
if (fstat (handle, &fileinfo) == -1)
{
close (handle);
I_Error ("Error fstating");
}
return fileinfo.st_size;
}
#endif
//==========================================================================
//
// uppercoppy
@ -532,8 +494,7 @@ void FWadCollection::AddFile (const char *filename, const char * data, int lengt
strcpy(base, lname);
char * dot = strrchr(base,'.');
if (dot) *dot=0;
strupr(base);
strncpy(lump_p->name, base, 8);
uppercopy(lump_p->name, base);
lump_p->fullname = copystring(name);
lump_p->position = LittleLong(zip_fh->dwFileOffset) + sizeof(FZipLocalHeader) + LittleShort(zip_fh->wFileNameSize);
lump_p->size = zip_fh->dwSize;
@ -600,8 +561,7 @@ void FWadCollection::AddFile (const char *filename, const char * data, int lengt
singleinfo.FilePos = 0;
singleinfo.Size = LittleLong(wadinfo->GetLength());
ExtractFileBase (filename, name);
strupr (name);
strncpy (singleinfo.Name, name, 8);
uppercopy(singleinfo.Name, name);
NumLumps++;
}
Printf ("\n");