mirror of
https://github.com/correl/mage.git
synced 2025-03-13 01:09:53 -09:00
* Battlefield Thaumarurge - Fixed that the same creature was counted multiple times, if it was targeted multiple times.
This commit is contained in:
parent
925d533d5c
commit
b1a930cb4f
1 changed files with 5 additions and 3 deletions
|
@ -27,6 +27,8 @@
|
|||
*/
|
||||
package mage.sets.journeyintonyx;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
|
@ -103,16 +105,16 @@ class BattlefieldThaumaturgeSpellsCostReductionEffect extends CostModificationEf
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source, Ability abilityToModify) {
|
||||
int creatureTargets = 0;
|
||||
Set<UUID> creaturesTargeted = new HashSet<>();
|
||||
for (Target target: abilityToModify.getTargets()) {
|
||||
for (UUID uuid: target.getTargets()) {
|
||||
Permanent permanent = game.getPermanent(uuid);
|
||||
if (permanent != null && permanent.getCardType().contains(CardType.CREATURE)) {
|
||||
creatureTargets++;
|
||||
creaturesTargeted.add(permanent.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
CardUtil.reduceCost(abilityToModify, creatureTargets);
|
||||
CardUtil.reduceCost(abilityToModify, creaturesTargeted.size());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue