This commit is contained in:
Rachael Alexanderson 2017-05-17 08:53:34 -04:00
commit 0f54d7f854
15 changed files with 43 additions and 37 deletions

View file

@ -398,6 +398,10 @@ enum ActorFlag7
MF7_FORCEINFIGHTING = 0x40000000, // overrides a map setting of 'no infighting'. MF7_FORCEINFIGHTING = 0x40000000, // overrides a map setting of 'no infighting'.
MF7_SPRITEFLIP = 0x80000000, // sprite flipped on x-axis MF7_SPRITEFLIP = 0x80000000, // sprite flipped on x-axis
}; };
enum ActorFlag8
{
MF8_FRIGHTENING = 0x00000001, // for those moments when halloween just won't do
};
// --- mobj.renderflags --- // --- mobj.renderflags ---
enum ActorRenderFlag enum ActorRenderFlag
@ -517,6 +521,7 @@ typedef TFlags<ActorFlag4> ActorFlags4;
typedef TFlags<ActorFlag5> ActorFlags5; typedef TFlags<ActorFlag5> ActorFlags5;
typedef TFlags<ActorFlag6> ActorFlags6; typedef TFlags<ActorFlag6> ActorFlags6;
typedef TFlags<ActorFlag7> ActorFlags7; typedef TFlags<ActorFlag7> ActorFlags7;
typedef TFlags<ActorFlag8> ActorFlags8;
typedef TFlags<ActorRenderFlag> ActorRenderFlags; typedef TFlags<ActorRenderFlag> ActorRenderFlags;
typedef TFlags<ActorBounceFlag, uint16_t> ActorBounceFlags; typedef TFlags<ActorBounceFlag, uint16_t> ActorBounceFlags;
DEFINE_TFLAGS_OPERATORS (ActorFlags) DEFINE_TFLAGS_OPERATORS (ActorFlags)
@ -526,6 +531,7 @@ DEFINE_TFLAGS_OPERATORS (ActorFlags4)
DEFINE_TFLAGS_OPERATORS (ActorFlags5) DEFINE_TFLAGS_OPERATORS (ActorFlags5)
DEFINE_TFLAGS_OPERATORS (ActorFlags6) DEFINE_TFLAGS_OPERATORS (ActorFlags6)
DEFINE_TFLAGS_OPERATORS (ActorFlags7) DEFINE_TFLAGS_OPERATORS (ActorFlags7)
DEFINE_TFLAGS_OPERATORS (ActorFlags8)
DEFINE_TFLAGS_OPERATORS (ActorRenderFlags) DEFINE_TFLAGS_OPERATORS (ActorRenderFlags)
DEFINE_TFLAGS_OPERATORS (ActorBounceFlags) DEFINE_TFLAGS_OPERATORS (ActorBounceFlags)
@ -1022,6 +1028,7 @@ public:
ActorFlags5 flags5; // OMG! We need another one. ActorFlags5 flags5; // OMG! We need another one.
ActorFlags6 flags6; // Shit! Where did all the flags go? ActorFlags6 flags6; // Shit! Where did all the flags go?
ActorFlags7 flags7; // WHO WANTS TO BET ON 8!? ActorFlags7 flags7; // WHO WANTS TO BET ON 8!?
ActorFlags8 flags8; // I see your 8, and raise you a bet for 9.
double Floorclip; // value to use for floor clipping double Floorclip; // value to use for floor clipping
double radius, Height; // for movement checking double radius, Height; // for movement checking

View file

@ -211,7 +211,6 @@ typedef enum
CF_BUDDHA2 = 1 << 24, // [MC] Absolute buddha. No voodoo can kill it either. CF_BUDDHA2 = 1 << 24, // [MC] Absolute buddha. No voodoo can kill it either.
CF_GODMODE2 = 1 << 25, // [MC] Absolute godmode. No voodoo can kill it either. CF_GODMODE2 = 1 << 25, // [MC] Absolute godmode. No voodoo can kill it either.
CF_BUDDHA = 1 << 27, // [SP] Buddha mode - take damage, but don't die CF_BUDDHA = 1 << 27, // [SP] Buddha mode - take damage, but don't die
CF_POWERBUDDHA = 1 << 28, // [MC] Powerup version of Buddha to prevent interference with actual cheat.
CF_NOCLIP2 = 1 << 30, // [RH] More Quake-like noclip CF_NOCLIP2 = 1 << 30, // [RH] More Quake-like noclip
} cheat_t; } cheat_t;

View file

@ -207,6 +207,7 @@ xx(QuestItem28)
xx(QuestItem29) xx(QuestItem29)
xx(PowerDoubleFiringSpeed) xx(PowerDoubleFiringSpeed)
xx(PowerInfiniteAmmo) xx(PowerInfiniteAmmo)
xx(PowerBuddha)
xx(AcolyteBlue) xx(AcolyteBlue)
xx(SpectralLightningV1) xx(SpectralLightningV1)

