mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
- C14: Added Assault Suit
This commit is contained in:
@@ -53,6 +53,7 @@ public class BalanceEffect extends SpellAbilityEffect {
|
||||
p.discard(card, sa);
|
||||
}
|
||||
} else { // Battlefield
|
||||
// TODO: "can'e be sacrificed"
|
||||
for(Card card : p.getController().choosePermanentsToSacrifice(sa, numToBalance, numToBalance, validCards.get(i), valid)) {
|
||||
if ( null == card ) continue;
|
||||
game.getAction().sacrifice(card, sa);
|
||||
|
||||
@@ -151,7 +151,7 @@ public class ManaEffect extends SpellAbilityEffect {
|
||||
// Only clear express choice after mana has been produced
|
||||
abMana.clearExpressChoice();
|
||||
|
||||
// convert these to SubAbilities when appropriate
|
||||
// TODO: convert these to SubAbilities when appropriate
|
||||
if (sa.hasParam("Stuck")) {
|
||||
sa.setUndoable(false);
|
||||
card.addHiddenExtrinsicKeyword("This card doesn't untap during your next untap step.");
|
||||
|
||||
@@ -6,6 +6,7 @@ import forge.game.ability.SpellAbilityEffect;
|
||||
import forge.game.card.Card;
|
||||
import forge.game.card.CardCollectionView;
|
||||
import forge.game.card.CardLists;
|
||||
import forge.game.card.CardPredicates;
|
||||
import forge.game.card.CardUtil;
|
||||
import forge.game.player.Player;
|
||||
import forge.game.spellability.SpellAbility;
|
||||
@@ -54,6 +55,7 @@ public class SacrificeAllEffect extends SpellAbilityEffect {
|
||||
if (sa.hasParam("Controller")) {
|
||||
list = CardLists.filterControlledBy(list, AbilityUtils.getDefinedPlayers(sa.getHostCard(), sa.getParam("Controller"), sa));
|
||||
}
|
||||
list = CardLists.filter(list, CardPredicates.canBeSacrificedBy(sa));
|
||||
|
||||
final boolean remSacrificed = sa.hasParam("RememberSacrificed");
|
||||
if (remSacrificed) {
|
||||
|
||||
@@ -5850,6 +5850,10 @@ public class Card extends GameEntity implements Comparable<Card>, IIdentifiable
|
||||
return isInPlay() && (!hasKeyword("Indestructible") || (isCreature() && getNetToughness() <= 0));
|
||||
}
|
||||
|
||||
public final boolean canBeSacrificed() {
|
||||
return isInPlay() && !this.isPhasedOut() && !hasKeyword("CARDNAME can't be sacrificed.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean canBeTargetedBy(final SpellAbility sa) {
|
||||
if (sa == null) {
|
||||
@@ -6170,7 +6174,7 @@ public class Card extends GameEntity implements Comparable<Card>, IIdentifiable
|
||||
System.out.println("Trying to sacrifice immutables: " + this);
|
||||
return false;
|
||||
}
|
||||
if (isPhasedOut()) {
|
||||
if (!canBeSacrificed()) {
|
||||
return false;
|
||||
}
|
||||
if (source != null && getController().isOpponentOf(source.getActivatingPlayer())
|
||||
|
||||
@@ -20,6 +20,7 @@ package forge.game.cost;
|
||||
import forge.game.card.Card;
|
||||
import forge.game.card.CardCollectionView;
|
||||
import forge.game.card.CardLists;
|
||||
import forge.game.card.CardPredicates;
|
||||
import forge.game.player.Player;
|
||||
import forge.game.spellability.SpellAbility;
|
||||
import forge.game.zone.ZoneType;
|
||||
@@ -92,6 +93,7 @@ public class CostSacrifice extends CostPartWithList {
|
||||
if (activator.hasKeyword("You can't sacrifice creatures to cast spells or activate abilities.")) {
|
||||
typeList = CardLists.getNotType(typeList, "Creature");
|
||||
}
|
||||
typeList = CardLists.filter(typeList, CardPredicates.canBeSacrificedBy(ability));
|
||||
|
||||
if (!needsAnnoucement && (amount != null) && (typeList.size() < amount)) {
|
||||
return false;
|
||||
@@ -102,7 +104,7 @@ public class CostSacrifice extends CostPartWithList {
|
||||
// choice, it can be Paid even if it's 0
|
||||
}
|
||||
else {
|
||||
if (!source.isInPlay()) {
|
||||
if (!source.canBeSacrificed()) {
|
||||
return false;
|
||||
}
|
||||
else if (source.isCreature() && activator.hasKeyword("You can't sacrifice creatures to cast spells or activate abilities.")) {
|
||||
|
||||
@@ -174,7 +174,7 @@ public class ManaCostAdjustment {
|
||||
|
||||
Card toSac = null;
|
||||
CardCollectionView canOffer = CardLists.filter(sa.getActivatingPlayer().getCardsIn(ZoneType.Battlefield),
|
||||
CardPredicates.isType(offeringType));
|
||||
CardPredicates.isType(offeringType), CardPredicates.canBeSacrificedBy(sa));
|
||||
|
||||
final CardCollectionView toSacList = sa.getHostCard().getController().getController().choosePermanentsToSacrifice(sa, 0, 1, canOffer, offeringType);
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ public class Upkeep extends Phase {
|
||||
runParams.put("PayingMana", StringUtils.join(this.getPayingMana(), ""));
|
||||
game.getTriggerHandler().runTrigger(TriggerType.PayCumulativeUpkeep, runParams, false);
|
||||
if (!isPaid) {
|
||||
game.getAction().sacrifice(c, null);
|
||||
game.getAction().sacrifice(c, this);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user