[VOW] Implemented Screaming Swarm

This commit is contained in:
Evan Kranzler 2021-11-08 08:04:16 -05:00
parent 7970eecc47
commit 10185a0999
3 changed files with 123 additions and 3 deletions

View file

@ -49,14 +49,22 @@ public class AttacksWithCreaturesTriggeredAbility extends TriggeredAbilityImpl {
@Override
public boolean checkTrigger(GameEvent event, Game game) {
return isControlledBy(game.getCombat().getAttackingPlayerId())
&& game
if (!isControlledBy(game.getCombat().getAttackingPlayerId())) {
return false;
}
int attackers = game
.getCombat()
.getAttackers()
.stream()
.map(game::getPermanent)
.filter(permanent -> filter.match(permanent, sourceId, controllerId, game))
.mapToInt(x -> 1).sum() >= minAttackers;
.mapToInt(x -> 1)
.sum();
if (attackers < minAttackers) {
return false;
}
getEffects().setValue("attackers", attackers);
return true;
}
@Override