mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
Check if card for PlayEffect is worth it
This commit is contained in:
@@ -55,7 +55,7 @@ public abstract class SpellAbilityEffect {
|
||||
public abstract void resolve(SpellAbility sa);
|
||||
|
||||
protected String getStackDescription(final SpellAbility sa) {
|
||||
// Unless overriden, let the spell description also be the stack description
|
||||
// Unless overridden, let the spell description also be the stack description
|
||||
return sa.getDescription();
|
||||
}
|
||||
|
||||
@@ -218,7 +218,6 @@ public abstract class SpellAbilityEffect {
|
||||
: AbilityUtils.getDefinedSpellAbilities(sa.getHostCard(), sa.getParam(definedParam), sa);
|
||||
}
|
||||
|
||||
|
||||
// Targets of card or player type
|
||||
protected final static List<GameEntity> getTargetEntities(final SpellAbility sa) { return getEntities(false, "Defined", sa); }
|
||||
protected final static List<GameEntity> getTargetEntities(final SpellAbility sa, final String definedParam) { return getEntities(false, definedParam, sa); }
|
||||
|
||||
@@ -40,6 +40,10 @@ import forge.util.Lang;
|
||||
import forge.util.Localizer;
|
||||
|
||||
public class PlayEffect extends SpellAbilityEffect {
|
||||
private Card tgtCard;
|
||||
|
||||
public Card getTgtCard() { return tgtCard; }
|
||||
|
||||
@Override
|
||||
protected String getStackDescription(final SpellAbility sa) {
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
@@ -181,7 +185,7 @@ public class PlayEffect extends SpellAbilityEffect {
|
||||
final CardCollection saidNoTo = new CardCollection();
|
||||
while (tgtCards.size() > saidNoTo.size() && saidNoTo.size() < amount && amount > 0) {
|
||||
activator.getController().tempShowCards(showCards);
|
||||
Card tgtCard = controller.getController().chooseSingleEntityForEffect(tgtCards, sa, Localizer.getInstance().getMessage("lblSelectCardToPlay"), null);
|
||||
tgtCard = controller.getController().chooseSingleEntityForEffect(tgtCards, sa, Localizer.getInstance().getMessage("lblSelectCardToPlay"), null);
|
||||
activator.getController().endTempShowCards();
|
||||
if (tgtCard == null) {
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user