Door to nothingness (as well as any other spell effect causing a GL) should be displayed correctly in quest battle debriefing

This commit is contained in:
Maxmtg
2011-09-12 18:12:19 +00:00
parent 8efc1f9f35
commit 575d9db1a4
4 changed files with 13 additions and 7 deletions

View File

@@ -618,8 +618,8 @@ public class GameAction {
boolean isGameDone = humanWins || computerWins; boolean isGameDone = humanWins || computerWins;
if (isGameDone) { if (isGameDone) {
game.getPlayerRating(PlayerIndex.AI).setLossReason(computer.getLossState()); game.getPlayerRating(PlayerIndex.AI).setLossReason(computer.getLossState(), computer.getLossConditionSource());
game.getPlayerRating(PlayerIndex.HUMAN).setLossReason(human.getLossState()); game.getPlayerRating(PlayerIndex.HUMAN).setLossReason(human.getLossState(), computer.getLossConditionSource());
AllZone.getMatchState().addGamePlayed(game); AllZone.getMatchState().addGamePlayed(game);
} }

View File

@@ -264,6 +264,7 @@ public class Gui_WinLose extends JFrame implements NewConstants {
switch(whyAiLost) { switch(whyAiLost) {
case Poisoned: winConditionName = "Poison"; break; case Poisoned: winConditionName = "Poison"; break;
case Milled: winConditionName = "Milled"; break; case Milled: winConditionName = "Milled"; break;
case SpellEffect: winConditionName = aiRating.getLossSpellName(); break;
default: break; default: break;
} }
} }

View File

@@ -1388,16 +1388,15 @@ public abstract class Player extends GameEntity {
* *
* @return a {@link java.lang.String} object. * @return a {@link java.lang.String} object.
*/ */
public GameLossReason getLossState() { public GameLossReason getLossState() { return lossState; }
return lossState; public String getLossConditionSource() { return loseConditionSpell; }
}
/** /**
* <p>altWinConditionMet.</p> * <p>altWinConditionMet.</p>
* *
* @param s a {@link java.lang.String} object. * @param s a {@link java.lang.String} object.
*/ */
public void altWinBySpellEffect( String sourceName ) { public void altWinBySpellEffect(final String sourceName) {
if (cantWin()) { if (cantWin()) {
System.out.println("Tried to win, but currently can't."); System.out.println("Tried to win, but currently can't.");
return; return;

View File

@@ -13,12 +13,18 @@ public class GamePlayerRating {
protected int timesMulliganed = 0; protected int timesMulliganed = 0;
protected GameLossReason lossReason = GameLossReason.DidNotLoseYet; protected GameLossReason lossReason = GameLossReason.DidNotLoseYet;
protected String lossSpellName;
public final GameLossReason getLossReason() { public final GameLossReason getLossReason() {
return lossReason; return lossReason;
} }
public void setLossReason(GameLossReason loseCondition) {
public void setLossReason(GameLossReason loseCondition, String spellName) {
lossReason = loseCondition; lossReason = loseCondition;
lossSpellName = spellName;
}
public String getLossSpellName() {
return lossSpellName;
} }
public final int getOpeningHandSize() { public final int getOpeningHandSize() {