- Added Sword of the Meek, Thopter Foundry (awesome combo, AI can use this too!), Tinker, and Goblin Charbelcher.

This commit is contained in:
jendave
2011-08-06 02:50:13 +00:00
parent b0d660a6bb
commit de91918e51
6 changed files with 491 additions and 4 deletions

View File

@@ -1,3 +1,23 @@
Sword of the Meek
2
Artifact Equipment
Equipped creature gets +1/+2. Whenever a 1/1 creature enters the battlefield under your control, you may return Sword of the Meek from your graveyard to the battlefield, then attach it to that creature.
Thopter Foundry
WB U
Artifact
no text
Tinker
2 U
Sorcery
As an additional cost to cast Tinker, sacrifice an artifact. Search your library for an artifact card and put that card onto the battlefield. Then shuffle your library.
Goblin Charbelcher
4
Artifact
no text
Umezawa's Jitte Umezawa's Jitte
2 2
Artifact Equipment Artifact Equipment

View File

@@ -1,6 +1,6 @@
program/mail=mtgerror@yahoo.com program/mail=mtgerror@yahoo.com
program/forum=http://www.slightlymagic.net/forum/viewforum.php?f=26 program/forum=http://www.slightlymagic.net/forum/viewforum.php?f=26
program/version=MTG Forge -- official beta: 09/11/02, SVN revision: 94 program/version=MTG Forge -- official beta: 09/11/02, SVN revision: 95
tokens--file=AllTokens.txt tokens--file=AllTokens.txt

View File

@@ -17138,6 +17138,303 @@ return land.size() > 1 && CardFactoryUtil.AI_isMainPhase();
}//*************** END ************ END ************************** }//*************** END ************ END **************************
//*************** START *********** START **************************
if (cardName.equals("Goblin Charbelcher"))
{
final Ability_Tap ability = new Ability_Tap(card, "3")
{
private static final long serialVersionUID = -840041589720758423L;
public void resolve() {
PlayerZone lib = AllZone.getZone(Constant.Zone.Library, card.getController());
CardList topOfLibrary = new CardList(lib.getCards());
CardList revealed = new CardList();
if (topOfLibrary.size() == 0)
return;
int damage = 0;
int count = 0;
Card c = null;
Card crd;
while (c == null)
{
revealed.add(topOfLibrary.get(count));
crd = topOfLibrary.get(count++);
if (crd.isLand() || count == topOfLibrary.size() ) {
c = crd;
damage = count;
if (crd.getName().equals("Mountain"))
damage = damage * 2;
}
}//while
AllZone.Display.getChoiceOptional("Revealed cards:", revealed.toArray());
}
};
ability.setChooseTargetAI(CardFactoryUtil.AI_targetHuman());
ability.setBeforePayMana(CardFactoryUtil.input_targetCreaturePlayer(ability, true));
card.addSpellAbility(ability);
}//*************** END ************ END **************************
//*************** START *********** START **************************
if (cardName.equals("Tinker"))
{
final SpellAbility spell = new Spell(card)
{
private static final long serialVersionUID = -5878957726445248334L;
public boolean canPlay() {
PlayerZone play = AllZone.getZone(Constant.Zone.Play, card.getController());
CardList list = new CardList(play.getCards());
list = list.getType("Artifact");
return list.size() > 0;
}
public boolean canPlayAI()
{
PlayerZone play = AllZone.getZone(Constant.Zone.Play, Constant.Player.Computer);
PlayerZone lib = AllZone.getZone(Constant.Zone.Library, Constant.Player.Computer);
CardList playList = new CardList(play.getCards());
playList = playList.filter(new CardListFilter()
{
public boolean addCard(Card c) {
return c.isArtifact() && CardUtil.getConvertedManaCost(c.getManaCost()) <= 2;
}
});
CardList libList = new CardList(lib.getCards());
libList = libList.filter(new CardListFilter()
{
public boolean addCard(Card c){
return c.isArtifact() && CardUtil.getConvertedManaCost(c.getManaCost()) > 5;
}
});
if (libList.size() > 0 && playList.size() > 0)
{
playList.shuffle();
setTargetCard(playList.get(0));
return true;
}
return false;
}
public void resolve() {
Card c = getTargetCard();
PlayerZone play = AllZone.getZone(Constant.Zone.Play, card.getController());
PlayerZone lib = AllZone.getZone(Constant.Zone.Library, card.getController());
if (AllZone.GameAction.isCardInPlay(c))
{
AllZone.GameAction.sacrifice(c);
if (card.getController().equals(Constant.Player.Computer)) {
CardList list = new CardList(lib.getCards());
list = list.filter(new CardListFilter()
{
public boolean addCard(Card c)
{
return c.isArtifact() && CardUtil.getConvertedManaCost(c.getManaCost()) > 5;
}
});
if (list.size() > 0)
{
Card crd = CardFactoryUtil.AI_getBestArtifact(list);
lib.remove(crd);
play.add(crd);
AllZone.GameAction.shuffle(Constant.Player.Computer);
}
}
else //human
{
CardList list = new CardList(lib.getCards());
list = list.filter(new CardListFilter()
{
public boolean addCard(Card c)
{
return c.isArtifact();
}
});
if (list.size() > 0) {
Object o = AllZone.Display.getChoiceOptional("Select artifact", list.toArray());
if (o != null)
{
Card crd = (Card)o;
lib.remove(crd);
play.add(crd);
}
AllZone.GameAction.shuffle(Constant.Player.Human);
}
}
}//if isCardInPlay
}
};
/*
final Command sac = new Command()
{
private static final long serialVersionUID = -8925816099640324876L;
public void execute() {
AllZone.GameAction.sacrifice(spell.getTargetCard());
}
};
*/
Input runtime = new Input()
{
private static final long serialVersionUID = -4653972223582155502L;
public void showMessage()
{
CardList choice = new CardList();
choice.addAll(AllZone.Human_Play.getCards());
choice = choice.getType("Artifact");
stopSetNext(CardFactoryUtil.input_targetSpecific(spell, choice, "Select artifact to sacrifice.", false));
}
};
spell.setBeforePayMana(runtime);
card.clearSpellAbility();
card.addSpellAbility(spell);
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if (cardName.equals("Thopter Foundry"))
{
final String player = card.getController();
final SpellAbility ability = new Ability(card, "1")
{
public void chooseTargetAI()
{
Card c;
PlayerZone play = AllZone.getZone(Constant.Zone.Play, player);
CardList meek = new CardList();
meek.addAll(play.getCards());
meek = meek.getName("Sword of the Meek");
if (meek.size() >= 1)
c = meek.get(0);
else
c = getArtifact();
setTargetCard(c);
}
public Card getArtifact()
{
//target creature that is going to attack
PlayerZone play = AllZone.getZone(Constant.Zone.Play, player);
CardList arts = new CardList();
arts.addAll(play.getCards());
arts = arts.filter(new CardListFilter()
{
public boolean addCard(Card c)
{
return c.isArtifact() && !c.isToken() && (CardUtil.getConvertedManaCost(c.getManaCost()) <= 1 || c.getName().equals("Sword of the Meek"));
}
});
if (arts.size() > 0) {
arts.shuffle();
return arts.get(0);
}
else
return null;
}//getAttacker()
public boolean canPlayAI()
{
String phase = AllZone.Phase.getPhase();
return phase.equals(Constant.Phase.Main2);
}
public void resolve()
{
Card c = getTargetCard();
if (AllZone.GameAction.isCardInPlay(c)){
AllZone.GameAction.sacrifice(c);
makeToken();
PlayerLife life = AllZone.GameAction.getPlayerLife(card.getController());
life.addLife(1);
}
}//resolve
public void makeToken()
{
Card c = new Card();
c.setName("Thopter");
c.setImageName("U 1 1 Thopter");
c.setOwner(card.getController());
c.setController(card.getController());
c.setManaCost("U");
c.setToken(true);
c.addType("Creature");
c.addType("Thopter");
c.setBaseAttack(1);
c.setBaseDefense(1);
c.addIntrinsicKeyword("Flying");
PlayerZone play = AllZone.getZone(Constant.Zone.Play, card.getController());
play.add(c);
}
};
Input runtime = new Input()
{
private static final long serialVersionUID = 3557158378851031238L;
public void showMessage()
{
PlayerZone play = AllZone.getZone(Constant.Zone.Play, player);
CardList arts = new CardList();
arts.addAll(play.getCards());
arts = arts.filter(new CardListFilter()
{
public boolean addCard(Card c)
{
return c.isArtifact() && !c.isToken();
}
});
stopSetNext(CardFactoryUtil.input_targetSpecific(ability, arts, "Select a non-token Artifact to sacrifice", false));
}//showMessage()
};//Input
card.addSpellAbility(ability);
ability.setDescription("1, Sacrifice a nontoken artifact: Put a 1/1 blue Thopter artifact creature token with flying onto the battlefield. You gain 1 life.");
ability.setStackDescription(card.getName() + " - Put a 1/1 blue Thopter artifact creature token with flying onto the battlefield. You gain 1 life.");
ability.setBeforePayMana(runtime);
}//*************** END ************ END **************************
// Cards with Cycling abilities // Cards with Cycling abilities
// -1 means keyword "Cycling" not found // -1 means keyword "Cycling" not found

View File

@@ -16154,8 +16154,6 @@ public class CardFactory_Creatures {
AllZone.GameAction.shuffle(card.getController()); AllZone.GameAction.shuffle(card.getController());
lib.remove(c); lib.remove(c);
lib.add(c, 0); lib.add(c, 0);
} }
}//resolve() }//resolve()
}; };
@@ -16304,7 +16302,7 @@ public class CardFactory_Creatures {
} }
else //comp else //comp
{ {
if (AllZone.Phase.getTurn() > 12 && nonLandList.size() > 0) if (AllZone.Phase.getTurn() >= 12 && nonLandList.size() > 0)
{ {
Card c = CardFactoryUtil.AI_getMostExpensivePermanent(nonLandList, card, false); Card c = CardFactoryUtil.AI_getMostExpensivePermanent(nonLandList, card, false);
hand.remove(c); hand.remove(c);

View File

@@ -1883,6 +1883,126 @@ class CardFactory_Equipment {
} //*************** END ************ END ************************** } //*************** END ************ END **************************
//*************** START *********** START **************************
else if (cardName.equals("Sword of the Meek"))
{
final Ability equip = new Ability(card, "2")
{
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());
}
}
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") );
}
public boolean canPlayAI()
{
return getCreature().size() != 0 && !card.isEquipping();
}
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
return list;
}//getCreature()
};//equip ability
Command onEquip = new Command()
{
private static final long serialVersionUID = -1783065127683640831L;
public void execute()
{
if (card.isEquipping())
{
Card crd = card.getEquipping().get(0);
crd.addSemiPermanentAttackBoost(1);
crd.addSemiPermanentDefenseBoost(2);
}
}//execute()
};//Command
Command onUnEquip = new Command()
{
private static final long serialVersionUID = -754739553859502626L;
public void execute()
{
if (card.isEquipping())
{
Card crd = card.getEquipping().get(0);
crd.addSemiPermanentAttackBoost(-1);
crd.addSemiPermanentDefenseBoost(-2);
}
}//execute()
};//Command
Input runtime = new Input()
{
private static final long serialVersionUID = 6238211194632758032L;
public void showMessage()
{
//get all creatures you control
CardList list = new CardList();
list.addAll(AllZone.Human_Play.getCards());
list = list.getType("Creature");
stopSetNext(CardFactoryUtil.input_targetSpecific(equip, list, "Select target creature to equip", true));
}
};//Input
equip.setBeforePayMana(runtime);
equip.setDescription("Equip: 2");
card.addSpellAbility(equip);
card.addEquipCommand(onEquip);
card.addUnEquipCommand(onUnEquip);
} //*************** END ************ END **************************
return card; return card;

