diff --git a/core/src/main/assets/messages/items/items.properties b/core/src/main/assets/messages/items/items.properties index e90390699..344ed6dd1 100644 --- a/core/src/main/assets/messages/items/items.properties +++ b/core/src/main/assets/messages/items/items.properties @@ -1405,8 +1405,8 @@ items.trinkets.shardofoblivion$wandusetracker.desc=You have recently used an uni items.trinkets.thirteenleafclover.name=thirteen leaf clover items.trinkets.thirteenleafclover.desc=Somehow stewing in the alchemy pot has caused this clover to grow a bunch of extra leaves! It's not really clear if this trinket is lucky or unlucky, perhaps this trinket will make your luck more chaotic? -items.trinkets.thirteenleafclover.typical_stats_desc=Normally when the hero deals damage, numbers closer to the average are more common. Typically this trinket has a _%d%%_ chance to invert this, making your attacks much more likely to deal the maximum or minimum damage instead.\n\nThis trinket costs relatively little energy to upgrade. -items.trinkets.thirteenleafclover.stats_desc=Normally when the hero deals damage, numbers closer to the average are more common. At its current level this trinket has a _%d%%_ chance to invert this, making your attacks much more likely to deal the maximum or minimum damage instead.\n\nThis trinket costs relatively little energy to upgrade. +items.trinkets.thirteenleafclover.typical_stats_desc=Typically this trinket will cause you to deal maximum damage _%1$d%%_ of the time, and minimum damage _%2$d%%_ of the time. +items.trinkets.thirteenleafclover.stats_desc=At its current level this trinket will cause you to deal maximum damage _%1$d%%_ of the time, and minimum damage _%2$d%%_ of the time. items.trinkets.trapmechanism.name=trap mechanism items.trinkets.trapmechanism.desc=The core mechanism of one of the dungeon's pitfall traps, carefully carved out of the floor so it can be carried. It seems to be magically tied to the dungeon itself, making terrain more hazardous for you and the dungeon's inhabitants. diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java index 2ce863b80..9102116c1 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java @@ -674,10 +674,10 @@ public class Hero extends Char { return dmg; } - //damage rolls that come from the hero can have their RNG influenced + //damage rolls that come from the hero can have their RNG influenced by clover public static int heroDamageIntRange(int min, int max ){ - if (Random.Float() < ThirteenLeafClover.combatDistributionInverseChance()){ - return ThirteenLeafClover.invCombatRoll(min, max); + if (Random.Float() < ThirteenLeafClover.alterHeroDamageChance()){ + return ThirteenLeafClover.alterDamageRoll(min, max); } else { return Random.NormalIntRange(min, max); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/trinkets/ThirteenLeafClover.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/trinkets/ThirteenLeafClover.java index db7c35909..bf34487a1 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/trinkets/ThirteenLeafClover.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/trinkets/ThirteenLeafClover.java @@ -33,24 +33,24 @@ public class ThirteenLeafClover extends Trinket { @Override protected int upgradeEnergyCost() { - //6 -> 5(11) -> 7(18) -> 8(26) - return Math.round(5+1.67f*level()); + //6 -> 8(14) -> 10(24) -> 12(36) + return 6+2*level(); } @Override public String statsDesc() { if (isIdentified()){ - return Messages.get(this, "stats_desc", (int)(100*combatDistributionInverseChance(buffedLvl()))); + return Messages.get(this, "stats_desc", Math.round(MAX_CHANCE * 100*alterHeroDamageChance(buffedLvl())), Math.round((1f-MAX_CHANCE) * 100*alterHeroDamageChance(buffedLvl()))); } else { - return Messages.get(this, "typical_stats_desc", (int)(100*combatDistributionInverseChance(0))); + return Messages.get(this, "typical_stats_desc", Math.round(MAX_CHANCE * 100*alterHeroDamageChance(0)), Math.round((1f-MAX_CHANCE) * 100*alterHeroDamageChance(0))); } } - public static float combatDistributionInverseChance(){ - return combatDistributionInverseChance(trinketLevel(ThirteenLeafClover.class)); + public static float alterHeroDamageChance(){ + return alterHeroDamageChance(trinketLevel(ThirteenLeafClover.class)); } - public static float combatDistributionInverseChance( int level ){ + public static float alterHeroDamageChance(int level ){ if (level <= -1){ return 0; } else { @@ -58,8 +58,14 @@ public class ThirteenLeafClover extends Trinket { } } - public static int invCombatRoll( int min, int max){ - return Random.InvNormalIntRange( min, max ); + private static float MAX_CHANCE = 0.6f; + + public static int alterDamageRoll(int min, int max){ + if (Random.Float() < MAX_CHANCE){ + return max; + } else { + return min; + } } }