mirror of
https://github.com/magefree/mage.git
synced 2025-12-21 19:11:59 -08:00
Fix #9476
This commit is contained in:
parent
a5621cf247
commit
f991e94e9b
1 changed files with 10 additions and 1 deletions
|
|
@ -84,10 +84,19 @@ class SoulScarMageDamageReplacementEffect extends ReplacementEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
// If a source you control...
|
||||
if (!source.isControlledBy(game.getControllerId(event.getSourceId()))) {
|
||||
return false;
|
||||
}
|
||||
// ...would deal noncombat damage...
|
||||
if (((DamageEvent) event).isCombatDamage()) {
|
||||
return false;
|
||||
}
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
return permanent != null
|
||||
// ...to a creature...
|
||||
&& permanent.isCreature(game)
|
||||
&& !((DamageEvent) event).isCombatDamage()
|
||||
// ...an opponent controls
|
||||
&& game.getOpponents(permanent.getControllerId()).contains(source.getControllerId());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue