Merge pull request #6249 from Dilnu/Mogis

Fix Mogis God of Slaughter's ability when a player has no creatures.
This commit is contained in:
Oleg Agafonov 2020-02-03 22:07:40 +01:00 committed by GitHub
commit 8ab21be00c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -77,9 +77,12 @@ class MogisGodOfSlaughterEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(game.getActivePlayerId());
if (player == null || game.getBattlefield().countAll(StaticFilters.FILTER_PERMANENT_CREATURE, game.getActivePlayerId(), game) == 0) {
if (player == null) {
return false;
}
if (game.getBattlefield().countAll(StaticFilters.FILTER_PERMANENT_CREATURE, game.getActivePlayerId(), game) == 0) {
return player.damage(2, source.getSourceId(), game) > 0;
}
TargetPermanent target = new TargetControlledCreaturePermanent(1);
target.setNotTarget(true);
if (target.canChoose(player.getId(), game)