mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
fixed Diamond Valley to not check canTarget() since it's a sacrifice. The stack still says targeting...
This can probably be converted to abGainLife keyword.
This commit is contained in:
@@ -3278,34 +3278,31 @@ class CardFactory_Lands {
|
|||||||
|
|
||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
else if(cardName.equals("Diamond Valley")) {
|
else if(cardName.equals("Diamond Valley")) {
|
||||||
|
/*
|
||||||
|
* Tap, Sacrifice a creature: You gain life equal to the
|
||||||
|
* sacrificed creature's toughness.
|
||||||
|
*/
|
||||||
final Ability_Tap ability = new Ability_Tap(card, "0") {
|
final Ability_Tap ability = new Ability_Tap(card, "0") {
|
||||||
|
|
||||||
private static final long serialVersionUID = -6589125674356046586L;
|
private static final long serialVersionUID = -6589125674356046586L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlayAI() {
|
public boolean canPlayAI() {
|
||||||
CardList list = new CardList(AllZone.Computer_Play.getCards());
|
CardList list = AllZoneUtil.getCreaturesInPlay(Constant.Player.Computer);
|
||||||
list = list.filter(new CardListFilter() {
|
if(AllZoneUtil.getCreaturesInPlay(Constant.Player.Computer).size() > 0
|
||||||
public boolean addCard(Card c) {
|
&& AllZone.Computer_Life.getLife() < 5 )
|
||||||
return c.isCreature();
|
setTargetCard(CardFactoryUtil.AI_getBestCreature(list, card));
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if(list.size() > 0 && AllZone.Computer_Life.getLife() < 5 ) setTargetCard(CardFactoryUtil.AI_getBestCreature(list, card));
|
|
||||||
|
|
||||||
return list.size() > 0;
|
return list.size() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
Card c = getTargetCard();
|
Card c = getTargetCard();
|
||||||
|
|
||||||
if(c != null) {
|
if(c != null && c.isCreature()) {
|
||||||
if(CardFactoryUtil.canTarget(card, c) && c.isCreature() ) {
|
AllZone.GameAction.gainLife(c.getController(), c.getNetDefense());
|
||||||
AllZone.GameAction.gainLife(c.getController(), c.getNetDefense());
|
AllZone.GameAction.sacrifice(c);
|
||||||
AllZone.GameAction.sacrifice(c);
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -3315,17 +3312,8 @@ class CardFactory_Lands {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void showMessage() {
|
public void showMessage() {
|
||||||
CardList choice = new CardList();
|
final String player = card.getController();
|
||||||
final String player = card.getController();
|
CardList choice = AllZoneUtil.getCreaturesInPlay(player);
|
||||||
PlayerZone play = AllZone.getZone(Constant.Zone.Play, player);
|
|
||||||
choice.addAll(play.getCards());
|
|
||||||
|
|
||||||
choice = choice.getType("Creature");
|
|
||||||
choice = choice.filter(new CardListFilter() {
|
|
||||||
public boolean addCard(Card c) {
|
|
||||||
return (c.isCreature());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
stopSetNext(CardFactoryUtil.input_targetSpecific(ability, choice,
|
stopSetNext(CardFactoryUtil.input_targetSpecific(ability, choice,
|
||||||
"Select target creature:", true, false));
|
"Select target creature:", true, false));
|
||||||
@@ -3334,7 +3322,6 @@ class CardFactory_Lands {
|
|||||||
|
|
||||||
card.addSpellAbility(ability);
|
card.addSpellAbility(ability);
|
||||||
ability.setBeforePayMana(runtime);
|
ability.setBeforePayMana(runtime);
|
||||||
|
|
||||||
}//*************** END ************ END **************************
|
}//*************** END ************ END **************************
|
||||||
|
|
||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
|
|||||||
Reference in New Issue
Block a user