- Added Regenerate: B to Mortivore.

- Fixed a bug with Cascade and abilities triggering on casting spells.
This commit is contained in:
jendave
2011-08-06 03:36:36 +00:00
parent aa7ff49cd2
commit 270034b255
2 changed files with 58 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ package forge;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Random;
import javax.swing.JOptionPane;
@@ -14285,6 +14286,60 @@ public class CardFactory_Creatures {
};
card.clearSpellAbility();
card.addSpellAbility(spell);
final Command untilEOT = new Command() {
private static final long serialVersionUID = 8163158247122311120L;
public void execute() {
card.setShield(0);
}
};
final SpellAbility a1 = new Ability(card, "B") {
@Override
public boolean canPlayAI() {
if(CardFactoryUtil.AI_isMainPhase()) {
if(CardFactoryUtil.AI_doesCreatureAttack(card)) {
int weight[] = new int[3];
if(card.getKeyword().size() > 0) weight[0] = 75;
else weight[0] = 0;
CardList HandList = new CardList(AllZone.getZone(Constant.Zone.Hand,
Constant.Player.Computer).getCards());
if(HandList.size() >= 4) weight[1] = 25;
else weight[1] = 75;
int hCMC = 0;
for(int i = 0; i < HandList.size(); i++)
if(CardUtil.getConvertedManaCost(HandList.getCard(i).getManaCost()) > hCMC) hCMC = CardUtil.getConvertedManaCost(HandList.getCard(
i).getManaCost());
CardList LandList = new CardList(AllZone.getZone(Constant.Zone.Play,
Constant.Player.Computer).getCards());
LandList = LandList.getType("Land");
if(hCMC + 2 >= LandList.size()) weight[2] = 50;
else weight[2] = 0;
int aw = (weight[0] + weight[1] + weight[2]) / 3;
Random r = new Random();
if(r.nextInt(100) <= aw) return true;
}
}
return false;
}
@Override
public void resolve() {
card.addShield();
AllZone.EndOfTurn.addUntil(untilEOT);
}
}; //SpellAbility
a1.setDescription("Regenerate: B");
card.addSpellAbility(a1);
}
//*************** END ************ END **************************

View File

@@ -104,6 +104,8 @@ public class GameActionUtil {
// (called in MagicStack.java)
Card c = sa.getSourceCard();
playCard_Cascade(c);
playCard_Dovescape(c); //keep this one top
playCard_Demigod_of_Revenge(c);
playCard_Halcyon_Glaze(c);
@@ -144,7 +146,7 @@ public class GameActionUtil {
playCard_Mold_Adder(c);
playCard_Fable_of_Wolf_and_Owl(c);
playCard_Cascade(c);
}