v0.3.4: cleaned up ring of force

This commit is contained in:
Evan Debenham
2016-01-03 21:02:24 -05:00
committed by Evan Debenham
parent c19e6c2442
commit 6c95e48f14
4 changed files with 36 additions and 10 deletions
@@ -240,10 +240,9 @@ public class Ring extends KindofMisc {
String desc = isKnown()? desc() : Messages.get(this, "unknown_desc", gem());
if (isEquipped( Dungeon.hero )) {
if (cursed && isEquipped( Dungeon.hero )) {
desc += "\n\n" + Messages.get(Ring.class, "on_finger", name());
if (cursed) desc += " " + Messages.get(Ring.class, "cursed_worn");
desc += "\n\n" + Messages.get(Ring.class, "cursed_worn");
} else if (cursed && cursedKnown) {
@@ -21,6 +21,7 @@
package com.shatteredpixel.shatteredpixeldungeon.items.rings;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
public class RingOfForce extends Ring {
@@ -29,6 +30,31 @@ public class RingOfForce extends Ring {
return new Force();
}
public static int min(int bonus, int herostr){
if (bonus < 0) return 0;
int STR = herostr-8;
return Math.max(STR/2+bonus, 0);
}
public static int max(int bonus, int herostr){
if (bonus < 0) return 0;
int STR = herostr-8;
return Math.max((int)(STR*0.5f*bonus) + STR*2, bonus);
}
@Override
public String desc() {
String desc = super.desc();
int str = Dungeon.hero.STR();
if (levelKnown) {
desc += "\n\n" + Messages.get(this, "avg_dmg", (min(level(), str) + max(level(), str))/2);
} else {
desc += "\n\n" + Messages.get(this, "typical_avg_dmg", (min(1, str) + max(1, str))/2);
}
return desc;
}
public class Force extends RingBuff {
}
}