mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 11:32:00 -08:00
[CLB] Implemented Undercellar Sweep
This commit is contained in:
parent
e9044d69e9
commit
b09ee6ced1
2 changed files with 66 additions and 0 deletions
65
Mage.Sets/src/mage/cards/u/UndercellarSweep.java
Normal file
65
Mage.Sets/src/mage/cards/u/UndercellarSweep.java
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
package mage.cards.u;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AttacksWithCreaturesTriggeredAbility;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.TakeTheInitiativeEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.token.SoldierToken;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class UndercellarSweep extends CardImpl {
|
||||
|
||||
public UndercellarSweep(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{4}{W}");
|
||||
|
||||
// When Undercellar Sweep enters the battlefield, you take the initiative.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new TakeTheInitiativeEffect()));
|
||||
|
||||
// Whenever you attack, if you or a player you're attacking has the initiative, you create two 1/1 white Soldier creature token that are tapped and attacking.
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
|
||||
new AttacksWithCreaturesTriggeredAbility(
|
||||
new CreateTokenEffect(new SoldierToken(), 2, true, true), 1
|
||||
), UndercellarSweepCondition.instance, "Whenever you attack, if you or a player you're attacking " +
|
||||
"has the initiative, you create two 1/1 white Soldier creature token that are tapped and attacking."
|
||||
));
|
||||
}
|
||||
|
||||
private UndercellarSweep(final UndercellarSweep card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UndercellarSweep copy() {
|
||||
return new UndercellarSweep(this);
|
||||
}
|
||||
}
|
||||
|
||||
enum UndercellarSweepCondition implements Condition {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
if (game.getInitiativeId() == null) {
|
||||
return false;
|
||||
}
|
||||
return source.isControlledBy(game.getInitiativeId())
|
||||
|| game
|
||||
.getCombat()
|
||||
.getAttackers()
|
||||
.stream()
|
||||
.filter(uuid -> source.isControlledBy(game.getControllerId(uuid)))
|
||||
.map(game.getCombat()::getDefenderId)
|
||||
.anyMatch(game.getInitiativeId()::equals);
|
||||
}
|
||||
}
|
||||
|
|
@ -557,6 +557,7 @@ public final class CommanderLegendsBattleForBaldursGate extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Uchuulon", 673, Rarity.RARE, mage.cards.u.Uchuulon.class));
|
||||
cards.add(new SetCardInfo("Unbreakable Formation", 710, Rarity.RARE, mage.cards.u.UnbreakableFormation.class));
|
||||
cards.add(new SetCardInfo("Undercellar Myconid", 259, Rarity.COMMON, mage.cards.u.UndercellarMyconid.class));
|
||||
cards.add(new SetCardInfo("Undercellar Sweep", 47, Rarity.UNCOMMON, mage.cards.u.UndercellarSweep.class));
|
||||
cards.add(new SetCardInfo("Underdark Explorer", 154, Rarity.COMMON, mage.cards.u.UnderdarkExplorer.class));
|
||||
cards.add(new SetCardInfo("Undermountain Adventurer", 260, Rarity.RARE, mage.cards.u.UndermountainAdventurer.class));
|
||||
cards.add(new SetCardInfo("Universal Solvent", 342, Rarity.COMMON, mage.cards.u.UniversalSolvent.class));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue