V0.2.0: reworked Ring of Accuracy, now reduces enemy evasion instead of attack accuracy.

This commit is contained in:
Evan Debenham 2014-09-10 11:41:35 -04:00
parent ae271a7f4a
commit 17b71d183c
2 changed files with 14 additions and 2 deletions

View File

@ -35,6 +35,7 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.Wound;
import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfAccuracy;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
@ -378,7 +379,17 @@ public abstract class Mob extends Char {
@Override
public int defenseSkill( Char enemy ) {
return enemySeen && !paralysed ? defenseSkill : 0;
if (enemySeen && !paralysed) {
int defenseSkill = this.defenseSkill;
int penalty = 0;
for (Buff buff : enemy.buffs(RingOfAccuracy.Accuracy.class)) {
penalty += ((RingOfAccuracy.Accuracy) buff).level;
}
if (penalty != 0)
defenseSkill *= Math.pow(0.8, penalty);
return defenseSkill;
} else
return 0;
}
@Override

View File

@ -31,7 +31,8 @@ public class RingOfAccuracy extends Ring {
@Override
public String desc() {
return isKnown() ?
"This ring increases your chance to hit the enemy." :
"This ring increases your focus, reducing your enemy's ability to dodge your attacks. "+
"A cursed ring will instead make you easier to evade.":
super.desc();
}