mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
Add Raging River
This commit is contained in:
@@ -24,6 +24,7 @@ public class AnimateEffect extends AnimateEffectBase {
|
||||
final Card source = sa.getHostCard();
|
||||
|
||||
String animateRemembered = null;
|
||||
String animateImprinted = null;
|
||||
|
||||
//if host is not on the battlefield don't apply
|
||||
if ((sa.hasParam("UntilHostLeavesPlay") || sa.hasParam("UntilLoseControlOfHost"))
|
||||
@@ -35,6 +36,10 @@ public class AnimateEffect extends AnimateEffectBase {
|
||||
if (sa.hasParam("RememberObjects")) {
|
||||
animateRemembered = sa.getParam("RememberObjects");
|
||||
}
|
||||
// Imprint Cards
|
||||
if (sa.hasParam("ImprintCards")) {
|
||||
animateImprinted = sa.getParam("ImprintCards");
|
||||
}
|
||||
|
||||
// AF specific sa
|
||||
Integer power = null;
|
||||
@@ -162,6 +167,18 @@ public class AnimateEffect extends AnimateEffectBase {
|
||||
}
|
||||
}
|
||||
|
||||
// give Imprinted
|
||||
if (animateImprinted != null) {
|
||||
for (final Card imprintedCard : AbilityUtils.getDefinedCards(source, animateImprinted, sa)) {
|
||||
c.addImprintedCard(imprintedCard);
|
||||
}
|
||||
}
|
||||
|
||||
// Restore immutable to effect
|
||||
if (sa.hasParam("Immutable")) {
|
||||
c.setImmutable(true);
|
||||
}
|
||||
|
||||
game.fireEvent(new GameEventCardStatsChanged(c));
|
||||
}
|
||||
|
||||
|
||||
@@ -140,6 +140,10 @@ public class EffectEffect extends SpellAbilityEffect {
|
||||
final Card eff = createEffect(sa, controller, name, image);
|
||||
eff.setSetCode(sa.getHostCard().getSetCode());
|
||||
eff.setRarity(sa.getHostCard().getRarity());
|
||||
// For Raging River effect to add attacker "left" or "right" pile later
|
||||
if (sa.hasParam("Mutable")) {
|
||||
eff.setImmutable(false);
|
||||
}
|
||||
|
||||
// Abilities and triggers work the same as they do for Token
|
||||
// Grant abilities
|
||||
|
||||
@@ -13,6 +13,7 @@ import forge.game.spellability.AbilitySub;
|
||||
import forge.game.spellability.SpellAbility;
|
||||
import forge.game.spellability.TargetRestrictions;
|
||||
import forge.game.zone.ZoneType;
|
||||
import forge.util.Lang;
|
||||
import forge.util.Localizer;
|
||||
|
||||
public class TwoPilesEffect extends SpellAbilityEffect {
|
||||
@@ -52,6 +53,7 @@ public class TwoPilesEffect extends SpellAbilityEffect {
|
||||
final Card card = sa.getHostCard();
|
||||
ZoneType zone = null;
|
||||
boolean pile1WasChosen = true;
|
||||
boolean isLeftRightPile = sa.hasParam("LeftRightPile");
|
||||
|
||||
if (sa.hasParam("Zone")) {
|
||||
zone = ZoneType.smartValueOf(sa.getParam("Zone"));
|
||||
@@ -89,8 +91,14 @@ public class TwoPilesEffect extends SpellAbilityEffect {
|
||||
return;
|
||||
}
|
||||
|
||||
String title = "One".equals(sa.getParamOrDefault("FaceDown", "False")) ? Localizer.getInstance().getMessage("lblSelectCardForFaceDownPile") :
|
||||
Localizer.getInstance().getMessage("lblDivideCardIntoTwoPiles");
|
||||
String title;
|
||||
if("One".equals(sa.getParamOrDefault("FaceDown", "False"))) {
|
||||
title = Localizer.getInstance().getMessage("lblSelectCardForFaceDownPile");
|
||||
} else if (isLeftRightPile) {
|
||||
title = Localizer.getInstance().getMessage("lblSelectCardForLeftPile");
|
||||
} else {
|
||||
title = Localizer.getInstance().getMessage("lblDivideCardIntoTwoPiles");
|
||||
}
|
||||
|
||||
card.clearRemembered();
|
||||
|
||||
@@ -103,20 +111,49 @@ public class TwoPilesEffect extends SpellAbilityEffect {
|
||||
//System.out.println("Pile 2:" + pile2);
|
||||
|
||||
|
||||
pile1WasChosen = chooser.getController().chooseCardsPile(sa, pile1, pile2, sa.getParamOrDefault("FaceDown", "False"));
|
||||
if (isLeftRightPile) {
|
||||
pile1WasChosen = true;
|
||||
} else {
|
||||
pile1WasChosen = chooser.getController().chooseCardsPile(sa, pile1, pile2, sa.getParamOrDefault("FaceDown", "False"));
|
||||
}
|
||||
CardCollectionView chosenPile = pile1WasChosen ? pile1 : pile2;
|
||||
CardCollectionView unchosenPile = !pile1WasChosen ? pile1 : pile2;
|
||||
|
||||
StringBuilder notification = new StringBuilder(chooser + " " + Localizer.getInstance().getMessage("lblChoosesPile") + " " + (pile1WasChosen ? "1" : "2") + ":\n");
|
||||
if (!chosenPile.isEmpty()) {
|
||||
for (Card c : chosenPile) {
|
||||
notification.append(c.getName()).append("\n");
|
||||
StringBuilder notification = new StringBuilder();
|
||||
if (isLeftRightPile) {
|
||||
notification.append("\n");
|
||||
notification.append(Lang.getInstance().getPossessedObject(separator.getName(), Localizer.getInstance().getMessage("lblLeftPile")));
|
||||
notification.append("\n--------------------\n");
|
||||
if (!chosenPile.isEmpty()) {
|
||||
for (Card c : chosenPile) {
|
||||
notification.append(c.getName()).append("\n");
|
||||
}
|
||||
} else {
|
||||
notification.append("(" + Localizer.getInstance().getMessage("lblEmptyPile") + ")\n");
|
||||
}
|
||||
notification.append("\n");
|
||||
notification.append(Lang.getInstance().getPossessedObject(separator.getName(), Localizer.getInstance().getMessage("lblRightPile")));
|
||||
notification.append("\n--------------------\n");
|
||||
if (!unchosenPile.isEmpty()) {
|
||||
for (Card c : unchosenPile) {
|
||||
notification.append(c.getName()).append("\n");
|
||||
}
|
||||
} else {
|
||||
notification.append("(" + Localizer.getInstance().getMessage("lblEmptyPile") + ")\n");
|
||||
}
|
||||
p.getGame().getAction().notifyOfValue(sa, separator, notification.toString(), separator);
|
||||
} else {
|
||||
notification.append("(" + Localizer.getInstance().getMessage("lblEmptyPile") + ")");
|
||||
notification.append(chooser + " " + Localizer.getInstance().getMessage("lblChoosesPile") + " " + (pile1WasChosen ? "1" : "2") + ":\n");
|
||||
if (!chosenPile.isEmpty()) {
|
||||
for (Card c : chosenPile) {
|
||||
notification.append(c.getName()).append("\n");
|
||||
}
|
||||
} else {
|
||||
notification.append("(" + Localizer.getInstance().getMessage("lblEmptyPile") + ")");
|
||||
}
|
||||
p.getGame().getAction().notifyOfValue(sa, chooser, notification.toString(), chooser);
|
||||
}
|
||||
|
||||
p.getGame().getAction().notifyOfValue(sa, chooser, notification.toString(), chooser);
|
||||
|
||||
// take action on the chosen pile
|
||||
if (sa.hasParam("ChosenPile")) {
|
||||
|
||||
Reference in New Issue
Block a user