Add DetainEffect

This commit is contained in:
Hans Mackowiak
2025-03-20 00:33:43 +01:00
parent dde58be5a6
commit a85f00043b
15 changed files with 54 additions and 13 deletions

View File

@@ -67,6 +67,7 @@ public enum ApiType {
Counter (CounterEffect.class),
DamageAll (DamageAllEffect.class),
DealDamage (DamageDealEffect.class),
Detain (DetainEffect.class),
DayTime (DayTimeEffect.class),
Debuff (DebuffEffect.class),
DelayedTrigger (DelayedTriggerEffect.class),

View File

@@ -0,0 +1,40 @@
package forge.game.ability.effects;
import java.util.EnumSet;
import forge.game.Game;
import forge.game.ability.SpellAbilityEffect;
import forge.game.card.Card;
import forge.game.card.CardCollection;
import forge.game.spellability.SpellAbility;
import forge.game.staticability.StaticAbility;
import forge.game.zone.ZoneType;
public class DetainEffect extends SpellAbilityEffect {
@Override
public void resolve(SpellAbility sa) {
Card source = sa.getHostCard();
final Game game = source.getGame();
CardCollection list = getTargetCards(sa);
if (list.isEmpty()) {
return;
}
Card eff = createEffect(sa, sa.getActivatingPlayer(), "Detain Effect", source.getImageKey());
eff.addRemembered(list);
// Add forgot trigger
addForgetOnMovedTrigger(eff, "Battlefield");
StaticAbility stAb = eff.addStaticAbility("Mode$ CantAttack,CantBlock,CantBeActivated | ValidCard$ Card.IsRemembered | Description$ Remembered can't attack or block and its activated abilities can't be activated.");
stAb.setActiveZone(EnumSet.of(ZoneType.Command));
stAb.setIntrinsic(true);
addUntilCommand(sa, exileEffectCommand(game, eff), "UntilYourNextTurn", sa.getActivatingPlayer());
game.getAction().moveToCommand(eff, sa);
}
}

View File

@@ -4,6 +4,6 @@ Types:Creature Archon
PT:4/5
K:Flying
T:Mode$ Attacks | TriggerZones$ Battlefield | ValidCard$ Card.Self | Execute$ Detain | TriggerDescription$ Whenever CARDNAME attacks, detain up to two target nonland permanents your opponents control. (Until your next turn, those permanents can't attack or block and their activated abilities can't be activated.)
SVar:Detain:DB$ Pump | TargetMin$ 0 | TargetMax$ 2 | KW$ HIDDEN CARDNAME can't attack or block. & HIDDEN CARDNAME's activated abilities can't be activated. | IsCurse$ True | ValidTgts$ Permanent.nonLand+OppCtrl | TgtPrompt$ Select target nonland permanent your opponent controls to detain. | Duration$ UntilYourNextTurn | AILogic$ DetainNonLand
SVar:Detain:DB$ Detain | TargetMin$ 0 | TargetMax$ 2 | ValidTgts$ Permanent.nonLand+OppCtrl | TgtPrompt$ Select target nonland permanent your opponent controls to detain.
SVar:HasAttackEffect:TRUE
Oracle:Flying\nWhenever Archon of the Triumvirate attacks, detain up to two target nonland permanents your opponents control. (Until your next turn, those permanents can't attack or block and their activated abilities can't be activated.)

View File

@@ -3,6 +3,6 @@ ManaCost:1 W
Types:Creature Human Soldier
PT:2/1
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ Detain | TriggerDescription$ When CARDNAME enters, detain target creature an opponent controls. (Until your next turn, that creature can't attack or block and its activated abilities can't be activated.)
SVar:Detain:DB$ Pump | KW$ HIDDEN CARDNAME can't attack or block. & HIDDEN CARDNAME's activated abilities can't be activated. | IsCurse$ True | Duration$ UntilYourNextTurn | ValidTgts$ Creature.OppCtrl | TgtPrompt$ Select target creature your opponent controls to detain.
SVar:Detain:DB$ Detain | ValidTgts$ Creature.OppCtrl | TgtPrompt$ Select target creature your opponent controls to detain.
SVar:PlayMain1:TRUE
Oracle:When Azorius Arrester enters, detain target creature an opponent controls. (Until your next turn, that creature can't attack or block and its activated abilities can't be activated.)

View File

@@ -3,6 +3,6 @@ ManaCost:2 W W
Types:Creature Human Wizard
PT:2/2
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ Detain | TriggerDescription$ When CARDNAME enters, detain up to two target creatures your opponents control. (Until your next turn, those creatures can't attack or block and their activated abilities can't be activated.)
SVar:Detain:DB$ Pump | TargetMin$ 0 | TargetMax$ 2 | KW$ HIDDEN CARDNAME can't attack or block. & HIDDEN CARDNAME's activated abilities can't be activated. | IsCurse$ True | Duration$ UntilYourNextTurn | ValidTgts$ Creature.OppCtrl | TgtPrompt$ Select target creature your opponent controls to detain. | AILogic$ DetainNonLand
SVar:Detain:DB$ Detain | TargetMin$ 0 | TargetMax$ 2 | ValidTgts$ Creature.OppCtrl | TgtPrompt$ Select target creature your opponent controls to detain.
SVar:PlayMain1:TRUE
Oracle:When Azorius Justiciar enters, detain up to two target creatures your opponents control. (Until your next turn, those creatures can't attack or block and their activated abilities can't be activated.)

View File

@@ -1,6 +1,6 @@
Name:Inaction Injunction
ManaCost:1 U
Types:Sorcery
A:SP$ Pump | ValidTgts$ Creature.OppCtrl | TgtPrompt$ Select target creature your opponent controls to detain. | KW$ HIDDEN CARDNAME can't attack or block. & HIDDEN CARDNAME's activated abilities can't be activated. | IsCurse$ True | Duration$ UntilYourNextTurn | SubAbility$ DBDraw | SpellDescription$ Detain target creature an opponent controls. (Until your next turn, that creature can't attack or block and its activated abilities can't be activated.)
A:SP$ Detain | ValidTgts$ Creature.OppCtrl | TgtPrompt$ Select target creature your opponent controls to detain. | SubAbility$ DBDraw | SpellDescription$ Detain target creature an opponent controls. (Until your next turn, that creature can't attack or block and its activated abilities can't be activated.)
SVar:DBDraw:DB$ Draw | NumCards$ 1 | SpellDescription$ Draw a card.
Oracle:Detain target creature an opponent controls. (Until your next turn, that creature can't attack or block and its activated abilities can't be activated.)\nDraw a card.

View File

@@ -4,6 +4,6 @@ Types:Creature Vedalken Knight
PT:3/3
K:Flying
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ Detain | TriggerDescription$ When CARDNAME enters, detain target creature an opponent controls. (Until your next turn, that creature can't attack or block and its activated abilities can't be activated.)
SVar:Detain:DB$ Pump | KW$ HIDDEN CARDNAME can't attack or block. & HIDDEN CARDNAME's activated abilities can't be activated. | IsCurse$ True | Duration$ UntilYourNextTurn | ValidTgts$ Creature.OppCtrl | TgtPrompt$ Select target creature your opponent controls to detain.
SVar:Detain:DB$ Detain | ValidTgts$ Creature.OppCtrl | TgtPrompt$ Select target creature your opponent controls to detain.
SVar:PlayMain1:TRUE
Oracle:Flying\nWhen Isperia's Skywatch enters, detain target creature an opponent controls. (Until your next turn, that creature can't attack or block and its activated abilities can't be activated.)

View File

@@ -4,6 +4,6 @@ Types:Legendary Creature Human Soldier
PT:4/4
K:Protection from red
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ Detain | TriggerDescription$ When CARDNAME enters, detain each nonland permanent your opponents control with mana value 4 or less.
SVar:Detain:DB$ PumpAll | KW$ HIDDEN CARDNAME can't attack or block. & HIDDEN CARDNAME's activated abilities can't be activated. | IsCurse$ True | Duration$ UntilYourNextTurn | ValidCards$ Permanent.OppCtrl+nonLand+cmcLE4
SVar:Detain:DB$ Detain | Defined$ Valid Permanent.OppCtrl+nonLand+cmcLE4
SVar:PlayMain1:TRUE
Oracle:Protection from red\nWhen Lavinia of the Tenth enters, detain each nonland permanent your opponents control with mana value 4 or less. (Until your next turn, those permanents can't attack or block and their activated abilities can't be activated.)

View File

@@ -1,5 +1,5 @@
Name:Lyev Decree
ManaCost:1 W
Types:Sorcery
A:SP$ Pump | TargetMin$ 0 | TargetMax$ 2 | KW$ HIDDEN CARDNAME can't attack or block. & HIDDEN CARDNAME's activated abilities can't be activated. | IsCurse$ True | ValidTgts$ Creature.OppCtrl | TgtPrompt$ Select target creature your opponent controls to detain. | Duration$ UntilYourNextTurn | SpellDescription$ Detain up to two target creatures your opponents control. (Until your next turn, those permanents can't attack or block and their activated abilities can't be activated.)
A:SP$ Detain | TargetMin$ 0 | TargetMax$ 2 | ValidTgts$ Creature.OppCtrl | TgtPrompt$ Select target creature your opponent controls to detain. | SpellDescription$ Detain up to two target creatures your opponents control. (Until your next turn, those permanents can't attack or block and their activated abilities can't be activated.)
Oracle:Detain up to two target creatures your opponents control. (Until your next turn, those creatures can't attack or block and their activated abilities can't be activated.)

View File

@@ -4,6 +4,6 @@ Types:Creature Human Knight
PT:3/1
K:Flying
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ Detain | TriggerDescription$ When CARDNAME enters, detain target nonland permanent an opponent controls. (Until your next turn, that permanent can't attack or block and its activated abilities can't be activated.)
SVar:Detain:DB$ Pump | KW$ HIDDEN CARDNAME can't attack or block. & HIDDEN CARDNAME's activated abilities can't be activated. | IsCurse$ True | Duration$ UntilYourNextTurn | ValidTgts$ Permanent.nonLand+OppCtrl | TgtPrompt$ Select target nonland permanent an opponent controls | AILogic$ DetainNonLand
SVar:Detain:DB$ Detain | ValidTgts$ Permanent.nonLand+OppCtrl | TgtPrompt$ Select target nonland permanent an opponent controls
SVar:PlayMain1:TRUE
Oracle:Flying\nWhen Lyev Skyknight enters, detain target nonland permanent an opponent controls. (Until your next turn, that permanent can't attack or block and its activated abilities can't be activated.)

View File

@@ -2,5 +2,5 @@ Name:Martial Law
ManaCost:2 W W
Types:Enchantment
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ Detain | TriggerDescription$ At the beginning of your upkeep, detain target creature an opponent controls. (Until your next turn, that creature can't attack or block and its activated abilities can't be activated.)
SVar:Detain:DB$ Pump | KW$ HIDDEN CARDNAME can't attack or block. & HIDDEN CARDNAME's activated abilities can't be activated. | IsCurse$ True | Duration$ UntilYourNextTurn | ValidTgts$ Creature.OppCtrl | TgtPrompt$ Select target creature your opponent controls to detain.
SVar:Detain:DB$ Detain | ValidTgts$ Creature.OppCtrl | TgtPrompt$ Select target creature your opponent controls to detain.
Oracle:At the beginning of your upkeep, detain target creature an opponent controls. (Until your next turn, that creature can't attack or block and its activated abilities can't be activated.)

View File

@@ -3,5 +3,5 @@ ManaCost:W U
Types:Creature Human Wizard
PT:2/2
A:AB$ Pump | Cost$ W U | ValidTgts$ Creature | TgtPrompt$ Select target creature | KW$ Flying | SpellDescription$ Target creature gains flying until end of turn.
A:AB$ Pump | Cost$ 3 W U | ValidTgts$ Permanent.nonLand+OppCtrl | TgtPrompt$ Select target nonland permanent your opponent controls to detain. | KW$ HIDDEN CARDNAME can't attack or block. & HIDDEN CARDNAME's activated abilities can't be activated. | IsCurse$ True | Duration$ UntilYourNextTurn | AILogic$ DetainNonLand | SpellDescription$ Detain target nonland permanent an opponent controls. (Until your next turn, that permanent can't attack or block and its activated abilities can't be activated.)
A:AB$ Detain | Cost$ 3 W U | ValidTgts$ Permanent.nonLand+OppCtrl | TgtPrompt$ Select target nonland permanent your opponent controls to detain. | SpellDescription$ Detain target nonland permanent an opponent controls. (Until your next turn, that permanent can't attack or block and its activated abilities can't be activated.)
Oracle:{W}{U}: Target creature gains flying until end of turn.\n{3}{W}{U}: Detain target nonland permanent an opponent controls. (Until your next turn, that permanent can't attack or block and its activated abilities can't be activated.)

View File

@@ -4,6 +4,6 @@ Types:Creature Spirit
PT:2/1
S:Mode$ CantBlockBy | ValidAttacker$ Creature.Self | Description$ CARDNAME can't be blocked.
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ Detain | TriggerDescription$ When CARDNAME enters, detain target creature an opponent controls. (Until your next turn, that creature can't attack or block and its activated abilities can't be activated.)
SVar:Detain:DB$ Pump | KW$ HIDDEN CARDNAME can't attack or block. & HIDDEN CARDNAME's activated abilities can't be activated. | IsCurse$ True | Duration$ UntilYourNextTurn | ValidTgts$ Creature.OppCtrl | TgtPrompt$ Select target creature your opponent controls to detain.
SVar:Detain:DB$ Detain | ValidTgts$ Creature.OppCtrl | TgtPrompt$ Select target creature your opponent controls to detain.
SVar:PlayMain1:TRUE
Oracle:Soulsworn Spirit can't be blocked.\nWhen Soulsworn Spirit enters, detain target creature an opponent controls. (Until your next turn, that creature can't attack or block and its activated abilities can't be activated.)

View File

@@ -3,5 +3,5 @@ ManaCost:no cost
Types:Plane Unknown Planet
S:Mode$ Continuous | Affected$ Creature.YouOwn | AffectedZone$ Graveyard | AddKeyword$ Escape:CardManaCost ExileFromGrave<3/Card.Other/other> | EffectZone$ Command | Description$ Each creature card in your graveyard has escape. The escape cost is equal to the card's mana cost plus exile three other cards from your graveyard. (You may cast cards from your graveyard for their escape cost.)
T:Mode$ ChaosEnsues | TriggerZones$ Command | Execute$ TrigDetain | TriggerDescription$ Whenever chaos ensues, detain target creature an opponent controls. (Until your next turn, that creature can't attack or block and its activated abilities can't be activated.)
SVar:TrigDetain:DB$ Pump | KW$ HIDDEN CARDNAME can't attack or block. & HIDDEN CARDNAME's activated abilities can't be activated. | IsCurse$ True | Duration$ UntilYourNextTurn | ValidTgts$ Creature.OppCtrl | TgtPrompt$ Select target creature your opponent controls to detain.
SVar:TrigDetain:DB$ Detain | ValidTgts$ Creature.OppCtrl | TgtPrompt$ Select target creature your opponent controls to detain.
Oracle:Each creature card in your graveyard has escape. The escape cost is equal to the card's mana cost plus exile three other cards from your graveyard. (You may cast cards from your graveyard for their escape cost.)\nWhenever chaos ensues, detain target creature an opponent controls. (Until your next turn, that creature can't attack or block and its activated abilities can't be activated.)

View File

@@ -6,5 +6,5 @@ T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.S
SVar:TrigCharm:DB$ Charm | Choices$ DBTax,DBDetain
SVar:DBTax:DB$ Effect | Duration$ UntilYourNextTurn | StaticAbilities$ RaiseCost | SpellDescription$ Until your next turn, spells your opponents cast cost {1} more to cast.
SVar:RaiseCost:Mode$ RaiseCost | ValidCard$ Card | Activator$ Opponent | Type$ Spell | Amount$ 1 | Description$ Spells your opponents cast cost {1} more to cast.
SVar:DBDetain:DB$ Pump | KW$ HIDDEN CARDNAME can't attack or block. & HIDDEN CARDNAME's activated abilities can't be activated. | IsCurse$ True | Duration$ UntilYourNextTurn | ValidTgts$ Creature.OppCtrl | TgtPrompt$ Select target creature your opponent controls to detain. | SpellDescription$ Arrest — Detain target creature an opponent controls. (Until your next turn, that creature can't attack or block and its activated abilities can't be activated.)
SVar:DBDetain:DB$ Detain | ValidTgts$ Creature.OppCtrl | TgtPrompt$ Select target creature your opponent controls to detain. | SpellDescription$ Arrest — Detain target creature an opponent controls. (Until your next turn, that creature can't attack or block and its activated abilities can't be activated.)
Oracle:When Tax Collector enters, choose one —\n• Tax — Until your next turn, spells your opponents cast cost {1} more to cast.\n• Arrest — Detain target creature an opponent controls. (Until your next turn, that creature can't attack or block and its activated abilities can't be activated.)