mirror of
https://github.com/correl/mage.git
synced 2024-12-27 03:00:13 +00:00
This commit is contained in:
parent
b860253624
commit
6d4e353867
3 changed files with 33 additions and 6 deletions
|
@ -29,6 +29,7 @@ public final class ProdigalPyromancer extends CardImpl {
|
|||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
// {T} : Prodigal Pyromancer deals 1 damage to any target.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new TapSourceCost());
|
||||
ability.addTarget(new TargetAnyTarget());
|
||||
this.addAbility(ability);
|
||||
|
|
|
@ -9,17 +9,18 @@ import mage.game.Game;
|
|||
import mage.game.GameException;
|
||||
import mage.game.mulligan.MulliganType;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestMultiPlayerBaseWithRangeAll;
|
||||
import org.mage.test.serverside.base.CardTestMultiPlayerBase;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
|
||||
/**
|
||||
* @author JayDi85
|
||||
*/
|
||||
public class MonarchTest extends CardTestMultiPlayerBaseWithRangeAll {
|
||||
public class MonarchTest extends CardTestMultiPlayerBase {
|
||||
|
||||
@Override
|
||||
protected Game createNewGameAndPlayers() throws GameException, FileNotFoundException {
|
||||
// reason: must use MultiplayerAttackOption.MULTIPLE
|
||||
Game game = new FreeForAll(MultiplayerAttackOption.MULTIPLE, RangeOfInfluence.ALL, MulliganType.GAME_DEFAULT.getMulligan(0), 20);
|
||||
// Player order: A -> D -> C -> B
|
||||
playerA = createPlayer(game, "PlayerA");
|
||||
|
@ -93,4 +94,31 @@ public class MonarchTest extends CardTestMultiPlayerBaseWithRangeAll {
|
|||
setStopAt(3 + 4, PhaseStep.END_TURN);
|
||||
execute();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_MonarchByDies() {
|
||||
// Player order: A -> D -> C -> B
|
||||
addCustomEffect_TargetDamage(playerA, 100);
|
||||
|
||||
// When Thorn of the Black Rose enters the battlefield, you become the monarch.
|
||||
addCard(Zone.HAND, playerA, "Thorn of the Black Rose", 1); // {3}{B}
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 4);
|
||||
|
||||
// A as monarch
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Thorn of the Black Rose");
|
||||
waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN);
|
||||
checkMonarch("monarch to A", 1, PhaseStep.PRECOMBAT_MAIN, playerA, playerA);
|
||||
|
||||
// kill itself, so monarch goes to next - player D
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "target damage 100", playerA);
|
||||
waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN);
|
||||
|
||||
checkMonarch("monarch to D", 2, PhaseStep.POSTCOMBAT_MAIN, playerD, playerD);
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(2, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertLostTheGame(playerA);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,7 +35,6 @@ public abstract class Designation extends MageObjectImpl {
|
|||
|
||||
private boolean copy;
|
||||
private MageObject copyFrom; // copied card INFO (used to call original adjusters)
|
||||
private Abilities<Ability> abilites = new AbilitiesImpl<>();
|
||||
|
||||
public Designation(DesignationType designationType) {
|
||||
this(designationType, true);
|
||||
|
@ -56,7 +55,6 @@ public abstract class Designation extends MageObjectImpl {
|
|||
this.frameStyle = designation.frameStyle;
|
||||
this.copy = designation.copy;
|
||||
this.copyFrom = (designation.copyFrom != null ? designation.copyFrom.copy() : null);
|
||||
this.abilites = designation.abilites.copy();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -80,8 +78,8 @@ public abstract class Designation extends MageObjectImpl {
|
|||
|
||||
public void addAbility(Ability ability) {
|
||||
ability.setSourceId(this.objectId);
|
||||
abilites.add(ability);
|
||||
abilites.addAll(ability.getSubAbilities());
|
||||
this.abilities.add(ability);
|
||||
this.abilities.addAll(ability.getSubAbilities());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue