mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
Merge branch 'master' of git.cardforge.org:core-developers/forge
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package forge.game.ability.effects;
|
||||
|
||||
import forge.game.Game;
|
||||
import forge.game.ability.AbilityUtils;
|
||||
import forge.game.ability.SpellAbilityEffect;
|
||||
import forge.game.card.Card;
|
||||
import forge.game.card.CardCollection;
|
||||
@@ -38,18 +39,21 @@ public class RemoveFromCombatEffect extends SpellAbilityEffect {
|
||||
final Combat combat = game.getPhaseHandler().getCombat();
|
||||
if (combat != null && (tgt == null || c.canBeTargetedBy(sa))) {
|
||||
// Unblock creatures that were blocked only by this card (e.g. Ydwen Efreet)
|
||||
if (sa.hasParam("UnblockCreaturesBlockedOnlyBySelf")) {
|
||||
CardCollection blockedBySelf = combat.getAttackersBlockedBy(sa.getHostCard());
|
||||
for (Card atk : blockedBySelf) {
|
||||
boolean blockedOnlyBySelf = true;
|
||||
for (Card blocker : combat.getBlockers(atk)) {
|
||||
if (!blocker.equals(sa.getHostCard())) {
|
||||
blockedOnlyBySelf = false;
|
||||
break;
|
||||
if (sa.hasParam("UnblockCreaturesBlockedOnlyBy")) {
|
||||
CardCollection attackers = AbilityUtils.getDefinedCards(sa.getHostCard(), sa.getParam("UnblockCreaturesBlockedOnlyBy"), sa);
|
||||
if (!attackers.isEmpty()) {
|
||||
CardCollection blockedByCard = combat.getAttackersBlockedBy(attackers.getFirst());
|
||||
for (Card atk : blockedByCard) {
|
||||
boolean blockedOnlyByCard = true;
|
||||
for (Card blocker : combat.getBlockers(atk)) {
|
||||
if (!blocker.equals(attackers.getFirst())) {
|
||||
blockedOnlyByCard = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (blockedOnlyByCard) {
|
||||
combat.setBlocked(atk, false);
|
||||
}
|
||||
}
|
||||
if (blockedOnlyBySelf) {
|
||||
combat.setBlocked(atk, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,21 +188,13 @@ public class CardProperty {
|
||||
Player p = property.endsWith("Ctrl") ? controller : card.getOwner();
|
||||
if (!source.hasRemembered()) {
|
||||
final Card newCard = game.getCardState(source);
|
||||
for (final Object o : newCard.getRemembered()) {
|
||||
if (o instanceof Player) {
|
||||
if (!p.equals(o)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (!newCard.isRemembered(p)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
for (final Object o : source.getRemembered()) {
|
||||
if (o instanceof Player) {
|
||||
if (!p.equals(o)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (!source.isRemembered(p)) {
|
||||
return false;
|
||||
}
|
||||
} else if (property.startsWith("nonRememberedPlayerCtrl")) {
|
||||
if (!source.hasRemembered()) {
|
||||
|
||||
@@ -160,6 +160,13 @@ public class TriggerSpellAbilityCast extends Trigger {
|
||||
}
|
||||
}
|
||||
|
||||
if (hasParam("HasTapCost")) {
|
||||
final Cost cost = (Cost) (runParams2.get("Cost"));
|
||||
if (!cost.hasTapCost()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (hasParam("Conspire")) {
|
||||
if (!spellAbility.isOptionalCostPaid(OptionalCost.Conspire)) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user