mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- Converted Horde of Notions to script.
This commit is contained in:
@@ -6,6 +6,7 @@ PT:5/5
|
|||||||
K:Vigilance
|
K:Vigilance
|
||||||
K:Trample
|
K:Trample
|
||||||
K:Haste
|
K:Haste
|
||||||
|
A:AB$ Play | Cost$ W U B R G | TgtZone$ Graveyard | WithoutManaCost$ True | ValidTgts$ Elemental.YouCtrl | TgtPrompt$ Choose target Elemental card from your graveyard | SpellDescription$ You may play target Elemental card from your graveyard without paying its mana cost.
|
||||||
SVar:Rarity:Rare
|
SVar:Rarity:Rare
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/horde_of_notions.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/horde_of_notions.jpg
|
||||||
SetInfo:LRW|Rare|http://magiccards.info/scans/en/lw/249.jpg
|
SetInfo:LRW|Rare|http://magiccards.info/scans/en/lw/249.jpg
|
||||||
|
|||||||
@@ -20,19 +20,26 @@ package forge.card.abilityfactory;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
import forge.AllZone;
|
import forge.AllZone;
|
||||||
|
import forge.AllZoneUtil;
|
||||||
import forge.Card;
|
import forge.Card;
|
||||||
|
import forge.CardList;
|
||||||
import forge.ComputerUtil;
|
import forge.ComputerUtil;
|
||||||
import forge.Player;
|
import forge.Player;
|
||||||
|
import forge.Constant.Zone;
|
||||||
|
import forge.card.cardfactory.CardFactoryUtil;
|
||||||
import forge.card.cost.Cost;
|
import forge.card.cost.Cost;
|
||||||
import forge.card.cost.CostMana;
|
import forge.card.cost.CostMana;
|
||||||
import forge.card.cost.CostPart;
|
import forge.card.cost.CostPart;
|
||||||
|
import forge.card.cost.CostUtil;
|
||||||
import forge.card.spellability.AbilityActivated;
|
import forge.card.spellability.AbilityActivated;
|
||||||
import forge.card.spellability.AbilitySub;
|
import forge.card.spellability.AbilitySub;
|
||||||
import forge.card.spellability.Spell;
|
import forge.card.spellability.Spell;
|
||||||
import forge.card.spellability.SpellAbility;
|
import forge.card.spellability.SpellAbility;
|
||||||
import forge.card.spellability.Target;
|
import forge.card.spellability.Target;
|
||||||
|
import forge.util.MyRandom;
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* AbilityFactory_Copy class.
|
* AbilityFactory_Copy class.
|
||||||
@@ -225,7 +232,57 @@ public final class AbilityFactoryPlay {
|
|||||||
* @return a boolean.
|
* @return a boolean.
|
||||||
*/
|
*/
|
||||||
private static boolean PlayCanPlayAI(final AbilityFactory af, final SpellAbility sa) {
|
private static boolean PlayCanPlayAI(final AbilityFactory af, final SpellAbility sa) {
|
||||||
return false;
|
final Cost abCost = af.getAbCost();
|
||||||
|
final Card source = af.getHostCard();
|
||||||
|
final HashMap<String, String> params = af.getMapParams();
|
||||||
|
final Random r = MyRandom.getRandom();
|
||||||
|
|
||||||
|
if (abCost != null) {
|
||||||
|
// AI currently disabled for these costs
|
||||||
|
if (!CostUtil.checkSacrificeCost(abCost, source)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!CostUtil.checkLifeCost(abCost, source, 4)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!CostUtil.checkDiscardCost(abCost, source)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!CostUtil.checkRemoveCounterCost(abCost, source)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// don't use this as a response
|
||||||
|
if (AllZone.getStack().size() != 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// prevent run-away activations - first time will always return true
|
||||||
|
boolean chance = r.nextFloat() <= Math.pow(.6667, sa.getRestrictions().getNumberTurnActivations());
|
||||||
|
|
||||||
|
CardList cards;
|
||||||
|
final Target tgt = sa.getTarget();
|
||||||
|
if (tgt != null) {
|
||||||
|
Zone zone = tgt.getZone().get(0);
|
||||||
|
cards = AllZoneUtil.getCardsIn(zone);
|
||||||
|
cards = cards.getValidCards(tgt.getValidTgts(), AllZone.getComputerPlayer(), source);
|
||||||
|
if (cards.isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
tgt.addTarget(CardFactoryUtil.getBestAI(cards));
|
||||||
|
} else {
|
||||||
|
cards = new CardList(AbilityFactory.getDefinedCards(sa.getSourceCard(), params.get("Defined"), sa));
|
||||||
|
if (cards.isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return chance;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -277,7 +334,12 @@ public final class AbilityFactoryPlay {
|
|||||||
if (tgtCards.isEmpty()) {
|
if (tgtCards.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Card tgtCard = tgtCards.get(0);
|
Card tgtCard = tgtCards.get(0);
|
||||||
|
if (tgtCard.isLand()) {
|
||||||
|
controller.playLand(tgtCard);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ArrayList<SpellAbility> sas = tgtCard.getBasicSpells();
|
ArrayList<SpellAbility> sas = tgtCard.getBasicSpells();
|
||||||
if (sas.isEmpty()) {
|
if (sas.isEmpty()) {
|
||||||
|
|||||||
@@ -729,7 +729,7 @@ public class CardFactoryCreatures {
|
|||||||
} // *************** END ************ END **************************
|
} // *************** END ************ END **************************
|
||||||
|
|
||||||
// *************** START *********** START **************************
|
// *************** START *********** START **************************
|
||||||
else if (cardName.equals("Horde of Notions")) {
|
/*else if (cardName.equals("Horde of Notions")) {
|
||||||
final Ability ability = new Ability(card, "W U B R G") {
|
final Ability ability = new Ability(card, "W U B R G") {
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
@@ -782,7 +782,7 @@ public class CardFactoryCreatures {
|
|||||||
sbStack.append("graveyard without paying its mana cost.");
|
sbStack.append("graveyard without paying its mana cost.");
|
||||||
ability.setStackDescription(sbStack.toString());
|
ability.setStackDescription(sbStack.toString());
|
||||||
ability.setBeforePayMana(new InputPayManaCost(ability));
|
ability.setBeforePayMana(new InputPayManaCost(ability));
|
||||||
} // *************** END ************ END **************************
|
}*/ // *************** END ************ END **************************
|
||||||
|
|
||||||
// *************** START *********** START **************************
|
// *************** START *********** START **************************
|
||||||
else if (cardName.equals("Rhys the Redeemed")) {
|
else if (cardName.equals("Rhys the Redeemed")) {
|
||||||
|
|||||||
Reference in New Issue
Block a user