- M15: Added Generator Servant and Sliver Hivelord

This commit is contained in:
swordshine
2014-07-01 05:43:35 +00:00
parent bdaed80796
commit ba09fa98ed
4 changed files with 52 additions and 3 deletions

View File

@@ -102,6 +102,14 @@ public class Mana {
return this.manaAbility != null && manaAbility.addKeywords(saBeingPaid);
}
public final boolean addsKeywordsType() {
return this.manaAbility != null && manaAbility.getAddsKeyowrdsType() != null;
}
public final boolean addsKeywordsUntil() {
return this.manaAbility != null && manaAbility.getAddsKeywordsUntil() != null;
}
public final String getAddedKeywords() {
return this.manaAbility.getKeywords();
}

View File

@@ -21,10 +21,13 @@ import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Lists;
import com.google.common.collect.Multimap;
import forge.GameCommand;
import forge.card.MagicColor;
import forge.card.mana.ManaCostShard;
import forge.game.GlobalRuleChange;
import forge.game.card.Card;
import forge.game.event.EventValueChangeType;
import forge.game.event.GameEventCardStatsChanged;
import forge.game.event.GameEventManaPool;
import forge.game.event.GameEventZone;
import forge.game.phase.PhaseType;
@@ -34,6 +37,7 @@ import forge.game.spellability.SpellAbility;
import forge.game.zone.ZoneType;
import org.apache.commons.lang3.StringUtils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
@@ -256,9 +260,34 @@ public class ManaPool implements Iterable<Mana> {
sa.getHostCard().setCanCounter(false);
}
if (sa.isSpell() && sa.getHostCard() != null) {
if (sa.getHostCard().isCreature() && mana.addsKeywords(sa)) {
final Card host = sa.getHostCard();
if (mana.addsKeywords(sa) && mana.addsKeywordsType()
&& host.isType(mana.getManaAbility().getAddsKeyowrdsType())) {
final long timestamp = sa.getHostCard().getGame().getNextTimestamp();
sa.getHostCard().addChangedCardKeywords(Arrays.asList(mana.getAddedKeywords().split(" & ")), new ArrayList<String>(), false, timestamp);
final List<String> kws = Arrays.asList(mana.getAddedKeywords().split(" & "));
host.addChangedCardKeywords(kws, new ArrayList<String>(), false, timestamp);
if (mana.addsKeywordsUntil()) {
final GameCommand untilEOT = new GameCommand() {
private static final long serialVersionUID = -8285169579025607693L;
@Override
public void run() {
if (!kws.isEmpty()) {
for (String kw : kws) {
if (kw.startsWith("HIDDEN")) {
sa.getHostCard().removeHiddenExtrinsicKeyword(kw);
}
}
host.removeChangedCardKeywords(timestamp);
}
host.getGame().fireEvent(new GameEventCardStatsChanged(host));
}
};
String until = mana.getManaAbility().getAddsKeywordsUntil();
if ("UntilEOT".equals(until)) {
host.getGame().getEndOfTurn().addUntil(untilEOT);
}
}
}
if (mana.addsCounters(sa)) {
mana.getManaAbility().createETBCounters(sa.getHostCard());

View File

@@ -55,6 +55,8 @@ public class AbilityManaPart implements java.io.Serializable {
private final String manaRestrictions;
private final String cannotCounterSpell;
private final String addsKeywords;
private final String addsKeyowrdsType;
private final String addsKeywordsUntil;
private final String addsCounters;
private final boolean persistentMana;
private String manaReplaceType;
@@ -88,6 +90,8 @@ public class AbilityManaPart implements java.io.Serializable {
this.manaRestrictions = params.containsKey("RestrictValid") ? params.get("RestrictValid") : "";
this.cannotCounterSpell = params.get("AddsNoCounter");
this.addsKeywords = params.get("AddsKeywords");
this.addsKeyowrdsType = params.get("AddsKeywordsType");
this.addsKeywordsUntil = params.get("AddsKeywordsUntil");
this.addsCounters = params.get("AddsCounters");
this.persistentMana = (null == params.get("PersistentMana")) ? false :
"True".equalsIgnoreCase(params.get("PersistentMana"));
@@ -198,6 +202,14 @@ public class AbilityManaPart implements java.io.Serializable {
return this.addsKeywords != null;
}
public String getAddsKeyowrdsType() {
return addsKeyowrdsType;
}
public String getAddsKeywordsUntil() {
return addsKeywordsUntil;
}
/**
* <p>
* getKeywords.

View File

@@ -2,6 +2,6 @@ Name:Hall of the Bandit Lord
ManaCost:no cost
Types:Legendary Land
K:CARDNAME enters the battlefield tapped.
A:AB$ Mana | Cost$ T PayLife<3> | Produced$ 1 | AddsKeywords$ Haste | SpellDescription$ Add {1} to your mana pool. If that mana is spent on a creature spell, it gains haste.
A:AB$ Mana | Cost$ T PayLife<3> | Produced$ 1 | AddsKeywords$ Haste | AddsKeywordsType$ Creature | SpellDescription$ Add {1} to your mana pool. If that mana is spent on a creature spell, it gains haste.
SVar:Picture:http://www.wizards.com/global/images/magic/general/hall_of_the_bandit_lord.jpg
Oracle:Hall of the Bandit Lord enters the battlefield tapped.\n{T}, Pay 3 life: Add {1} to your mana pool. If that mana is spent on a creature spell, it gains haste.