mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 18:58:00 +00:00
Fix CostSacrifice paying from Effect
This commit is contained in:
committed by
Michael Kamensky
parent
33377abc9f
commit
a9f5ab8772
@@ -178,7 +178,6 @@ public final class AbilityFactory {
|
||||
return getAbility(type, type.getApiTypeOf(mapParams), mapParams, parseAbilityCost(state, mapParams, type), state, sVarHolder);
|
||||
}
|
||||
|
||||
|
||||
public static Cost parseAbilityCost(final CardState state, Map<String, String> mapParams, AbilityRecordType type) {
|
||||
Cost abCost = null;
|
||||
if (type != AbilityRecordType.SubAbility) {
|
||||
|
||||
@@ -6229,7 +6229,7 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (source == null){
|
||||
if (source == null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -240,8 +240,7 @@ public class Cost implements Serializable {
|
||||
xCantBe0 = true;
|
||||
} else if ("Mandatory".equals(part)) {
|
||||
this.isMandatory = true;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
CostPart cp = parseCostPart(part, tapCost, untapCost);
|
||||
if (null != cp )
|
||||
if (cp instanceof CostPartMana ) {
|
||||
@@ -268,7 +267,6 @@ public class Cost implements Serializable {
|
||||
}
|
||||
|
||||
private static CostPart parseCostPart(String parse, boolean tapCost, boolean untapCost) {
|
||||
|
||||
if (parse.startsWith("Mana<")) {
|
||||
final String[] splitStr = TextUtil.split(abCostParse(parse, 1)[0], '\\');
|
||||
final String restriction = splitStr.length > 1 ? splitStr[1] : null;
|
||||
|
||||
@@ -3337,7 +3337,6 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
}
|
||||
return targetPlayer == null || !targetPlayer.equals(sa.getActivatingPlayer())
|
||||
|| !hasKeyword("Spells and abilities you control can't cause you to search your library.");
|
||||
|
||||
}
|
||||
|
||||
public Card getKeywordCard() {
|
||||
|
||||
@@ -65,7 +65,7 @@ public abstract class AbilityActivated extends SpellAbility implements Cloneable
|
||||
this.setTargetRestrictions(tgt);
|
||||
}
|
||||
|
||||
public boolean isActivatedAbility() { return true; }
|
||||
public boolean isActivatedAbility() { return !isTrigger(); }
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
|
||||
@@ -579,7 +579,7 @@ public class TriggerHandler {
|
||||
sa.setOptionalTrigger(true);
|
||||
decider = AbilityUtils.getDefinedPlayers(host, regtrig.getParam("OptionalDecider"), sa).get(0);
|
||||
}
|
||||
else if (sa instanceof AbilitySub || !sa.hasParam("Cost") || sa.hasParam("CostMandatory") || sa.getParam("Cost").equals("0")) {
|
||||
else if (sa instanceof AbilitySub || !sa.hasParam("Cost") || (sa.getPayCosts() != null && sa.getPayCosts().isMandatory()) || sa.getParam("Cost").equals("0")) {
|
||||
isMandatory = true;
|
||||
} else { // triggers with a cost can't be mandatory
|
||||
sa.setOptionalTrigger(true);
|
||||
|
||||
Reference in New Issue
Block a user