View file

@ -3765,6 +3765,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Respawn)
self->flags5 = defs->flags5; self->flags5 = defs->flags5;
self->flags6 = defs->flags6; self->flags6 = defs->flags6;
self->flags7 = defs->flags7; self->flags7 = defs->flags7;
self->flags8 = defs->flags8;
self->SetState (self->SpawnState); self->SetState (self->SpawnState);
self->renderflags &= ~RF_INVISIBLE; self->renderflags &= ~RF_INVISIBLE;

View file

@ -996,7 +996,8 @@ void P_NewChaseDir(AActor * actor)
if (!(actor->flags6 & MF6_NOFEAR)) if (!(actor->flags6 & MF6_NOFEAR))
{ {
if ((actor->target->player != NULL && (actor->target->player->cheats & CF_FRIGHTENING)) || if ((actor->target->player != NULL && (actor->target->player->cheats & CF_FRIGHTENING)) ||
(actor->flags4 & MF4_FRIGHTENED)) (actor->flags4 & MF4_FRIGHTENED) ||
(actor->target->flags8 & MF8_FRIGHTENING))
{ {
delta = -delta; delta = -delta;
} }
@ -2658,7 +2659,7 @@ void A_DoChase (AActor *actor, bool fastchase, FState *meleestate, FState *missi
// [RH] Scared monsters attack less frequently // [RH] Scared monsters attack less frequently
if (((actor->target->player == NULL || if (((actor->target->player == NULL ||
!(actor->target->player->cheats & CF_FRIGHTENING)) && !((actor->target->player->cheats & CF_FRIGHTENING) || (actor->target->flags8 & MF8_FRIGHTENING))) &&
!(actor->flags4 & MF4_FRIGHTENED)) || !(actor->flags4 & MF4_FRIGHTENED)) ||
pr_scaredycat() < 43) pr_scaredycat() < 43)
{ {

View file

@ -963,7 +963,7 @@ static int DamageMobj (AActor *target, AActor *inflictor, AActor *source, int da
} }
return 0; return 0;
} }
if (target == source && damage < TELEFRAG_DAMAGE) if (target == source && (!telefragDamage || target->flags7 & MF7_LAXTELEFRAGDMG))
{ {
damage = int(damage * target->SelfDamageFactor); damage = int(damage * target->SelfDamageFactor);
} }
@ -1360,7 +1360,9 @@ static int DamageMobj (AActor *target, AActor *inflictor, AActor *source, int da
// but telefragging should still do enough damage to kill the player) // but telefragging should still do enough damage to kill the player)
// Ignore players that are already dead. // Ignore players that are already dead.
// [MC]Buddha2 absorbs telefrag damage, and anything else thrown their way. // [MC]Buddha2 absorbs telefrag damage, and anything else thrown their way.
if (!(flags & DMG_FORCED) && (((player->cheats & CF_BUDDHA2) || (((player->cheats & CF_BUDDHA|CF_POWERBUDDHA) || (player->mo->flags7 & MF7_BUDDHA)) && !telefragDamage)) && (player->playerstate != PST_DEAD))) if (!(flags & DMG_FORCED) && (((player->cheats & CF_BUDDHA2) || (((player->cheats & CF_BUDDHA) ||
(player->mo->FindInventory (PClass::FindActor(NAME_PowerBuddha),true) != nullptr) ||
(player->mo->flags7 & MF7_BUDDHA)) && !telefragDamage)) && (player->playerstate != PST_DEAD)))
{ {
// If this is a voodoo doll we need to handle the real player as well. // If this is a voodoo doll we need to handle the real player as well.
player->mo->health = target->health = player->health = 1; player->mo->health = target->health = player->health = 1;
@ -1896,7 +1898,9 @@ void P_PoisonDamage (player_t *player, AActor *source, int damage, bool playPain
target->health -= damage; target->health -= damage;
if (target->health <= 0) if (target->health <= 0)
{ // Death { // Death
if ((((player->cheats & CF_BUDDHA|CF_POWERBUDDHA) || (player->mo->flags7 & MF7_BUDDHA)) && damage < TELEFRAG_DAMAGE) || (player->cheats & CF_BUDDHA2)) if ((((player->cheats & CF_BUDDHA) || (player->cheats & CF_BUDDHA2) ||
(player->mo->flags7 & MF7_BUDDHA)) && damage < TELEFRAG_DAMAGE) ||
(player->mo->FindInventory (PClass::FindActor(NAME_PowerBuddha),true) != nullptr))
{ // [SP] Save the player... { // [SP] Save the player...
player->health = target->health = 1; player->health = target->health = 1;
} }

View file

@ -2873,7 +2873,7 @@ FUNC(LS_SetPlayerProperty)
// Add or remove a power // Add or remove a power
if (arg2 >= PROP_INVULNERABILITY && arg2 <= PROP_SPEED) if (arg2 >= PROP_INVULNERABILITY && arg2 <= PROP_SPEED)
{ {
static ENamedName powers[13] = static ENamedName powers[14] =
{ {
NAME_PowerInvulnerable, NAME_PowerInvulnerable,
NAME_PowerStrength, NAME_PowerStrength,
@ -2887,7 +2887,8 @@ FUNC(LS_SetPlayerProperty)
NAME_None, NAME_None,
NAME_PowerSpeed, NAME_PowerSpeed,
NAME_PowerInfiniteAmmo, NAME_PowerInfiniteAmmo,
NAME_PowerDoubleFiringSpeed NAME_PowerDoubleFiringSpeed,
NAME_PowerBuddha
}; };
int power = arg2 - PROP_INVULNERABILITY; int power = arg2 - PROP_INVULNERABILITY;
@ -2977,7 +2978,7 @@ FUNC(LS_SetPlayerProperty)
switch (arg2) switch (arg2)
{ {
case PROP_BUDDHA: case PROP_BUDDHA:
mask = CF_POWERBUDDHA; mask = CF_BUDDHA;
break; break;
case PROP_FROZEN: case PROP_FROZEN:
mask = CF_FROZEN; mask = CF_FROZEN;

View file

@ -407,6 +407,7 @@ void AActor::Serialize(FSerializer &arc)
A("flags5", flags5) A("flags5", flags5)
A("flags6", flags6) A("flags6", flags6)
A("flags7", flags7) A("flags7", flags7)
A("flags8", flags8)
A("weaponspecial", weaponspecial) A("weaponspecial", weaponspecial)
A("special1", special1) A("special1", special1)
A("special2", special2) A("special2", special2)
@ -8397,6 +8398,9 @@ void PrintMiscActorInfo(AActor *query)
Printf("\n flags7: %x", query->flags7.GetValue()); Printf("\n flags7: %x", query->flags7.GetValue());
for (flagi = 0; flagi <= 31; flagi++) for (flagi = 0; flagi <= 31; flagi++)
if (query->flags7 & ActorFlags7::FromInt(1<<flagi)) Printf(" %s", FLAG_NAME(1<<flagi, flags7)); if (query->flags7 & ActorFlags7::FromInt(1<<flagi)) Printf(" %s", FLAG_NAME(1<<flagi, flags7));
Printf("\n flags8: %x", query->flags8.GetValue());
for (flagi = 0; flagi <= 31; flagi++)
if (query->flags8 & ActorFlags8::FromInt(1<<flagi)) Printf(" %s", FLAG_NAME(1<<flagi, flags8));
Printf("\nBounce flags: %x\nBounce factors: f:%f, w:%f", Printf("\nBounce flags: %x\nBounce factors: f:%f, w:%f",
query->BounceFlags.GetValue(), query->bouncefactor, query->BounceFlags.GetValue(), query->bouncefactor,
query->wallbouncefactor); query->wallbouncefactor);

View file

@ -2156,9 +2156,10 @@ void P_FallingDamage (AActor *actor)
{ {
S_Sound (actor, CHAN_AUTO, "*land", 1, ATTN_NORM); S_Sound (actor, CHAN_AUTO, "*land", 1, ATTN_NORM);
P_NoiseAlert (actor, actor, true); P_NoiseAlert (actor, actor, true);
if (damage >= TELEFRAG_DAMAGE && (actor->player->cheats & (CF_GODMODE | CF_BUDDHA | CF_POWERBUDDHA ))) if (damage >= TELEFRAG_DAMAGE && ((actor->player->cheats & (CF_GODMODE | CF_BUDDHA) ||
(actor->FindInventory(PClass::FindActor(NAME_PowerBuddha), true) != nullptr))))
{ {
damage = 999; damage = TELEFRAG_DAMAGE - 1;
} }
} }
P_DamageMobj (actor, NULL, NULL, damage, NAME_Falling); P_DamageMobj (actor, NULL, NULL, damage, NAME_Falling);

View file

@ -324,6 +324,8 @@ static FFlagDef ActorFlagDefs[]=
DEFINE_FLAG(MF7, FORCEINFIGHTING, AActor, flags7), DEFINE_FLAG(MF7, FORCEINFIGHTING, AActor, flags7),
DEFINE_FLAG(MF7, SPRITEFLIP, AActor, flags7), DEFINE_FLAG(MF7, SPRITEFLIP, AActor, flags7),
DEFINE_FLAG(MF8, FRIGHTENING, AActor, flags8),
// Effect flags // Effect flags
DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects), DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects),
DEFINE_FLAG2(FX_ROCKET, ROCKETTRAIL, AActor, effects), DEFINE_FLAG2(FX_ROCKET, ROCKETTRAIL, AActor, effects),

View file

@ -989,6 +989,7 @@ DEFINE_PROPERTY(clearflags, 0, Actor)
defaults->flags5 = 0; defaults->flags5 = 0;
defaults->flags6 = 0; defaults->flags6 = 0;
defaults->flags7 = 0; defaults->flags7 = 0;
defaults->flags8 = 0;
} }
//========================================================================== //==========================================================================

View file

@ -1768,9 +1768,9 @@ void ScaleWithAspect (int &w, int &h, int Width, int Height)
} }
double y = w/yratio; double y = w/yratio;
if (y > h) if (y > h)
w = h*yratio; w = static_cast<int>(h * yratio);
else else
h = y; h = static_cast<int>(y);
} }
void IVideo::DumpAdapters () void IVideo::DumpAdapters ()

View file

@ -1114,7 +1114,6 @@ enum EPlayerCheats
CF_BUDDHA2 = 1 << 24, // [MC] Absolute buddha. No voodoo can kill it either. CF_BUDDHA2 = 1 << 24, // [MC] Absolute buddha. No voodoo can kill it either.
CF_GODMODE2 = 1 << 25, // [MC] Absolute godmode. No voodoo can kill it either. CF_GODMODE2 = 1 << 25, // [MC] Absolute godmode. No voodoo can kill it either.
CF_BUDDHA = 1 << 27, // [SP] Buddha mode - take damage, but don't die CF_BUDDHA = 1 << 27, // [SP] Buddha mode - take damage, but don't die
CF_POWERBUDDHA = 1 << 28, // [MC] Powerup version of Buddha to prevent interference with actual cheat.
CF_NOCLIP2 = 1 << 30, // [RH] More Quake-like noclip CF_NOCLIP2 = 1 << 30, // [RH] More Quake-like noclip
// These flags no longer exist, but keep the names for some stray mod that might have used them. // These flags no longer exist, but keep the names for some stray mod that might have used them.

View file

@ -1450,26 +1450,6 @@ class PowerBuddha : Powerup
{ {
Powerup.Duration -60; Powerup.Duration -60;
} }
override void InitEffect ()
{
Super.InitEffect();
if (Owner== null || Owner.player == null)
return;
Owner.player.cheats |= CF_POWERBUDDHA;
}
override void EndEffect ()
{
Super.EndEffect();
if (Owner== null || Owner.player == null)
return;
Owner.player.cheats &= ~CF_POWERBUDDHA;
}
} }
//=========================================================================== //===========================================================================

