mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
Add Winter Cynical Opportunist (#6325)
This commit is contained in:
@@ -4,7 +4,6 @@ import com.google.common.base.Predicates;
|
|||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
|
|
||||||
import forge.card.CardStateName;
|
import forge.card.CardStateName;
|
||||||
import forge.card.CardType;
|
import forge.card.CardType;
|
||||||
import forge.game.*;
|
import forge.game.*;
|
||||||
@@ -27,7 +26,9 @@ import org.apache.commons.lang3.ObjectUtils;
|
|||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.commons.lang3.tuple.Pair;
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public class ChangeZoneEffect extends SpellAbilityEffect {
|
public class ChangeZoneEffect extends SpellAbilityEffect {
|
||||||
|
|
||||||
@@ -1085,8 +1086,10 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
|
|||||||
String selectPrompt = sa.hasParam("SelectPrompt") ? sa.getParam("SelectPrompt") : MessageUtil.formatMessage(Localizer.getInstance().getMessage("lblSelectCardFromPlayerZone", "{player's}", Lang.joinHomogenous(origin, ZoneType::getTranslatedName).toLowerCase()), decider, player);
|
String selectPrompt = sa.hasParam("SelectPrompt") ? sa.getParam("SelectPrompt") : MessageUtil.formatMessage(Localizer.getInstance().getMessage("lblSelectCardFromPlayerZone", "{player's}", Lang.joinHomogenous(origin, ZoneType::getTranslatedName).toLowerCase()), decider, player);
|
||||||
final String totalcmc = sa.getParam("WithTotalCMC");
|
final String totalcmc = sa.getParam("WithTotalCMC");
|
||||||
final String totalpower = sa.getParam("WithTotalPower");
|
final String totalpower = sa.getParam("WithTotalPower");
|
||||||
|
final String totalCardTypes = sa.getParam("WithTotalCardTypes");
|
||||||
int totcmc = AbilityUtils.calculateAmount(source, totalcmc, sa);
|
int totcmc = AbilityUtils.calculateAmount(source, totalcmc, sa);
|
||||||
int totpower = AbilityUtils.calculateAmount(source, totalpower, sa);
|
int totpower = AbilityUtils.calculateAmount(source, totalpower, sa);
|
||||||
|
int totCardTypes = AbilityUtils.calculateAmount(source, totalCardTypes, sa);
|
||||||
|
|
||||||
CardCollection chosenCards = new CardCollection();
|
CardCollection chosenCards = new CardCollection();
|
||||||
if (changeType.startsWith("EACH")) {
|
if (changeType.startsWith("EACH")) {
|
||||||
@@ -1160,6 +1163,7 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// If we're choosing multiple cards, only need to show the reveal dialog the first time through.
|
// If we're choosing multiple cards, only need to show the reveal dialog the first time through.
|
||||||
boolean shouldReveal = (i == 0);
|
boolean shouldReveal = (i == 0);
|
||||||
Card c = null;
|
Card c = null;
|
||||||
@@ -1170,6 +1174,10 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
|
|||||||
c = Aggregates.random(fetchList);
|
c = Aggregates.random(fetchList);
|
||||||
} else if (defined && !chooseFromDef) {
|
} else if (defined && !chooseFromDef) {
|
||||||
c = Iterables.getFirst(fetchList, null);
|
c = Iterables.getFirst(fetchList, null);
|
||||||
|
} else if (totalCardTypes != null) {
|
||||||
|
String title = selectPrompt;
|
||||||
|
title += "\nCard types left: " + Math.max(totCardTypes, 0);
|
||||||
|
c = decider.getController().chooseSingleCardForZoneChange(destination, origin, sa, fetchList, shouldReveal ? delayedReveal : null, title, !mandatory, decider);
|
||||||
} else {
|
} else {
|
||||||
String title = selectPrompt;
|
String title = selectPrompt;
|
||||||
if (changeNum > 1) { //indicate progress if multiple cards being chosen
|
if (changeNum > 1) { //indicate progress if multiple cards being chosen
|
||||||
@@ -1202,6 +1210,13 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
|
|||||||
if (totalpower != null) {
|
if (totalpower != null) {
|
||||||
totpower -= c.getCurrentPower();
|
totpower -= c.getCurrentPower();
|
||||||
}
|
}
|
||||||
|
if (totalCardTypes != null) {
|
||||||
|
totCardTypes -= Iterables.size(c.getType().getCoreTypes());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (totalCardTypes != null && totCardTypes > 0) {
|
||||||
|
chosenCards.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1537,7 +1552,8 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
|
|||||||
&& !sa.hasParam("AtRandom")
|
&& !sa.hasParam("AtRandom")
|
||||||
&& (!sa.hasParam("Defined") || sa.hasParam("ChooseFromDefined"))
|
&& (!sa.hasParam("Defined") || sa.hasParam("ChooseFromDefined"))
|
||||||
&& !sa.hasParam("WithTotalCMC")
|
&& !sa.hasParam("WithTotalCMC")
|
||||||
&& !sa.hasParam("WithTotalPower");
|
&& !sa.hasParam("WithTotalPower")
|
||||||
|
&& !sa.hasParam("WithTotalCardTypes");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
14
forge-gui/res/cardsfolder/w/winter_cynical_opportunist.txt
Normal file
14
forge-gui/res/cardsfolder/w/winter_cynical_opportunist.txt
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
Name:Winter, Cynical Opportunist
|
||||||
|
ManaCost:2 B G
|
||||||
|
Types:Legendary Creature Human Warlock
|
||||||
|
PT:2/5
|
||||||
|
K:Deathtouch
|
||||||
|
T:Mode$ Attacks | ValidCard$ Card.Self | Execute$ TrigMill | TriggerDescription$ Whenever NICKNAME attacks, mill three cards.
|
||||||
|
SVar:TrigMill:DB$ Mill | NumCards$ 3
|
||||||
|
T:Mode$ Phase | Phase$ End of Turn | ValidPlayer$ You | Delirium$ True | TriggerZones$ Battlefield | Execute$ TrigExileDelirium | TriggerDescription$ Delirium — At the beginning of your end step, you may exile any number of cards from your graveyard with four or more card types among them. If you do, put a permanent card from among them onto the battlefield with a finality counter on it.
|
||||||
|
SVar:TrigExileDelirium:DB$ ChangeZone | Origin$ Graveyard | Destination$ Exile | ChangeType$ Card.YouOwn | ChangeNum$ X | RememberChanged$ True | Hidden$ True | WithTotalCardTypes$ 4 | SubAbility$ DBReturn
|
||||||
|
SVar:DBReturn:DB$ ChangeZone | Origin$ Exile | Destination$ Battlefield | WithCountersType$ FINALITY | Hidden$ True | ChangeType$ Permanent.YouOwn+IsRemembered | ChangeNum$ 1 | SubAbility$ DBCleanup | Mandatory$ True
|
||||||
|
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
||||||
|
SVar:X:Count$ValidGraveyard Card.YouOwn
|
||||||
|
AI:RemoveDeck:All
|
||||||
|
Oracle:Deathtouch\nWhenever Winter attacks, mill three cards.\nDelirium — At the beginning of your end step, you may exile any number of cards from your graveyard with four or more card types among them. If you do, put a permanent card from among them onto the battlefield with a finality counter on it.
|
||||||
Reference in New Issue
Block a user