Card Requests
by mtgrares
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Re: Card Requests
by slapshot5 » 12 Mar 2010, 00:05
Disclaimer: Untested with current source
Here is my old code for Ley Druid if someone wants to have a look and check in:
Here is my old code for Ley Druid if someone wants to have a look and check in:
- Code: Select all
//****************************START*****************
if(cardName.equals("Ley Druid")) {
final Ability_Tap ability = new Ability_Tap(card) {
public boolean canPlayAI() {
return false;
}
public void resolve() {
if(AllZone.GameAction.isCardInPlay(getTargetCard())) {
getTargetCard().untap(); //untapping land
}
}
};//Ability_Tap
Input target = new Input() {
public void showMessage() {
AllZone.Display.showMessage("Select target tapped land to untap");
ButtonUtil.enableOnlyCancel();
}
public void selectButtonCancel() {stop();}
public void selectCard(Card c, PlayerZone zone) {
if(c.isLand() && zone.is(Constant.Zone.Play) && c.isTapped()) {
card.tap(); //tapping Ley Druid
ability.setTargetCard(c);
AllZone.Stack.add(ability);
stop();
}
}//selectCard()
};//Input
card.addSpellAbility(ability);
ability.setDescription("tap: Untap target land.");
ability.setBeforePayMana(target);
}//end Ley Druid
//**************END****************END***********************
- slapshot5
- Programmer
- Posts: 1391
- Joined: 03 Jan 2010, 17:47
- Location: Mac OS X
- Has thanked: 25 times
- Been thanked: 68 times
Re: Card Requests
by slapshot5 » 12 Mar 2010, 00:09
Disclaimer: Untested with current source
Old code for Clone (based off May 2008 source unfortunately...)
Old code for Clone (based off May 2008 source unfortunately...)
- Code: Select all
//**************************START**********************
if(cardName.equals("Clone")) {
final SpellAbility spell = new Spell(card) {
public boolean canPlayAI() {
return false;
}
public void chooseTargetAI() {
//setTargetCard(c);
}//chooseTargetAI()
public void resolve() {
if(AllZone.GameAction.isCardInPlay(getTargetCard())) {
Card clone = new Card();
Card source = getTargetCard();
clone.setOwner(card.getController());
clone.setController(card.getController());
clone.setName( source.getName() );
clone.setManaCost( source.getManaCost() );
clone.setType( source.getType() );
clone.setAttack( source.getAttack() );
clone.setDefense( source.getDefense() );
clone.setKeyword( source.getKeyword() );
clone.setText( source.getSpellText() );
PlayerZone play = AllZone.getZone(Constant.Zone.Play, clone.getController());
play.add(clone);
}
}
};//SpellAbility
spell.setBeforePayMana(CardFactoryUtil.input_targetType(spell, "Creature"));
card.clearSpellAbility();
card.addSpellAbility(spell);
}//end Clone
//**************END****************END***********************
- slapshot5
- Programmer
- Posts: 1391
- Joined: 03 Jan 2010, 17:47
- Location: Mac OS X
- Has thanked: 25 times
- Been thanked: 68 times
Re: Card Requests
by slapshot5 » 12 Mar 2010, 00:17
Ivory Tower is on the Request List. I also implemented that against the May 2008 source:
In GameActionUtil.java:
-Dennis
In GameActionUtil.java:
- Code: Select all
public static void upkeep_Ivory_Tower() {
final String player = AllZone.Phase.getActivePlayer();
PlayerZone playZone = AllZone.getZone(Constant.Zone.Play,player);
CardList list = new CardList(playZone.getCards());
list = list.getName("Ivory Tower");
Ability ability;
for(int i = 0; i < list.size(); i++) {
ability = new Ability(list.get(i), "0") {
public void resolve() {
PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, player);
int numCards = hand.getCards().length;
if( numCards > 4 ) {
AllZone.GameAction.getPlayerLife(player).addLife(numCards-4);
}
}
};//Ability
ability.setStackDescription("Ivory Tower - " +player+ " gains 1 life for each card > 4");
AllZone.Stack.add(ability);
}//for
}//upkeep_Ivory_Tower()
- Code: Select all
upkeep_Ivory_Tower();
- Code: Select all
public static void executeUpkeepEffects()
-Dennis
- slapshot5
- Programmer
- Posts: 1391
- Joined: 03 Jan 2010, 17:47
- Location: Mac OS X
- Has thanked: 25 times
- Been thanked: 68 times
Re: Card Requests
by DennisBergkamp » 12 Mar 2010, 00:25
Slapshot,
Thanks for posting these! I'll see if I can merge them.
By the way, is your name Dennis too? Even though that's not my real name, it's still a cool name
Thanks for posting these! I'll see if I can merge them.
By the way, is your name Dennis too? Even though that's not my real name, it's still a cool name

