- Fixed Soul-Scar Mage. Bug #3163

This commit is contained in:
Jeff 2017-04-19 11:02:27 -05:00
parent 04c80c27a3
commit 10a043f19b

View file

@ -114,8 +114,14 @@ class SoulScarMageDamageReplacementEffect extends ReplacementEffectImpl {
@Override @Override
public boolean applies(GameEvent event, Ability source, Game game) { public boolean applies(GameEvent event, Ability source, Game game) {
boolean weControlSource = game.getControllerId(event.getSourceId()).equals(source.getControllerId()); UUID sourceControllerId = game.getControllerId(event.getSourceId());
boolean isNoncombatDamage = !((DamageCreatureEvent)event).isCombatDamage(); UUID targetControllerId = game.getControllerId(event.getTargetId());
return weControlSource && isNoncombatDamage; UUID controllerId = source.getControllerId();
boolean weControlSource = controllerId == sourceControllerId;
boolean opponentControlsTarget = game.getOpponents(sourceControllerId).contains(targetControllerId);
boolean isNoncombatDamage = !((DamageCreatureEvent) event).isCombatDamage();
return weControlSource
&& isNoncombatDamage
&& opponentControlsTarget;
} }
} }