From ecfe67dd788f957a5017da0d7a45039aa7fa767e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 12 Aug 2013 09:13:55 +0200 Subject: [PATCH] - removed weirdness from Powerup.Strength property that was specifically tailored to its use on PowerInvisibility and made its use problematic elsewhere. --- src/g_shared/a_artifacts.cpp | 6 +++--- src/thingdef/thingdef_properties.cpp | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/g_shared/a_artifacts.cpp b/src/g_shared/a_artifacts.cpp index 5c8cd9614..2ef2b03c5 100644 --- a/src/g_shared/a_artifacts.cpp +++ b/src/g_shared/a_artifacts.cpp @@ -589,7 +589,7 @@ void APowerInvisibility::DoEffect () Super::DoEffect(); // Due to potential interference with other PowerInvisibility items // the effect has to be refreshed each tic. - fixed_t ts = Strength * (special1 + 1); if (ts > FRACUNIT) ts = FRACUNIT; + fixed_t ts = (Strength/100) * (special1 + 1); if (ts > FRACUNIT) ts = FRACUNIT; Owner->alpha = clamp((OPAQUE - ts), 0, OPAQUE); switch (Mode) { @@ -669,7 +669,7 @@ int APowerInvisibility::AlterWeaponSprite (visstyle_t *vis) else if (changed == 1) { // something else set the weapon sprite back to opaque but this item is still active. - fixed_t ts = Strength * (special1 + 1); if (ts > FRACUNIT) ts = FRACUNIT; + fixed_t ts = (Strength/100) * (special1 + 1); if (ts > FRACUNIT) ts = FRACUNIT; vis->alpha = clamp((OPAQUE - ts), 0, OPAQUE); switch (Mode) { @@ -696,7 +696,7 @@ int APowerInvisibility::AlterWeaponSprite (visstyle_t *vis) // Handling of Strife-like cumulative invisibility powerups, the weapon itself shouldn't become invisible if ((vis->alpha < TRANSLUC25 && special1 > 0) || (vis->alpha == 0)) { - vis->alpha = clamp((OPAQUE - Strength), 0, OPAQUE); + vis->alpha = clamp((OPAQUE - (Strength/100)), 0, OPAQUE); vis->colormap = SpecialColormaps[INVERSECOLORMAP].Colormap; } return -1; // This item is valid so another one shouldn't reset the translucency diff --git a/src/thingdef/thingdef_properties.cpp b/src/thingdef/thingdef_properties.cpp index fcb3bc2ef..dc08db361 100644 --- a/src/thingdef/thingdef_properties.cpp +++ b/src/thingdef/thingdef_properties.cpp @@ -2113,9 +2113,8 @@ DEFINE_CLASS_PROPERTY_PREFIX(powerup, strength, F, Inventory) I_Error("\"powerup.strength\" requires an actor of type \"Powerup\"\n"); return; } - // Puts a percent value in the 0.0..1.0 range PROP_FIXED_PARM(f, 0); - *pStrength = f / 100; + *pStrength = f; } //==========================================================================