v0.7.1: corrected inconsistencies with ring description logic

This commit is contained in:
Evan Debenham
2018-12-07 22:43:26 -05:00
parent 0ea97b0149
commit 5157b83394
12 changed files with 68 additions and 104 deletions
@@ -155,7 +155,7 @@ public class Ring extends KindofMisc {
} }
@Override @Override
public String desc() { public String info(){
String desc = isKnown() ? super.desc() : Messages.get(this, "unknown_desc"); String desc = isKnown() ? super.desc() : Messages.get(this, "unknown_desc");
@@ -170,9 +170,17 @@ public class Ring extends KindofMisc {
} }
if (isKnown()) {
desc += "\n\n" + statsInfo();
}
return desc; return desc;
} }
protected String statsInfo(){
return "";
}
@Override @Override
public Item upgrade() { public Item upgrade() {
super.upgrade(); super.upgrade();
@@ -28,16 +28,12 @@ import java.text.DecimalFormat;
public class RingOfAccuracy extends Ring { public class RingOfAccuracy extends Ring {
public String info() { public String statsInfo() {
String desc = desc(); if (isIdentified()){
if (isKnown()){ return Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.3f, soloBonus()) - 1f)));
if (isIdentified()){ } else {
desc += "\n\n" + Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.3f, soloBonus()) - 1f))); return Messages.get(this, "typical_stats", new DecimalFormat("#.##").format(30f));
} else {
desc += "\n\n" + Messages.get(this, "typical_stats", new DecimalFormat("#.##").format(30f));
}
} }
return desc;
} }
@Override @Override
@@ -46,16 +46,12 @@ import java.util.HashSet;
public class RingOfElements extends Ring { public class RingOfElements extends Ring {
public String info() { public String statsInfo() {
String desc = desc(); if (isIdentified()){
if (isKnown()){ return Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (1f - Math.pow(0.875f, soloBonus()))));
if (isIdentified()){ } else {
desc += "\n\n" + Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (1f - Math.pow(0.875f, soloBonus())))); return Messages.get(this, "typical_stats", new DecimalFormat("#.##").format(12.5f));
} else {
desc += "\n\n" + Messages.get(this, "typical_stats", new DecimalFormat("#.##").format(12.5f));
}
} }
return desc;
} }
@Override @Override
@@ -28,16 +28,12 @@ import java.text.DecimalFormat;
public class RingOfEnergy extends Ring { public class RingOfEnergy extends Ring {
public String info() { public String statsInfo() {
String desc = desc(); if (isIdentified()){
if (isKnown()){ return Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.2f, soloBonus()) - 1f)));
if (isIdentified()){ } else {
desc += "\n\n" + Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.2f, soloBonus()) - 1f))); return Messages.get(this, "typical_stats", new DecimalFormat("#.##").format(20f));
} else {
desc += "\n\n" + Messages.get(this, "typical_stats", new DecimalFormat("#.##").format(20f));
}
} }
return desc;
} }
@Override @Override
@@ -28,16 +28,12 @@ import java.text.DecimalFormat;
public class RingOfEvasion extends Ring { public class RingOfEvasion extends Ring {
public String info() { public String statsInfo() {
String desc = desc(); if (isIdentified()){
if (isKnown()){ return Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.15f, soloBonus()) - 1f)));
if (isIdentified()){ } else {
desc += "\n\n" + Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.15f, soloBonus()) - 1f))); return Messages.get(this, "typical_stats", new DecimalFormat("#.##").format(15f));
} else {
desc += "\n\n" + Messages.get(this, "typical_stats", new DecimalFormat("#.##").format(15f));
}
} }
return desc;
} }
@Override @Override
@@ -78,17 +78,13 @@ public class RingOfForce extends Ring {
} }
@Override @Override
public String desc() { public String statsInfo() {
String desc = super.desc(); float tier = tier(Dungeon.hero.STR());
if (isKnown()) { if (isIdentified()) {
float tier = tier(Dungeon.hero.STR()); return Messages.get(this, "stats", min(soloBonus(), tier), max(soloBonus(), tier));
if (isIdentified()) { } else {
desc += "\n\n" + Messages.get(this, "stats", min(soloBonus(), tier), max(soloBonus(), tier)); return Messages.get(this, "typical_stats", min(1, tier), max(1, tier));
} else {
desc += "\n\n" + Messages.get(this, "typical_stats", min(1, tier), max(1, tier));
}
} }
return desc;
} }
public class Force extends RingBuff { public class Force extends RingBuff {
@@ -28,16 +28,12 @@ import java.text.DecimalFormat;
public class RingOfFuror extends Ring { public class RingOfFuror extends Ring {
public String info() { public String statsInfo() {
String desc = desc(); if (isIdentified()){
if (isKnown()){ return Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.105f, soloBonus()) - 1f)));
if (isIdentified()){ } else {
desc += "\n\n" + Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.105f, soloBonus()) - 1f))); return Messages.get(this, "typical_stats", new DecimalFormat("#.##").format(10.5f));
} else {
desc += "\n\n" + Messages.get(this, "typical_stats", new DecimalFormat("#.##").format(10.5f));
}
} }
return desc;
} }
@Override @Override
@@ -28,16 +28,12 @@ import java.text.DecimalFormat;
public class RingOfHaste extends Ring { public class RingOfHaste extends Ring {
public String info() { public String statsInfo() {
String desc = desc(); if (isIdentified()){
if (isKnown()){ return Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.2f, soloBonus()) - 1f)));
if (isIdentified()){ } else {
desc += "\n\n" + Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.2f, soloBonus()) - 1f))); return Messages.get(this, "typical_stats", new DecimalFormat("#.##").format(20f));
} else {
desc += "\n\n" + Messages.get(this, "typical_stats", new DecimalFormat("#.##").format(20f));
}
} }
return desc;
} }
@Override @Override
@@ -70,16 +70,12 @@ public class RingOfMight extends Ring {
} }
} }
public String info() { public String statsInfo() {
String desc = desc(); if (isIdentified()){
if (isKnown()){ return Messages.get(this, "stats", soloBonus(), new DecimalFormat("#.##").format(100f * (Math.pow(1.035, soloBonus()) - 1f)));
if (isIdentified()){ } else {
desc += "\n\n" + Messages.get(this, "stats", soloBonus(), new DecimalFormat("#.##").format(100f * (Math.pow(1.035, soloBonus()) - 1f))); return Messages.get(this, "typical_stats", 1, new DecimalFormat("#.##").format(3.5f));
} else {
desc += "\n\n" + Messages.get(this, "typical_stats", 1, new DecimalFormat("#.##").format(3.5f));
}
} }
return desc;
} }
@Override @Override
@@ -28,16 +28,12 @@ import java.text.DecimalFormat;
public class RingOfSharpshooting extends Ring { public class RingOfSharpshooting extends Ring {
public String info() { public String statsInfo() {
String desc = desc(); if (isIdentified()){
if (isKnown()){ return Messages.get(this, "stats", soloBonus(), new DecimalFormat("#.##").format(100f * (Math.pow(1.2, soloBonus()) - 1f)));
if (isIdentified()){ } else {
desc += "\n\n" + Messages.get(this, "stats", soloBonus(), new DecimalFormat("#.##").format(100f * (Math.pow(1.2, soloBonus()) - 1f))); return Messages.get(this, "typical_stats", 1, new DecimalFormat("#.##").format(20f));
} else {
desc += "\n\n" + Messages.get(this, "typical_stats", 1, new DecimalFormat("#.##").format(20f));
}
} }
return desc;
} }
@Override @Override
@@ -28,16 +28,12 @@ import java.text.DecimalFormat;
public class RingOfTenacity extends Ring { public class RingOfTenacity extends Ring {
public String info() { public String statsInfo() {
String desc = desc(); if (isIdentified()){
if (isKnown()){ return Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (1f - Math.pow(0.85f, soloBonus()))));
if (isIdentified()){ } else {
desc += "\n\n" + Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (1f - Math.pow(0.85f, soloBonus())))); return Messages.get(this, "typical_stats", new DecimalFormat("#.##").format(15f));
} else {
desc += "\n\n" + Messages.get(this, "typical_stats", new DecimalFormat("#.##").format(15f));
}
} }
return desc;
} }
@Override @Override
@@ -38,16 +38,12 @@ public class RingOfWealth extends Ring {
private float triesToDrop = 0; private float triesToDrop = 0;
public String info() { public String statsInfo() {
String desc = desc(); if (isIdentified()){
if (isKnown()){ return Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.15f, soloBonus()) - 1f)));
if (isIdentified()){ } else {
desc += "\n\n" + Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.15f, soloBonus()) - 1f))); return Messages.get(this, "typical_stats", new DecimalFormat("#.##").format(15f));
} else {
desc += "\n\n" + Messages.get(this, "typical_stats", new DecimalFormat("#.##").format(15f));
}
} }
return desc;
} }
@Override @Override