mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
@@ -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));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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)) {
|
||||||
|
|||||||
@@ -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.)
|
||||||
|
|||||||
Reference in New Issue
Block a user