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

View File

@ -155,7 +155,7 @@ public class Ring extends KindofMisc {
}
@Override
public String desc() {
public String info(){
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;
}
protected String statsInfo(){
return "";
}
@Override
public Item upgrade() {
super.upgrade();

View File

@ -28,17 +28,13 @@ import java.text.DecimalFormat;
public class RingOfAccuracy extends Ring {
public String info() {
String desc = desc();
if (isKnown()){
public String statsInfo() {
if (isIdentified()){
desc += "\n\n" + Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.3f, soloBonus()) - 1f)));
return Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.3f, soloBonus()) - 1f)));
} else {
desc += "\n\n" + Messages.get(this, "typical_stats", new DecimalFormat("#.##").format(30f));
return Messages.get(this, "typical_stats", new DecimalFormat("#.##").format(30f));
}
}
return desc;
}
@Override
protected RingBuff buff( ) {

View File

@ -46,17 +46,13 @@ import java.util.HashSet;
public class RingOfElements extends Ring {
public String info() {
String desc = desc();
if (isKnown()){
public String statsInfo() {
if (isIdentified()){
desc += "\n\n" + Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (1f - Math.pow(0.875f, soloBonus()))));
return Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (1f - Math.pow(0.875f, soloBonus()))));
} else {
desc += "\n\n" + Messages.get(this, "typical_stats", new DecimalFormat("#.##").format(12.5f));
return Messages.get(this, "typical_stats", new DecimalFormat("#.##").format(12.5f));
}
}
return desc;
}
@Override
protected RingBuff buff( ) {

View File

@ -28,17 +28,13 @@ import java.text.DecimalFormat;
public class RingOfEnergy extends Ring {
public String info() {
String desc = desc();
if (isKnown()){
public String statsInfo() {
if (isIdentified()){
desc += "\n\n" + Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.2f, soloBonus()) - 1f)));
return Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.2f, soloBonus()) - 1f)));
} else {
desc += "\n\n" + Messages.get(this, "typical_stats", new DecimalFormat("#.##").format(20f));
return Messages.get(this, "typical_stats", new DecimalFormat("#.##").format(20f));
}
}
return desc;
}
@Override
protected RingBuff buff( ) {

View File

@ -28,17 +28,13 @@ import java.text.DecimalFormat;
public class RingOfEvasion extends Ring {
public String info() {
String desc = desc();
if (isKnown()){
public String statsInfo() {
if (isIdentified()){
desc += "\n\n" + Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.15f, soloBonus()) - 1f)));
return Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.15f, soloBonus()) - 1f)));
} else {
desc += "\n\n" + Messages.get(this, "typical_stats", new DecimalFormat("#.##").format(15f));
return Messages.get(this, "typical_stats", new DecimalFormat("#.##").format(15f));
}
}
return desc;
}
@Override
protected RingBuff buff( ) {

View File

@ -78,18 +78,14 @@ public class RingOfForce extends Ring {
}
@Override
public String desc() {
String desc = super.desc();
if (isKnown()) {
public String statsInfo() {
float tier = tier(Dungeon.hero.STR());
if (isIdentified()) {
desc += "\n\n" + Messages.get(this, "stats", min(soloBonus(), tier), max(soloBonus(), tier));
return Messages.get(this, "stats", min(soloBonus(), tier), max(soloBonus(), tier));
} else {
desc += "\n\n" + Messages.get(this, "typical_stats", min(1, tier), max(1, tier));
return Messages.get(this, "typical_stats", min(1, tier), max(1, tier));
}
}
return desc;
}
public class Force extends RingBuff {
}

View File

@ -28,17 +28,13 @@ import java.text.DecimalFormat;
public class RingOfFuror extends Ring {
public String info() {
String desc = desc();
if (isKnown()){
public String statsInfo() {
if (isIdentified()){
desc += "\n\n" + Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.105f, soloBonus()) - 1f)));
return Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.105f, soloBonus()) - 1f)));
} else {
desc += "\n\n" + Messages.get(this, "typical_stats", new DecimalFormat("#.##").format(10.5f));
return Messages.get(this, "typical_stats", new DecimalFormat("#.##").format(10.5f));
}
}
return desc;
}
@Override
protected RingBuff buff( ) {

View File

@ -28,17 +28,13 @@ import java.text.DecimalFormat;
public class RingOfHaste extends Ring {
public String info() {
String desc = desc();
if (isKnown()){
public String statsInfo() {
if (isIdentified()){
desc += "\n\n" + Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.2f, soloBonus()) - 1f)));
return Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.2f, soloBonus()) - 1f)));
} else {
desc += "\n\n" + Messages.get(this, "typical_stats", new DecimalFormat("#.##").format(20f));
return Messages.get(this, "typical_stats", new DecimalFormat("#.##").format(20f));
}
}
return desc;
}
@Override
protected RingBuff buff( ) {

View File

@ -70,17 +70,13 @@ public class RingOfMight extends Ring {
}
}
public String info() {
String desc = desc();
if (isKnown()){
public String statsInfo() {
if (isIdentified()){
desc += "\n\n" + Messages.get(this, "stats", soloBonus(), new DecimalFormat("#.##").format(100f * (Math.pow(1.035, soloBonus()) - 1f)));
return Messages.get(this, "stats", soloBonus(), new DecimalFormat("#.##").format(100f * (Math.pow(1.035, soloBonus()) - 1f)));
} else {
desc += "\n\n" + Messages.get(this, "typical_stats", 1, new DecimalFormat("#.##").format(3.5f));
return Messages.get(this, "typical_stats", 1, new DecimalFormat("#.##").format(3.5f));
}
}
return desc;
}
@Override
protected RingBuff buff( ) {

View File

@ -28,17 +28,13 @@ import java.text.DecimalFormat;
public class RingOfSharpshooting extends Ring {
public String info() {
String desc = desc();
if (isKnown()){
public String statsInfo() {
if (isIdentified()){
desc += "\n\n" + Messages.get(this, "stats", soloBonus(), new DecimalFormat("#.##").format(100f * (Math.pow(1.2, soloBonus()) - 1f)));
return Messages.get(this, "stats", soloBonus(), new DecimalFormat("#.##").format(100f * (Math.pow(1.2, soloBonus()) - 1f)));
} else {
desc += "\n\n" + Messages.get(this, "typical_stats", 1, new DecimalFormat("#.##").format(20f));
return Messages.get(this, "typical_stats", 1, new DecimalFormat("#.##").format(20f));
}
}
return desc;
}
@Override
protected RingBuff buff( ) {

View File

@ -28,17 +28,13 @@ import java.text.DecimalFormat;
public class RingOfTenacity extends Ring {
public String info() {
String desc = desc();
if (isKnown()){
public String statsInfo() {
if (isIdentified()){
desc += "\n\n" + Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (1f - Math.pow(0.85f, soloBonus()))));
return Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (1f - Math.pow(0.85f, soloBonus()))));
} else {
desc += "\n\n" + Messages.get(this, "typical_stats", new DecimalFormat("#.##").format(15f));
return Messages.get(this, "typical_stats", new DecimalFormat("#.##").format(15f));
}
}
return desc;
}
@Override
protected RingBuff buff( ) {

View File

@ -38,17 +38,13 @@ public class RingOfWealth extends Ring {
private float triesToDrop = 0;
public String info() {
String desc = desc();
if (isKnown()){
public String statsInfo() {
if (isIdentified()){
desc += "\n\n" + Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.15f, soloBonus()) - 1f)));
return Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.15f, soloBonus()) - 1f)));
} else {
desc += "\n\n" + Messages.get(this, "typical_stats", new DecimalFormat("#.##").format(15f));
return Messages.get(this, "typical_stats", new DecimalFormat("#.##").format(15f));
}
}
return desc;
}
@Override
protected RingBuff buff( ) {