Merge pull request #3407 from spjspj/master

Add emblems into the int.txt file 'emblem:Human:ElspethSunsChampionEm…
This commit is contained in:
spjspj 2017-05-21 12:44:17 +10:00 committed by GitHub
commit 7497697171
2 changed files with 14 additions and 0 deletions

View file

@ -87,6 +87,8 @@ public final class SystemUtil {
gameZone = Zone.LIBRARY; gameZone = Zone.LIBRARY;
} else if ("token".equalsIgnoreCase(zone)) { } else if ("token".equalsIgnoreCase(zone)) {
gameZone = Zone.BATTLEFIELD; gameZone = Zone.BATTLEFIELD;
} else if ("emblem".equalsIgnoreCase(zone)) {
gameZone = Zone.COMMAND;
} else { } else {
continue; // go parse next line continue; // go parse next line
} }
@ -103,6 +105,17 @@ public final class SystemUtil {
Object token = cons.newInstance(); Object token = cons.newInstance();
if (token != null && token instanceof mage.game.permanent.token.Token) { if (token != null && token instanceof mage.game.permanent.token.Token) {
((mage.game.permanent.token.Token) token).putOntoBattlefield(amount, game, null, player.getId(), false, false); ((mage.game.permanent.token.Token) token).putOntoBattlefield(amount, game, null, player.getId(), false, false);
continue;
}
} else if ("emblem".equalsIgnoreCase(zone)) {
// eg: emblem:Human:ElspethSunsChampionEmblem:1
Class<?> c = Class.forName("mage.game.command.emblems." + cardName);
Constructor<?> cons = c.getConstructor();
Object emblem = cons.newInstance();
if (emblem != null && emblem instanceof mage.game.command.Emblem) {
((mage.game.command.Emblem) emblem).setControllerId(player.getId());
game.addEmblem((mage.game.command.Emblem) emblem, null, player.getId());
continue;
} }
} }
logger.warn("Couldn't find a card: " + cardName); logger.warn("Couldn't find a card: " + cardName);

View file

@ -48,6 +48,7 @@ public class ElspethSunsChampionEmblem extends Emblem {
public ElspethSunsChampionEmblem() { public ElspethSunsChampionEmblem() {
this.setName("Emblem Elspeth"); this.setName("Emblem Elspeth");
this.setExpansionSetCodeForImage("THS");
Ability ability = new SimpleStaticAbility(Zone.COMMAND, new BoostControlledEffect(2, 2, Duration.EndOfGame, filter, false)); Ability ability = new SimpleStaticAbility(Zone.COMMAND, new BoostControlledEffect(2, 2, Duration.EndOfGame, filter, false));
ability.addEffect(new GainAbilityControlledEffect(FlyingAbility.getInstance(), Duration.EndOfGame, filter)); ability.addEffect(new GainAbilityControlledEffect(FlyingAbility.getInstance(), Duration.EndOfGame, filter));
this.getAbilities().add(ability); this.getAbilities().add(ability);