Add Planeswalker Ulimtates achievements

This commit is contained in:
drdev
2014-09-22 15:05:11 +00:00
parent 9ea8d84ee8
commit a4f8ee4f9c
7 changed files with 123 additions and 2 deletions

1
.gitattributes vendored
View File

@@ -16895,6 +16895,7 @@ forge-gui/src/main/java/forge/achievement/LifeToSpare.java -text
forge-gui/src/main/java/forge/achievement/MatchWinStreak.java -text
forge-gui/src/main/java/forge/achievement/NeedForSpeed.java -text
forge-gui/src/main/java/forge/achievement/Overkill.java -text
forge-gui/src/main/java/forge/achievement/PlaneswalkerAchievements.java -text
forge-gui/src/main/java/forge/achievement/Poisoned.java -text
forge-gui/src/main/java/forge/achievement/QuestAchievements.java -text
forge-gui/src/main/java/forge/achievement/SealedAchievements.java -text

Binary file not shown.

Before

Width:  |  Height:  |  Size: 520 KiB

After

Width:  |  Height:  |  Size: 521 KiB

View File

@@ -38,6 +38,7 @@ public abstract class AchievementCollection implements Iterable<Achievement> {
cb.addItem(FModel.getAchievements(GameType.Sealed));
cb.addItem(FModel.getAchievements(GameType.Quest));
cb.addItem(AltWinAchievements.instance);
cb.addItem(PlaneswalkerAchievements.instance);
}
protected AchievementCollection(String name0, String filename0, boolean isLimitedFormat0) {

View File

@@ -45,7 +45,7 @@ public class AltWinAchievements extends AchievementCollection {
@Override
public void updateAll(IGuiBase gui, Player player) {
//only call update on achievement for alternate win condition (if any)
//only call update achievement for alternate win condition (if any)
if (player.getOutcome().hasWon()) {
String altWinCondition = player.getOutcome().altWinSourceName;
if (!StringUtils.isEmpty(altWinCondition)) {

View File

@@ -0,0 +1,117 @@
package forge.achievement;
import java.util.HashSet;
import forge.game.Game;
import forge.game.player.Player;
import forge.interfaces.IGuiBase;
import forge.properties.ForgeConstants;
public class PlaneswalkerAchievements extends AchievementCollection {
public static final PlaneswalkerAchievements instance = new PlaneswalkerAchievements();
private final HashSet<String> activatedUltimates = new HashSet<String>();
private PlaneswalkerAchievements() {
super("Planeswalker Ultimates", ForgeConstants.ACHIEVEMENTS_DIR + "planeswalkers.xml", false);
}
@Override
protected void addSharedAchivements() {
//prevent including shared achievements
}
@Override
protected void addAchievements() {
add("Ajani Goldmane", "Ajani's Better Half", "Serra? Is that you?");
add("Ajani Steadfast", "Ajani's Forcefield", "Shields up!");
add("Ajani Vengeant", "Ajani's Tantrum", "Look Ma! No lands!");
add("Ajani, Caller of the Pride", "Ajani's Menagerie", "You're a crazy cat lady now!");
add("Ajani, Mentor of Heroes", "Ajani's Vitality", "Do sta let!");
add("Ashiok, Nightmare Weaver", "Ashiok's Identity", "I subscribe to the theory of blank slate!");
add("Chandra Ablaze", "Chandra's Flashback", "I feel like I've seen those before...");
add("Chandra Nalaar", "Chandra's Hot Spring", "Careful! It's scalding!");
add("Chandra, Pyromaster", "Chandra's Menial Job", "Please file in triplicate!");
add("Chandra, the Firebrand", "Chandra's Hex", "When burning five is just not enough.");
add("Dack Fayden", "Dack's Discount", "Do you have any evidence it was me?");
add("Domri Rade", "Domri's Surprise", "That's GOTTA get me a date!");
add("Elspeth Tirel", "Elspeth's Solitude", "Tokens are my only friends...");
add("Elspeth, Knight-Errant", "Elspeth's Immortality", "Bant will prevail!");
add("Elspeth, Sun's Champion", "Elspeth's Crusade", "With Heliod on my side, I'm invincible!");
add("Garruk, the Veil-Cursed", "Garruk's Grave Romp", "The dead shall help the living!");
add("Garruk Wildspeaker", "Garruk's Overrun", "I speak seven languages, including Wild!");
add("Garruk, Apex Predator", "Garruk's Prey", "Funny, it's usually a good thing to have an emblem...");
add("Garruk, Caller of Beasts", "Garruk's Wild Pair", "Can you beat two for the price of one?");
add("Garruk, Primal Hunter", "Garruk's Garden", "They came out after a rain...");
add("Gideon Jura", "Gideon's Brawl", "Are you man enough to mess with me?");
add("Gideon, Champion of Justice", "Gideon's Aftermath", "Gideon stands alone!");
add("Jace Beleren", "Jace's Grind", "Nice memories... not!");
add("Jace, Architect of Thought", "Jace's Incantation", "I like that one. I'll steal it!");
add("Jace, Memory Adept", "Jace's Revelation", "So many things to learn!");
add("Jace, the Living Guildpact", "Jace's Timetwister", "Symmetry? What symmetry?");
add("Jace, the Mind Sculptor", "Jace's Lobotomy", "What do you mean, \"overpowered\"?");
add("Karn Liberated", "Karn's Reset", "Let's do this again!");
add("Kiora, the Crashing Wave", "Kiora's Best Friend", "Say hello to Cthulhu for me!");
add("Koth of the Hammer", "Koth's Eruption", "You won't like the mountains when they are angry!");
add("Liliana Vess", "Liliana's Ritual", "Stop being lazy and go to work!");
add("Liliana of the Dark Realms", "Liliana's Swamp", "What do you mean, \"out of character\"?");
add("Liliana of the Veil", "Liliana's Choice", "Which one of your children do you love best?");
add("Nicol Bolas, Planeswalker", "Bolas's Ultimatum", "Whatever you do, don't call him \"Nicol\"!");
add("Nissa Revane", "Nissa's Summoning", "The whole village is here!");
add("Nissa, Worldwaker", "Nissa's Awakening", "The whole country is here!");
add("Ral Zarek", "Ral's Long Day", "So much work, so much time!");
add("Sarkhan Vol", "Sarkhan's Dragons", "Go forth, my minions!");
add("Sarkhan the Mad", "Sarkhan's Beatdown", "Tag! You're it!");
add("Sarkhan, the Dragonspeaker", "Sarkhan's Voices", "Huh? What are you saying?)");
add("Sorin Markov", "Sorin's Hypnosis", "You're getting sleepy... very sleepy...");
add("Sorin, Lord of Innistrad", "Sorin's Recruitment", "My favorite game is Shogi!");
add("Sorin, Solemn Visitor", "Sorin's Abyss", "Don't get so close to the edge!");
add("Tamiyo, the Moon Sage", "Tamiyo's Recycling", "Wash, rinse, repeat!");
add("Teferi, Temporal Archmage", "Teferi's Time Slip", "Let's speed this up a bit!");
add("Tezzeret the Seeker", "Tezzeret's Robots", "You can't stop the progress!");
add("Tezzeret, Agent of Bolas", "Tezzeret's Drain", "Technological superiority for the win!");
add("Tibalt, the Fiend-Blooded", "Tibalt's Insurrection", "My side is the winning side!");
add("Venser, the Sojourner", "Venser's Oblivion", "Let's just clean this up a bit...");
add("Vraska, the Unseen", "Vraska's Crew", "Say hello to my little friends!");
add("Xenagos, the Reveler", "Xenagos's Reveal", "Mwahahaha! Now I'm a god!");
}
private void add(String cardName0, String displayName0, String flavorText0) {
add(new PlaneswalkerUltimate(cardName0, displayName0, flavorText0));
}
@Override
public void updateAll(IGuiBase gui, Player player) {
//only call update achievements for any ultimates activated during the game
if (player.getOutcome().hasWon()) {
boolean needSave = false;
for (String ultimate : activatedUltimates) {
Achievement achievement = achievements.get(ultimate);
if (achievement != null) {
achievement.update(gui, player);
needSave = true;
}
}
if (needSave) {
save();
}
}
activatedUltimates.clear();
}
private class PlaneswalkerUltimate extends Achievement {
private PlaneswalkerUltimate(String cardName0, String displayName0, String flavorText0) {
super(cardName0, displayName0, "Win a game after activating " + cardName0 + "'s ultimate", flavorText0);
}
@Override
protected int evaluate(Player player, Game game) {
return current + 1; //if this reaches this point, it can be presumed that alternate win condition achieved
}
@Override
public String getSubTitle() {
return current + " Win" + (current != 1 ? "s" : "");
}
}
}

View File

@@ -236,7 +236,7 @@ public enum FSkinProp {
IMG_RARE_TROPHY (new int[] {270, 0, 135, 185}, PropType.TROPHY),
IMG_MYTHIC_TROPHY (new int[] {405, 0, 135, 185}, PropType.TROPHY),
IMG_SPECIAL_TROPHY (new int[] {540, 0, 135, 185}, PropType.TROPHY),
IMG_TROPHY_PLATE (new int[] {675, 0, 160, 40}, PropType.TROPHY),
IMG_TROPHY_PLATE (new int[] {675, 0, 170, 40}, PropType.TROPHY),
IMG_TROPHY_CASE_TOP (new int[] {0, 185, 798, 38}, PropType.TROPHY),
IMG_TROPHY_SHELF (new int[] {0, 223, 798, 257}, PropType.TROPHY),

View File

@@ -33,6 +33,7 @@ import com.google.common.collect.Sets;
import forge.LobbyPlayer;
import forge.achievement.AltWinAchievements;
import forge.achievement.PlaneswalkerAchievements;
import forge.card.CardCharacteristicName;
import forge.card.ColorSet;
import forge.card.MagicColor;
@@ -1353,6 +1354,7 @@ public class PlayerControllerHuman extends PlayerController {
public void run() {
FModel.getAchievements(game.getRules().getGameType()).updateAll(gui, player);
AltWinAchievements.instance.updateAll(gui, player);
PlaneswalkerAchievements.instance.updateAll(gui, player);
}
});
}