- Added Glittering Lynx and Glittering Lion.

This commit is contained in:
Sloth
2012-10-18 15:51:58 +00:00
parent da1e300ab0
commit 03a95d04cd
4 changed files with 47 additions and 4 deletions

2
.gitattributes vendored
View File

@@ -3899,6 +3899,8 @@ res/cardsfolder/g/glissas_scorn.txt svneol=native#text/plain
res/cardsfolder/g/glistener_elf.txt svneol=native#text/plain
res/cardsfolder/g/glistening_oil.txt svneol=native#text/plain
res/cardsfolder/g/glitterfang.txt svneol=native#text/plain
res/cardsfolder/g/glittering_lion.txt -text
res/cardsfolder/g/glittering_lynx.txt -text
res/cardsfolder/g/global_ruin.txt svneol=native#text/plain
res/cardsfolder/g/gloom.txt svneol=native#text/plain
res/cardsfolder/g/gloom_surgeon.txt -text

View File

@@ -0,0 +1,12 @@
Name:Glittering Lion
ManaCost:2 W
Types:Creature Cat
Text:no text
PT:2/2
K:Prevent all damage that would be dealt to CARDNAME.
A:AB$ Debuff | Cost$ 3 | Defined$ Self | Keywords$ Prevent all damage that would be dealt to CARDNAME. | AnyPlayer$ True | SpellDescription$ Until end of turn, CARDNAME loses "Prevent all damage that would be dealt to CARDNAME." Any player may activate this ability.
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/glittering_lion.jpg
SetInfo:PCY|Uncommon|http://magiccards.info/scans/en/pr/9.jpg
Oracle:Prevent all damage that would be dealt to Glittering Lion.\n{3}: Until end of turn, Glittering Lion loses "Prevent all damage that would be dealt to Glittering Lion." Any player may activate this ability.
End

View File

@@ -0,0 +1,12 @@
Name:Glittering Lynx
ManaCost:W
Types:Creature Cat
Text:no text
PT:1/1
K:Prevent all damage that would be dealt to CARDNAME.
A:AB$ Debuff | Cost$ 2 | Defined$ Self | Keywords$ Prevent all damage that would be dealt to CARDNAME. | AnyPlayer$ True | SpellDescription$ Until end of turn, CARDNAME loses "Prevent all damage that would be dealt to CARDNAME." Any player may activate this ability.
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/glittering_lynx.jpg
SetInfo:PCY|Common|http://magiccards.info/scans/en/pr/10.jpg
Oracle:Prevent all damage that would be dealt to Glittering Lynx.\n{2}: Until end of turn, Glittering Lion loses "Prevent all damage that would be dealt to Glittering Lynx." Any player may activate this ability.
End

View File

@@ -42,6 +42,7 @@ import forge.card.spellability.SpellAbilityRestriction;
import forge.card.spellability.Target;
import forge.game.GameState;
import forge.game.phase.CombatUtil;
import forge.game.phase.PhaseHandler;
import forge.game.phase.PhaseType;
import forge.game.player.ComputerUtil;
import forge.game.player.Player;
@@ -317,9 +318,12 @@ public final class AbilityFactoryDebuff {
final HashMap<String, String> params = af.getMapParams();
final SpellAbilityRestriction restrict = sa.getRestrictions();
final PhaseHandler ph = Singletons.getModel().getGameState().getPhaseHandler();
// Phase Restrictions
if ((Singletons.getModel().getGameState().getStack().size() == 0) && Singletons.getModel().getGameState().getPhaseHandler().getPhase().isBefore(PhaseType.COMBAT_BEGIN)) {
if (ph.getPhase().isBefore(PhaseType.COMBAT_DECLARE_ATTACKERS_INSTANT_ABILITY)
|| ph.getPhase().isAfter(PhaseType.COMBAT_DECLARE_BLOCKERS_INSTANT_ABILITY)
|| !Singletons.getModel().getGameState().getStack().isEmpty()) {
// Instant-speed pumps should not be cast outside of combat when the
// stack is empty
if (!AbilityFactory.isSorcerySpeed(sa)) {
@@ -335,15 +339,28 @@ public final class AbilityFactoryDebuff {
}
if ((sa.getTarget() == null) || !sa.getTarget().doesTarget()) {
final ArrayList<Card> cards = AbilityFactory.getDefinedCards(sa.getSourceCard(), params.get("Defined"), sa);
if (cards.size() == 0) {
List<Card> cards = AbilityFactory.getDefinedCards(sa.getSourceCard(), params.get("Defined"), sa);
if (!cards.isEmpty()) {
cards = CardLists.filter(cards, new Predicate<Card>() {
@Override
public boolean apply(final Card c) {
if (!c.isBlocking() && !c.isAttacking()) {
return false;
}
// don't add duplicate negative keywords
return c.hasAnyKeyword(AbilityFactoryDebuff.getKeywords(params));
}
});
}
if (cards.isEmpty()) {
return false;
}
} else {
return AbilityFactoryDebuff.debuffTgtAI(ai, af, sa, AbilityFactoryDebuff.getKeywords(params), false);
}
return false;
return true;
}
/**