-
DennisBergkamp - AI Programmer
- Posts: 2602
- Joined: 09 Sep 2008, 15:46
- Has thanked: 0 time
- Been thanked: 0 time
Re: Card Requests
by slapshot5 » 12 Mar 2010, 01:07
Request: Ali from Cairo
I've been using this card for a long time against the May 2008 source.
My implementation:
In checkStateEffects() in GameAction.java:
That should be all that is necessary.
-Dennis
I've been using this card for a long time against the May 2008 source.
My implementation:
In checkStateEffects() in GameAction.java:
- Code: Select all
if(AllZone.Computer_Life.getLife() <= 0) {
if(isAliFromCairoInPlay(AllZone.Computer_Play)) {
AllZone.Computer_Life.setLife(1);
}
else {
Constant.Runtime.WinLose.addWin();
stop = true;
}
}
if(AllZone.Human_Life.getLife() <= 0) {
if(isAliFromCairoInPlay(AllZone.Human_Play)) {
AllZone.Human_Life.setLife(1);
}
else {
Constant.Runtime.WinLose.addLose();
stop = true;
}
}
- Code: Select all
private boolean isAliFromCairoInPlay(PlayerZone zone) {
if( zone == null ) {
return false;
}
else {
CardList all = new CardList();
all.addAll(zone.getCards());
return all.containsName("Ali from Cairo");
}
}
That should be all that is necessary.
-Dennis
- slapshot5
- Programmer
- Posts: 1391
- Joined: 03 Jan 2010, 17:47
- Location: Mac OS X
- Has thanked: 25 times
- Been thanked: 68 times
Re: Card Requests
by slapshot5 » 12 Mar 2010, 03:57
Here is some old code I had for Reprisal (based off May 2008 source again...)
- Code: Select all
//*************** START *********** START **************************
if(cardName.equals("Reprisal")) {
final SpellAbility spell = new Spell(card) {
public void resolve() {
if(AllZone.GameAction.isCardInPlay(getTargetCard())) {
AllZone.GameAction.destroy(getTargetCard());
}
}//resolve
};//SpellAbility
card.clearSpellAbility();
card.addSpellAbility(spell);
Input target = new Input() {
public void showMessage() {
AllZone.Display.showMessage("Select target Creature to destroy");
ButtonUtil.enableOnlyCancel();
}
public void selectButtonCancel() {
stop();
}
public void selectCard(Card c, PlayerZone zone) {
if(zone.is(Constant.Zone.Play) && c.isCreature() && (c.getAttack() > 3)) {
spell.setTargetCard(c);
stopSetNext(new Input_PayManaCost(spell));
}
}
};//input
spell.setBeforePayMana(target);
}//*************** END ************ END **************************
- slapshot5
- Programmer
- Posts: 1391
- Joined: 03 Jan 2010, 17:47
- Location: Mac OS X
- Has thanked: 25 times
- Been thanked: 68 times
Re: Card Requests
by slapshot5 » 12 Mar 2010, 04:32
Requesting:
Argothian Pixies
Chain Lightning
Chaos Orb - (could be fun to implement)
Mind Twist
EDIT - Also:
Twiddle
Argothian Pixies
Chain Lightning
Chaos Orb - (could be fun to implement)
Mind Twist
EDIT - Also:
Twiddle
- slapshot5
- Programmer
- Posts: 1391
- Joined: 03 Jan 2010, 17:47
- Location: Mac OS X
- Has thanked: 25 times
- Been thanked: 68 times
Re: Card Requests
by ajcgr » 12 Mar 2010, 15:31
Hi, and the allies? Halimar Excavator and others... thanks. 

Re: Card Requests
by slapshot5 » 12 Mar 2010, 16:47
- slapshot5
- Programmer
- Posts: 1391
- Joined: 03 Jan 2010, 17:47
- Location: Mac OS X
- Has thanked: 25 times
- Been thanked: 68 times
Re: Card Requests
by lm01 » 12 Mar 2010, 17:52
@slapshot5
@cgraham54
Thanks to point that, guess I was too sleepy when I added them
Upgrading requests
Btw, you do realize Chaos Orb is banned
@cgraham54
Thanks to point that, guess I was too sleepy when I added them

Upgrading requests
Btw, you do realize Chaos Orb is banned

