...
 
Commits (100)
......@@ -6,7 +6,7 @@
<parent>
<artifactId>forge</artifactId>
<groupId>forge</groupId>
<version>1.6.29-SNAPSHOT</version>
<version>1.6.30-SNAPSHOT</version>
</parent>
<artifactId>forge-ai</artifactId>
......
......@@ -22,7 +22,6 @@ import com.google.common.base.Predicates;
import forge.card.CardStateName;
import forge.game.CardTraitBase;
import forge.game.GameEntity;
import forge.game.GlobalRuleChange;
import forge.game.card.*;
import forge.game.combat.Combat;
import forge.game.combat.CombatUtil;
......@@ -768,14 +767,12 @@ public class AiBlockController {
blockers.removeAll(combat.getBlockers(attacker));
// Don't add any blockers that won't kill the attacker because the damage would be prevented by a static effect
if (!ai.getGame().getStaticEffects().getGlobalRuleChange(GlobalRuleChange.noPrevention)) {
blockers = CardLists.filter(blockers, new Predicate<Card>() {
@Override
public boolean apply(Card blocker) {
return !ComputerUtilCombat.isCombatDamagePrevented(blocker, attacker, blocker.getNetCombatDamage());
}
});
}
blockers = CardLists.filter(blockers, new Predicate<Card>() {
@Override
public boolean apply(Card blocker) {
return !ComputerUtilCombat.isCombatDamagePrevented(blocker, attacker, blocker.getNetCombatDamage());
}
});
// Try to use safe blockers first
if (blockers.size() > 0) {
......
......@@ -9,7 +9,6 @@ import com.google.common.collect.Iterables;
import forge.ai.*;
import forge.card.mana.ManaCost;
import forge.game.Game;
import forge.game.GlobalRuleChange;
import forge.game.ability.ApiType;
import forge.game.card.*;
import forge.game.combat.CombatUtil;
......@@ -267,7 +266,7 @@ public class EffectAi extends SpellAbilityAi {
final SpellAbility saTop = game.getStack().peekAbility();
final Card host = saTop.getHostCard();
if (saTop.getActivatingPlayer() != ai // from opponent
&& !game.getStaticEffects().getGlobalRuleChange(GlobalRuleChange.noPrevention) // no prevent damage
&& host.canDamagePrevented(false) // no prevent damage
&& host != null && (host.isInstant() || host.isSorcery())
&& !host.hasKeyword("Prevent all damage that would be dealt by CARDNAME.")) { // valid target
final ApiType type = saTop.getApi();
......
......@@ -6,7 +6,7 @@
<parent>
<artifactId>forge</artifactId>
<groupId>forge</groupId>
<version>1.6.29-SNAPSHOT</version>
<version>1.6.30-SNAPSHOT</version>
</parent>
<artifactId>forge-core</artifactId>
......
......@@ -6,7 +6,7 @@
<parent>
<artifactId>forge</artifactId>
<groupId>forge</groupId>
<version>1.6.29-SNAPSHOT</version>
<version>1.6.30-SNAPSHOT</version>
</parent>
<artifactId>forge-game</artifactId>
......
......@@ -148,7 +148,7 @@ public class GameAction {
}
// if an adventureCard is put from Stack somewhere else, need to reset to Original State
if (c.isAdventureCard() && (zoneFrom.is(ZoneType.Stack) || !zoneTo.is(ZoneType.Stack))) {
if (c.isAdventureCard() && (ZoneType.Stack.equals(zoneFrom) || !ZoneType.Stack.equals(zoneTo))) { //fix NPE momir
c.setState(CardStateName.Original, true);
}
......@@ -781,11 +781,10 @@ public class GameAction {
final Card co = preList.get(c);
List<StaticAbility> toRemove = Lists.newArrayList();
for (StaticAbility stAb : co.getStaticAbilities()) {
if (stAb.getParam("Mode").equals("Continuous")) {
staticAbilities.add(stAb);
}
if (stAb.isTemporary()) {
toRemove.add(stAb);
} else if (stAb.getParam("Mode").equals("Continuous")) {
staticAbilities.add(stAb);
}
}
for (StaticAbility stAb : toRemove) {
......
......@@ -162,8 +162,7 @@ public abstract class GameEntity extends GameObject implements IIdentifiable {
public final int preventDamage(
final int damage, final Card source, final boolean isCombat, CardDamageMap preventMap,
final SpellAbility cause) {
if (getGame().getStaticEffects().getGlobalRuleChange(GlobalRuleChange.noPrevention)
|| source.hasKeyword("Damage that would be dealt by CARDNAME can't be prevented.")) {
if (!source.canDamagePrevented(isCombat)) {
return damage;
}
......
......@@ -234,6 +234,6 @@ public final class GameOutcome implements Iterable<Entry<RegisteredPlayer, Playe
}
public String getOutcomeString(RegisteredPlayer player) {
return playerNames.get(player) + " has " + playerRating.get(player).getOutcome();
return playerNames.get(player) + " " + playerRating.get(player).getOutcome();
}
}
......@@ -29,7 +29,6 @@ public enum GlobalRuleChange {
noCreatureETBTriggers ("Creatures entering the battlefield don't cause abilities to trigger."),
noCreatureDyingTriggers ("Creatures dying don't cause abilities to trigger."),
noLegendRule ("The legend rule doesn't apply."),
noPrevention ("Damage can't be prevented."),
/* onlyOneAttackerATurn ("No more than one creature can attack each turn."), */
onlyOneAttackerACombat ("No more than one creature can attack each combat."),
onlyOneBlocker ("No more than one creature can block each combat."),
......
......@@ -3659,6 +3659,8 @@ public class Card extends GameEntity implements Comparable<Card> {
if (updateView) {
updateKeywords();
if (isToken())
game.fireEvent(new GameEventTokenStateUpdate(this));
}
}
......@@ -3713,6 +3715,8 @@ public class Card extends GameEntity implements Comparable<Card> {
KeywordsChange change = changedCardKeywords.remove(timestamp);
if (change != null && updateView) {
updateKeywords();
if (isToken())
game.fireEvent(new GameEventTokenStateUpdate(this));
}
return change;
}
......@@ -4691,9 +4695,23 @@ public class Card extends GameEntity implements Comparable<Card> {
return 0;
}
public final boolean canDamagePrevented(final boolean isCombat) {
CardCollection list = new CardCollection(getGame().getCardsIn(ZoneType.listValueOf("Battlefield,Command")));
list.add(this);
for (final Card ca : list) {
for (final StaticAbility stAb : ca.getStaticAbilities()) {
if (stAb.applyAbility("CantPreventDamage", this, isCombat)) {
return false;
}
}
}
return true;
}
// This is used by the AI to forecast an effect (so it must not change the game state)
public final int staticDamagePrevention(final int damage, final int possiblePrevention, final Card source, final boolean isCombat) {
if (getGame().getStaticEffects().getGlobalRuleChange(GlobalRuleChange.noPrevention)) {
if (!source.canDamagePrevented(isCombat)) {
return damage;
}
......@@ -4735,7 +4753,7 @@ public class Card extends GameEntity implements Comparable<Card> {
return 0;
}
if (getGame().getStaticEffects().getGlobalRuleChange(GlobalRuleChange.noPrevention)) {
if (!source.canDamagePrevented(isCombat)) {
return damageIn;
}
......@@ -5460,6 +5478,14 @@ public class Card extends GameEntity implements Comparable<Card> {
}
return hexproofKey;
}
public String getKeywordKey() {
List<String> ability = new ArrayList<>();
for (final KeywordInterface inst : getKeywords()) {
ability.add(inst.getOriginal());
}
Collections.sort(ability);
return String.join(",", ability);
}
public Zone getZone() {
return currentZone;
}
......
......@@ -1017,6 +1017,7 @@ public class CardView extends GameEntityView {
foilIndexOverride = index0;
}
public String getKeywordKey() { return get(TrackableProperty.KeywordKey); }
public String getProtectionKey() { return get(TrackableProperty.ProtectionKey); }
public String getHexproofKey() { return get(TrackableProperty.HexproofKey); }
public boolean hasDeathtouch() { return get(TrackableProperty.HasDeathtouch); }
......@@ -1026,11 +1027,13 @@ public class CardView extends GameEntityView {
public boolean hasFlying() { return get(TrackableProperty.HasFlying); }
public boolean hasFear() { return get(TrackableProperty.HasFear); }
public boolean hasHexproof() { return get(TrackableProperty.HasHexproof); }
public boolean hasHorsemanship() { return get(TrackableProperty.HasHorsemanship); }
public boolean hasIndestructible() { return get(TrackableProperty.HasIndestructible); }
public boolean hasIntimidate() { return get(TrackableProperty.HasIntimidate); }
public boolean hasLifelink() { return get(TrackableProperty.HasLifelink); }
public boolean hasMenace() { return get(TrackableProperty.HasMenace); }
public boolean hasReach() { return get(TrackableProperty.HasReach); }
public boolean hasShadow() { return get(TrackableProperty.HasShadow); }
public boolean hasShroud() { return get(TrackableProperty.HasShroud); }
public boolean hasTrample() { return get(TrackableProperty.HasTrample); }
public boolean hasVigilance() { return get(TrackableProperty.HasVigilance); }
......@@ -1060,11 +1063,13 @@ public class CardView extends GameEntityView {
set(TrackableProperty.HasFlying, c.hasKeyword(Keyword.FLYING, state));
set(TrackableProperty.HasFear, c.hasKeyword(Keyword.FEAR, state));
set(TrackableProperty.HasHexproof, c.hasKeyword(Keyword.HEXPROOF, state));
set(TrackableProperty.HasHorsemanship, c.hasKeyword(Keyword.HORSEMANSHIP, state));
set(TrackableProperty.HasIndestructible, c.hasKeyword(Keyword.INDESTRUCTIBLE, state));
set(TrackableProperty.HasIntimidate, c.hasKeyword(Keyword.INTIMIDATE, state));
set(TrackableProperty.HasLifelink, c.hasKeyword(Keyword.LIFELINK, state));
set(TrackableProperty.HasMenace, c.hasKeyword(Keyword.MENACE, state));
set(TrackableProperty.HasReach, c.hasKeyword(Keyword.REACH, state));
set(TrackableProperty.HasShadow, c.hasKeyword(Keyword.SHADOW, state));
set(TrackableProperty.HasShroud, c.hasKeyword(Keyword.SHROUD, state));
set(TrackableProperty.HasTrample, c.hasKeyword(Keyword.TRAMPLE, state));
set(TrackableProperty.HasVigilance, c.hasKeyword(Keyword.VIGILANCE, state));
......@@ -1076,6 +1081,8 @@ public class CardView extends GameEntityView {
set(TrackableProperty.ProtectionKey, c.getProtectionKey());
//set hexproofKeys for Icons
set(TrackableProperty.HexproofKey, c.getHexproofKey());
//keywordkey
set(TrackableProperty.KeywordKey, c.getKeywordKey());
}
public boolean isBasicLand() {
......
package forge.game.event;
import forge.game.card.Card;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
public class GameEventTokenStateUpdate extends GameEvent {
public final Collection<Card> cards;
public GameEventTokenStateUpdate(Card affected) {
cards = Arrays.asList(affected);
}
public GameEventTokenStateUpdate(List<Card> affected) {
cards = affected;
}
@Override
public <T> T visit(IGameEventVisitor<T> visitor) {
return visitor.visit(this);
}
}
......@@ -37,6 +37,7 @@ public interface IGameEventVisitor<T> {
T visit(GameEventPlayerPoisoned event);
T visit(GameEventPlayerPriority event);
T visit(GameEventPlayerStatsChanged event);
T visit(GameEventTokenStateUpdate event);
T visit(GameEventScry event);
T visit(GameEventShuffle event);
T visit(GameEventSpellAbilityCast gameEventSpellAbilityCast);
......@@ -83,6 +84,7 @@ public interface IGameEventVisitor<T> {
public T visit(GameEventPlayerPoisoned event) { return null; }
public T visit(GameEventPlayerPriority event) { return null; }
public T visit(GameEventPlayerStatsChanged event) { return null; }
public T visit(GameEventTokenStateUpdate event) { return null; }
public T visit(GameEventScry event) { return null; }
public T visit(GameEventShuffle event) { return null; }
public T visit(GameEventSpellResolved event) { return null; }
......
......@@ -189,6 +189,8 @@ public class PhaseHandler implements java.io.Serializable {
final List<Card> lands = CardLists.filter(playerTurn.getLandsInPlay(), Presets.UNTAPPED);
playerTurn.setNumPowerSurgeLands(lands.size());
}
//update tokens
game.fireEvent(new GameEventTokenStateUpdate(playerTurn.getTokensInPlay()));
game.fireEvent(new GameEventTurnPhase(playerTurn, phase, phaseType));
}
......
......@@ -635,7 +635,7 @@ public class Player extends GameEntity implements Comparable<Player> {
if (damage <= 0) {
return 0;
}
if (game.getStaticEffects().getGlobalRuleChange(GlobalRuleChange.noPrevention)) {
if (!source.canDamagePrevented(isCombat)) {
return damage;
}
......@@ -2362,6 +2362,13 @@ public class Player extends GameEntity implements Comparable<Player> {
return CardLists.filter(getCardsIn(ZoneType.Battlefield), Presets.CREATURES);
}
/**
* use to get a list of tokens in play for a given player.
*/
public CardCollection getTokensInPlay() {
return CardLists.filter(getCardsIn(ZoneType.Battlefield), Presets.TOKEN);
}
/**
* use to get a list of all lands a given player has on the battlefield.
*/
......
package forge.game.player;
import forge.util.Localizer;
/**
* TODO: Write javadoc for this type.
*/
......@@ -58,23 +60,24 @@ public class PlayerOutcome {
*/
@Override
public String toString() {
Localizer localizer = Localizer.getInstance();
if ( lossState == null ) {
if ( altWinSourceName == null )
return "won because all opponents have lost";
return localizer.getMessage("lblWonBecauseAllOpponentsHaveLost");
else
return "won due to effect of '" + altWinSourceName + "'";
return localizer.getMessage("lblWonDueToEffectOf").replace("%s", altWinSourceName);
}
switch(lossState){
case Conceded: return "conceded";
case Milled: return "lost trying to draw cards from empty library";
case LifeReachedZero: return "lost because life total reached 0";
case Poisoned: return "lost because of obtaining 10 poison counters";
case OpponentWon: return "lost because an opponent has won by spell '" + loseConditionSpell + "'";
case SpellEffect: return "lost due to effect of spell '" + loseConditionSpell + "'";
case CommanderDamage: return "lost due to accumulation of 21 damage from generals";
case IntentionalDraw: return "accepted that the game is a draw";
case Conceded: return localizer.getMessage("lblConceded");
case Milled: return localizer.getMessage("lblLostTryingToDrawCardsFromEmptyLibrary");
case LifeReachedZero: return localizer.getMessage("lblLostBecauseLifeTotalReachedZero");
case Poisoned: return localizer.getMessage("lblLostBecauseOfObtainingTenPoisonCounters");
case OpponentWon: return localizer.getMessage("lblLostBecauseAnOpponentHasWonBySpell").replace("%s", loseConditionSpell);
case SpellEffect: return localizer.getMessage("lblLostDueToEffectOfSpell").replace("%s", loseConditionSpell);
case CommanderDamage: return localizer.getMessage("lblLostDueToAccumulationOf21DamageFromGenerals");
case IntentionalDraw: return localizer.getMessage("lblAcceptedThatTheGameIsADraw");
}
return "lost for unknown reason (this is a bug)";
return localizer.getMessage("lblLostForUnknownReasonBug");
}
}
......@@ -6,12 +6,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
......@@ -81,7 +81,7 @@ public class StaticAbility extends CardTraitBase implements IIdentifiable, Clone
* <p>
* Getter for the field <code>mapParams</code>.
* </p>
*
*
* @param abString
* a {@link java.lang.String} object.
* @param hostCard
......@@ -129,7 +129,7 @@ public class StaticAbility extends CardTraitBase implements IIdentifiable, Clone
/**
* Gets the {@link Set} of {@link StaticAbilityLayer}s in which this
* {@link StaticAbility} is to be applied.
*
*
* @return the applicable layers.
*/
private final Set<StaticAbilityLayer> generateLayer() {
......@@ -213,7 +213,7 @@ public class StaticAbility extends CardTraitBase implements IIdentifiable, Clone
* <p>
* toString.
* </p>
*
*
* @return a {@link java.lang.String} object.
*/
@Override
......@@ -231,7 +231,7 @@ public class StaticAbility extends CardTraitBase implements IIdentifiable, Clone
// main constructor
/**
* Instantiates a new static ability.
*
*
* @param params
* the params
* @param host
......@@ -243,7 +243,7 @@ public class StaticAbility extends CardTraitBase implements IIdentifiable, Clone
/**
* Instantiates a new static ability.
*
*
* @param params
* the params
* @param host
......@@ -274,7 +274,7 @@ public class StaticAbility extends CardTraitBase implements IIdentifiable, Clone
/**
* Check whether a continuous ability should be applied.
*
*
* @param layer
* the {@link StaticAbilityLayer} under investigation.
* @param ignoreTempSuppression
......@@ -299,7 +299,7 @@ public class StaticAbility extends CardTraitBase implements IIdentifiable, Clone
// apply the ability if it has the right mode
/**
* Apply ability.
*
*
* @param mode
* the mode
* @param source
......@@ -333,7 +333,7 @@ public class StaticAbility extends CardTraitBase implements IIdentifiable, Clone
/**
* Apply ability if it has the right mode.
*
*
* @param mode
* the mode
* @param card
......@@ -366,7 +366,7 @@ public class StaticAbility extends CardTraitBase implements IIdentifiable, Clone
/**
* Apply ability.
*
*
* @param mode
* the mode
* @param card
......@@ -437,7 +437,7 @@ public class StaticAbility extends CardTraitBase implements IIdentifiable, Clone
/**
* Apply ability.
*
*
* @param mode
* the mode
* @param card
......@@ -466,9 +466,26 @@ public class StaticAbility extends CardTraitBase implements IIdentifiable, Clone
return false;
}
public final boolean applyAbility(final String mode, final Card card, final boolean isCombat) {
// don't apply the ability if it hasn't got the right mode
if (!getParam("Mode").equals(mode)) {
return false;
}
if (this.isSuppressed() || !this.checkConditions()) {
return false;
}
if (mode.equals("CantPreventDamage")) {
return StaticAbilityCantPreventDamage.applyCantPreventDamage(this, card, isCombat);
}
return false;
}
/**
* Apply ability.
*
*
* @param mode
* the mode
* @param card
......@@ -516,7 +533,7 @@ public class StaticAbility extends CardTraitBase implements IIdentifiable, Clone
/**
* Check conditions for static abilities acting on a specific player. Also
* automatically check the general conditions.
*
*
* @param player a {@link Player}.
* @return true, if the static ability is applicable.
* @see {@link StaticAbility#checkConditions()}
......@@ -536,7 +553,7 @@ public class StaticAbility extends CardTraitBase implements IIdentifiable, Clone
/**
* Check conditions.
*
*
* @return true, if the static ability is applicable.
*/
public final boolean checkConditions() {
......
package forge.game.staticability;
import forge.game.card.Card;
public class StaticAbilityCantPreventDamage {
public StaticAbilityCantPreventDamage() {
}
public static boolean applyCantPreventDamage(final StaticAbility st, final Card source, final boolean isCombat) {
final Card hostCard = st.getHostCard();
if (st.hasParam("IsCombat")) {
if (st.getParamOrDefault("IsCombat", "False").equals("True") != isCombat) {
return false;
}
}
if (st.hasParam("ValidSource")) {
if (!source.isValid(st.getParam("ValidSource").split(","), hostCard.getController(), hostCard, null)) {
return false;
}
}
return true;
}
}
......@@ -134,6 +134,8 @@ public final class StaticAbilityContinuous {
boolean removeArtifactTypes = false;
boolean removeEnchantmentTypes = false;
boolean overwriteColors = false;
List<Player> mayLookAt = null;
List<Player> withFlash = null;
......@@ -269,7 +271,6 @@ public final class StaticAbilityContinuous {
if (addTypes[0].equals("ChosenType")) {
final String chosenType = hostCard.getChosenType();
addTypes[0] = chosenType;
se.setChosenType(chosenType);
} else if (addTypes[0].equals("ImprintedCreatureType")) {
if (hostCard.hasImprintedCard()) {
final Set<String> imprinted = hostCard.getImprintedCards().getFirst().getType().getCreatureTypes();
......@@ -283,7 +284,6 @@ public final class StaticAbilityContinuous {
if (removeTypes[0].equals("ChosenType")) {
final String chosenType = hostCard.getChosenType();
removeTypes[0] = chosenType;
se.setChosenType(chosenType);
}
}
......@@ -335,7 +335,7 @@ public final class StaticAbilityContinuous {
} else {
addColors = CardUtil.getShortColorsString(Arrays.asList(colors.split(" & ")));
}
se.setOverwriteColors(true);
overwriteColors = true;
}
}
......@@ -625,7 +625,7 @@ public final class StaticAbilityContinuous {
// add colors
if (addColors != null) {
affectedCard.addColor(addColors, !se.isOverwriteColors(), hostCard.getTimestamp());
affectedCard.addColor(addColors, !overwriteColors, hostCard.getTimestamp());
}
// add triggers
......
......@@ -82,6 +82,7 @@ public enum TrackableProperty {
ChangedColorWords(TrackableTypes.StringMapType),
ChangedTypes(TrackableTypes.StringMapType),
KeywordKey(TrackableTypes.StringType),
HasDeathtouch(TrackableTypes.BooleanType),
HasDefender(TrackableTypes.BooleanType),
HasDoubleStrike(TrackableTypes.BooleanType),
......@@ -89,11 +90,13 @@ public enum TrackableProperty {
HasFlying(TrackableTypes.BooleanType),
HasFear(TrackableTypes.BooleanType),
HasHexproof(TrackableTypes.BooleanType),
HasHorsemanship(TrackableTypes.BooleanType),
HasIndestructible(TrackableTypes.BooleanType),
HasIntimidate(TrackableTypes.BooleanType),
HasLifelink(TrackableTypes.BooleanType),
HasMenace(TrackableTypes.BooleanType),
HasReach(TrackableTypes.BooleanType),
HasShadow(TrackableTypes.BooleanType),
HasShroud(TrackableTypes.BooleanType),
HasTrample(TrackableTypes.BooleanType),
HasVigilance(TrackableTypes.BooleanType),
......
......@@ -6,7 +6,7 @@
<packaging.type>jar</packaging.type>
<build.min.memory>-Xms1024m</build.min.memory>
<build.max.memory>-Xmx1536m</build.max.memory>
<alpha-version>1.6.28.002</alpha-version>
<alpha-version>1.6.29.001</alpha-version>
<sign.keystore>keystore</sign.keystore>
<sign.alias>alias</sign.alias>
<sign.storepass>storepass</sign.storepass>
......@@ -19,7 +19,7 @@
<parent>
<artifactId>forge</artifactId>
<groupId>forge</groupId>
<version>1.6.29-SNAPSHOT</version>
<version>1.6.30-SNAPSHOT</version>
</parent>
<artifactId>forge-gui-android</artifactId>
......
......@@ -4,7 +4,7 @@
<parent>
<artifactId>forge</artifactId>
<groupId>forge</groupId>
<version>1.6.29-SNAPSHOT</version>
<version>1.6.30-SNAPSHOT</version>
</parent>
<artifactId>forge-gui-desktop</artifactId>
......
......@@ -12,7 +12,7 @@ import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
import forge.util.TextUtil;
import forge.util.Localizer;
import net.miginfocom.swing.MigLayout;
import org.apache.commons.lang3.StringUtils;
......@@ -116,11 +116,12 @@ public class ViewWinLose implements IWinLoseView<FButton> {
lblStats.setHorizontalAlignment(SwingConstants.CENTER);
lblStats.setFont(FSkin.getRelativeFont(26));
btnContinue.setText("Next Game");
final Localizer localizer = Localizer.getInstance();
btnContinue.setText(localizer.getMessage("btnNextGame"));
btnContinue.setFont(FSkin.getRelativeFont(22));
btnRestart.setText("Start New Match");
btnRestart.setText(localizer.getMessage("btnStartNewMatch"));
btnRestart.setFont(FSkin.getRelativeFont(22));
btnQuit.setText("Quit Match");
btnQuit.setText(localizer.getMessage("btnQuitMatch"));
btnQuit.setFont(FSkin.getRelativeFont(22));
btnContinue.setEnabled(!game0.isMatchOver());
......@@ -130,7 +131,7 @@ public class ViewWinLose implements IWinLoseView<FButton> {
txtLog.setFont(FSkin.getRelativeFont(14));
txtLog.setFocusable(true); // allow highlighting and copying of log
final FLabel btnCopyLog = new FLabel.ButtonBuilder().text("Copy to clipboard").build();
final FLabel btnCopyLog = new FLabel.ButtonBuilder().text(localizer.getMessage("btnCopyToClipboard")).build();
btnCopyLog.setCommand(new UiCommand() {
@Override
public void run() {
......@@ -178,7 +179,7 @@ public class ViewWinLose implements IWinLoseView<FButton> {
pnlLog.setOpaque(false);
pnlLog.add(
new FLabel.Builder().text("Game Log").fontAlign(SwingConstants.CENTER).fontSize(18)
new FLabel.Builder().text(localizer.getMessage("lblGameLog")).fontAlign(SwingConstants.CENTER).fontSize(18)
.fontStyle(Font.BOLD).build(), "w 300px!, h 28px!, gaptop 20px");
pnlLog.add(scrLog, "w 300px!, h 100px!, gap 0 0 10 10");
......@@ -214,12 +215,13 @@ public class ViewWinLose implements IWinLoseView<FButton> {
private static String composeTitle(final GameView game) {
final String winner = game.getWinningPlayerName();
final int winningTeam = game.getWinningTeam();
final Localizer localizer = Localizer.getInstance();
if (winner == null || winner.isEmpty()) {
return "It's a draw!";
return localizer.getMessage("lblItsADraw");
} else if (winningTeam != -1) {
return TextUtil.concatNoSpace("Team ", String.valueOf(winningTeam), " won!");
return localizer.getMessage("lblTeamWon").replace("%s", String.valueOf(winningTeam));
} else {
return TextUtil.concatNoSpace(winner, " won!");
return localizer.getMessage("lblWinnerWon").replace("%s", winner);
}
}
......
......@@ -1039,7 +1039,7 @@ public class FSkin {
private static String preferredDir;
private static String preferredName;
private static BufferedImage bimDefaultSprite, bimFavIcon, bimPreferredSprite, bimFoils, bimQuestDraftDeck,
bimOldFoils, bimDefaultAvatars, bimPreferredAvatars, bimTrophies, bimAbilities;
bimOldFoils, bimDefaultAvatars, bimPreferredAvatars, bimTrophies, bimAbilities, bimManaIcons;
private static int x0, y0, w0, h0, newW, newH, preferredW, preferredH;
private static int[] tempCoords;
private static int defaultFontSize = 12;
......@@ -1172,6 +1172,7 @@ public class FSkin {
final File f8 = new File(defaultDir + ForgeConstants.DRAFT_DECK_IMG_FILE);
final File f9 = new File(defaultDir + ForgeConstants.SPRITE_FAVICONS_FILE);
final File f10 = new File(defaultDir + ForgeConstants.SPRITE_ABILITY_FILE);
final File f11 = new File(defaultDir + ForgeConstants.SPRITE_MANAICONS_FILE);
try {
int p = 0;
......@@ -1179,6 +1180,8 @@ public class FSkin {
FView.SINGLETON_INSTANCE.incrementSplashProgessBar(++p);
bimAbilities = ImageIO.read(f10);
FView.SINGLETON_INSTANCE.incrementSplashProgessBar(++p);
bimManaIcons = ImageIO.read(f11);
FView.SINGLETON_INSTANCE.incrementSplashProgessBar(++p);
bimPreferredSprite = ImageIO.read(f2);
FView.SINGLETON_INSTANCE.incrementSplashProgessBar(++p);
bimFoils = ImageIO.read(f3);
......@@ -1242,6 +1245,9 @@ public class FSkin {
case ABILITY:
setImage(prop, bimAbilities);
break;
case MANAICONS:
setImage(prop, bimManaIcons);
break;
default:
break;
}
......@@ -1263,6 +1269,7 @@ public class FSkin {
bimQuestDraftDeck.flush();
bimTrophies.flush();
bimAbilities.flush();
bimManaIcons.flush();
if (bimPreferredAvatars != null) { bimPreferredAvatars.flush(); }
......@@ -1275,6 +1282,7 @@ public class FSkin {
bimQuestDraftDeck = null;
bimTrophies = null;
bimAbilities = null;
bimManaIcons = null;
//establish encoding symbols
final File dir = new File(ForgeConstants.CACHE_SYMBOLS_DIR);
......
......@@ -6,13 +6,13 @@
<packaging.type>jar</packaging.type>
<build.min.memory>-Xms128m</build.min.memory>
<build.max.memory>-Xmx2048m</build.max.memory>
<alpha-version>1.6.28.002</alpha-version>
<alpha-version>1.6.29.001</alpha-version>
</properties>
<parent>
<artifactId>forge</artifactId>
<groupId>forge</groupId>
<version>1.6.29-SNAPSHOT</version>
<version>1.6.30-SNAPSHOT</version>
</parent>
<artifactId>forge-gui-ios</artifactId>
......
......@@ -4,7 +4,7 @@
<parent>
<artifactId>forge</artifactId>
<groupId>forge</groupId>
<version>1.6.29-SNAPSHOT</version>
<version>1.6.30-SNAPSHOT</version>
</parent>
<artifactId>forge-gui-mobile-dev</artifactId>
......
......@@ -4,7 +4,7 @@
<parent>
<artifactId>forge</artifactId>
<groupId>forge</groupId>
<version>1.6.29-SNAPSHOT</version>
<version>1.6.30-SNAPSHOT</version>
</parent>
<artifactId>forge-gui-mobile</artifactId>
......