mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 02:38:02 +00:00
- Added Blinding Powder
- Unattach cost can use OriginalHost (preferred method for pumped activated abilities that require unattaching the card granting the ability)
This commit is contained in:
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -1008,6 +1008,7 @@ res/cardsfolder/b/blinding_angel.txt -text
|
||||
res/cardsfolder/b/blinding_beam.txt -text
|
||||
res/cardsfolder/b/blinding_light.txt svneol=native#text/plain
|
||||
res/cardsfolder/b/blinding_mage.txt svneol=native#text/plain
|
||||
res/cardsfolder/b/blinding_powder.txt -text
|
||||
res/cardsfolder/b/blinding_souleater.txt svneol=native#text/plain
|
||||
res/cardsfolder/b/blinking_spirit.txt svneol=native#text/plain
|
||||
res/cardsfolder/b/blinkmoth_infusion.txt svneol=native#text/plain
|
||||
|
||||
11
res/cardsfolder/b/blinding_powder.txt
Normal file
11
res/cardsfolder/b/blinding_powder.txt
Normal file
@@ -0,0 +1,11 @@
|
||||
Name:Blinding Powder
|
||||
ManaCost:1
|
||||
Types:Artifact Equipment
|
||||
Text:no text
|
||||
S:Mode$ Continuous | Affected$ Creature.EquippedBy | AddAbility$ BlindEnemies | Description$ Equipped creature has "Unattach CARDNAME: Prevent all combat damage that would be dealt to this creature this turn."
|
||||
SVar:BlindEnemies:AB$ Pump | Cost$ Unattach<OriginalHost/Blinding Powder> | Defined$ Self | KW$ HIDDEN Prevent all combat damage that would be dealt to CARDNAME. | SpellDescription$ Prevent all combat damage that would be dealt to CARDNAME this turn.
|
||||
K:Equip 2
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/blinding_powder.jpg
|
||||
SetInfo:BOK|Uncommon|http://magiccards.info/scans/en/bok/153.jpg
|
||||
Oracle:Equipped creature has "Unattach Blinding Powder: Prevent all combat damage that would be dealt to this creature this turn."\nEquip {2} ({2}: Attach to target creature you control. Equip only as a sorcery.)
|
||||
End
|
||||
@@ -3,8 +3,8 @@ ManaCost:4
|
||||
Types:Artifact Equipment
|
||||
Text:no text
|
||||
K:Equip 5
|
||||
S:Mode$ Continuous | Affected$ Creature.EquippedBy | AddPower$ 2 | AddToughness$ 1 | AddAbility$ SeekerDestroy | Description$ Equipped creature gets +2/+1 and has "{T}, Unattach Heartseeker: Destroy target creature."
|
||||
SVar:SeekerDestroy:AB$ Destroy | Cost$ T Unattach<Card.Attached+namedHeartseeker/equipped Heartseeker> | ValidTgts$ Creature | SpellDescription$ Destroy target creature.
|
||||
S:Mode$ Continuous | Affected$ Creature.EquippedBy | AddPower$ 2 | AddToughness$ 1 | AddAbility$ SeekerDestroy | Description$ Equipped creature gets +2/+1 and has "{T}, Unattach CARDNAME: Destroy target creature."
|
||||
SVar:SeekerDestroy:AB$ Destroy | Cost$ T Unattach<OriginalHost/Heartseeker> | ValidTgts$ Creature | SpellDescription$ Destroy target creature.
|
||||
SVar:Rarity:Rare
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/heartseeker.jpg
|
||||
SetInfo:DST|Rare|http://magiccards.info/scans/en/ds/124.jpg
|
||||
|
||||
@@ -33,22 +33,20 @@ import forge.gui.GuiDialog;
|
||||
public class CostUnattach extends CostPartWithList {
|
||||
// Unattach<CARDNAME> if ability is on the Equipment
|
||||
// Unattach<Card.Attached+namedHeartseeker/Equipped Heartseeker> if equipped creature has the ability
|
||||
|
||||
|
||||
/**
|
||||
* Instantiates a new cost unattach.
|
||||
*/
|
||||
public CostUnattach(final String type, final String desc) {
|
||||
super("1", type, desc);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isUndoable() { return false; }
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isReusable() { return false; }
|
||||
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
@@ -73,6 +71,11 @@ public class CostUnattach extends CostPartWithList {
|
||||
if (source.isEquipping()) {
|
||||
return true;
|
||||
}
|
||||
} else if (type.equals("OriginalHost")) {
|
||||
Card originalEquipment = ability.getOriginalHost();
|
||||
if (originalEquipment.isEquipping()) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
List<Card> equipped = source.getEquippedBy();
|
||||
if (CardLists.getValidCards(equipped, type, activator, source).size() > 0) {
|
||||
@@ -91,7 +94,7 @@ public class CostUnattach extends CostPartWithList {
|
||||
*/
|
||||
@Override
|
||||
public final void payAI(final AIPlayer ai, final SpellAbility ability, final Card source, final CostPayment payment, final GameState game) {
|
||||
Card cardToUnattach = findCardToUnattach(source, (Player)ai);
|
||||
Card cardToUnattach = findCardToUnattach(source, (Player) ai, ability);
|
||||
if (cardToUnattach == null) {
|
||||
// We really shouldn't be able to get here if there's nothing to unattach
|
||||
return;
|
||||
@@ -113,7 +116,7 @@ public class CostUnattach extends CostPartWithList {
|
||||
public final boolean payHuman(final SpellAbility ability, final Card source, final CostPayment payment, final GameState game) {
|
||||
this.resetList();
|
||||
Player activator = ability.getActivatingPlayer();
|
||||
Card cardToUnattach = findCardToUnattach(source, activator);
|
||||
Card cardToUnattach = findCardToUnattach(source, activator, ability);
|
||||
if (cardToUnattach != null && GuiDialog.confirm(source, String.format("Unattach %s?", cardToUnattach.toString()))) {
|
||||
Card equippingCard = cardToUnattach.getEquipping().get(0);
|
||||
cardToUnattach.unEquipCard(equippingCard);
|
||||
@@ -127,12 +130,17 @@ public class CostUnattach extends CostPartWithList {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private Card findCardToUnattach(final Card source, Player activator) {
|
||||
|
||||
private Card findCardToUnattach(final Card source, Player activator, SpellAbility ability) {
|
||||
if (getType().equals("CARDNAME")) {
|
||||
if (source.isEquipping()) {
|
||||
return source;
|
||||
}
|
||||
} else if (getType().equals("OriginalHost")) {
|
||||
Card originalEquipment = ability.getOriginalHost();
|
||||
if (originalEquipment.isEquipping()) {
|
||||
return originalEquipment;
|
||||
}
|
||||
} else {
|
||||
List<Card> attachees = CardLists.getValidCards(source.getEquippedBy(), this.getType(), activator, source);
|
||||
if (attachees.size() > 0) {
|
||||
|
||||
Reference in New Issue
Block a user