mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
[CLB] Implemented Cloakwood Swarmkeeper
This commit is contained in:
parent
e197b60519
commit
74c175765e
4 changed files with 106 additions and 12 deletions
85
Mage.Sets/src/mage/cards/c/CloakwoodSwarmkeeper.java
Normal file
85
Mage.Sets/src/mage/cards/c/CloakwoodSwarmkeeper.java
Normal file
|
@ -0,0 +1,85 @@
|
|||
package mage.cards.c;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.ZoneChangeGroupEvent;
|
||||
import mage.game.permanent.PermanentImpl;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class CloakwoodSwarmkeeper extends CardImpl {
|
||||
|
||||
public CloakwoodSwarmkeeper(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{G}");
|
||||
|
||||
this.subtype.add(SubType.ELF);
|
||||
this.subtype.add(SubType.RANGER);
|
||||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
// Gathered Swarm — Whenever one or more tokens enter the battlefield under your control, put a +1/+1 counter on Cloakwood Swarmkeeper.
|
||||
this.addAbility(new CloakwoodSwarmkeeperTriggeredAbility());
|
||||
}
|
||||
|
||||
private CloakwoodSwarmkeeper(final CloakwoodSwarmkeeper card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CloakwoodSwarmkeeper copy() {
|
||||
return new CloakwoodSwarmkeeper(this);
|
||||
}
|
||||
}
|
||||
|
||||
class CloakwoodSwarmkeeperTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
CloakwoodSwarmkeeperTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false);
|
||||
this.withFlavorWord("Gathered Swarm");
|
||||
}
|
||||
|
||||
private CloakwoodSwarmkeeperTriggeredAbility(final CloakwoodSwarmkeeperTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.ZONE_CHANGE_GROUP;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
ZoneChangeGroupEvent zEvent = (ZoneChangeGroupEvent) event;
|
||||
return Zone.BATTLEFIELD == zEvent.getToZone()
|
||||
&& zEvent.getTokens() != null
|
||||
&& zEvent
|
||||
.getTokens()
|
||||
.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.map(PermanentImpl::getControllerId)
|
||||
.anyMatch(this::isControlledBy);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CloakwoodSwarmkeeperTriggeredAbility copy() {
|
||||
return new CloakwoodSwarmkeeperTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTriggerPhrase() {
|
||||
return "Whenever one or more tokens enter the battlefield under your control, ";
|
||||
}
|
||||
}
|
|
@ -46,6 +46,8 @@ public final class MyrkulsEdict extends CardImpl {
|
|||
|
||||
// 20 | Each opponent sacrifices a creature with the greatest power among creatures that player controls.
|
||||
effect.addTableEntry(20, 20, new SacrificeOpponentsEffect(filter));
|
||||
|
||||
this.getSpellAbility().addEffect(effect);
|
||||
}
|
||||
|
||||
private MyrkulsEdict(final MyrkulsEdict card) {
|
||||
|
|
|
@ -12,7 +12,9 @@ import mage.counters.CounterType;
|
|||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.ZoneChangeGroupEvent;
|
||||
import mage.game.permanent.PermanentImpl;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
|
@ -60,18 +62,22 @@ class WoodlandChampionTriggeredAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
ZoneChangeGroupEvent zEvent = (ZoneChangeGroupEvent) event;
|
||||
if (zEvent != null && Zone.BATTLEFIELD == zEvent.getToZone()
|
||||
&& zEvent.getTokens() != null) {
|
||||
int tokenCount = zEvent
|
||||
.getTokens()
|
||||
.stream()
|
||||
.mapToInt(card -> card.isControlledBy(this.getControllerId()) ? 1 : 0)
|
||||
.sum();
|
||||
if (tokenCount > 0) {
|
||||
this.getEffects().clear();
|
||||
this.addEffect(new AddCountersSourceEffect(CounterType.P1P1.createInstance(tokenCount)));
|
||||
return true;
|
||||
}
|
||||
if (zEvent.getToZone() != Zone.BATTLEFIELD
|
||||
|| zEvent.getTokens() == null) {
|
||||
return false;
|
||||
}
|
||||
int tokenCount = zEvent
|
||||
.getTokens()
|
||||
.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.map(PermanentImpl::getControllerId)
|
||||
.filter(this::isControlledBy)
|
||||
.mapToInt(x -> 1)
|
||||
.sum();
|
||||
if (tokenCount > 0) {
|
||||
this.getEffects().clear();
|
||||
this.addEffect(new AddCountersSourceEffect(CounterType.P1P1.createInstance(tokenCount)));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -79,6 +79,7 @@ public final class CommanderLegendsBattleForBaldursGate extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Cliffgate", 350, Rarity.COMMON, mage.cards.c.Cliffgate.class));
|
||||
cards.add(new SetCardInfo("Cloak of the Bat", 307, Rarity.COMMON, mage.cards.c.CloakOfTheBat.class));
|
||||
cards.add(new SetCardInfo("Cloakwood Hermit", 221, Rarity.UNCOMMON, mage.cards.c.CloakwoodHermit.class));
|
||||
cards.add(new SetCardInfo("Cloakwood Swarmkeeper", 222, Rarity.COMMON, mage.cards.c.CloakwoodSwarmkeeper.class));
|
||||
cards.add(new SetCardInfo("Clockwork Fox", 308, Rarity.COMMON, mage.cards.c.ClockworkFox.class));
|
||||
cards.add(new SetCardInfo("Colossal Badger", 223, Rarity.COMMON, mage.cards.c.ColossalBadger.class));
|
||||
cards.add(new SetCardInfo("Command Tower", 351, Rarity.COMMON, mage.cards.c.CommandTower.class));
|
||||
|
|
Loading…
Reference in a new issue