mirror of
https://github.com/magefree/mage.git
synced 2026-01-25 04:39:18 -08:00
fixed Curtain of Light targeting, updated how being unblocked is checked
This commit is contained in:
parent
3b0b923b7c
commit
2733d736d5
5 changed files with 19 additions and 22 deletions
|
|
@ -41,7 +41,7 @@ import mage.constants.TurnPhase;
|
|||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.permanent.AttackingPredicate;
|
||||
import mage.filter.predicate.permanent.BlockingPredicate;
|
||||
import mage.filter.predicate.permanent.BlockedPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.combat.CombatGroup;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
|
@ -58,11 +58,11 @@ public class CurtainOfLight extends CardImpl {
|
|||
|
||||
static {
|
||||
filter.add(new AttackingPredicate());
|
||||
filter.add(Predicates.not(new BlockingPredicate()));
|
||||
filter.add(Predicates.not(new BlockedPredicate()));
|
||||
}
|
||||
|
||||
public CurtainOfLight(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{W}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{W}");
|
||||
|
||||
// Cast Curtain of Light only during combat after blockers are declared.
|
||||
this.addAbility(new CastOnlyDuringPhaseStepSourceAbility(TurnPhase.COMBAT, AfterBlockersAreDeclaredCondition.instance));
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ import mage.constants.Duration;
|
|||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.combat.CombatGroup;
|
||||
import mage.game.events.DamagePlayerEvent;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
|
@ -95,17 +94,8 @@ class WeatheredBodyguardsEffect extends ReplacementEffectImpl {
|
|||
DamagePlayerEvent damageEvent = (DamagePlayerEvent) event;
|
||||
Permanent damager = game.getPermanentOrLKIBattlefield(damageEvent.getSourceId());
|
||||
Permanent p = game.getPermanent(source.getSourceId());
|
||||
boolean applyIt = false;
|
||||
if (p != null && !p.isTapped() && damageEvent.isCombatDamage() && damager != null && damager.isAttacking()) {
|
||||
for (CombatGroup cg : game.getCombat().getGroups()) {
|
||||
if (cg.getAttackers().contains(damager.getId()) && !cg.getBlocked()) {
|
||||
applyIt = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (applyIt) {
|
||||
p.damage(damageEvent.getAmount(), event.getSourceId(), game, damageEvent.isCombatDamage(), damageEvent.isPreventable());
|
||||
}
|
||||
if (p != null && !p.isTapped() && damageEvent.isCombatDamage() && damager != null && damager.isAttacking() && !damager.isBlocked(game)) {
|
||||
p.damage(damageEvent.getAmount(), event.getSourceId(), game, damageEvent.isCombatDamage(), damageEvent.isPreventable());
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue