mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-14 17:58:01 +00:00
@@ -8,7 +8,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import forge.card.mana.ManaCost;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -1082,8 +1081,7 @@ public class ComputerUtilCard {
|
||||
//chosen.add(MagicColor.Constant.GREEN);
|
||||
chosen.add(getMostProminentColor(ai.getAllCards(), colorChoices));
|
||||
}
|
||||
//convert to proper case same with the colorChoices..
|
||||
return chosen.stream().map(s -> Character.toUpperCase(s.charAt(0)) + s.substring(1)).collect(Collectors.toList());
|
||||
return chosen;
|
||||
}
|
||||
|
||||
public static boolean useRemovalNow(final SpellAbility sa, final Card c, final int dmg, ZoneType destination) {
|
||||
|
||||
@@ -1317,22 +1317,6 @@ public class AbilityUtils {
|
||||
final Object o = root.getTriggeringObject(AbilityKey.fromString(triggeringType));
|
||||
if (o instanceof SpellAbility) {
|
||||
s = (SpellAbility) o;
|
||||
// if there is no target information in SA but targets are listed in SpellAbilityTargeting cards, copy that
|
||||
// information so it's not lost if the calling code is interested in targets of the triggered SA.
|
||||
if (triggeringType.equals("SpellAbility")) {
|
||||
final List<GameEntity> tgtList = (List<GameEntity>) root.getTriggeringObject(AbilityKey.SpellAbilityTargets);
|
||||
if (s.getTargets() != null && s.getTargets().size() == 0) {
|
||||
if (tgtList != null && tgtList.size() > 0) {
|
||||
TargetChoices tc = new TargetChoices();
|
||||
for (GameEntity ge : tgtList) {
|
||||
if (ge instanceof Card) {
|
||||
tc.add((Card) ge);
|
||||
}
|
||||
}
|
||||
s.setTargets(tc);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (o instanceof SpellAbilityStackInstance) {
|
||||
s = ((SpellAbilityStackInstance) o).getSpellAbility(true);
|
||||
}
|
||||
|
||||
@@ -82,14 +82,13 @@ public class ChooseColorEffect extends SpellAbilityEffect {
|
||||
}
|
||||
noNotify = null;
|
||||
} else {
|
||||
colorChoices = colorChoices.stream().map(DeckRecognizer::getLocalisedMagicColorName).collect(Collectors.toList());
|
||||
chosenColors = p.getController().chooseColors(prompt, sa, cntMin, cntMax, colorChoices);
|
||||
chosenColors = chosenColors.stream().map(DeckRecognizer::getColorNameByLocalisedName).collect(Collectors.toList());
|
||||
}
|
||||
if (chosenColors.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
card.setChosenColors(chosenColors);
|
||||
chosenColors = chosenColors.stream().map(DeckRecognizer::getLocalisedMagicColorName).collect(Collectors.toList());
|
||||
p.getGame().getAction().notifyOfValue(sa, p, Lang.joinHomogenous(chosenColors), noNotify);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -303,10 +303,13 @@ public class ManaPool extends ManaConversionMatrix implements Iterable<Mana> {
|
||||
// Send all mana back to your mana pool, before accounting for it.
|
||||
|
||||
// move non-undoable paying mana back to floating
|
||||
|
||||
refundMana(sa.getPayingMana(), owner, sa);
|
||||
|
||||
List<SpellAbility> payingAbilities = sa.getPayingManaAbilities();
|
||||
|
||||
// start with the most recent
|
||||
Collections.reverse(payingAbilities);
|
||||
|
||||
for (final SpellAbility am : payingAbilities) {
|
||||
// undo paying abilities if we can
|
||||
am.undo();
|
||||
|
||||
@@ -561,7 +561,7 @@ public class TriggerHandler {
|
||||
sa.setTriggerRemembered(regtrig.getTriggerRemembered());
|
||||
|
||||
if (regtrig.hasParam("TriggerController")) {
|
||||
Player p = AbilityUtils.getDefinedPlayers(regtrig.getHostCard(), regtrig.getParam("TriggerController"), sa).get(0);
|
||||
Player p = AbilityUtils.getDefinedPlayers(host, regtrig.getParam("TriggerController"), sa).get(0);
|
||||
sa.setActivatingPlayer(p);
|
||||
}
|
||||
|
||||
|
||||
@@ -210,12 +210,12 @@ public class MagicStack /* extends MyObservable */ implements Iterable<SpellAbil
|
||||
for (SpellAbility sa : sas) {
|
||||
// reset in case a trigger stopped it on a previous activation
|
||||
sa.setUndoable(true);
|
||||
undoStack.remove(undoStack.lastIndexOf(sa));
|
||||
}
|
||||
undoStack.removeAll(sas);
|
||||
}
|
||||
public final void clearUndoStack() {
|
||||
if (undoStackOwner == null) { return; }
|
||||
clearUndoStack(undoStack);
|
||||
clearUndoStack(Lists.newArrayList(undoStack));
|
||||
undoStackOwner = null;
|
||||
}
|
||||
public Iterable<SpellAbility> filterUndoStackByHost(final Card c) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Name:Blood Divination
|
||||
ManaCost:3 B
|
||||
Types:Sorcery
|
||||
A:SP$ Draw | Cost$ 3 B Sac<1/Creature> | NumCards$ 3 | SpellDescription$ As an additional cost to cast this spell, sacrifice a creature. Draw three cards.
|
||||
A:SP$ Draw | Cost$ 3 B Sac<1/Creature> | NumCards$ 3 | SpellDescription$ Draw three cards.
|
||||
SVar:AIPreference:SacCost$Creature.token,Creature.cmcLE3
|
||||
Oracle:As an additional cost to cast this spell, sacrifice a creature.\nDraw three cards.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Name:Charge of the Forever-Beast
|
||||
ManaCost:2 G
|
||||
Types:Sorcery
|
||||
A:SP$ DealDamage | Cost$ 2 G Reveal<1/Creature> | ValidTgts$ Creature,Planeswalker | TgtPrompt$ Select target creature or planeswalker | NumDmg$ X | SpellDescription$ As an additional cost to cast this spell, reveal a creature card from your hand. CARDNAME deals damage to target creature or planeswalker equal to the revealed card's power.
|
||||
A:SP$ DealDamage | Cost$ 2 G Reveal<1/Creature> | ValidTgts$ Creature,Planeswalker | TgtPrompt$ Select target creature or planeswalker | NumDmg$ X | SpellDescription$ CARDNAME deals damage to target creature or planeswalker equal to the revealed card's power.
|
||||
SVar:X:Revealed$CardPower
|
||||
AI:RemoveDeck:All
|
||||
Oracle:As an additional cost to cast this spell, reveal a creature card from your hand.\nCharge of the Forever-Beast deals damage to target creature or planeswalker equal to the revealed card's power.
|
||||
|
||||
@@ -7,5 +7,4 @@ T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.S
|
||||
SVar:TrigExile:DB$ Dig | DigNum$ 1 | ChangeNum$ All | Defined$ Player | DestinationZone$ Exile | ExileWithCounter$ COLLECTION
|
||||
S:Mode$ Continuous | MayPlayLimit$ 1 | Affected$ Card.ExiledByYou+counters_GE1_COLLECTION | AffectedZone$ Exile | MayPlay$ True | MayPlayIgnoreColor$ True | Description$ Once each turn, you may play a card from exile with a collection counter on it if it was exiled by an ability you controlled, and you may spend mana as though it were any color to cast it.
|
||||
DeckHints:Type$Vampire
|
||||
Oracle:Flash\nWhenever Evelyn, the Covetous or another Vampire enters the battlefield under your control, exile the top card of each player's library with a collection counter on it.
|
||||
\nOnce each turn, you may play a card from exile with a collection counter on it if it was exiled by an ability you controlled, and you may spend mana as though it were mana of any color to cast it.
|
||||
Oracle:Flash\nWhenever Evelyn, the Covetous or another Vampire enters the battlefield under your control, exile the top card of each player's library with a collection counter on it.\nOnce each turn, you may play a card from exile with a collection counter on it if it was exiled by an ability you controlled, and you may spend mana as though it were mana of any color to cast it.
|
||||
@@ -1,7 +1,7 @@
|
||||
Name:Swallow Whole
|
||||
ManaCost:W
|
||||
Types:Sorcery
|
||||
A:SP$ ChangeZone | Cost$ W tapXType<1/Creature> | ValidTgts$ Creature.tapped | TgtPrompt$ Select target tapped creature | Origin$ Battlefield | Destination$ Exile | SubAbility$ DBPutCounter | SpellDescription$ As an additional cost to cast this spell, tap an untapped creature you control. Exile target tapped creature.
|
||||
A:SP$ ChangeZone | Cost$ W tapXType<1/Creature> | ValidTgts$ Creature.tapped | TgtPrompt$ Select target tapped creature | Origin$ Battlefield | Destination$ Exile | SubAbility$ DBPutCounter | SpellDescription$ Exile target tapped creature.
|
||||
SVar:DBPutCounter:DB$ PutCounter | Defined$ Tapped | CounterType$ P1P1 | SpellDescription$ Put a +1/+1 counter on the creature tapped to cast this spell.
|
||||
DeckHas:Ability$Counters
|
||||
Oracle:As an additional cost to cast this spell, tap an untapped creature you control.\nExile target tapped creature. Put a +1/+1 counter on the creature tapped to pay this spell's additional cost.
|
||||
|
||||
@@ -16,6 +16,7 @@ import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import forge.util.ImageUtil;
|
||||
@@ -49,6 +50,7 @@ import forge.card.mana.ManaCost;
|
||||
import forge.card.mana.ManaCostShard;
|
||||
import forge.deck.CardPool;
|
||||
import forge.deck.Deck;
|
||||
import forge.deck.DeckRecognizer;
|
||||
import forge.deck.DeckSection;
|
||||
import forge.game.Game;
|
||||
import forge.game.GameEntity;
|
||||
@@ -1712,8 +1714,10 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
|
||||
|
||||
@Override
|
||||
public List<String> chooseColors(final String message, final SpellAbility sa, final int min, final int max,
|
||||
final List<String> options) {
|
||||
return getGui().getChoices(message, min, max, options);
|
||||
List<String> options) {
|
||||
options = options.stream().map(DeckRecognizer::getLocalisedMagicColorName).collect(Collectors.toList());
|
||||
List<String> choices = getGui().getChoices(message, min, max, options);
|
||||
return choices.stream().map(DeckRecognizer::getColorNameByLocalisedName).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user