mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
- Added Sword of Body and Mind.
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
Sword of Body and Mind
|
||||||
|
3
|
||||||
|
Artifact Equipment
|
||||||
|
Equipped creature gets +2/+2 and has protection from green and from blue. Whenever equipped creature deals combat damage to a player, you put a 2/2 green Wolf creature token onto the battlefield and that player puts the top ten cards of his or her library into his or her graveyard.
|
||||||
|
SVar:Rarity:Rare
|
||||||
|
|
||||||
Desecrated Earth
|
Desecrated Earth
|
||||||
4 B
|
4 B
|
||||||
Sorcery
|
Sorcery
|
||||||
|
|||||||
@@ -839,6 +839,108 @@ class CardFactory_Equipment {
|
|||||||
|
|
||||||
} //*************** END ************ END **************************
|
} //*************** END ************ END **************************
|
||||||
|
|
||||||
|
|
||||||
|
//*************** START *********** START **************************
|
||||||
|
else if(cardName.equals("Sword of Body and Mind")) {
|
||||||
|
final Ability equip = new Ability(card, "2") {
|
||||||
|
@Override
|
||||||
|
public void resolve() {
|
||||||
|
if(AllZone.GameAction.isCardInPlay(getTargetCard())
|
||||||
|
&& CardFactoryUtil.canTarget(card, getTargetCard())) {
|
||||||
|
if(card.isEquipping()) {
|
||||||
|
Card crd = card.getEquipping().get(0);
|
||||||
|
if(crd.equals(getTargetCard())) return;
|
||||||
|
|
||||||
|
card.unEquipCard(crd);
|
||||||
|
}
|
||||||
|
card.equipCard(getTargetCard());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPlay() {
|
||||||
|
return AllZone.getZone(card).is(Constant.Zone.Play)
|
||||||
|
&& AllZone.Phase.getActivePlayer().equals(card.getController())
|
||||||
|
&& (AllZone.Phase.getPhase().equals("Main1") || AllZone.Phase.getPhase().equals(
|
||||||
|
"Main2"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPlayAI() {
|
||||||
|
return getCreature().size() != 0 && !card.isEquipping();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void chooseTargetAI() {
|
||||||
|
Card target = CardFactoryUtil.AI_getBestCreature(getCreature());
|
||||||
|
setTargetCard(target);
|
||||||
|
}
|
||||||
|
|
||||||
|
CardList getCreature() {
|
||||||
|
CardList list = new CardList(AllZone.Computer_Play.getCards());
|
||||||
|
list = list.filter(new CardListFilter() {
|
||||||
|
public boolean addCard(Card c) {
|
||||||
|
return c.isCreature() && (!CardFactoryUtil.AI_doesCreatureAttack(c))
|
||||||
|
&& CardFactoryUtil.canTarget(card, c)
|
||||||
|
&& (!c.getKeyword().contains("Defender"));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// list.remove(card); // if mana-only cost, allow self-target
|
||||||
|
|
||||||
|
// is there at least 1 Loxodon Punisher to target
|
||||||
|
|
||||||
|
CardList equipMagnetList = list.getName("Loxodon Punisher");
|
||||||
|
if (equipMagnetList.size() != 0) {
|
||||||
|
return equipMagnetList;
|
||||||
|
}
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}//getCreature()
|
||||||
|
|
||||||
|
|
||||||
|
};//equip ability
|
||||||
|
|
||||||
|
Command onEquip = new Command() {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 4792252563711300648L;
|
||||||
|
|
||||||
|
public void execute() {
|
||||||
|
if(card.isEquipping()) {
|
||||||
|
Card crd = card.getEquipping().get(0);
|
||||||
|
crd.addSemiPermanentAttackBoost(2);
|
||||||
|
crd.addSemiPermanentDefenseBoost(2);
|
||||||
|
crd.addExtrinsicKeyword("Protection from green");
|
||||||
|
crd.addExtrinsicKeyword("Protection from blue");
|
||||||
|
}
|
||||||
|
}//execute()
|
||||||
|
};//Command
|
||||||
|
|
||||||
|
|
||||||
|
Command onUnEquip = new Command() {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 6204739827947031589L;
|
||||||
|
|
||||||
|
public void execute() {
|
||||||
|
if(card.isEquipping()) {
|
||||||
|
Card crd = card.getEquipping().get(0);
|
||||||
|
crd.addSemiPermanentAttackBoost(-2);
|
||||||
|
crd.addSemiPermanentDefenseBoost(-2);
|
||||||
|
crd.removeExtrinsicKeyword("Protection from red");
|
||||||
|
crd.removeExtrinsicKeyword("Protection from blue");
|
||||||
|
}
|
||||||
|
|
||||||
|
}//execute()
|
||||||
|
};//Command
|
||||||
|
|
||||||
|
equip.setBeforePayMana(CardFactoryUtil.input_equipCreature(equip));
|
||||||
|
equip.setDescription("Equip: 2");
|
||||||
|
card.addSpellAbility(equip);
|
||||||
|
|
||||||
|
card.addEquipCommand(onEquip);
|
||||||
|
card.addUnEquipCommand(onUnEquip);
|
||||||
|
|
||||||
|
} //*************** END ************ END **************************
|
||||||
|
|
||||||
if (shouldEquip(card) != -1) {
|
if (shouldEquip(card) != -1) {
|
||||||
int n = shouldEquip(card);
|
int n = shouldEquip(card);
|
||||||
if (n != -1) {
|
if (n != -1) {
|
||||||
|
|||||||
@@ -750,7 +750,10 @@ public class CombatUtil {
|
|||||||
GameActionUtil.executeSwordOfFireAndIceEffects(equip);
|
GameActionUtil.executeSwordOfFireAndIceEffects(equip);
|
||||||
}
|
}
|
||||||
if(c.getDealtCombatDmgToOppThisTurn() && equip.getName().equals("Sword of Light and Shadow")) {
|
if(c.getDealtCombatDmgToOppThisTurn() && equip.getName().equals("Sword of Light and Shadow")) {
|
||||||
GameActionUtil.executeSwordOfLightandShadowEffects(equip);
|
GameActionUtil.executeSwordOfLightAndShadowEffects(equip);
|
||||||
|
}
|
||||||
|
if(c.getDealtCombatDmgToOppThisTurn() && equip.getName().equals("Sword of Body and Mind")) {
|
||||||
|
GameActionUtil.executeSwordOfBodyAndMindEffects(equip);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}//isEquipped && getNetAttack > 0
|
}//isEquipped && getNetAttack > 0
|
||||||
|
|||||||
@@ -4932,7 +4932,7 @@ public class GameActionUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void executeSwordOfLightandShadowEffects(Card source) {
|
public static void executeSwordOfLightAndShadowEffects(Card source) {
|
||||||
final Card src = source;
|
final Card src = source;
|
||||||
final Ability ability = new Ability(src, "0") {
|
final Ability ability = new Ability(src, "0") {
|
||||||
@Override
|
@Override
|
||||||
@@ -4989,6 +4989,34 @@ public class GameActionUtil {
|
|||||||
res.execute();
|
res.execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void executeSwordOfBodyAndMindEffects(Card source)
|
||||||
|
{
|
||||||
|
final Card src = source;
|
||||||
|
final Ability ability = new Ability(src, "0") {
|
||||||
|
@Override
|
||||||
|
public void resolve() {
|
||||||
|
String opponent = AllZone.GameAction.getOpponent(src.getController());
|
||||||
|
|
||||||
|
CardFactoryUtil.makeToken("Wolf", "G 2 2 Wolf", src, "G",
|
||||||
|
new String[] {"Creature", "Wolf"}, 2, 2, new String[] {""});
|
||||||
|
|
||||||
|
|
||||||
|
CardList lib = AllZoneUtil.getPlayerCardsInLibrary(opponent);
|
||||||
|
int max = lib.size();
|
||||||
|
if (max > 10)
|
||||||
|
max = 10;
|
||||||
|
|
||||||
|
for (int i=0;i<max;i++)
|
||||||
|
AllZone.GameAction.moveToGraveyard(lib.get(i));
|
||||||
|
|
||||||
|
//AllZone.GameAction.getPlayerLife(src.getController()).addLife(3);
|
||||||
|
}
|
||||||
|
}; // ability
|
||||||
|
|
||||||
|
ability.setStackDescription("Sword of Body and Mind - put a 2/2 green Wolf creature token onto the battlefield and opponent puts the top ten cards of his or her library into his or her graveyard. " );
|
||||||
|
AllZone.Stack.add(ability);
|
||||||
|
}
|
||||||
|
|
||||||
//this is for cards like Sengir Vampire
|
//this is for cards like Sengir Vampire
|
||||||
public static void executeVampiricEffects(Card c) {
|
public static void executeVampiricEffects(Card c) {
|
||||||
ArrayList<String> a = c.getKeyword();
|
ArrayList<String> a = c.getKeyword();
|
||||||
|
|||||||
Reference in New Issue
Block a user