mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
Update ReplacementMill
This commit is contained in:
@@ -1670,21 +1670,22 @@ 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;
|
||||||
case Updated:
|
case Updated:
|
||||||
// check if this is still the affected player
|
// check if this is still the affected player
|
||||||
if (this.equals(repRunParams.get(AbilityKey.Affected))) {
|
if (this.equals(repRunParams.get(AbilityKey.Affected))) {
|
||||||
n = (int) repRunParams.get(AbilityKey.Number);
|
n = (int) repRunParams.get(AbilityKey.Number);
|
||||||
} else {
|
} else {
|
||||||
return milled;
|
return milled;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return milled;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return milled;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
final int max = Math.min(n, lib.size());
|
final int max = Math.min(n, lib.size());
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user