- scriptified a few more of the simpler powerups.

This commit is contained in:
Christoph Oelckers 2016-12-31 01:08:09 +01:00
commit 267b1842b4
5 changed files with 136 additions and 193 deletions

View file

@ -1481,10 +1481,6 @@ void APowerBuddha::EndEffect ()
Owner->player->cheats &= ~CF_BUDDHA;
}
// Scanner powerup ----------------------------------------------------------
IMPLEMENT_CLASS(APowerScanner, false, false)
// Time freezer powerup -----------------------------------------------------
IMPLEMENT_CLASS( APowerTimeFreezer, false, false)
@ -1747,144 +1743,6 @@ void APowerProtection::ModifyDamage(int damage, FName damageType, int &newdamage
}
}
// Drain rune -------------------------------------------------------
IMPLEMENT_CLASS(APowerDrain, false, false)
//===========================================================================
//
// ARuneDrain :: InitEffect
//
//===========================================================================
void APowerDrain::InitEffect( )
{
Super::InitEffect();
if (Owner== NULL || Owner->player == NULL)
return;
// Give the player the power to drain life from opponents when he damages them.
Owner->player->cheats |= CF_DRAIN;
}
//===========================================================================
//
// ARuneDrain :: EndEffect
//
//===========================================================================
void APowerDrain::EndEffect( )
{
Super::EndEffect();
// Nothing to do if there's no owner.
if (Owner != NULL && Owner->player != NULL)
{
// Take away the drain power.
Owner->player->cheats &= ~CF_DRAIN;
}
}
// Regeneration rune -------------------------------------------------------
IMPLEMENT_CLASS(APowerRegeneration, false, false)
//===========================================================================
//
// APowerRegeneration :: DoEffect
//
//===========================================================================
void APowerRegeneration::DoEffect()
{
Super::DoEffect();
if (Owner != NULL && Owner->health > 0 && (level.time & 31) == 0)
{
if (P_GiveBody(Owner, int(Strength)))
{
S_Sound(Owner, CHAN_ITEM, "*regenerate", 1, ATTN_NORM );
}
}
}
// High jump rune -------------------------------------------------------
IMPLEMENT_CLASS(APowerHighJump, false, false)
//===========================================================================
//
// ARuneHighJump :: InitEffect
//
//===========================================================================
void APowerHighJump::InitEffect( )
{
Super::InitEffect();
if (Owner== NULL || Owner->player == NULL)
return;
// Give the player the power to jump much higher.
Owner->player->cheats |= CF_HIGHJUMP;
}
//===========================================================================
//
// ARuneHighJump :: EndEffect
//
//===========================================================================
void APowerHighJump::EndEffect( )
{
Super::EndEffect();
// Nothing to do if there's no owner.
if (Owner != NULL && Owner->player != NULL)
{
// Take away the high jump power.
Owner->player->cheats &= ~CF_HIGHJUMP;
}
}
// Double firing speed rune ---------------------------------------------
IMPLEMENT_CLASS(APowerDoubleFiringSpeed, false, false)
//===========================================================================
//
// APowerDoubleFiringSpeed :: InitEffect
//
//===========================================================================
void APowerDoubleFiringSpeed::InitEffect( )
{
Super::InitEffect();
if (Owner== NULL || Owner->player == NULL)
return;
// Give the player the power to shoot twice as fast.
Owner->player->cheats |= CF_DOUBLEFIRINGSPEED;
}
//===========================================================================
//
// APowerDoubleFiringSpeed :: EndEffect
//
//===========================================================================
void APowerDoubleFiringSpeed::EndEffect( )
{
Super::EndEffect();
// Nothing to do if there's no owner.
if (Owner != NULL && Owner->player != NULL)
{
// Take away the shooting twice as fast power.
Owner->player->cheats &= ~CF_DOUBLEFIRINGSPEED;
}
}
// Morph powerup ------------------------------------------------------
IMPLEMENT_CLASS(APowerMorph, false, true)