*Added Count$<Your/Opp>StartingLife.

This commit is contained in:
Hellfish
2012-01-09 09:33:14 +00:00
parent 20a82797f0
commit 558283ec98
3 changed files with 39 additions and 2 deletions

View File

@@ -1314,8 +1314,8 @@ public class GameAction {
final CardList computer, final int humanLife, final int computerLife, final QuestEvent qe) { final CardList computer, final int humanLife, final int computerLife, final QuestEvent qe) {
this.newGame(humanDeck, computerDeck); this.newGame(humanDeck, computerDeck);
AllZone.getComputerPlayer().setLife(computerLife, null); AllZone.getComputerPlayer().setStartingLife(computerLife);
AllZone.getHumanPlayer().setLife(humanLife, null); AllZone.getHumanPlayer().setStartingLife(humanLife);
for (final Card c : human) { for (final Card c : human) {
@@ -1348,6 +1348,9 @@ public class GameAction {
// ComputerAI_General()); // ComputerAI_General());
Constant.Quest.FANTASY_QUEST[0] = false; Constant.Quest.FANTASY_QUEST[0] = false;
AllZone.getComputerPlayer().setStartingLife(20);
AllZone.getHumanPlayer().setStartingLife(20);
AllZone.newGameCleanup(); AllZone.newGameCleanup();
this.canShowWinLose = true; this.canShowWinLose = true;
forge.card.trigger.Trigger.resetIDs(); forge.card.trigger.Trigger.resetIDs();

View File

@@ -54,6 +54,9 @@ public abstract class Player extends GameEntity {
/** The life. */ /** The life. */
private int life; private int life;
/** The life this player started the game with. */
private int startingLife;
/** The assigned damage. */ /** The assigned damage. */
private int assignedDamage; private int assignedDamage;
@@ -259,6 +262,16 @@ public abstract class Player extends GameEntity {
return change; return change;
} }
/**
* Sets the starting life for a game. Should only be called from newGame()'s.
*
* @param startLife
* a int.
*/
public final void setStartingLife(final int startLife) {
this.startingLife = this.life = startLife;
}
/** /**
* <p> * <p>
* Getter for the field <code>life</code>. * Getter for the field <code>life</code>.
@@ -270,6 +283,17 @@ public abstract class Player extends GameEntity {
return this.life; return this.life;
} }
/**
* <p>
* Getter for the field <code>startingLife</code>.
* </p>
*
* @return a int.
*/
public final int getStartingLife() {
return this.startingLife;
}
/** /**
* <p> * <p>
* addLife. * addLife.

View File

@@ -2833,6 +2833,16 @@ public class CardFactoryUtil {
return CardFactoryUtil.doXMath(n, m, c); return CardFactoryUtil.doXMath(n, m, c);
} }
// Count$YourStartingLife
if (sq[0].contains("YourStartingLife")) {
return CardFactoryUtil.doXMath(cardController.getStartingLife(), m, c);
}
// Count$OppStartingLife
if (sq[0].contains("OppStartingLife")) {
return CardFactoryUtil.doXMath(oppController.getStartingLife(), m, c);
}
// Count$YourLifeTotal // Count$YourLifeTotal
if (sq[0].contains("YourLifeTotal")) { if (sq[0].contains("YourLifeTotal")) {
return CardFactoryUtil.doXMath(cardController.getLife(), m, c); return CardFactoryUtil.doXMath(cardController.getLife(), m, c);