diff --git a/src/actor.h b/src/actor.h index 17a7a6a8ab..043f07ae5f 100644 --- a/src/actor.h +++ b/src/actor.h @@ -398,6 +398,10 @@ enum ActorFlag7 MF7_FORCEINFIGHTING = 0x40000000, // overrides a map setting of 'no infighting'. MF7_SPRITEFLIP = 0x80000000, // sprite flipped on x-axis }; +enum ActorFlag8 +{ + MF8_FRIGHTENING = 0x00000001, // for those moments when halloween just won't do +}; // --- mobj.renderflags --- enum ActorRenderFlag @@ -517,6 +521,7 @@ typedef TFlags ActorFlags4; typedef TFlags ActorFlags5; typedef TFlags ActorFlags6; typedef TFlags ActorFlags7; +typedef TFlags ActorFlags8; typedef TFlags ActorRenderFlags; typedef TFlags ActorBounceFlags; DEFINE_TFLAGS_OPERATORS (ActorFlags) @@ -526,6 +531,7 @@ DEFINE_TFLAGS_OPERATORS (ActorFlags4) DEFINE_TFLAGS_OPERATORS (ActorFlags5) DEFINE_TFLAGS_OPERATORS (ActorFlags6) DEFINE_TFLAGS_OPERATORS (ActorFlags7) +DEFINE_TFLAGS_OPERATORS (ActorFlags8) DEFINE_TFLAGS_OPERATORS (ActorRenderFlags) DEFINE_TFLAGS_OPERATORS (ActorBounceFlags) @@ -1022,6 +1028,7 @@ public: ActorFlags5 flags5; // OMG! We need another one. ActorFlags6 flags6; // Shit! Where did all the flags go? 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 radius, Height; // for movement checking diff --git a/src/d_player.h b/src/d_player.h index 509f089d98..7d8dbf380c 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -211,7 +211,6 @@ typedef enum 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_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 } cheat_t; diff --git a/src/namedef.h b/src/namedef.h index f4f9a22c8d..db492c1b27 100644 --- a/src/namedef.h +++ b/src/namedef.h @@ -207,6 +207,7 @@ xx(QuestItem28) xx(QuestItem29) xx(PowerDoubleFiringSpeed) xx(PowerInfiniteAmmo) +xx(PowerBuddha) xx(AcolyteBlue) xx(SpectralLightningV1) diff --git a/src/p_actionfunctions.cpp b/src/p_actionfunctions.cpp index 838c885e60..51c37f23d4 100644 --- a/src/p_actionfunctions.cpp +++ b/src/p_actionfunctions.cpp @@ -3765,6 +3765,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Respawn) self->flags5 = defs->flags5; self->flags6 = defs->flags6; self->flags7 = defs->flags7; + self->flags8 = defs->flags8; self->SetState (self->SpawnState); self->renderflags &= ~RF_INVISIBLE; diff --git a/src/p_enemy.cpp b/src/p_enemy.cpp index 3b052cfa6d..abd6508ed8 100644 --- a/src/p_enemy.cpp +++ b/src/p_enemy.cpp @@ -996,7 +996,8 @@ void P_NewChaseDir(AActor * actor) if (!(actor->flags6 & MF6_NOFEAR)) { 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; } @@ -2658,7 +2659,7 @@ void A_DoChase (AActor *actor, bool fastchase, FState *meleestate, FState *missi // [RH] Scared monsters attack less frequently 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)) || pr_scaredycat() < 43) { diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index 069967a7fb..f9c027c35f 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -963,7 +963,7 @@ static int DamageMobj (AActor *target, AActor *inflictor, AActor *source, int da } return 0; } - if (target == source && damage < TELEFRAG_DAMAGE) + if (target == source && (!telefragDamage || target->flags7 & MF7_LAXTELEFRAGDMG)) { 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) // Ignore players that are already dead. // [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. 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; if (target->health <= 0) { // 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... player->health = target->health = 1; } diff --git a/src/p_lnspec.cpp b/src/p_lnspec.cpp index 130ea00f39..001b39be83 100644 --- a/src/p_lnspec.cpp +++ b/src/p_lnspec.cpp @@ -2873,7 +2873,7 @@ FUNC(LS_SetPlayerProperty) // Add or remove a power if (arg2 >= PROP_INVULNERABILITY && arg2 <= PROP_SPEED) { - static ENamedName powers[13] = + static ENamedName powers[14] = { NAME_PowerInvulnerable, NAME_PowerStrength, @@ -2887,7 +2887,8 @@ FUNC(LS_SetPlayerProperty) NAME_None, NAME_PowerSpeed, NAME_PowerInfiniteAmmo, - NAME_PowerDoubleFiringSpeed + NAME_PowerDoubleFiringSpeed, + NAME_PowerBuddha }; int power = arg2 - PROP_INVULNERABILITY; @@ -2977,7 +2978,7 @@ FUNC(LS_SetPlayerProperty) switch (arg2) { case PROP_BUDDHA: - mask = CF_POWERBUDDHA; + mask = CF_BUDDHA; break; case PROP_FROZEN: mask = CF_FROZEN; diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 2db57b613a..c2aa09682f 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -407,6 +407,7 @@ void AActor::Serialize(FSerializer &arc) A("flags5", flags5) A("flags6", flags6) A("flags7", flags7) + A("flags8", flags8) A("weaponspecial", weaponspecial) A("special1", special1) A("special2", special2) @@ -8397,6 +8398,9 @@ void PrintMiscActorInfo(AActor *query) Printf("\n flags7: %x", query->flags7.GetValue()); for (flagi = 0; flagi <= 31; flagi++) if (query->flags7 & ActorFlags7::FromInt(1<flags8.GetValue()); + for (flagi = 0; flagi <= 31; flagi++) + if (query->flags8 & ActorFlags8::FromInt(1<BounceFlags.GetValue(), query->bouncefactor, query->wallbouncefactor); diff --git a/src/p_user.cpp b/src/p_user.cpp index f01ea08ae6..4d9ed3af27 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -2156,9 +2156,10 @@ void P_FallingDamage (AActor *actor) { S_Sound (actor, CHAN_AUTO, "*land", 1, ATTN_NORM); 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); diff --git a/src/scripting/thingdef_data.cpp b/src/scripting/thingdef_data.cpp index 0c3962c7d2..f62ba0c88a 100644 --- a/src/scripting/thingdef_data.cpp +++ b/src/scripting/thingdef_data.cpp @@ -324,6 +324,8 @@ static FFlagDef ActorFlagDefs[]= DEFINE_FLAG(MF7, FORCEINFIGHTING, AActor, flags7), DEFINE_FLAG(MF7, SPRITEFLIP, AActor, flags7), + DEFINE_FLAG(MF8, FRIGHTENING, AActor, flags8), + // Effect flags DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects), DEFINE_FLAG2(FX_ROCKET, ROCKETTRAIL, AActor, effects), diff --git a/src/scripting/thingdef_properties.cpp b/src/scripting/thingdef_properties.cpp index c948d05e35..170fa11483 100644 --- a/src/scripting/thingdef_properties.cpp +++ b/src/scripting/thingdef_properties.cpp @@ -989,6 +989,7 @@ DEFINE_PROPERTY(clearflags, 0, Actor) defaults->flags5 = 0; defaults->flags6 = 0; defaults->flags7 = 0; + defaults->flags8 = 0; } //========================================================================== diff --git a/src/v_video.cpp b/src/v_video.cpp index a3c7d38788..44f634d000 100644 --- a/src/v_video.cpp +++ b/src/v_video.cpp @@ -1768,9 +1768,9 @@ void ScaleWithAspect (int &w, int &h, int Width, int Height) } double y = w/yratio; if (y > h) - w = h*yratio; + w = static_cast(h * yratio); else - h = y; + h = static_cast(y); } void IVideo::DumpAdapters () diff --git a/wadsrc/static/zscript/constants.txt b/wadsrc/static/zscript/constants.txt index 2d2be8ff7d..5477d24eed 100644 --- a/wadsrc/static/zscript/constants.txt +++ b/wadsrc/static/zscript/constants.txt @@ -1114,7 +1114,6 @@ enum EPlayerCheats 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_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 // These flags no longer exist, but keep the names for some stray mod that might have used them. diff --git a/wadsrc/static/zscript/inventory/powerups.txt b/wadsrc/static/zscript/inventory/powerups.txt index cf0dc21067..055fd518f8 100644 --- a/wadsrc/static/zscript/inventory/powerups.txt +++ b/wadsrc/static/zscript/inventory/powerups.txt @@ -1450,26 +1450,6 @@ class PowerBuddha : Powerup { 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; - } } //=========================================================================== diff --git a/wadsrc/static/zscript/menu/playercontrols.txt b/wadsrc/static/zscript/menu/playercontrols.txt index b0f97cdbc2..b5bd7c79ee 100644 --- a/wadsrc/static/zscript/menu/playercontrols.txt +++ b/wadsrc/static/zscript/menu/playercontrols.txt @@ -363,6 +363,7 @@ class ListMenuItemSlider : ListMenuItemSelectable int mMinrange, mMaxrange; int mStep; int mSelection; + int mDrawX; //============================================================================= // @@ -380,6 +381,7 @@ class ListMenuItemSlider : ListMenuItemSelectable mMinrange = min; mMaxrange = max; mStep = step; + mDrawX = 0; } //============================================================================= @@ -398,6 +400,7 @@ class ListMenuItemSlider : ListMenuItemSelectable mMinrange = min; mMaxrange = max; mStep = step; + mDrawX = 0; } //============================================================================= @@ -466,8 +469,8 @@ class ListMenuItemSlider : ListMenuItemSelectable lm.ReleaseFocus(); } - int slide_left = SmallFont.StringWidth ("Green") + 8 + int(mXpos); - int slide_right = slide_left + 12*8; // 12 char cells with 8 pixels each. + int slide_left = mDrawX + 8; + int slide_right = slide_left + 10*8; // 12 char cells with 8 pixels each. if (type == Menu.MOUSE_Click) { @@ -520,6 +523,8 @@ class ListMenuItemSlider : ListMenuItemSelectable double x = SmallFont.StringWidth ("Green") + 8 + mXpos; double x2 = SmallFont.StringWidth (text) + 8 + mXpos; - DrawSlider (MAX(x2, x), mYpos); + mDrawX = MAX(x2, x); + + DrawSlider (mDrawX, mYpos); } } \ No newline at end of file