diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java index 9221731ec..4f241e1ec 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java @@ -630,7 +630,7 @@ public abstract class Mob extends Char { } //ring of wealth logic - if (Ring.getBonus(Dungeon.hero, RingOfWealth.Wealth.class) > 0) { + if (Ring.getBuffedBonus(Dungeon.hero, RingOfWealth.Wealth.class) > 0) { int rolls = 1; if (properties.contains(Property.BOSS)) rolls = 15; else if (properties.contains(Property.MINIBOSS)) rolls = 5; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/Ring.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/Ring.java index 7e2f70b1d..15a253551 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/Ring.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/Ring.java @@ -309,8 +309,24 @@ public class Ring extends KindofMisc { } return bonus; } + + public static int getBuffedBonus(Char target, Class type){ + int bonus = 0; + for (RingBuff buff : target.buffs(type)) { + bonus += buff.buffedLvl(); + } + return bonus; + } public int soloBonus(){ + if (cursed){ + return Math.min( 0, Ring.this.level()-2 ); + } else { + return Ring.this.level()+1; + } + } + + public int soloBuffedBonus(){ if (cursed){ return Math.min( 0, Ring.this.buffedLvl()-2 ); } else { @@ -332,5 +348,9 @@ public class Ring extends KindofMisc { return Ring.this.soloBonus(); } + public int buffedLvl(){ + return Ring.this.soloBuffedBonus(); + } + } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfAccuracy.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfAccuracy.java index 66ba4ac03..224309511 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfAccuracy.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfAccuracy.java @@ -42,7 +42,7 @@ public class RingOfAccuracy extends Ring { } public static float accuracyMultiplier( Char target ){ - return (float)Math.pow(1.3f, getBonus(target, Accuracy.class)); + return (float)Math.pow(1.3f, getBuffedBonus(target, Accuracy.class)); } public class Accuracy extends RingBuff { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfElements.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfElements.java index 69a3ce9a6..abf32b3f1 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfElements.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfElements.java @@ -114,11 +114,11 @@ public class RingOfElements extends Ring { } public static float resist( Char target, Class effect ){ - if (getBonus(target, Resistance.class) == 0) return 1f; + if (getBuffedBonus(target, Resistance.class) == 0) return 1f; for (Class c : RESISTS){ if (c.isAssignableFrom(effect)){ - return (float)Math.pow(0.80, getBonus(target, Resistance.class)); + return (float)Math.pow(0.80, getBuffedBonus(target, Resistance.class)); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfEnergy.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfEnergy.java index e14ab8d42..c3e0e8438 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfEnergy.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfEnergy.java @@ -42,7 +42,7 @@ public class RingOfEnergy extends Ring { } public static float wandChargeMultiplier( Char target ){ - return (float)Math.pow(1.30, getBonus(target, Energy.class)); + return (float)Math.pow(1.30, getBuffedBonus(target, Energy.class)); } public class Energy extends RingBuff { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfEvasion.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfEvasion.java index 227d5d7bb..229fb97d0 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfEvasion.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfEvasion.java @@ -42,7 +42,7 @@ public class RingOfEvasion extends Ring { } public static float evasionMultiplier( Char target ){ - return (float) Math.pow( 1.15, getBonus(target, Evasion.class)); + return (float) Math.pow( 1.15, getBuffedBonus(target, Evasion.class)); } public class Evasion extends RingBuff { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfForce.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfForce.java index bd0e1a579..4d6bf4723 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfForce.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfForce.java @@ -35,7 +35,7 @@ public class RingOfForce extends Ring { } public static int armedDamageBonus( Char ch ){ - return getBonus( ch, Force.class); + return getBuffedBonus( ch, Force.class); } @@ -52,7 +52,7 @@ public class RingOfForce extends Ring { public static int damageRoll( Hero hero ){ if (hero.buff(Force.class) != null) { - int level = getBonus(hero, Force.class); + int level = getBuffedBonus(hero, Force.class); float tier = tier(hero.STR()); return Random.NormalIntRange(min(level, tier), max(level, tier)); } else { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfFuror.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfFuror.java index 22817d5ee..50f8d1429 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfFuror.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfFuror.java @@ -42,7 +42,7 @@ public class RingOfFuror extends Ring { } public static float attackDelayMultiplier(Char target ){ - return 1f / (float)Math.pow(1.105, getBonus(target, Furor.class)); + return 1f / (float)Math.pow(1.105, getBuffedBonus(target, Furor.class)); } public class Furor extends RingBuff { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfHaste.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfHaste.java index 3fa9c31e4..310f07909 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfHaste.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfHaste.java @@ -42,7 +42,7 @@ public class RingOfHaste extends Ring { } public static float speedMultiplier( Char target ){ - return (float)Math.pow(1.2, getBonus(target, Haste.class)); + return (float)Math.pow(1.2, getBuffedBonus(target, Haste.class)); } public class Haste extends RingBuff { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfMight.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfMight.java index 80a560d3c..cc0a1416d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfMight.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfMight.java @@ -88,7 +88,7 @@ public class RingOfMight extends Ring { } public static float HTMultiplier( Char target ){ - return (float)Math.pow(1.035, getBonus(target, Might.class)); + return (float)Math.pow(1.035, getBuffedBonus(target, Might.class)); } public class Might extends RingBuff { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfSharpshooting.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfSharpshooting.java index ad4023fd7..65c559f8d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfSharpshooting.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfSharpshooting.java @@ -42,7 +42,7 @@ public class RingOfSharpshooting extends Ring { } public static int levelDamageBonus( Char target ){ - return getBonus(target, RingOfSharpshooting.Aim.class); + return getBuffedBonus(target, RingOfSharpshooting.Aim.class); } public static float durabilityMultiplier( Char target ){ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfTenacity.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfTenacity.java index 5b8176921..931b34d1d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfTenacity.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfTenacity.java @@ -43,7 +43,7 @@ public class RingOfTenacity extends Ring { public static float damageMultiplier( Char t ){ //(HT - HP)/HT = heroes current % missing health. - return (float)Math.pow(0.85, getBonus( t, Tenacity.class)*((float)(t.HT - t.HP)/t.HT)); + return (float)Math.pow(0.85, getBuffedBonus( t, Tenacity.class)*((float)(t.HT - t.HP)/t.HT)); } public class Tenacity extends RingBuff { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfWealth.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfWealth.java index 8cb27cbec..7d49bf02e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfWealth.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfWealth.java @@ -80,11 +80,11 @@ public class RingOfWealth extends Ring { } public static float dropChanceMultiplier( Char target ){ - return (float)Math.pow(1.2, getBonus(target, Wealth.class)); + return (float)Math.pow(1.2, getBuffedBonus(target, Wealth.class)); } public static ArrayList tryForBonusDrop(Char target, int tries ){ - if (getBonus(target, Wealth.class) <= 0) return null; + if (getBuffedBonus(target, Wealth.class) <= 0) return null; HashSet buffs = target.buffs(Wealth.class); float triesToDrop = Float.MIN_VALUE; @@ -234,7 +234,7 @@ public class RingOfWealth extends Ring { } private static float dropProgression( Char target, int tries ){ - return tries * (float)Math.pow(1.2f, getBonus(target, Wealth.class) ); + return tries * (float)Math.pow(1.2f, getBuffedBonus(target, Wealth.class) ); } public class Wealth extends RingBuff {