- Convert Feral Hydra to AF

- Improve AI for PutCounter and AnyPlayer abilities
This commit is contained in:
jendave
2011-08-06 14:18:37 +00:00
parent 5a277f4480
commit 94f9ae19c4
3 changed files with 13 additions and 48 deletions

View File

@@ -3,6 +3,7 @@ ManaCost:X G
Types:Creature Hydra Types:Creature Hydra
Text:no text Text:no text
PT:0/0 PT:0/0
A:AB$PutCounter | Cost$ 3 | CounterType$ P1P1 | CounterNum$ 1 | AnyPlayer$ True | SpellDescription$ Put a +1/+1 counter on Feral Hydra. Any player may activate this ability.
SVar:Rarity:Rare SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/feral_hydra.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/feral_hydra.jpg
SetInfo:ALA|Rare|http://magiccards.info/scans/en/ala/131.jpg SetInfo:ALA|Rare|http://magiccards.info/scans/en/ala/131.jpg

View File

@@ -152,6 +152,12 @@ public class AbilityFactory_Counters {
if (list.size() == 0) if (list.size() == 0)
return false; return false;
} }
else{ // "put counter on this"
PlayerZone pZone = AllZone.getZone(source);
// Don't activate Curse abilities on my cards and non-curse abilites on my opponents
if (!pZone.getPlayer().equals(player))
return false;
}
if (abCost != null){ if (abCost != null){
// AI currently disabled for these costs // AI currently disabled for these costs
@@ -244,8 +250,9 @@ public class AbilityFactory_Counters {
else{ else{
// Placeholder: No targeting necessary // Placeholder: No targeting necessary
int currCounters = sa.getSourceCard().getCounters(Counters.valueOf(type)); int currCounters = sa.getSourceCard().getCounters(Counters.valueOf(type));
// each counter on the card is a 10% chance of not activating this ability. // each non +1/+1 counter on the card is a 10% chance of not activating this ability.
if (r.nextFloat() < .1 * currCounters)
if (!type.equals("P1P1") && r.nextFloat() < .1 * currCounters)
return false; return false;
} }

View File

@@ -9024,52 +9024,11 @@ public class CardFactory_Creatures {
ability.setDescription(abCost+"Target creature doesn't untap during its controller's next untap step."); ability.setDescription(abCost+"Target creature doesn't untap during its controller's next untap step.");
}//*************** END ************ END ************************** }//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Feral Hydra")) {
SpellAbility spell = new Spell_Permanent(card) {
private static final long serialVersionUID = -11489323319L;
@Override
public boolean canPlayAI() {
return super.canPlay() && 4 <= ComputerUtil.getAvailableMana().size() - CardUtil.getConvertedManaCost(card.getManaCost());
}
};
card.clearSpellAbility();
card.addSpellAbility(spell);
final SpellAbility ability = new Ability(card, "3") {
@Override
public void resolve() {
card.addCounter(Counters.P1P1,1);
}//resolve()
};
ability.setDescription("3: put a +1/+1 counter on Feral Hydra. Any player may activate this ability.");
ability.setStackDescription("Feral Hydra gets a +1/+1 counter.");
ability.getRestrictions().setAnyPlayer(true);
card.addSpellAbility(ability);
Command intoPlay = new Command() {
private static final long serialVersionUID = 2559021590L;
public void execute() {
int XCounters = card.getXManaCostPaid();
card.addCounter(Counters.P1P1, XCounters);
}//execute()
};//Command
card.addComesIntoPlayCommand(intoPlay);
}//*************** END ************ END **************************
//*************** START *********** START ************************** //*************** START *********** START **************************
else if(cardName.equals("Shifting Wall") || cardName.equals("Maga, Traitor to Mortals") else if(cardName.equals("Shifting Wall") || cardName.equals("Maga, Traitor to Mortals") || cardName.equals("Feral Hydra")
|| cardName.equals("Krakilin") || cardName.equals("Ivy Elemental") || cardName.equals("Lightning Serpent")) { || cardName.equals("Krakilin") || cardName.equals("Ivy Elemental") || cardName.equals("Lightning Serpent")) {
if(!card.getName().equals("Krakilin")) {
SpellAbility spell = new Spell_Permanent(card) { SpellAbility spell = new Spell_Permanent(card) {
private static final long serialVersionUID = -11489323313L; private static final long serialVersionUID = -11489323313L;
@@ -9078,10 +9037,8 @@ public class CardFactory_Creatures {
return super.canPlay() && 4 <= ComputerUtil.getAvailableMana().size() - CardUtil.getConvertedManaCost(card.getManaCost()); return super.canPlay() && 4 <= ComputerUtil.getAvailableMana().size() - CardUtil.getConvertedManaCost(card.getManaCost());
} }
}; };
card.clearSpellAbility(); card.clearFirstSpellAbility();
card.addSpellAbility(spell); card.addFirstSpellAbility(spell);
}
final SpellAbility ability = new Ability(card, "0") { final SpellAbility ability = new Ability(card, "0") {
@Override @Override