mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
Merge pull request #3962 from Northmoc/WHO-fixed
WHO: fixed_point_in_time.txt and support
This commit is contained in:
@@ -1,22 +1,36 @@
|
||||
package forge.game.ability.effects;
|
||||
|
||||
import forge.game.Game;
|
||||
import forge.game.ability.AbilityKey;
|
||||
import forge.game.ability.AbilityUtils;
|
||||
import forge.game.ability.SpellAbilityEffect;
|
||||
import forge.game.card.CardCollectionView;
|
||||
import forge.game.player.Player;
|
||||
import forge.game.replacement.ReplacementResult;
|
||||
import forge.game.replacement.ReplacementType;
|
||||
import forge.game.spellability.SpellAbility;
|
||||
import forge.util.Localizer;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
public class PlaneswalkEffect extends SpellAbilityEffect {
|
||||
@Override
|
||||
public void resolve(SpellAbility sa) {
|
||||
Game game = sa.getActivatingPlayer().getGame();
|
||||
Player activator = sa.getActivatingPlayer();
|
||||
Game game = activator.getGame();
|
||||
|
||||
if (game.getActivePlanes() == null) { // not a planechase game, nothing happens
|
||||
return;
|
||||
}
|
||||
|
||||
final Map<AbilityKey, Object> repParams = AbilityKey.mapFromAffected(activator);
|
||||
Object cause = sa.hasParam("Cause") ? sa.getParam("Cause") : sa;
|
||||
repParams.put(AbilityKey.Cause, cause);
|
||||
if (game.getReplacementHandler().run(ReplacementType.Planeswalk, repParams) == ReplacementResult.Replaced) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (sa.hasParam("Optional") && !sa.getActivatingPlayer().getController().confirmAction(sa, null,
|
||||
Localizer.getInstance().getMessage("lblWouldYouLikeToPlaneswalk"), null)) {
|
||||
return;
|
||||
|
||||
@@ -329,7 +329,7 @@ public class CardFactory {
|
||||
String trigger = "Mode$ PlanarDice | Result$ Planeswalk | TriggerZones$ Command | Secondary$ True | " +
|
||||
"TriggerDescription$ Whenever you roll the Planeswalker symbol on the planar die, planeswalk.";
|
||||
|
||||
String rolledWalk = "DB$ Planeswalk";
|
||||
String rolledWalk = "DB$ Planeswalk | Cause$ PlanarDie";
|
||||
|
||||
Trigger planesWalkTrigger = TriggerHandler.parseTrigger(trigger, card, true);
|
||||
planesWalkTrigger.setOverridingAbility(AbilityFactory.getAbility(rolledWalk, card));
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
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 ReplacePlaneswalk extends ReplacementEffect {
|
||||
|
||||
public ReplacePlaneswalk(final Map<String, String> mapParams, final Card host, final boolean intrinsic) {
|
||||
super(mapParams, host, intrinsic);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canReplace(Map<AbilityKey, Object> runParams) {
|
||||
if (!matchesValidParam("ValidCause", runParams.get(AbilityKey.Cause))) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setReplacingObjects(Map<AbilityKey, Object> runParams, SpellAbility sa) {
|
||||
sa.setReplacingObject(AbilityKey.Cause, runParams.get(AbilityKey.Cause));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -35,6 +35,7 @@ public enum ReplacementType {
|
||||
Moved(ReplaceMoved.class),
|
||||
PayLife(ReplacePayLife.class),
|
||||
PlanarDiceResult(ReplacePlanarDiceResult.class),
|
||||
Planeswalk(ReplacePlaneswalk.class),
|
||||
ProduceMana(ReplaceProduceMana.class),
|
||||
Proliferate(ReplaceProliferate.class),
|
||||
RemoveCounter(ReplaceRemoveCounter.class),
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
Name:Fixed Point in Time
|
||||
ManaCost:no cost
|
||||
Types:Phenomenon
|
||||
T:Mode$ PlaneswalkedTo | ValidCard$ Card.Self | Execute$ TrigEffect | TriggerDescription$ When you encounter CARDNAME, until your next turn, if a player would planeswalk as a result of rolling the planar die, chaos ensues instead. (Then planeswalk away from this phenomenon.)
|
||||
SVar:TrigEffect:DB$ Effect | ReplacementEffects$ ReplacePlaneswalk | Duration$ UntilYourNextTurn | SubAbility$ PWAway
|
||||
SVar:ReplacePlaneswalk:Event$ Planeswalk | ValidCause$ PlanarDie | ReplaceWith$ Chaos | Description$ If a player would planeswalk as a result of rolling the planar die, chaos ensues instead.
|
||||
SVar:Chaos:DB$ ChaosEnsues
|
||||
SVar:PWAway:DB$ Planeswalk
|
||||
Oracle:When you encounter Fixed Point in Time, until your next turn, if a player would planeswalk as a result of rolling the planar die, chaos ensues instead. (Then planeswalk away from this phenomenon.)
|
||||
Reference in New Issue
Block a user