Update ReplacementMill

This commit is contained in:
swordshine
2020-06-26 16:46:14 +08:00
parent 5fc1f92309
commit 01183c454b
2 changed files with 15 additions and 19 deletions

View File

@@ -1670,8 +1670,8 @@ public class Player extends GameEntity implements Comparable<Player> {
// Replacement effects // Replacement effects
final Map<AbilityKey, Object> repRunParams = AbilityKey.mapFromAffected(this); final Map<AbilityKey, Object> repRunParams = AbilityKey.mapFromAffected(this);
repRunParams.put(AbilityKey.Number, n); repRunParams.put(AbilityKey.Number, n);
repRunParams.put(AbilityKey.Destination, destination);
if (destination == ZoneType.Graveyard && !bottom) {
switch (getGame().getReplacementHandler().run(ReplacementType.Mill, repRunParams)) { switch (getGame().getReplacementHandler().run(ReplacementType.Mill, repRunParams)) {
case NotReplaced: case NotReplaced:
break; break;
@@ -1686,6 +1686,7 @@ public class Player extends GameEntity implements Comparable<Player> {
default: default:
return milled; return milled;
} }
}
final int max = Math.min(n, lib.size()); final int max = Math.min(n, lib.size());

View File

@@ -20,8 +20,6 @@ package forge.game.replacement;
import forge.game.ability.AbilityKey; import forge.game.ability.AbilityKey;
import forge.game.card.Card; import forge.game.card.Card;
import forge.game.spellability.SpellAbility; import forge.game.spellability.SpellAbility;
import forge.game.zone.ZoneType;
import java.util.Map; import java.util.Map;
/** /**
@@ -46,9 +44,6 @@ public class ReplaceMill extends ReplacementEffect {
@Override @Override
public boolean canReplace(Map<AbilityKey, Object> runParams) { public boolean canReplace(Map<AbilityKey, Object> runParams) {
if (ZoneType.Graveyard != ((ZoneType) runParams.get(AbilityKey.Destination))) {
return false;
}
if (hasParam("ValidPlayer")) { if (hasParam("ValidPlayer")) {
if (!matchesValid(runParams.get(AbilityKey.Affected), getParam("ValidPlayer").split(","), getHostCard())) { if (!matchesValid(runParams.get(AbilityKey.Affected), getParam("ValidPlayer").split(","), getHostCard())) {
return false; return false;