mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
- Convert Feral Hydra to AF
- Improve AI for PutCounter and AnyPlayer abilities
This commit is contained in:
@@ -3,6 +3,7 @@ ManaCost:X G
|
||||
Types:Creature Hydra
|
||||
Text:no text
|
||||
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:Picture:http://www.wizards.com/global/images/magic/general/feral_hydra.jpg
|
||||
SetInfo:ALA|Rare|http://magiccards.info/scans/en/ala/131.jpg
|
||||
|
||||
@@ -152,6 +152,12 @@ public class AbilityFactory_Counters {
|
||||
if (list.size() == 0)
|
||||
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){
|
||||
// AI currently disabled for these costs
|
||||
@@ -244,8 +250,9 @@ public class AbilityFactory_Counters {
|
||||
else{
|
||||
// Placeholder: No targeting necessary
|
||||
int currCounters = sa.getSourceCard().getCounters(Counters.valueOf(type));
|
||||
// each counter on the card is a 10% chance of not activating this ability.
|
||||
if (r.nextFloat() < .1 * currCounters)
|
||||
// each non +1/+1 counter on the card is a 10% chance of not activating this ability.
|
||||
|
||||
if (!type.equals("P1P1") && r.nextFloat() < .1 * currCounters)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -9024,52 +9024,11 @@ public class CardFactory_Creatures {
|
||||
ability.setDescription(abCost+"Target creature doesn't untap during its controller's next untap step.");
|
||||
}//*************** 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 **************************
|
||||
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")) {
|
||||
|
||||
if(!card.getName().equals("Krakilin")) {
|
||||
SpellAbility spell = new Spell_Permanent(card) {
|
||||
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());
|
||||
}
|
||||
};
|
||||
card.clearSpellAbility();
|
||||
card.addSpellAbility(spell);
|
||||
}
|
||||
|
||||
card.clearFirstSpellAbility();
|
||||
card.addFirstSpellAbility(spell);
|
||||
|
||||
final SpellAbility ability = new Ability(card, "0") {
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user