- Added the ACS commands

ReplaceTextures (str old_texture, str new_texture, optional bool not_lower,
      optional bool not_mid, optional bool not_upper, optional bool not_floor,
      optional bool not_ceiling); and
  SectorDamage (int tag, int amount, str type, bool players_only, bool in_air,
      str protection_item, bool subclasses_okay);
- Added the vid_nowidescreen cvar to disable widescreen aspect ratio
  correction. When this is enabled, the only display ratio available is 4:3
  (and 5:4 if vid_tft is set).
- Added support for setting an actor's damage property to an expression
  through decorate. Just enclose it within parentheses, and the expression
  will be evaluated exactly as-is without the normal Doom damage calculation.
  So if you want something that does exactly 6 damage, use a "Damage (6)"
  property. To deal normal Doom missile damage, you can use
  "Damage (random(1,8)*6)" instead of "Damage 6".
- Moved InvFirst and InvSel into APlayerPawn so that they can be consistantly
  maintained by ObtainInventory.


SVN r288 (trunk)
This commit is contained in:
Randy Heit 2006-08-12 02:30:57 +00:00
commit b25c7722f3
30 changed files with 369 additions and 180 deletions

View file

@ -95,6 +95,7 @@ static FRandom pr_ripperblood ("RipperBlood");
static FRandom pr_chunk ("Chunk");
static FRandom pr_checkmissilespawn ("CheckMissileSpawn");
static FRandom pr_spawnmissile ("SpawnMissile");
static FRandom pr_missiledamage ("MissileDamage");
FRandom pr_slam ("SkullSlam");
static FRandom pr_multiclasschoice ("MultiClassChoice");
@ -256,7 +257,7 @@ void AActor::Serialize (FArchive &arc)
<< momz
<< tics
<< state
<< damage
<< Damage
<< flags
<< flags2
<< flags3
@ -884,6 +885,16 @@ void AActor::ObtainInventory (AActor *other)
other->Inventory = NULL;
other->InventoryID = 0;
if (other->IsKindOf(RUNTIME_CLASS(APlayerPawn)) && this->IsKindOf(RUNTIME_CLASS(APlayerPawn)))
{
APlayerPawn *you = static_cast<APlayerPawn *>(other);
APlayerPawn *me = static_cast<APlayerPawn *>(this);
me->InvFirst = you->InvFirst;
me->InvSel = you->InvSel;
you->InvFirst = NULL;
you->InvSel = NULL;
}
AInventory *item = Inventory;
while (item != NULL)
{
@ -2198,9 +2209,6 @@ void P_NightmareRespawn (AActor *mobj)
}
//
// [RH] Some new functions to work with Thing IDs. ------->
//
AActor *AActor::TIDHash[128];
//
@ -2265,8 +2273,6 @@ void AActor::RemoveFromHash ()
tid = 0;
}
// <------- [RH] End new functions
angle_t AActor::AngleIncrements ()
{
return ANGLE_45;
@ -2280,6 +2286,35 @@ void AActor::GetExplodeParms (int &damage, int &dist, bool &hurtSource)
{
}
//==========================================================================
//
// AActor :: GetMissileDamage
//
// If the actor's damage amount is an expression, evaluate it and return
// the result. Otherwise, return ((random() & mask) + add) * damage.
//
//==========================================================================
int AActor::GetMissileDamage (int mask, int add)
{
if ((Damage & 0xC0000000) == 0x40000000)
{
return EvalExpressionI (Damage & 0x3FFFFFFF, this);
}
if (Damage == 0)
{
return 0;
}
else if (mask == 0)
{
return add * Damage;
}
else
{
return ((pr_missiledamage() & mask) + add) * Damage;
}
}
void AActor::Howl ()
{
}
@ -2304,7 +2339,7 @@ void AActor::HitFloor ()
bool AActor::Slam (AActor *thing)
{
int dam = ((pr_slam()%8)+1) * damage;
int dam = GetMissileDamage (7, 1);
P_DamageMobj (thing, this, this, dam, MOD_HIT);
P_TraceBleed (dam, thing, this);
flags &= ~MF_SKULLFLY;
@ -2747,7 +2782,7 @@ void AActor::Tick ()
// won't hurt anything. Don't do this if damage is 0! That way, you can
// still have missiles that go straight up and down through actors without
// damaging anything.
if ((flags & MF_MISSILE) && (momx|momy) == 0 && damage != 0)
if ((flags & MF_MISSILE) && (momx|momy) == 0 && Damage != 0)
{
momx = 1;
}