Jorn God of Winter and Kaldrin the Rimestaff

This commit is contained in:
Hans Mackowiak
2021-02-05 04:45:50 +00:00
committed by Michael Kamensky
parent 006fcda2c8
commit 592f708c00
4 changed files with 47 additions and 30 deletions

View File

@@ -211,7 +211,9 @@ public class EffectEffect extends SpellAbilityEffect {
}
if (sa.hasParam("ForgetOnMoved")) {
addForgetOnMovedTrigger(eff, sa.getParam("ForgetOnMoved"));
if (!"Stack".equals(sa.getParam("ForgetOnMoved"))) {
addForgetOnCastTrigger(eff);
}
} else if (sa.hasParam("ExileOnMoved")) {
addExileOnMovedTrigger(eff, sa.getParam("ExileOnMoved"));
}

View File

@@ -3,10 +3,7 @@ package forge.game.ability.effects;
import forge.game.ability.SpellAbilityEffect;
import forge.game.card.Card;
import forge.game.spellability.SpellAbility;
import forge.game.spellability.TargetRestrictions;
import org.apache.commons.lang3.StringUtils;
import java.util.List;
import forge.util.Lang;
public class TapEffect extends SpellAbilityEffect {
@@ -22,11 +19,8 @@ public class TapEffect extends SpellAbilityEffect {
card.clearRemembered();
}
final TargetRestrictions tgt = sa.getTargetRestrictions();
final List<Card> tgtCards = getTargetCards(sa);
for (final Card tgtC : tgtCards) {
if (tgt != null && !tgtC.canBeTargetedBy(sa)) {
for (final Card tgtC : getTargetCards(sa)) {
if (sa.usesTargeting() && !tgtC.canBeTargetedBy(sa)) {
continue;
}
if (tgtC.isInPlay()) {
@@ -47,8 +41,7 @@ public class TapEffect extends SpellAbilityEffect {
final StringBuilder sb = new StringBuilder();
sb.append("Tap ");
final List<Card> tgtCards = getTargetCards(sa);
sb.append(StringUtils.join(tgtCards, ", "));
sb.append(Lang.joinHomogenous(getTargetCards(sa)));
sb.append(".");
return sb.toString();
}

View File

@@ -8,15 +8,10 @@ import forge.game.card.CardLists;
import forge.game.card.CardPredicates.Presets;
import forge.game.player.Player;
import forge.game.spellability.SpellAbility;
import forge.game.spellability.TargetRestrictions;
import forge.game.zone.ZoneType;
import forge.util.Lang;
import forge.util.Localizer;
import org.apache.commons.lang3.StringUtils;
import java.util.List;
public class UntapEffect extends SpellAbilityEffect {
/* (non-Javadoc)
@@ -33,8 +28,7 @@ public class UntapEffect extends SpellAbilityEffect {
sb.append("up to ").append(sa.getParam("Amount")).append(" ");
sb.append(sa.getParam("UntapType")).append("s");
} else {
List<Card> tgtCards = getTargetCards(sa);
sb.append(StringUtils.join(tgtCards, ", "));
sb.append(Lang.joinHomogenous(getTargetCards(sa)));
}
sb.append(".");
return sb.toString();
@@ -42,20 +36,22 @@ public class UntapEffect extends SpellAbilityEffect {
@Override
public void resolve(SpellAbility sa) {
final TargetRestrictions tgt = sa.getTargetRestrictions();
if (sa.hasParam("UntapUpTo")) {
untapChoose(sa, false);
} else if (sa.hasParam("UntapExactly")) {
untapChoose(sa, true);
} else {
final List<Card> tgtCards = getTargetCards(sa);
for (final Card tgtC : tgtCards) {
if (tgtC.isInPlay() && ((tgt == null) || tgtC.canBeTargetedBy(sa))) {
for (final Card tgtC : getTargetCards(sa)) {
if (sa.usesTargeting() && !tgtC.canBeTargetedBy(sa)) {
continue;
}
if (tgtC.isInPlay()) {
tgtC.untap();
}
if (sa.hasParam("ETB")) {
// do not fire triggers
tgtC.setTapped(false);
}
}
}
}
@@ -74,9 +70,7 @@ public class UntapEffect extends SpellAbilityEffect {
final int num = Integer.parseInt(sa.getParam("Amount"));
final String valid = sa.getParam("UntapType");
final List<Player> definedPlayers = AbilityUtils.getDefinedPlayers(sa.getHostCard(), sa.getParam("Defined"), sa);
for (final Player p : definedPlayers) {
for (final Player p : AbilityUtils.getDefinedPlayers(sa.getHostCard(), sa.getParam("Defined"), sa)) {
CardCollectionView list = CardLists.getValidCards(p.getGame().getCardsIn(ZoneType.Battlefield),
valid, sa.getActivatingPlayer(), sa.getHostCard());
list = CardLists.filter(list, Presets.TAPPED);

View File

@@ -0,0 +1,28 @@
Name:Jorn, God of Winter
ManaCost:2 G
Types:Legendary Snow Creature God
PT:3/3
T:Mode$ Attacks | ValidCard$ Card.Self | Execute$ TrigUntapAllSnow | TriggerDescription$ Whenever CARDNAME attacks, untap each snow permanent you control.
SVar:TrigUntapAllSnow:DB$ UntapAll | ValidCards$ Permanent.Snow+YouCtrl
SVar:PlayMain1:TRUE
AlternateMode:Modal
DeckNeeds:Type$Snow
DeckHas:Ability$Graveyard
Oracle:Whenever Jorn attacks, untap each snow permanent you control.
ALTERNATE
Name:Kaldring, the Rimestaff
ManaCost:1 U B
Types:Legendary Snow Artifact
A:AB$ Effect | Cost$ T | TgtZone$ Graveyard | ValidTgts$ Permanent.Snow+YouCtrl | TgtPrompt$ Choose target snow permanent card in your graveyard | StaticAbilities$ STPlay | RememberObjects$ Targeted | ForgetOnMoved$ Graveyard | SubAbility$ DBEffect | SpellDescription$ You may play target snow permanent card from your graveyard this turn. If you do, it enters the battlefield tapped.
SVar:STPlay:Mode$ Continuous | MayPlay$ True | EffectZone$ Command | Affected$ Card.IsRemembered | AffectedZone$ Graveyard | Description$ You may play target snow permanent card from your graveyard this turn.
SVar:DBEffect:DB$ Effect | RememberObjects$ ParentTarget | ForgetOnMoved$ Stack | ReplacementEffects$ ETBCreat | SVars$ DBTap,ToBattlefield,DBExile | References$ ETBCreat,DBTap,ToBattlefield,DBExile
SVar:ETBCreat:Event$ Moved | ValidCard$ Card.IsRemembered | Destination$ Battlefield | ReplaceWith$ DBTap | Description$ If you do, it enters the battlefield tapped.
SVar:DBTap:DB$ Tap | Defined$ ReplacedCard | ETB$ True | SubAbility$ ToBattlefield
SVar:ToBattlefield:DB$ InternalEtbReplacement | SubAbility$ DBExile
SVar:DBExile:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile
SVar:STTapped:Mode$ Continuous | Affected$ Card.IsRemembered | AddKeyword$ CARDNAME enters the battlefield tapped.
DeckNeeds:Type$Snow
DeckHas:Ability$Graveyard
Oracle:{T}: You may play target snow permanent card from your graveyard this turn. If you do, it enters the battlefield tapped.