---
If you want to request cards refer to: Card Requests
If you want to see cards already requested refer to: Card List
If you want to request cards refer to: Card Requests
If you want to see cards already requested refer to: Card List
Re: Card Requests
by slapshot5 » 12 Mar 2010, 19:00
Yeah, but I'm a little old school I guess. I started playing in late 1994. At that time, it was in the world champion's sideboard and the runner up's deck.
- slapshot5
- Programmer
- Posts: 1391
- Joined: 03 Jan 2010, 17:47
- Location: Mac OS X
- Has thanked: 25 times
- Been thanked: 68 times
Re: Card Requests
by slapshot5 » 12 Mar 2010, 19:04
FWIW, Here's some old code I was using for Icy Manipulator:
-Dennis
- Code: Select all
//*****************************START*******************************
if(cardName.equals("Icy Manipulator")) {
/* The Rules state that this can target a tapped card, but it won't do anything */
final Ability_Tap ability = new Ability_Tap(card, "1") {
public boolean canPlayAI() {
return false;
}
public void chooseTargetAI() {
//setTargetCard(c);
}//chooseTargetAI()
public void resolve() {
if(AllZone.GameAction.isCardInPlay(getTargetCard())) {
getTargetCard().tap();
}
}
};//SpellAbility
card.addSpellAbility(ability);
ability.setDescription("1, tap: Tap target artifact, creature or land.");
ability.setBeforePayMana(CardFactoryUtil.input_targetType(ability, "Artifact;Creature;Land"));
}//end Icy Manipulator
//****************END*******END***********************
- Code: Select all
//****************copied from input_targetType*****************
//cardType is like "Creature", "Land", "Artifact", "Goblin", "Legendary", ";"-delimited
//cardType can also be "All", which will allow any permanent to be selected
public static Input input_targetType(final SpellAbility spell, final String cardTypeList) {
Input target = new Input() {
public void showMessage() {
StringTokenizer st = new StringTokenizer(cardTypeList, ";");
if(cardTypeList.equals("All")) {
AllZone.Display.showMessage("Select target permanent");
}
else {
String toDisplay = "";
toDisplay += "Select target ";
while( st.hasMoreTokens() ) {
toDisplay += st.nextToken();
if( st.hasMoreTokens() ) {
toDisplay += " or ";
}
}
AllZone.Display.showMessage( toDisplay );
}
ButtonUtil.enableOnlyCancel();
}
public void selectButtonCancel() {stop();}
public void selectCard(Card card, PlayerZone zone) {
boolean foundCardType = false;
StringTokenizer st = new StringTokenizer(cardTypeList, ";");
if( cardTypeList.equals("All") ) {
foundCardType = true;
} else {
while( st.hasMoreTokens() ) {
if( card.getType().contains( st.nextToken() )) {
foundCardType = true;
}
}
}
if( foundCardType && zone.is(Constant.Zone.Play)) {
spell.setTargetCard(card);
stopSetNext(new Input_PayManaCost(spell));
}
}
};
return target;
}//input_targetType()
//***************end copy******************
-Dennis
- slapshot5
- Programmer
- Posts: 1391
- Joined: 03 Jan 2010, 17:47
- Location: Mac OS X
- Has thanked: 25 times
- Been thanked: 68 times
Re: Card Requests
by DennisBergkamp » 12 Mar 2010, 20:04
Slapshot,
So far I've only added Ley Druid from your code (I'll add the rest sometime today - I'll hold off on Clone though, I can see some problems happening if it were to leave play... but maybe they can be fixed somehow?).
Hmm, I'm pretty sure Order of Leitbur is already in Forge.
So far I've only added Ley Druid from your code (I'll add the rest sometime today - I'll hold off on Clone though, I can see some problems happening if it were to leave play... but maybe they can be fixed somehow?).
Hmm, I'm pretty sure Order of Leitbur is already in Forge.
-
DennisBergkamp - AI Programmer
- Posts: 2602
- Joined: 09 Sep 2008, 15:46
- Has thanked: 0 time
- Been thanked: 0 time
Re: Card Requests
by psillusionist » 13 Mar 2010, 01:55
Given that X spells and effects are coming soon (according to that other thread), I'd like to request for:
Death Cloud
Decree of Justice
Demonfire
Channel
Fireball
Death Cloud
Decree of Justice
Demonfire
Channel
Fireball
- psillusionist
- Posts: 70
- Joined: 20 Jan 2010, 00:15
- Has thanked: 0 time
- Been thanked: 0 time
Who is online
Users browsing this forum: No registered users and 54 guests