mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
- Added Imprison
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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