mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
Cost: moved "You can't sacrifice creatures to cast spells or activate abilities." into Card.canBeSacrificedBy.
also add Property for that.
This commit is contained in:
@@ -3991,6 +3991,10 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
if (!getExiledWith().equals(host)) {
|
||||
return false;
|
||||
}
|
||||
} else if (property.equals("CanBeSacrificedBy")) {
|
||||
if (!canBeSacrificedBy(spellAbility)) {
|
||||
return false;
|
||||
}
|
||||
} else if (property.startsWith("AttachedBy")) {
|
||||
if (!isEquippedBy(source) && !isEnchantedBy(source) && !isFortifiedBy(source)) {
|
||||
return false;
|
||||
@@ -6641,8 +6645,21 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
if (!canBeSacrificed()) {
|
||||
return false;
|
||||
}
|
||||
return !(source != null && getController().isOpponentOf(source.getActivatingPlayer())
|
||||
&& getController().hasKeyword("Spells and abilities your opponents control can't cause you to sacrifice permanents."));
|
||||
|
||||
if (source == null){
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isCreature() && source.getActivatingPlayer().hasKeyword("You can't sacrifice creatures to cast spells or activate abilities.")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getController().isOpponentOf(source.getActivatingPlayer())
|
||||
&& getController().hasKeyword("Spells and abilities your opponents control can't cause you to sacrifice permanents.")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public CardRules getRules() {
|
||||
|
||||
@@ -93,9 +93,6 @@ public class CostSacrifice extends CostPartWithList {
|
||||
typeList = CardLists.getValidCards(typeList, this.getType().split(";"), activator, source, ability);
|
||||
final Integer amount = this.convertAmount();
|
||||
|
||||
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)) {
|
||||
@@ -106,13 +103,8 @@ public class CostSacrifice extends CostPartWithList {
|
||||
// if X is defined, it needs to be calculated and checked, if X is
|
||||
// choice, it can be Paid even if it's 0
|
||||
}
|
||||
else {
|
||||
if (!source.canBeSacrificed()) {
|
||||
return false;
|
||||
}
|
||||
else if (source.isCreature() && activator.hasKeyword("You can't sacrifice creatures to cast spells or activate abilities.")) {
|
||||
return false;
|
||||
}
|
||||
else if (!source.canBeSacrificedBy(ability)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user