View file

@ -363,6 +363,7 @@ class ListMenuItemSlider : ListMenuItemSelectable
int mMinrange, mMaxrange; int mMinrange, mMaxrange;
int mStep; int mStep;
int mSelection; int mSelection;
int mDrawX;
//============================================================================= //=============================================================================
// //
@ -380,6 +381,7 @@ class ListMenuItemSlider : ListMenuItemSelectable
mMinrange = min; mMinrange = min;
mMaxrange = max; mMaxrange = max;
mStep = step; mStep = step;
mDrawX = 0;
} }
//============================================================================= //=============================================================================
@ -398,6 +400,7 @@ class ListMenuItemSlider : ListMenuItemSelectable
mMinrange = min; mMinrange = min;
mMaxrange = max; mMaxrange = max;
mStep = step; mStep = step;
mDrawX = 0;
} }
//============================================================================= //=============================================================================
@ -466,8 +469,8 @@ class ListMenuItemSlider : ListMenuItemSelectable
lm.ReleaseFocus(); lm.ReleaseFocus();
} }
int slide_left = SmallFont.StringWidth ("Green") + 8 + int(mXpos); int slide_left = mDrawX + 8;
int slide_right = slide_left + 12*8; // 12 char cells with 8 pixels each. int slide_right = slide_left + 10*8; // 12 char cells with 8 pixels each.
if (type == Menu.MOUSE_Click) if (type == Menu.MOUSE_Click)
{ {
@ -520,6 +523,8 @@ class ListMenuItemSlider : ListMenuItemSelectable
double x = SmallFont.StringWidth ("Green") + 8 + mXpos; double x = SmallFont.StringWidth ("Green") + 8 + mXpos;
double x2 = SmallFont.StringWidth (text) + 8 + mXpos; double x2 = SmallFont.StringWidth (text) + 8 + mXpos;
DrawSlider (MAX(x2, x), mYpos); mDrawX = MAX(x2, x);
DrawSlider (mDrawX, mYpos);
} }
} }