Merge branch 'fireball' into 'master'

Fix Fireball

Closes #1970

See merge request core-developers/forge!5333
This commit is contained in:
Michael Kamensky
2021-09-12 10:06:38 +00:00
12 changed files with 10 additions and 22 deletions

View File

@@ -137,7 +137,6 @@ public class EffectAi extends SpellAbilityAi {
} }
randomReturn = true; randomReturn = true;
} else if (logic.equals("Evasion")) { } else if (logic.equals("Evasion")) {
if (!phase.isPlayerTurn(ai)) { if (!phase.isPlayerTurn(ai)) {
return false; return false;
} }

View File

@@ -155,7 +155,6 @@ public enum AbilityKey {
} }
} }
return null; return null;
} }
public static <V> EnumMap<AbilityKey, V> newMap() { public static <V> EnumMap<AbilityKey, V> newMap() {

View File

@@ -451,7 +451,6 @@ public class AbilityUtils {
public static int calculateAmount(final Card card, String amount, final CardTraitBase ability) { public static int calculateAmount(final Card card, String amount, final CardTraitBase ability) {
return calculateAmount(card, amount, ability, false); return calculateAmount(card, amount, ability, false);
} }
public static int calculateAmount(final Card card, String amount, final CardTraitBase ability, boolean maxto) { public static int calculateAmount(final Card card, String amount, final CardTraitBase ability, boolean maxto) {
// return empty strings and constants // return empty strings and constants
if (StringUtils.isBlank(amount)) { return 0; } if (StringUtils.isBlank(amount)) { return 0; }

View File

@@ -175,7 +175,6 @@ public class CountersRemoveEffect extends SpellAbilityEffect {
String title = Localizer.getInstance().getMessage("lblSelectRemoveCountersNumberOfTarget", type); String title = Localizer.getInstance().getMessage("lblSelectRemoveCountersNumberOfTarget", type);
cntToRemove = pc.chooseNumber(sa, title, 0, cntToRemove, params); cntToRemove = pc.chooseNumber(sa, title, 0, cntToRemove, params);
} }
} }
if (cntToRemove > 0) { if (cntToRemove > 0) {
gameCard.subtractCounter(counterType, cntToRemove); gameCard.subtractCounter(counterType, cntToRemove);
@@ -199,7 +198,6 @@ public class CountersRemoveEffect extends SpellAbilityEffect {
} }
} }
protected void removeAnyType(GameEntity entity, int cntToRemove, SpellAbility sa) { protected void removeAnyType(GameEntity entity, int cntToRemove, SpellAbility sa) {
boolean rememberRemoved = sa.hasParam("RememberRemoved"); boolean rememberRemoved = sa.hasParam("RememberRemoved");

View File

@@ -45,8 +45,7 @@ public class DigEffect extends SpellAbilityEffect {
if (tgtPlayers.contains(host.getController())) { if (tgtPlayers.contains(host.getController())) {
sb.append("their "); sb.append("their ");
} } else {
else {
for (final Player p : tgtPlayers) { for (final Player p : tgtPlayers) {
sb.append(Lang.getInstance().getPossesive(p.getName())).append(" "); sb.append(Lang.getInstance().getPossesive(p.getName())).append(" ");
} }
@@ -323,8 +322,7 @@ public class DigEffect extends SpellAbilityEffect {
libraryPosition = zone.size(); libraryPosition = zone.size();
} }
c = game.getAction().moveTo(zone, c, libraryPosition, sa); c = game.getAction().moveTo(zone, c, libraryPosition, sa);
} } else {
else {
c = game.getAction().moveTo(zone, c, sa); c = game.getAction().moveTo(zone, c, sa);
if (destZone1.equals(ZoneType.Battlefield)) { if (destZone1.equals(ZoneType.Battlefield)) {
if (sa.hasParam("Tapped")) { if (sa.hasParam("Tapped")) {
@@ -383,8 +381,7 @@ public class DigEffect extends SpellAbilityEffect {
Card m; Card m;
if (destZone2 == ZoneType.Library) { if (destZone2 == ZoneType.Library) {
m = game.getAction().moveToLibrary(c, libraryPosition2, sa); m = game.getAction().moveToLibrary(c, libraryPosition2, sa);
} } else {
else {
m = game.getAction().moveToVariantDeck(c, destZone2, libraryPosition2, sa); m = game.getAction().moveToVariantDeck(c, destZone2, libraryPosition2, sa);
} }
if (m != null && !origin.equals(m.getZone().getZoneType())) { if (m != null && !origin.equals(m.getZone().getZoneType())) {
@@ -394,8 +391,7 @@ public class DigEffect extends SpellAbilityEffect {
host.addRemembered(m); host.addRemembered(m);
} }
} }
} } else {
else {
// just move them randomly // just move them randomly
for (int i = 0; i < rest.size(); i++) { for (int i = 0; i < rest.size(); i++) {
Card c = rest.get(i); Card c = rest.get(i);

View File

@@ -34,8 +34,7 @@ public class ReorderZoneEffect extends SpellAbilityEffect {
if (shuffle) { if (shuffle) {
Collections.shuffle(list, MyRandom.getRandom()); Collections.shuffle(list, MyRandom.getRandom());
p.getZone(zone).setCards(list); p.getZone(zone).setCards(list);
} } else {
else {
p.getController().orderMoveToZoneList(list, zone, sa); p.getController().orderMoveToZoneList(list, zone, sa);
} }
} }

View File

@@ -81,7 +81,6 @@ public class ReplacementHandler {
//private final List<ReplacementEffect> tmpEffects = new ArrayList<ReplacementEffect>(); //private final List<ReplacementEffect> tmpEffects = new ArrayList<ReplacementEffect>();
public List<ReplacementEffect> getReplacementList(final ReplacementType event, final Map<AbilityKey, Object> runParams, final ReplacementLayer layer) { public List<ReplacementEffect> getReplacementList(final ReplacementType event, final Map<AbilityKey, Object> runParams, final ReplacementLayer layer) {
final CardCollection preList = new CardCollection(); final CardCollection preList = new CardCollection();
boolean checkAgain = false; boolean checkAgain = false;
Card affectedLKI = null; Card affectedLKI = null;

View File

@@ -2,7 +2,7 @@ Name:Fireball
ManaCost:X R ManaCost:X R
Types:Sorcery Types:Sorcery
A:SP$ DealDamage | Cost$ X R | ValidTgts$ Creature,Player,Planeswalker | TgtPrompt$ Select any target | NumDmg$ X | TargetMin$ 0 | TargetMax$ MaxTargets | DivideEvenly$ RoundedDown | SpellDescription$ This spell costs {1} more to cast for each target beyond the first. A:SP$ DealDamage | Cost$ X R | ValidTgts$ Creature,Player,Planeswalker | TgtPrompt$ Select any target | NumDmg$ X | TargetMin$ 0 | TargetMax$ MaxTargets | DivideEvenly$ RoundedDown | SpellDescription$ This spell costs {1} more to cast for each target beyond the first.
S:Mode$ RaiseCost | ValidCard$ Card.Self | Type$ Spell | Amount$ IncreaseCost | EffectZone$ All | Description$ CARDNAME deals X damage divided evenly, rounded down, among any number of targets. S:Mode$ RaiseCost | ValidCard$ Card.Self | Type$ Spell | Amount$ IncreaseCost | AffectedAmount$ True | EffectZone$ All | Description$ CARDNAME deals X damage divided evenly, rounded down, among any number of targets.
SVar:X:Count$xPaid SVar:X:Count$xPaid
SVar:MaxTargets:SVar$Maxplayer/Plus.Maxcreatureorplaneswalker SVar:MaxTargets:SVar$Maxplayer/Plus.Maxcreatureorplaneswalker
SVar:Maxplayer:PlayerCountPlayers$Amount SVar:Maxplayer:PlayerCountPlayers$Amount

View File

@@ -720,8 +720,7 @@ public class HumanCostDecision extends CostDecisionMakerBase {
final CardView view = CardView.get(card); final CardView view = CardView.get(card);
return player.getController().confirmPayment(cost, Localizer.getInstance().getMessage("lblReturnCardToHandConfirm", CardTranslation.getTranslatedName(view.getName())), ability) ? PaymentDecision.card(card) : null; return player.getController().confirmPayment(cost, Localizer.getInstance().getMessage("lblReturnCardToHandConfirm", CardTranslation.getTranslatedName(view.getName())), ability) ? PaymentDecision.card(card) : null;
} }
} } else {
else {
final CardCollectionView validCards = CardLists.getValidCards(ability.getActivatingPlayer().getCardsIn(ZoneType.Battlefield), final CardCollectionView validCards = CardLists.getValidCards(ability.getActivatingPlayer().getCardsIn(ZoneType.Battlefield),
cost.getType().split(";"), player, source, ability); cost.getType().split(";"), player, source, ability);