- Fixed: In Strife, using the shadow armor a second time while it is still

active should make you completely invisible and your first-person weapon
  inverse grayscale.


SVN r499 (trunk)
This commit is contained in:
Randy Heit 2007-03-08 23:34:54 +00:00
parent 72643bece6
commit 1a72c5f7b9
3 changed files with 50 additions and 5 deletions

View file

@ -1,3 +1,8 @@
March 8, 2007
- Fixed: In Strife, using the shadow armor a second time while it is still
active should make you completely invisible and your first-person weapon
inverse grayscale.
March 7, 2007
- Changed P_SpawnPlayerMissile() to use the same height calculation as
P_(Aim)LineAttack().

View file

@ -669,6 +669,40 @@ IMPLEMENT_STATELESS_ACTOR (APowerShadow, Any, -1, 0)
PROP_Inventory_FlagsSet (IF_HUBPOWER)
END_DEFAULTS
//===========================================================================
//
// APowerShadow :: HandlePickup
//
// If the player already has the first stage of the powerup, getting it
// again makes them completely invisible. Special1 tracks which stage we
// are in, initially 0.
//
//===========================================================================
bool APowerShadow::HandlePickup (AInventory *item)
{
if (special1 == 0 && item->GetClass() == GetClass())
{
APowerup *power = static_cast<APowerup *>(item);
if (power->EffectTics == 0)
{
power->ItemFlags |= IF_PICKUPGOOD;
return true;
}
// Only increase the EffectTics, not decrease it.
// Color also gets transferred only when the new item has an effect.
if (power->EffectTics > EffectTics)
{
EffectTics = power->EffectTics;
BlendColor = power->BlendColor;
}
special1 = 1; // Go to stage 2.
power->ItemFlags |= IF_PICKUPGOOD;
return true;
}
return Super::HandlePickup (item);
}
//===========================================================================
//
// APowerShadow :: InitEffect
@ -678,7 +712,7 @@ END_DEFAULTS
void APowerShadow::InitEffect ()
{
Owner->flags |= MF_SHADOW;
Owner->alpha = TRANSLUC25;
Owner->alpha = special1 == 0 ? TRANSLUC25 : 0;
Owner->RenderStyle = STYLE_Translucent;
}
@ -704,6 +738,11 @@ int APowerShadow::AlterWeaponSprite (vissprite_t *vis)
vis->alpha = TRANSLUC25;
vis->RenderStyle = STYLE_Translucent;
}
if (special1 == 1)
{
vis->alpha = TRANSLUC25;
vis->colormap = InverseColormap;
}
return -1; // This item is valid so another one shouldn't reset the translucency
}

View file

@ -105,6 +105,7 @@ class APowerShadow : public APowerInvisibility
{
DECLARE_STATELESS_ACTOR (APowerShadow, APowerInvisibility)
protected:
bool HandlePickup (AInventory *item);
void InitEffect ();
int AlterWeaponSprite (vissprite_t *vis);
};