* Oath of Kaya - fixed that it doesn't triggers on attacks;

This commit is contained in:
Oleg Agafonov 2019-04-24 21:41:24 +04:00
parent 9ad7c4c83d
commit e51b054249
3 changed files with 126 additions and 52 deletions

View file

@ -1539,6 +1539,18 @@ public class Combat implements Serializable, Copyable<Combat> {
return false;
}
public boolean isPlaneswalkerAttacked(UUID defenderId, Game game) {
for (CombatGroup group : groups) {
if (group.defenderIsPlaneswalker) {
Permanent permanent = game.getPermanent(group.getDefenderId());
if (permanent.isControlledBy(defenderId)) {
return true;
}
}
}
return false;
}
/**
* @param attackerId
* @return uuid of defending player or planeswalker