mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
LCI – ReplaceExplore cards and support
This commit is contained in:
@@ -14,6 +14,8 @@ import forge.game.card.CardCollection;
|
||||
import forge.game.card.CardZoneTable;
|
||||
import forge.game.card.CounterEnumType;
|
||||
import forge.game.player.Player;
|
||||
import forge.game.replacement.ReplacementResult;
|
||||
import forge.game.replacement.ReplacementType;
|
||||
import forge.game.spellability.SpellAbility;
|
||||
import forge.game.trigger.TriggerType;
|
||||
import forge.game.zone.Zone;
|
||||
@@ -53,6 +55,11 @@ public class ExploreEffect extends SpellAbilityEffect {
|
||||
moveParams.put(AbilityKey.LastStateBattlefield, sa.getLastStateBattlefield());
|
||||
moveParams.put(AbilityKey.LastStateGraveyard, sa.getLastStateGraveyard());
|
||||
for (final Card c : getTargetCards(sa)) {
|
||||
|
||||
if (game.getReplacementHandler().run(ReplacementType.Explore, AbilityKey.mapFromAffected(c)) != ReplacementResult.NotReplaced) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// revealed land card
|
||||
boolean revealedLand = false;
|
||||
final Player pl = c.getController();
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package forge.game.replacement;
|
||||
|
||||
import forge.game.ability.AbilityKey;
|
||||
import forge.game.card.Card;
|
||||
import forge.game.spellability.SpellAbility;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class ReplaceExplore extends ReplacementEffect {
|
||||
|
||||
public ReplaceExplore(final Map<String, String> params, final Card host, final boolean intrinsic) {
|
||||
super(params, host, intrinsic);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canReplace(Map<AbilityKey, Object> runParams) {
|
||||
if (!matchesValidParam("ValidExplorer", runParams.get(AbilityKey.Affected))) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setReplacingObjects(Map<AbilityKey, Object> runParams, SpellAbility sa) {
|
||||
sa.setReplacingObject(AbilityKey.Card, runParams.get(AbilityKey.Affected));
|
||||
}
|
||||
}
|
||||
@@ -26,6 +26,7 @@ public enum ReplacementType {
|
||||
Discard(ReplaceDiscard.class),
|
||||
Draw(ReplaceDraw.class),
|
||||
DrawCards(ReplaceDrawCards.class),
|
||||
Explore(ReplaceExplore.class),
|
||||
GainLife(ReplaceGainLife.class),
|
||||
GameLoss(ReplaceGameLoss.class),
|
||||
Learn(ReplaceLearn.class),
|
||||
|
||||
Reference in New Issue
Block a user