Commit af021e7d authored by Hans Mackowiak's avatar Hans Mackowiak Committed by Michael Kamensky

Dash: reworked and better Haste part

parent 0826f0c0
......@@ -204,7 +204,8 @@ public final class AbilityFactory {
else if (api == ApiType.PermanentCreature || api == ApiType.PermanentNoncreature) {
// If API is a permanent type, and creating AF Spell
// Clear out the auto created SpellPemanent spell
if (type == AbilityRecordType.Spell && !mapParams.containsKey("SubAbility")) {
if (type == AbilityRecordType.Spell
&& !mapParams.containsKey("SubAbility") && !mapParams.containsKey("NonBasicSpell")) {
hostCard.clearFirstSpell();
}
}
......@@ -389,6 +390,10 @@ public final class AbilityFactory {
sa.setBasicSpell(false);
}
if (mapParams.containsKey("Dash")) {
sa.setDash(true);
}
if (mapParams.containsKey("Outlast")) {
sa.setOutlast(true);
}
......
......@@ -238,7 +238,7 @@ public abstract class SpellAbilityEffect {
}
sb.append(Lang.joinHomogenous(crds));
if (location.equals("Hand")) {
sb.append("to your hand").append(" ");
sb.append(" to your hand");
}
sb.append(" at the ");
if (combat) {
......
......@@ -537,10 +537,10 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
tgtC.getController().getZone(destination), tgtC, sa, null);
if (sa.hasParam("Unearth")) {
movedCard.setUnearthed(true);
movedCard.addExtrinsicKeyword("Haste");
movedCard.addChangedCardKeywords(Lists.newArrayList("Haste"), null, false, false,
game.getNextTimestamp(), true);
registerDelayedTrigger(sa, "Exile", Lists.newArrayList(movedCard));
addLeaveBattlefieldReplacement(movedCard, sa, "Exile");
movedCard.updateStateForView();
}
if (sa.hasParam("FaceDown")) {
movedCard.turnFaceDown(true);
......
......@@ -83,10 +83,6 @@ public class DigEffect extends SpellAbilityEffect {
boolean changeAll = false;
boolean allButOne = false;
final List<String> keywords = new ArrayList<String>();
if (sa.hasParam("Keywords")) {
keywords.addAll(Arrays.asList(sa.getParam("Keywords").split(" & ")));
}
if (sa.hasParam("ChangeNum")) {
if (sa.getParam("ChangeNum").equalsIgnoreCase("All")) {
......@@ -307,9 +303,6 @@ public class DigEffect extends SpellAbilityEffect {
else {
c = game.getAction().moveTo(zone, c, sa);
if (destZone1.equals(ZoneType.Battlefield)) {
for (final String kw : keywords) {
c.addExtrinsicKeyword(kw);
}
if (sa.hasParam("Tapped")) {
c.setTapped(true);
}
......@@ -377,11 +370,7 @@ public class DigEffect extends SpellAbilityEffect {
if (!origin.equals(c.getZone().getZoneType())) {
table.put(origin, c.getZone().getZoneType(), c);
}
if (destZone2 == ZoneType.Battlefield && !keywords.isEmpty()) {
for (final String kw : keywords) {
c.addExtrinsicKeyword(kw);
}
} else if (destZone2 == ZoneType.Exile) {
if (destZone2 == ZoneType.Exile) {
if (sa.hasParam("ExileWithCounter")) {
c.addCounter(CounterType.getType(sa.getParam("ExileWithCounter")),
1, player, true, counterTable);
......
package forge.game.ability.effects;
import com.google.common.collect.Lists;
import forge.game.ability.SpellAbilityEffect;
import forge.game.card.Card;
import forge.game.player.Player;
......@@ -25,9 +27,8 @@ public class PermanentEffect extends SpellAbilityEffect {
// some extra for Dashing
if (sa.isDash()) {
c.addExtrinsicKeyword("Haste");
c.setSVar("EndOfTurnLeavePlay", "Dash");
c.updateKeywords();
registerDelayedTrigger(sa, "Hand", Lists.newArrayList(c));
}
}
}
......@@ -3850,23 +3850,11 @@ public class CardFactoryUtil {
inst.addSpellAbility(sa);
} else if (keyword.startsWith("Dash")) {
final String[] k = keyword.split(":");
final String dashString = "SP$ PermanentCreature | Cost$ " + k[1] + " | SubAbility$"
+ " DashDelayedTrigger";
final String dbDelayTrigger = "DB$ DelayedTrigger | Mode$ Phase | Phase$"
+ " End of Turn | Execute$ DashReturnSelf | RememberObjects$ Self"
+ " | TriggerDescription$ Return CARDNAME from the battlefield to" + " its owner's hand.";
final String dbReturn = "DB$ ChangeZone | Origin$ Battlefield | Destination$ Hand"
+ " | Defined$ DelayTriggerRemembered";
card.setSVar("DashDelayedTrigger", dbDelayTrigger);
card.setSVar("DashReturnSelf", dbReturn);
final String dashString = "SP$ PermanentCreature | Cost$ " + k[1] + " | StackDescription$ CARDNAME (Dash)"
+ " | Dash$ True | NonBasicSpell$ True"
+ " | SpellDescription$ Dash " + ManaCostParser.parse(k[1]) + " (" + inst.getReminderText() + ")";
final SpellAbility newSA = AbilityFactory.getAbility(dashString, card);
String desc = "Dash " + ManaCostParser.parse(k[1]) + " (" + inst.getReminderText()
+ ")";
newSA.setStackDescription(card.getName() + " (Dash)");
newSA.setDescription(desc);
newSA.setBasicSpell(false);
newSA.setDash(true);
newSA.setIntrinsic(intrinsic);
newSA.setTemporary(!intrinsic);
......@@ -4527,6 +4515,8 @@ public class CardFactoryUtil {
card.setSVar("CipherTrigger", trig);
card.setSVar("PlayEncoded", ab);
} else if (keyword.startsWith("Dash")) {
effect = "Mode$ Continuous | Affected$ Card.Self+dashed | AddKeyword$ Haste";
} else if (keyword.equals("Devoid")) {
effect = "Mode$ Continuous | EffectZone$ All | Affected$ Card.Self" +
" | CharacteristicDefining$ True | SetColor$ Colorless | Secondary$ True" +
......
......@@ -1639,6 +1639,11 @@ public class CardProperty {
return false;
}
return card.getCastSA().isSurged();
} else if (property.startsWith("dashed")) {
if (card.getCastSA() == null) {
return false;
}
return card.getCastSA().isDash();
} else if (property.startsWith("evoked")) {
if (card.getCastSA() == null) {
return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment