mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +00:00
removed getDirectSVars (#7389)
This commit is contained in:
@@ -607,7 +607,7 @@ public abstract class CardTraitBase extends GameObject implements IHasCardView,
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void setSVar(final String name, final String value) {
|
public void setSVar(final String name, final String value) {
|
||||||
sVars.put(name, value);
|
sVars.put(name, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -622,11 +622,6 @@ public abstract class CardTraitBase extends GameObject implements IHasCardView,
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, String> getDirectSVars() {
|
|
||||||
return sVars;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setSVars(Map<String, String> newSVars) {
|
public void setSVars(Map<String, String> newSVars) {
|
||||||
sVars = Maps.newTreeMap();
|
sVars = Maps.newTreeMap();
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ public interface IHasSVars {
|
|||||||
//public Set<String> getSVars();
|
//public Set<String> getSVars();
|
||||||
|
|
||||||
public Map<String, String> getSVars();
|
public Map<String, String> getSVars();
|
||||||
public Map<String, String> getDirectSVars();
|
|
||||||
|
|
||||||
public void removeSVar(final String var);
|
public void removeSVar(final String var);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1786,11 +1786,10 @@ public class AbilityUtils {
|
|||||||
}
|
}
|
||||||
// Count$NumTimesChoseMode
|
// Count$NumTimesChoseMode
|
||||||
if (sq[0].startsWith("NumTimesChoseMode")) {
|
if (sq[0].startsWith("NumTimesChoseMode")) {
|
||||||
SpellAbility sub = sa.getRootAbility();
|
|
||||||
int amount = 0;
|
int amount = 0;
|
||||||
while (sub != null) {
|
SpellAbility tail = sa.getTailAbility();
|
||||||
if (sub.getDirectSVars().containsKey("CharmOrder")) amount++;
|
if (tail.hasSVar("CharmOrder")) {
|
||||||
sub = sub.getSubAbility();
|
amount = tail.getSVarInt("CharmOrder");
|
||||||
}
|
}
|
||||||
return doXMath(amount, expr, c, ctb);
|
return doXMath(amount, expr, c, ctb);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public class CharmEffect extends SpellAbilityEffect {
|
|||||||
choices.removeAll(toRemove);
|
choices.removeAll(toRemove);
|
||||||
}
|
}
|
||||||
|
|
||||||
int indx = 0;
|
int indx = 1;
|
||||||
// set CharmOrder
|
// set CharmOrder
|
||||||
for (AbilitySub sub : choices) {
|
for (AbilitySub sub : choices) {
|
||||||
sub.setSVar("CharmOrder", Integer.toString(indx));
|
sub.setSVar("CharmOrder", Integer.toString(indx));
|
||||||
|
|||||||
@@ -2017,11 +2017,6 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars, ITr
|
|||||||
return currentState.getSVars();
|
return currentState.getSVars();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, String> getDirectSVars() {
|
|
||||||
return ImmutableMap.of();
|
|
||||||
}
|
|
||||||
|
|
||||||
public final void setSVars(final Map<String, String> newSVars) {
|
public final void setSVars(final Map<String, String> newSVars) {
|
||||||
currentState.setSVars(newSVars);
|
currentState.setSVars(newSVars);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -569,11 +569,6 @@ public class CardState extends GameObject implements IHasSVars, ITranslatable {
|
|||||||
return sVars;
|
return sVars;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, String> getDirectSVars() {
|
|
||||||
return sVars;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final String getSVar(final String var) {
|
public final String getSVar(final String var) {
|
||||||
if (sVars.containsKey(var)) {
|
if (sVars.containsKey(var)) {
|
||||||
|
|||||||
@@ -128,14 +128,10 @@ public class CostAdjustment {
|
|||||||
} else if (st.hasParam("Amount")) {
|
} else if (st.hasParam("Amount")) {
|
||||||
String amount = st.getParam("Amount");
|
String amount = st.getParam("Amount");
|
||||||
if ("Escalate".equals(amount)) {
|
if ("Escalate".equals(amount)) {
|
||||||
SpellAbility sub = sa;
|
SpellAbility tail = sa.getTailAbility();
|
||||||
while (sub != null) {
|
if (tail.hasSVar("CharmOrder")) {
|
||||||
if (sub.getDirectSVars().containsKey("CharmOrder")) {
|
count = tail.getSVarInt("CharmOrder") - 1;
|
||||||
count++;
|
|
||||||
}
|
|
||||||
sub = sub.getSubAbility();
|
|
||||||
}
|
}
|
||||||
--count;
|
|
||||||
} else if ("Strive".equals(amount)) {
|
} else if ("Strive".equals(amount)) {
|
||||||
for (TargetChoices tc : sa.getAllTargetChoices()) {
|
for (TargetChoices tc : sa.getAllTargetChoices()) {
|
||||||
count += tc.size();
|
count += tc.size();
|
||||||
|
|||||||
@@ -410,11 +410,6 @@ public abstract class KeywordInstance<T extends KeywordInstance<?>> implements K
|
|||||||
return getSVarFallback().getSVars();
|
return getSVarFallback().getSVars();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, String> getDirectSVars() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setSVars(Map<String, String> newSVars) {
|
public void setSVars(Map<String, String> newSVars) {
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1180,11 +1180,7 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit
|
|||||||
view.updateDescription(this);
|
view.updateDescription(this);
|
||||||
}
|
}
|
||||||
public void appendSubAbility(final AbilitySub toAdd) {
|
public void appendSubAbility(final AbilitySub toAdd) {
|
||||||
SpellAbility tailend = this;
|
getTailAbility().setSubAbility(toAdd);
|
||||||
while (tailend.getSubAbility() != null) {
|
|
||||||
tailend = tailend.getSubAbility();
|
|
||||||
}
|
|
||||||
tailend.setSubAbility(toAdd);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isBasicSpell() {
|
public boolean isBasicSpell() {
|
||||||
@@ -1642,6 +1638,13 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit
|
|||||||
}
|
}
|
||||||
return parent;
|
return parent;
|
||||||
}
|
}
|
||||||
|
public SpellAbility getTailAbility() {
|
||||||
|
SpellAbility tailend = this;
|
||||||
|
while (tailend.getSubAbility() != null) {
|
||||||
|
tailend = tailend.getSubAbility();
|
||||||
|
}
|
||||||
|
return tailend;
|
||||||
|
}
|
||||||
|
|
||||||
public SpellAbility getParent() {
|
public SpellAbility getParent() {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ import forge.game.card.CardView;
|
|||||||
import forge.game.card.IHasCardView;
|
import forge.game.card.IHasCardView;
|
||||||
import forge.game.player.Player;
|
import forge.game.player.Player;
|
||||||
import forge.game.trigger.TriggerType;
|
import forge.game.trigger.TriggerType;
|
||||||
import forge.game.trigger.WrappedAbility;
|
|
||||||
import forge.util.TextUtil;
|
import forge.util.TextUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -75,10 +74,9 @@ public class SpellAbilityStackInstance implements IIdentifiable, IHasCardView {
|
|||||||
|
|
||||||
subInstance = ability.getSubAbility() == null ? null : new SpellAbilityStackInstance(ability.getSubAbility());
|
subInstance = ability.getSubAbility() == null ? null : new SpellAbilityStackInstance(ability.getSubAbility());
|
||||||
|
|
||||||
final Map<String, String> sVars = (ability.isWrapper() ? ((WrappedAbility) ability).getWrappedAbility() : ability).getDirectSVars();
|
if (ApiType.SetState == sa.getApi() && !ability.hasSVar("StoredTransform")) {
|
||||||
if (ApiType.SetState == sa.getApi() && !sVars.containsKey("StoredTransform")) {
|
|
||||||
// Record current state of Transformation if the ability might change state
|
// Record current state of Transformation if the ability might change state
|
||||||
sVars.put("StoredTransform", String.valueOf(ability.getHostCard().getTransformedTimestamp()));
|
ability.setSVar("StoredTransform", String.valueOf(ability.getHostCard().getTransformedTimestamp()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sa.getApi() == ApiType.Charm && sa.hasParam("ChoiceRestriction")) {
|
if (sa.getApi() == ApiType.Charm && sa.hasParam("ChoiceRestriction")) {
|
||||||
|
|||||||
@@ -296,6 +296,11 @@ public class WrappedAbility extends Ability {
|
|||||||
return sa.getSVarInt(name);
|
return sa.getSVarInt(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setSVar(final String name, final String value) {
|
||||||
|
sa.setSVar(name, value);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, String> getSVars() {
|
public Map<String, String> getSVars() {
|
||||||
return sa.getSVars();
|
return sa.getSVars();
|
||||||
|
|||||||
Reference in New Issue
Block a user