Fixing Credits generated by Estates

This commit is contained in:
Sol
2011-11-07 01:09:30 +00:00
parent 59f1be90ff
commit 31ccb888b1

View File

@@ -319,26 +319,28 @@ public class QuestWinLoseHandler extends WinLoseModeHandler {
// Estates bonus // Estates bonus
credTotal = credBase + credGameplay + credUndefeated; credTotal = credBase + credGameplay + credUndefeated;
double estateValue = 0;
switch (this.model.qData.getInventory().getItemLevel("Estates")) { switch (this.model.qData.getInventory().getItemLevel("Estates")) {
case 1: case 1:
credEstates = (int) 0.1 * credTotal; estateValue = .1;
sb.append("Estates bonus: 10%.<br>");
break; break;
case 2: case 2:
credEstates = (int) 0.15 * credTotal; estateValue = .15;
sb.append("Estates bonus: 15%.<br>");
break; break;
case 3: case 3:
credEstates = (int) 0.2 * credTotal; estateValue = .2;
sb.append("Estates bonus: 20%.<br>");
break; break;
default: default:
break; break;
} }
credTotal += credEstates; if (estateValue > 0){
credEstates = (int) (estateValue * credTotal);
sb.append("Estates bonus: ").append((int) (100 * estateValue)).append("%.<br>");
credTotal += credEstates;
}
// Final output // Final output
String congrats = "<br><h3>"; String congrats = "<br><h3>";