mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
- Experimental (needs review): grant SVars to tokens before granting abilities and triggers in order to ensure that the game can see SubAbility SVars (e.g. Rekindling Phoenix).
This commit is contained in:
@@ -287,6 +287,22 @@ public class TokenEffect extends SpellAbilityEffect {
|
||||
}
|
||||
}
|
||||
|
||||
// Grant SVars
|
||||
if (this.tokenSVars != null) {
|
||||
for (final String s : this.tokenSVars) {
|
||||
String actualSVar = AbilityUtils.getSVar(root, s);
|
||||
String name = s;
|
||||
if (actualSVar.startsWith("SVar")) {
|
||||
actualSVar = actualSVar.split("SVar:")[1];
|
||||
name = actualSVar.split(":")[0];
|
||||
actualSVar = actualSVar.split(":")[1];
|
||||
}
|
||||
for (final Card c : tokens) {
|
||||
c.setSVar(name, actualSVar);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Grant abilities
|
||||
if (this.tokenAbilities != null) {
|
||||
for (final String s : this.tokenAbilities) {
|
||||
@@ -313,22 +329,6 @@ public class TokenEffect extends SpellAbilityEffect {
|
||||
}
|
||||
}
|
||||
|
||||
// Grant SVars
|
||||
if (this.tokenSVars != null) {
|
||||
for (final String s : this.tokenSVars) {
|
||||
String actualSVar = AbilityUtils.getSVar(root, s);
|
||||
String name = s;
|
||||
if (actualSVar.startsWith("SVar")) {
|
||||
actualSVar = actualSVar.split("SVar:")[1];
|
||||
name = actualSVar.split(":")[0];
|
||||
actualSVar = actualSVar.split(":")[1];
|
||||
}
|
||||
for (final Card c : tokens) {
|
||||
c.setSVar(name, actualSVar);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Grant static abilities
|
||||
if (this.tokenStaticAbilities != null) {
|
||||
for (final String s : this.tokenStaticAbilities) {
|
||||
|
||||
Reference in New Issue
Block a user