diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java index f07e2fe3a..04c3ecd9d 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java @@ -279,9 +279,10 @@ public class Hero extends Char { int bonus = 0; for (Buff buff : buffs( RingOfEvasion.Evasion.class )) { - bonus += ((RingOfEvasion.Evasion)buff).level; + bonus += ((RingOfEvasion.Evasion)buff).effectiveLevel; } - float evasion = bonus == 0 ? 1 : (float)Math.pow( 1.2, bonus ); + + float evasion = bonus == 0 ? 1 : (float)Math.pow( 1.15, bonus ); if (paralysed) { evasion /= 2; } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfEvasion.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfEvasion.java index fe00cab8b..7791c742f 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfEvasion.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfEvasion.java @@ -17,6 +17,12 @@ */ package com.shatteredpixel.shatteredpixeldungeon.items.rings; +import com.shatteredpixel.shatteredpixeldungeon.Badges; +import com.shatteredpixel.shatteredpixeldungeon.actors.Char; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass; +import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; + public class RingOfEvasion extends Ring { { @@ -31,10 +37,45 @@ public class RingOfEvasion extends Ring { @Override public String desc() { return isKnown() ? - "This ring increases your chance to dodge enemy attack." : + "This ring increases the wearer's ability to focus and anticipate the movements of an enemy. " + + "The longer the wearer stands still, the more focused they will become. " + + "A cursed ring will instead make dodging harder." : super.desc(); } - - public class Evasion extends RingBuff { + + //yup, the only ring in the game with logic inside of its class + public class Evasion extends RingBuff { + public int effectiveLevel; + private int pos; + + @Override + public boolean attachTo( Char target ) { + + pos = target.pos; + effectiveLevel = Math.min(0, level); + return super.attachTo(target); + } + + @Override + public boolean act() { + + if (level >= 0) { + if (pos == target.pos && effectiveLevel < level) { + effectiveLevel++; + } else if (pos != target.pos) { + effectiveLevel = 0; + pos = target.pos; + } + } else if (level < 0) { + if (pos == target.pos && effectiveLevel < 0) { + effectiveLevel++; + } else if (pos != target.pos) { + effectiveLevel = level; + pos = target.pos; + } + } + + return super.act(); + } } }