- I have updated the spLoseLifeGainLife keyword. The keyword will now look for an additional 2 fields as the keyword is parsed. The third and fourth fields contain the spell description and the stack description.

- I had to create a test to see if the card is "Absorb Vis" and if it is the spLoseLifeGainLife code will add the basic landcycling. This was the only way I could get it to work. I tried
This commit is contained in:
jendave
2011-08-06 03:02:41 +00:00
parent db0c8d1ee6
commit a4b502a6e0
3 changed files with 42 additions and 18 deletions

View File

@@ -1842,27 +1842,33 @@ public class CardFactory implements NewConstants {
card.addSpellAbility(spDraw);
}//spDrawCards
//Spell gain life lose life cards (like Soul Feast)
//Spell gain life lose life cards (like Soul Feast)
if (hasKeyword(card, "spLoseLifeGainLife") != -1)
{
int n = hasKeyword(card, "spLoseLifeGainLife");
if (n != -1)
{
String parse = card.getKeyword().get(n).toString();
String parse = card.getKeyword().get(n).toString();
card.removeIntrinsicKeyword(parse);
card.clearSpellAbility();
String k[] = parse.split(":");
final String lfdmg = k[1];
final String spDesc[] = {"none"};
final String stDesc[] = {"none"};
if (k.length > 2)
spDesc[0] = k[2];
if (k.length > 3)
stDesc[0] = k[3];
final SpellAbility spell = new Spell(card)
{
private static final long serialVersionUID = -8277174319360648715L;
private static final long serialVersionUID = -8361697584661592092L;
public void resolve()
public void resolve()
{
final int n = Integer.parseInt(lfdmg);
final int n = Integer.parseInt(lfdmg);
AllZone.GameAction.getPlayerLife(getTargetPlayer()).subtractLife(n);
PlayerLife life = AllZone.GameAction.getPlayerLife(card.getController());
@@ -1873,8 +1879,26 @@ public class CardFactory implements NewConstants {
spell.setChooseTargetAI(CardFactoryUtil.AI_targetHuman());
spell.setBeforePayMana(CardFactoryUtil.input_targetPlayer(spell));
if (spDesc[0].equals("none")) // create the card description
{
spDesc[0] = ("Target player loses " + lfdmg + " life and you gain " + lfdmg + " life.");
}
if (stDesc[0].equals("none")) // create the card stack description
{
stDesc[0] = (card.getName() + " - target loses life and you gain life.");
}
spell.setDescription(spDesc[0]);
spell.setStackDescription(stDesc[0]);
card.clearSpellAbility();
card.addSpellAbility(spell);
if (cardName.equals("Absorb Vis"))
{
card.addSpellAbility(CardFactoryUtil.ability_typecycle(card, "1 B","Basic"));
}
return card;
}