mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
Crafty Cutpurse: make it use a Control Layer for the Token Create Effect
This commit is contained in:
@@ -138,10 +138,11 @@ public class TokenInfo {
|
|||||||
final Game game = controller.getGame();
|
final Game game = controller.getGame();
|
||||||
|
|
||||||
int multiplier = 1;
|
int multiplier = 1;
|
||||||
|
Player player = controller;
|
||||||
|
|
||||||
final Map<String, Object> repParams = Maps.newHashMap();
|
final Map<String, Object> repParams = Maps.newHashMap();
|
||||||
repParams.put("Event", "CreateToken");
|
repParams.put("Event", "CreateToken");
|
||||||
repParams.put("Affected", controller);
|
repParams.put("Affected", player);
|
||||||
repParams.put("TokenNum", multiplier);
|
repParams.put("TokenNum", multiplier);
|
||||||
repParams.put("EffectOnly", applyMultiplier);
|
repParams.put("EffectOnly", applyMultiplier);
|
||||||
|
|
||||||
@@ -150,6 +151,7 @@ public class TokenInfo {
|
|||||||
break;
|
break;
|
||||||
case Updated: {
|
case Updated: {
|
||||||
multiplier = (int) repParams.get("TokenNum");
|
multiplier = (int) repParams.get("TokenNum");
|
||||||
|
player = (Player) repParams.get("Affected");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
@@ -157,7 +159,7 @@ public class TokenInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < multiplier; i++) {
|
for (int i = 0; i < multiplier; i++) {
|
||||||
list.add(makeOneToken(controller));
|
list.add(makeOneToken(player));
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,9 @@ public abstract class ReplacementEffect extends TriggerReplacementBase {
|
|||||||
originalMapParams.putAll(map);
|
originalMapParams.putAll(map);
|
||||||
mapParams.putAll(map);
|
mapParams.putAll(map);
|
||||||
this.setHostCard(host);
|
this.setHostCard(host);
|
||||||
|
if (map.containsKey("Layer")) {
|
||||||
|
this.setLayer(ReplacementLayer.smartValueOf(map.get("Layer")));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -53,7 +53,6 @@ public class ReplacementHandler {
|
|||||||
final Object affected = runParams.get("Affected");
|
final Object affected = runParams.get("Affected");
|
||||||
Player decider = null;
|
Player decider = null;
|
||||||
|
|
||||||
|
|
||||||
// Figure out who decides which of multiple replacements to apply
|
// Figure out who decides which of multiple replacements to apply
|
||||||
// as well as whether or not to apply optional replacements.
|
// as well as whether or not to apply optional replacements.
|
||||||
if (affected instanceof Player) {
|
if (affected instanceof Player) {
|
||||||
@@ -62,7 +61,6 @@ public class ReplacementHandler {
|
|||||||
decider = ((Card) affected).getController();
|
decider = ((Card) affected).getController();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (runParams.get("Event").equals("Moved")) {
|
|
||||||
ReplacementResult res = run(runParams, ReplacementLayer.Control, decider);
|
ReplacementResult res = run(runParams, ReplacementLayer.Control, decider);
|
||||||
if (res != ReplacementResult.NotReplaced) {
|
if (res != ReplacementResult.NotReplaced) {
|
||||||
return res;
|
return res;
|
||||||
@@ -79,13 +77,6 @@ public class ReplacementHandler {
|
|||||||
if (res != ReplacementResult.NotReplaced) {
|
if (res != ReplacementResult.NotReplaced) {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else {
|
|
||||||
ReplacementResult res = run(runParams, ReplacementLayer.None, decider);
|
|
||||||
if (res != ReplacementResult.NotReplaced) {
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return ReplacementResult.NotReplaced;
|
return ReplacementResult.NotReplaced;
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ PT:2/2
|
|||||||
K:Flash
|
K:Flash
|
||||||
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigEffect | TriggerDescription$ When CARDNAME enters the battlefield, each token that would be created under an opponent's control this turn is created under your control instead.
|
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigEffect | TriggerDescription$ When CARDNAME enters the battlefield, each token that would be created under an opponent's control this turn is created under your control instead.
|
||||||
SVar:TrigEffect:DB$ Effect | Name$ Crafty Cutpurse Effect | ReplacementEffects$ OppCreatEnters | SVars$ ETBYourCtrl | SpellDescription$ Each token that would be created under an opponent's control this turn is created under your control instead.
|
SVar:TrigEffect:DB$ Effect | Name$ Crafty Cutpurse Effect | ReplacementEffects$ OppCreatEnters | SVars$ ETBYourCtrl | SpellDescription$ Each token that would be created under an opponent's control this turn is created under your control instead.
|
||||||
SVar:OppCreatEnters:Event$ Moved | Destination$ Battlefield | ValidCard$ Permanent.token+OppCtrl | ReplaceWith$ ETBYourCtrl | ActiveZone$ Command | Description$ Each token that would be created under an opponent's control this turn is created under your control instead.
|
SVar:OppCreatEnters:Event$ CreateToken | ActiveZones$ Command | ValidPlayer$ Player.Opponent | ReplaceWith$ ETBYourCtrl | Layer$ Control | Description$ Each token that would be created under an opponent's control this turn is created under your control instead.
|
||||||
SVar:ETBYourCtrl:DB$ ChangeZone | Origin$ All | Destination$ Battlefield | Defined$ ReplacedCard | GainControl$ True
|
SVar:ETBYourCtrl:DB$ ReplaceEffect | VarName$ Affected | VarValue$ You | VarType$ Player
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/crafty_cutpurse.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/crafty_cutpurse.jpg
|
||||||
Oracle:Flash\nWhen Crafty Cutpurse enters the battlefield, each token that would be created under an opponent's control this turn is created under your control instead.
|
Oracle:Flash\nWhen Crafty Cutpurse enters the battlefield, each token that would be created under an opponent's control this turn is created under your control instead.
|
||||||
|
|||||||
Reference in New Issue
Block a user