Fix Bamboozling Beebles (#5531)

Co-authored-by: TRT <>
This commit is contained in:
tool4ever
2024-07-06 17:05:06 +02:00
committed by GitHub
parent b1f318e763
commit 10b78114bb
3 changed files with 12 additions and 15 deletions

View File

@@ -3,7 +3,6 @@ package forge.game.ability.effects;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.google.common.collect.Maps;
import forge.game.GameObject; import forge.game.GameObject;
import forge.game.PlanarDice; import forge.game.PlanarDice;
import forge.game.ability.AbilityKey; import forge.game.ability.AbilityKey;
@@ -45,11 +44,10 @@ public class ReplaceEffect extends SpellAbilityEffect {
} else if ("PlanarDice".equals(type)) { } else if ("PlanarDice".equals(type)) {
params.put(varName, PlanarDice.smartValueOf(varValue)); params.put(varName, PlanarDice.smartValueOf(varValue));
} else if ("Map".equals(type)) { } else if ("Map".equals(type)) {
Map<Player, Integer> m = Maps.newHashMap(); Map<Player, Integer> m = (Map<Player, Integer>) sa.getReplacingObject(varName);
for (Player key : AbilityUtils.getDefinedPlayers(card, sa.getParam("VarKey"), sa)) { for (Player key : AbilityUtils.getDefinedPlayers(card, sa.getParam("VarKey"), sa)) {
m.put(key, AbilityUtils.calculateAmount(card, varValue, sa)); m.put(key, m.getOrDefault(key, 0) + AbilityUtils.calculateAmount(card, varValue, sa));
} }
params.put(varName, m);
} else { } else {
params.put(varName, AbilityUtils.calculateAmount(card, varValue, sa)); params.put(varName, AbilityUtils.calculateAmount(card, varValue, sa));
} }

View File

@@ -584,21 +584,20 @@ public class CardProperty {
} }
} }
} else if (property.startsWith("EquippedBy") || property.startsWith("AttachedBy")) { } else if (property.startsWith("EquippedBy") || property.startsWith("AttachedBy")) {
if (property.substring(10).equals("Targeted")) { String prop = property.substring(10);
for (final Card c : AbilityUtils.getDefinedCards(source, "Targeted", spellAbility)) { if (prop.equals("Enchanted")) {
if (!card.hasCardAttachment(c)) {
return false;
}
}
} else if (property.substring(10).equals("Enchanted")) {
if (source.getEnchantingCard() == null || if (source.getEnchantingCard() == null ||
!card.hasCardAttachment(source.getEnchantingCard())) { !card.hasCardAttachment(source.getEnchantingCard())) {
return false; return false;
} }
} else { } else if (!StringUtils.isBlank(prop)) {
if (!card.hasCardAttachment(source)) { for (final Card c : AbilityUtils.getDefinedCards(source, prop, spellAbility)) {
return false; if (!card.hasCardAttachment(c)) {
return false;
}
} }
} else if (!card.hasCardAttachment(source)) {
return false;
} }
} else if (property.startsWith("FortifiedBy")) { } else if (property.startsWith("FortifiedBy")) {
if (!card.hasCardAttachment(source)) { if (!card.hasCardAttachment(source)) {

View File

@@ -1,5 +1,5 @@
Name:Havi, the All-Father Name:Havi, the All-Father
ManaCost:3 R W ManaCost:3 R G W
Types:Legendary Creature God Warrior Types:Legendary Creature God Warrior
PT:6/6 PT:6/6
S:Mode$ Continuous | Affected$ Card.Self | IsPresent$ Card.Historic+YouOwn | PresentZone$ Graveyard | PresentCompare$ GE4 | AddKeyword$ Indestructible | Description$ CARDNAME has indestructible as long as there are four or more historic cards in your graveyard. (Artifacts, legendaries, and Sagas are historic.) S:Mode$ Continuous | Affected$ Card.Self | IsPresent$ Card.Historic+YouOwn | PresentZone$ Graveyard | PresentCompare$ GE4 | AddKeyword$ Indestructible | Description$ CARDNAME has indestructible as long as there are four or more historic cards in your graveyard. (Artifacts, legendaries, and Sagas are historic.)