mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +00:00
Fix certain planes by triggering once for each plane left when planeswalking.
This commit is contained in:
@@ -20,6 +20,7 @@ package forge.game.player;
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.Iterables;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
@@ -2291,20 +2292,19 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
* Puts my currently active planes, if any, at the bottom of my planar deck.
|
||||
*/
|
||||
public void leaveCurrentPlane() {
|
||||
if (!currentPlanes.isEmpty()) {
|
||||
for (final Card plane : currentPlanes) {
|
||||
//Run PlaneswalkedFrom triggers here.
|
||||
HashMap<String,Object> runParams = new HashMap<String,Object>();
|
||||
runParams.put("Card", new CardCollection(currentPlanes));
|
||||
final Map<String, Object> runParams = new ImmutableMap.Builder<String, Object>().put("Card", plane).build();
|
||||
game.getTriggerHandler().runTrigger(TriggerType.PlaneswalkedFrom, runParams,false);
|
||||
|
||||
for (Card c : currentPlanes) {
|
||||
game.getZoneOf(c).remove(c);
|
||||
c.clearControllers();
|
||||
getZone(ZoneType.PlanarDeck).add(c);
|
||||
}
|
||||
currentPlanes.clear();
|
||||
}
|
||||
|
||||
for (final Card plane : currentPlanes) {
|
||||
game.getZoneOf(plane).remove(plane);
|
||||
plane.clearControllers();
|
||||
getZone(ZoneType.PlanarDeck).add(plane);
|
||||
}
|
||||
currentPlanes.clear();
|
||||
|
||||
//DBG
|
||||
//System.out.println("CurrentPlanes: " + currentPlanes);
|
||||
//System.out.println("ActivePlanes: " + game.getActivePlanes());
|
||||
|
||||
@@ -26,37 +26,30 @@ public class TriggerPlaneswalkedFrom extends Trigger {
|
||||
public TriggerPlaneswalkedFrom(final Map<String, String> params, final Card host, final boolean intrinsic) {
|
||||
super(params, host, intrinsic);
|
||||
}
|
||||
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see forge.card.trigger.Trigger#performTest(java.util.Map)
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public boolean performTest(Map<String, Object> runParams2) {
|
||||
public boolean performTest(final Map<String, Object> runParams2) {
|
||||
if (this.mapParams.containsKey("ValidCard")) {
|
||||
for(Card moved : (Iterable<Card>)runParams2.get("Card"))
|
||||
{
|
||||
if (moved.isValid(this.mapParams.get("ValidCard").split(","), this.getHostCard().getController(),
|
||||
this.getHostCard())) {
|
||||
return true;
|
||||
}
|
||||
final Card moved = (Card) runParams2.get("Card");
|
||||
if (moved.isValid(this.mapParams.get("ValidCard").split(","), this
|
||||
.getHostCard().getController(), this.getHostCard())) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see forge.card.trigger.Trigger#setTriggeringObjects(forge.card.spellability.SpellAbility)
|
||||
*/
|
||||
@Override
|
||||
public void setTriggeringObjects(SpellAbility sa) {
|
||||
sa.setTriggeringObject("Cards", this.getRunParams().get("Card"));
|
||||
// The 'Card' triggered object above is actually an array list of the current planes being left,
|
||||
// so the actual source has to be determined differently than usual
|
||||
sa.setTriggeringObject("Source", this.hostCard);
|
||||
public void setTriggeringObjects(final SpellAbility sa) {
|
||||
sa.setTriggeringObject("Card", this.getRunParams().get("Card"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ SVar:Eruption:AB$ DamageAll | Cost$ 0 | ValidCards$ Creature,Planeswalker | Vali
|
||||
T:Mode$ PlanarDice | Result$ Chaos | TriggerZones$ Command | Execute$ RolledChaos | TriggerDescription$ Whenever you roll {C}, prevent all damage that planes named CARDNAME would deal this game to permanents you control.
|
||||
SVar:RolledChaos:AB$ Effect | Cost$ 0 | Name$ Mount Keralia Effect | StaticAbilities$ KeraliaProtection | EffectOwner$ You | Duration$ Permanent | SpellDescription$ Prevent all damage that planes named CARDNAME would deal this game to permanents you control.
|
||||
SVar:KeraliaProtection:Mode$ PreventDamage | EffectZone$ Command | Target$ Permanent.YouCtrl | Source$ Plane.namedMount Keralia | Description$ Prevent all damage that planes named Mount Keralia would deal this game to permanents you control.
|
||||
SVar:KeraliaX:TriggeredSource$CardCounters.PRESSURE
|
||||
SVar:KeraliaX:TriggeredCard$CardCounters.PRESSURE
|
||||
SVar:AIRollPlanarDieParams:Mode$ Always | LowPriority$ True
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/mount_keralia.jpg
|
||||
Oracle:At the beginning of your end step, put a pressure counter on Mount Keralia.\nWhen you planeswalk away from Mount Keralia, it deals damage equal to the number of pressure counters on it to each creature and each planeswalker.\nWhenever you roll {C}, prevent all damage that planes named Mount Keralia would deal this game to permanents you control.
|
||||
|
||||
Reference in New Issue
Block a user