mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
Add Cruel Entertainment
This commit is contained in:
@@ -4,13 +4,14 @@ import java.util.List;
|
||||
|
||||
import forge.GameCommand;
|
||||
import forge.game.Game;
|
||||
import forge.game.ability.AbilityUtils;
|
||||
import forge.game.ability.SpellAbilityEffect;
|
||||
import forge.game.player.Player;
|
||||
import forge.game.spellability.SpellAbility;
|
||||
import forge.util.Lang;
|
||||
import forge.util.TextUtil;
|
||||
|
||||
/**
|
||||
/**
|
||||
* TODO: Write javadoc for this type.
|
||||
*
|
||||
*/
|
||||
@@ -18,16 +19,18 @@ public class ControlPlayerEffect extends SpellAbilityEffect {
|
||||
|
||||
@Override
|
||||
protected String getStackDescription(SpellAbility sa) {
|
||||
|
||||
|
||||
List<Player> tgtPlayers = getTargetPlayers(sa);
|
||||
return TextUtil.concatWithSpace(sa.getActivatingPlayer().toString(),"controls", Lang.joinHomogenous(tgtPlayers),"during their next turn");
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
@Override
|
||||
public void resolve(SpellAbility sa) {
|
||||
final Player activator = sa.getActivatingPlayer();
|
||||
final Game game = activator.getGame();
|
||||
final Player controller = sa.hasParam("Controller") ? AbilityUtils.getDefinedPlayers(
|
||||
sa.getHostCard(), sa.getParam("Controller"), sa).get(0) : activator;
|
||||
|
||||
List<Player> tgtPlayers = getTargetPlayers(sa);
|
||||
|
||||
@@ -37,13 +40,13 @@ public class ControlPlayerEffect extends SpellAbilityEffect {
|
||||
@Override
|
||||
public void run() {
|
||||
// CR 800.4b
|
||||
if (activator.hasLost()) {
|
||||
if (controller.hasLost()) {
|
||||
return;
|
||||
}
|
||||
|
||||
long ts = game.getNextTimestamp();
|
||||
pTarget.addController(ts, activator);
|
||||
|
||||
pTarget.addController(ts, controller);
|
||||
|
||||
// on following cleanup release control
|
||||
game.getEndOfTurn().addUntil(new GameCommand() {
|
||||
@Override
|
||||
|
||||
8
forge-gui/res/cardsfolder/c/cruel_entertainment.txt
Normal file
8
forge-gui/res/cardsfolder/c/cruel_entertainment.txt
Normal file
@@ -0,0 +1,8 @@
|
||||
Name:Cruel Entertainment
|
||||
ManaCost:6 B
|
||||
Types:Sorcery
|
||||
# Turn targeted player into chosen
|
||||
A:SP$ ChoosePlayer | ValidTgts$ Player | TargetUnique$ True | Choices$ ThisTargetedPlayer | Defined$ You | SubAbility$ DBControlPlayer1 | StackDescription$ SpellDescription | SpellDescription$ Choose target player and another target player. The first player controls the second player during the second player's next turn, and the second player controls the first player during the first player's next turn.
|
||||
SVar:DBControlPlayer1:DB$ ControlPlayer | ValidTgts$ Player | TargetUnique$ True | TgtPrompt$ Choose another target player | Controller$ Player.Chosen | SubAbility$ DBControlPlayer2 | StackDescription$ None
|
||||
SVar:DBControlPlayer2:DB$ ControlPlayer | Defined$ Player.Chosen | Controller$ ParentTarget | StackDescription$ None
|
||||
Oracle:Choose target player and another target player. The first player controls the second player during the second player's next turn, and the second player controls the first player during the first player's next turn.
|
||||
Reference in New Issue
Block a user