forked from External/mage
Refactored method in NaturesWill to not always return same value.
This commit is contained in:
parent
3ab65c1d86
commit
22d8a4ab36
1 changed files with 8 additions and 11 deletions
|
|
@ -84,19 +84,16 @@ class NaturesWillEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Set<UUID> damagedPlayers = (HashSet<UUID>) this.getValue("damagedPlayers");
|
||||
if (damagedPlayers == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
List<Permanent> lands = game.getBattlefield().getActivePermanents(StaticFilters.FILTER_LAND, source.getControllerId(), source.getSourceId(), game);
|
||||
for (Permanent land : lands) {
|
||||
if (damagedPlayers.contains(land.getControllerId())) {
|
||||
land.tap(game);
|
||||
} else if (land.getControllerId().equals(source.getControllerId())) {
|
||||
land.untap(game);
|
||||
if (damagedPlayers != null) {
|
||||
List<Permanent> lands = game.getBattlefield().getActivePermanents(StaticFilters.FILTER_LAND, source.getControllerId(), source.getSourceId(), game);
|
||||
for (Permanent land : lands) {
|
||||
if (damagedPlayers.contains(land.getControllerId())) {
|
||||
land.tap(game);
|
||||
} else if (land.getControllerId().equals(source.getControllerId())) {
|
||||
land.untap(game);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue