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