View File

@@ -108,6 +108,58 @@ public class PlayerZone_ComesIntoPlay extends DefaultPlayerZone
} }
} }
PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, c.getController());
PlayerZone play = AllZone.getZone(Constant.Zone.Play, c.getController());
CardList meek = new CardList(grave.getCards());
if (meek.size() > 0 && c.isCreature() && c.getNetAttack() == 1 && c.getNetDefense() == 1)
{
for (int i=0;i<meek.size();i++)
{
final Card crd = meek.get(i);
final Card creat = c;
final PlayerZone graveZone = grave;
final PlayerZone playZone = play;
Ability ability = new Ability(meek.get(i), "0")
{
public void resolve() {
if (crd.getController().equals(Constant.Player.Human))
{
String[] choices = { "Yes", "No" };
Object q = null;
q = AllZone.Display.getChoiceOptional("Attach " +crd + " to " +creat + "?", choices);
if (q == null || q.equals("No"))
;
else if (AllZone.GameAction.isCardInZone(crd, graveZone) && AllZone.GameAction.isCardInPlay(creat) && creat.isCreature() &&
creat.getNetAttack() == 1 && creat.getNetDefense() == 1){
graveZone.remove(crd);
playZone.add(crd);
crd.equipCard(creat);
}
}
else //computer
{
if (AllZone.GameAction.isCardInZone(crd, graveZone) && AllZone.GameAction.isCardInPlay(creat) && creat.isCreature() &&
creat.getNetAttack() == 1 && creat.getNetDefense() == 1) {
graveZone.remove(crd);
playZone.add(crd);
crd.equipCard(creat);
}
}
}
};
ability.setStackDescription("Sword of the Meek - Whenever a 1/1 creature enters the battlefield under your control, you may return Sword of the Meek from your graveyard to the battlefield, then attach it to that creature.");
AllZone.Stack.add(ability);
}
}
/* /*
for (String effect : AllZone.StateBasedEffects.getStateBasedMap().keySet() ) { for (String effect : AllZone.StateBasedEffects.getStateBasedMap().keySet() ) {