AtEOT: add AtEOTCondition & AtEOTDesc

This commit is contained in:
Hanmac
2018-01-13 17:11:23 +01:00
parent 722c16e925
commit 3c3c64a11a
2 changed files with 31 additions and 20 deletions

View File

@@ -218,6 +218,8 @@ public abstract class SpellAbilityEffect {
boolean your = location.startsWith("Your");
boolean combat = location.endsWith("Combat");
String desc = sa.hasParam("AtEOTDesc") ? sa.getParam("AtEOTDesc") : "";
if (your) {
location = location.substring("Your".length());
}
@@ -225,6 +227,21 @@ public abstract class SpellAbilityEffect {
location = location.substring(0, location.length() - "Combat".length());
}
if (desc.isEmpty()) {
StringBuilder sb = new StringBuilder();
sb.append(location).append(" ");
sb.append(Lang.joinHomogenous(crds));
sb.append(" at the ");
if (combat) {
sb.append("end of combat.");
} else {
sb.append("beginning of ");
sb.append(your ? "your" : "the");
sb.append(" next end step.");
}
desc = sb.toString();
}
StringBuilder delTrig = new StringBuilder();
delTrig.append("Mode$ Phase | Phase$ ");
delTrig.append(combat ? "EndCombat " : "End Of Turn ");
@@ -232,16 +249,8 @@ public abstract class SpellAbilityEffect {
if (your) {
delTrig.append("| ValidPlayer$ You ");
}
delTrig.append("| TriggerDescription$ " + location + " ");
delTrig.append(Lang.joinHomogenous(crds));
delTrig.append(" at the ");
if (combat) {
delTrig.append("end of combat.");
} else {
delTrig.append("beginning of ");
delTrig.append(your ? "your" : "the");
delTrig.append(" next end step.");
}
delTrig.append("| TriggerDescription$ " + desc);
final Trigger trig = TriggerHandler.parseTrigger(delTrig.toString(), sa.getHostCard(), intrinsic);
for (final Card c : crds) {
trig.addRemembered(c);
@@ -254,6 +263,10 @@ public abstract class SpellAbilityEffect {
} else if (location.equals("Destroy")) {
trigSA = "DB$ Destroy | Defined$ DelayTriggerRemembered";
}
if (sa.hasParam("AtEOTCondition")) {
String var = sa.getParam("AtEOTCondition");
trigSA += "| ConditionCheckSVar$ " + var + "| References$ " + var;
}
final SpellAbility newSa = AbilityFactory.getAbility(trigSA, sa.getHostCard());
newSa.setIntrinsic(intrinsic);
trig.setOverridingAbility(newSa);

View File

@@ -4,12 +4,10 @@ Types:Creature Human Shaman
PT:1/1
K:Ascend
T:Mode$ Attacks | ValidCard$ Card.Self | Execute$ TrigToken | TriggerDescription$ Whenever CARDNAME attacks, you may pay {X}{R}. If you do, create X 1/1 red Elemental creature tokens that are tapped and attacking. At the beginning of the next end step, exile those tokens unless you have the city's blessing.
SVar:TrigToken:AB$ Token | Cost$ X R | TokenAmount$ X | TokenName$ Elemental | TokenTypes$ Creature,Elemental | TokenOwner$ You | TokenColors$ Red | TokenPower$ 1 | TokenToughness$ 1 | TokenTapped$ True | TokenAttacking$ True | TokenImage$ r 1 1 Elemental RIX | RememberTokens$ True | SubAbility$ DelTrig
SVar:DelTrig:DB$ DelayedTrigger | Mode$ Phase | Phase$ End of Turn | Execute$ TrigExile | RememberObjects$ Remembered | TriggerDescription$ At the beginning of the next end step, exile those tokens unless you have the city's blessing. | SubAbility$ DBCleanup
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:TrigExile:DB$ ChangeZone | Origin$ Battlefield | Destination$ Exile | Defined$ DelayTriggerRemembered | ConditionCheckSVar$ Y | ConditionSVarCompare$ GE1 | References$ Y
SVar:TrigToken:AB$ Token | Cost$ X R | TokenAmount$ X | TokenName$ Elemental | TokenTypes$ Creature,Elemental | TokenOwner$ You | TokenColors$ Red | TokenPower$ 1 | TokenToughness$ 1 | TokenTapped$ True | TokenAttacking$ True | TokenImage$ r 1 1 Elemental RIX | AtEOT$ Exile | AtEOTCondition$ Y | AtEOTDesc$ At the beginning of the next end step, exile those tokens unless you have the city's blessing.
SVar:X:Count$xPaid
SVar:Y:Count$Blessing.0.1
DeckHas:Ability$Token
SVar:HasAttackEffect:TRUE
SVar:Picture:http://www.wizards.com/global/images/magic/general/tilonallis_summoner.jpg
Oracle:Ascend (If you control ten or more permanents, you get the city's blessing for the rest of the game.)\nWhenever Tilonalli's Summoner attacks, you may pay {X}{R}. If you do, create X 1/1 red Elemental creature tokens that are tapped and attacking. At the beginning of the next end step, exile those tokens unless you have the city's blessing.