mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
Remove code for References$
This commit is contained in:
@@ -252,12 +252,6 @@ public final class AbilityFactory {
|
||||
// *********************************************
|
||||
// set universal properties of the SpellAbility
|
||||
|
||||
if (mapParams.containsKey("References")) {
|
||||
for (String svar : mapParams.get("References").split(",")) {
|
||||
spellAbility.setSVar(svar, sVarHolder.getSVar(svar));
|
||||
}
|
||||
}
|
||||
|
||||
if ((api == ApiType.DelayedTrigger || api == ApiType.ImmediateTrigger) && mapParams.containsKey("Execute")) {
|
||||
spellAbility.setSVar(mapParams.get("Execute"), sVarHolder.getSVar(mapParams.get("Execute")));
|
||||
}
|
||||
|
||||
@@ -308,7 +308,7 @@ public abstract class SpellAbilityEffect {
|
||||
}
|
||||
if (sa.hasParam("AtEOTCondition")) {
|
||||
String var = sa.getParam("AtEOTCondition");
|
||||
trigSA += "| ConditionCheckSVar$ " + var + "| References$ " + var;
|
||||
trigSA += "| ConditionCheckSVar$ " + var;
|
||||
}
|
||||
final SpellAbility newSa = AbilityFactory.getAbility(trigSA, sa.getHostCard());
|
||||
newSa.setIntrinsic(intrinsic);
|
||||
|
||||
@@ -2203,10 +2203,6 @@ public class CardFactoryUtil {
|
||||
String abStr = "DB$ PutCounter | Defined$ Self | CounterType$ " + splitkw[1]
|
||||
+ " | ETB$ True | CounterNum$ " + amount;
|
||||
|
||||
if (!StringUtils.isNumeric(amount) && card.hasSVar(amount)) {
|
||||
abStr += " | References$ " + amount;
|
||||
}
|
||||
|
||||
SpellAbility sa = AbilityFactory.getAbility(abStr, card);
|
||||
setupETBReplacementAbility(sa);
|
||||
if (!intrinsic) {
|
||||
@@ -2465,9 +2461,8 @@ public class CardFactoryUtil {
|
||||
" | IsPresent$ Card.Self+cameUnderControlSinceLastUpkeep | Secondary$ True | " +
|
||||
"TriggerDescription$ " + inst.getReminderText();
|
||||
|
||||
String ref = "X".equals(cost) ? " | References$ X" : "";
|
||||
String effect = "DB$ Sacrifice | SacValid$ Self | "
|
||||
+ "Echo$ " + cost + ref;
|
||||
+ "Echo$ " + cost;
|
||||
|
||||
final Trigger trigger = TriggerHandler.parseTrigger(upkeepTrig, card, intrinsic);
|
||||
trigger.setOverridingAbility(AbilityFactory.getAbility(effect, card));
|
||||
@@ -3293,10 +3288,6 @@ public class CardFactoryUtil {
|
||||
|
||||
String effect = "DB$ Sacrifice | SacValid$ Self | UnlessPayer$ You | UnlessCost$ " + k[1];
|
||||
|
||||
if (!StringUtils.isNumeric(k[1])) {
|
||||
effect += " | References$ " + k[1];
|
||||
}
|
||||
|
||||
final Trigger parsedTrigger = TriggerHandler.parseTrigger(upkeepTrig, card, intrinsic);
|
||||
parsedTrigger.setOverridingAbility(AbilityFactory.getAbility(effect, card));
|
||||
|
||||
@@ -3910,8 +3901,6 @@ public class CardFactoryUtil {
|
||||
final String manacost = k[2];
|
||||
final String reduceCost = k.length > 3 ? k[3] : null;
|
||||
|
||||
Set<String> references = Sets.newHashSet();
|
||||
|
||||
String desc = "Adapt " + magnitude;
|
||||
|
||||
String effect = "AB$ PutCounter | Cost$ " + manacost + " | Adapt$ True | CounterNum$ " + magnitude
|
||||
@@ -3919,13 +3908,8 @@ public class CardFactoryUtil {
|
||||
|
||||
if (reduceCost != null) {
|
||||
effect += "| ReduceCost$ " + reduceCost;
|
||||
references.add(reduceCost);
|
||||
desc += ". This ability costs {1} less to activate for each instant and sorcery card in your graveyard.";
|
||||
}
|
||||
if (!references.isEmpty()) {
|
||||
effect += "| References$ " + TextUtil.join(references, ",");
|
||||
}
|
||||
|
||||
effect += "| SpellDescription$ " + desc + " (" + inst.getReminderText() + ")";
|
||||
|
||||
final SpellAbility sa = AbilityFactory.getAbility(effect, card);
|
||||
@@ -4258,23 +4242,15 @@ public class CardFactoryUtil {
|
||||
|
||||
final String reduceCost = k.length > 3 ? k[3] : null;
|
||||
|
||||
Set<String> references = Sets.newHashSet();
|
||||
String desc = "Monstrosity " + magnitude;
|
||||
|
||||
String effect = "AB$ PutCounter | Cost$ " + manacost + " | ConditionPresent$ "
|
||||
+ "Card.Self+IsNotMonstrous | Monstrosity$ True | CounterNum$ " + magnitude
|
||||
+ " | CounterType$ P1P1 | StackDescription$ SpellDescription";
|
||||
if ("X".equals(magnitude)) {
|
||||
references.add("X");
|
||||
}
|
||||
if (reduceCost != null) {
|
||||
effect += "| ReduceCost$ " + reduceCost;
|
||||
references.add(reduceCost);
|
||||
desc += ". This ability costs {1} less to activate for each creature card in your graveyard.";
|
||||
}
|
||||
if (!references.isEmpty()) {
|
||||
effect += "| References$ " + TextUtil.join(references, ",");
|
||||
}
|
||||
|
||||
if (card.hasSVar("MonstrosityAILogic")) {
|
||||
effect += "| AILogic$ " + card.getSVar("MonstrosityAILogic");
|
||||
@@ -4833,11 +4809,6 @@ public class CardFactoryUtil {
|
||||
}
|
||||
|
||||
altCostSA.setDescription(costDescription);
|
||||
if (params.containsKey("References")) {
|
||||
for (String svar : params.get("References").split(",")) {
|
||||
altCostSA.setSVar(svar, card.getSVar(svar));
|
||||
}
|
||||
}
|
||||
return altCostSA;
|
||||
}
|
||||
|
||||
|
||||
@@ -197,16 +197,6 @@ public class StaticAbility extends CardTraitBase implements IIdentifiable, Clone
|
||||
return layers;
|
||||
}
|
||||
|
||||
private void buildCommonAttributes(Card host) {
|
||||
if (hasParam("References")) {
|
||||
for (String svar : getParam("References").split(",")) {
|
||||
if (host.hasSVar(svar)) {
|
||||
this.setSVar(svar, host.getSVar(svar));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* toString.
|
||||
@@ -255,7 +245,6 @@ public class StaticAbility extends CardTraitBase implements IIdentifiable, Clone
|
||||
this.mapParams.putAll(params);
|
||||
this.layers = this.generateLayer();
|
||||
this.hostCard = host;
|
||||
buildCommonAttributes(host);
|
||||
this.setCardState(state);
|
||||
}
|
||||
|
||||
@@ -764,8 +753,6 @@ public class StaticAbility extends CardTraitBase implements IIdentifiable, Clone
|
||||
copyHelper(clone, host);
|
||||
|
||||
clone.layers = this.generateLayer();
|
||||
|
||||
clone.buildCommonAttributes(host);
|
||||
} catch (final CloneNotSupportedException e) {
|
||||
System.err.println(e);
|
||||
}
|
||||
|
||||
@@ -149,17 +149,11 @@ public class StaticAbilityCantAttackBlock {
|
||||
return null;
|
||||
}
|
||||
String costString = stAb.getParam("Cost");
|
||||
if ("X".equals(costString)) {
|
||||
costString = Integer.toString(CardFactoryUtil.xCount(hostCard, hostCard.getSVar("X")));
|
||||
} else if ("Y".equals(costString)) {
|
||||
costString = Integer.toString(CardFactoryUtil.xCount(hostCard, hostCard.getSVar("Y")));
|
||||
} else if (stAb.hasParam("References")) {
|
||||
costString = Integer.toString(CardFactoryUtil.xCount(hostCard, hostCard.getSVar(stAb.getParam("References"))));
|
||||
if (stAb.hasSVar(costString)) {
|
||||
costString = Integer.toString(CardFactoryUtil.xCount(hostCard, stAb.getSVar(costString)));
|
||||
}
|
||||
|
||||
final Cost cost = new Cost(costString, true);
|
||||
|
||||
return cost;
|
||||
return new Cost(costString, true);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -184,17 +178,11 @@ public class StaticAbilityCantAttackBlock {
|
||||
return null;
|
||||
}
|
||||
String costString = stAb.getParam("Cost");
|
||||
if ("X".equals(costString)) {
|
||||
costString = Integer.toString(CardFactoryUtil.xCount(hostCard, hostCard.getSVar("X")));
|
||||
} else if ("Y".equals(costString)) {
|
||||
costString = Integer.toString(CardFactoryUtil.xCount(hostCard, hostCard.getSVar("Y")));
|
||||
} else if (stAb.hasParam("References")) {
|
||||
costString = Integer.toString(CardFactoryUtil.xCount(hostCard, hostCard.getSVar(stAb.getParam("References"))));
|
||||
if (stAb.hasSVar(costString)) {
|
||||
costString = Integer.toString(CardFactoryUtil.xCount(hostCard, stAb.getSVar(costString)));
|
||||
}
|
||||
|
||||
final Cost cost = new Cost(costString, true);
|
||||
|
||||
return cost;
|
||||
return new Cost(costString, true);
|
||||
}
|
||||
|
||||
public static boolean applyCanAttackHasteAbility(final StaticAbility stAb, final Card card, final GameEntity target) {
|
||||
|
||||
Reference in New Issue
Block a user