prevent direct access of Player->counters ; some cleanup on counter removal effects ; implement [MH3] Izzet Generatorium (#12314)

This commit is contained in:
Susucre 2024-05-29 22:34:54 +02:00 committed by GitHub
parent 8d02ff14ff
commit 20b7a115da
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
110 changed files with 895 additions and 646 deletions

View file

@ -66,7 +66,7 @@ enum RadiationCondition implements Condition {
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
return player != null && player.getCounters().getCount(CounterType.RAD) > 0;
return player != null && player.getCountersCount(CounterType.RAD) > 0;
}
}
@ -102,13 +102,13 @@ class RadiationEffect extends OneShotEffect {
if (player == null) {
return false;
}
int amount = player.getCounters().getCount(CounterType.RAD);
int amount = player.getCountersCount(CounterType.RAD);
Cards milled = player.millCards(amount, source, game);
int countNonLand = milled.count(StaticFilters.FILTER_CARD_NON_LAND, player.getId(), source, game);
if (countNonLand > 0) {
// TODO: support gaining life instead with [[Strong, the Brutish Thespian]]
player.loseLife(countNonLand, game, source, false);
player.removeCounters(CounterType.RAD.getName(), countNonLand, source, game);
player.loseCounters(CounterType.RAD.getName(), countNonLand, source, game);
}
return true;
}