v0.4.1: reworked ring of evasion again.. again

This commit is contained in:
Evan Debenham 2016-07-07 02:34:46 -04:00 committed by Evan Debenham
parent 11f79b5e2c
commit cc1c156428
3 changed files with 5 additions and 46 deletions

View File

@ -274,7 +274,7 @@ public class Hero extends Char {
int bonus = RingOfEvasion.getBonus(this, RingOfEvasion.Evasion.class);
float evasion = (float)Math.pow( 1.15, bonus );
float evasion = (float)Math.pow( 1.125, bonus );
if (paralysed > 0) {
evasion /= 2;
}
@ -1214,9 +1214,9 @@ public class Hero extends Char {
@Override
public int stealth() {
int stealth = super.stealth();
for (Buff buff : buffs( RingOfEvasion.Evasion.class )) {
stealth += ((RingOfEvasion.Evasion)buff).effectiveLevel;
}
stealth += RingOfEvasion.getBonus(this, RingOfEvasion.Evasion.class);
if (belongings.armor != null && belongings.armor.hasGlyph(Obfuscation.class)){
stealth += belongings.armor.level();
}

View File

@ -20,10 +20,6 @@
*/
package com.shatteredpixel.shatteredpixeldungeon.items.rings;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
public class RingOfEvasion extends Ring {
@Override
@ -31,43 +27,6 @@ public class RingOfEvasion extends Ring {
return new Evasion();
}
//yup, the only ring in the game with logic inside of its class
public class Evasion extends RingBuff {
public int effectiveLevel;
@Override
public boolean attachTo( Char target ) {
effectiveLevel = Math.min(0, RingOfEvasion.this.level());
return super.attachTo(target);
}
@Override
public boolean act() {
boolean seen = false;
for (Mob enemy : Dungeon.level.mobs.toArray(new Mob[0])){
if (enemy.focusingHero()) {
seen = true;
break;
}
}
if (RingOfEvasion.this.level() < 1){
effectiveLevel = RingOfEvasion.this.level();
} else if (seen) {
effectiveLevel = Math.max(effectiveLevel - 1, 0);
} else {
effectiveLevel = Math.min(effectiveLevel + 1, RingOfEvasion.this.level());
}
return super.act();
}
@Override
public int level() {
return effectiveLevel;
}
}
}

View File

@ -515,7 +515,7 @@ items.rings.ringofelements.name=ring of elements
items.rings.ringofelements.desc=This ring provides resistance to different elements, such as fire, electricity, gases etc. Also it decreases duration of negative effects.
items.rings.ringofevasion.name=ring of evasion
items.rings.ringofevasion.desc=This ring obfuscates the true position of the wearer, making them harder to detect and attack. This ring is much stronger while the user remains undetected, and if the user is targeted the power of evasion will slowly fade away, remaining undetected will restore the ring's effectiveness. A degraded ring will instead make the user easier to detect and strike.
items.rings.ringofevasion.desc=This ring obfuscates the true position of the wearer, making them harder to detect and attack. A degraded ring will instead make the user easier to detect and strike.
items.rings.ringofforce.name=ring of force
items.rings.ringofforce.avg_dmg=When unarmed, at your current strength, this ring will deal _%1$d-%2$d damage._