mirror of
https://github.com/correl/mage.git
synced 2025-03-12 17:00:08 -09:00
[CLB] Implemented Cloudkill
This commit is contained in:
parent
0ef537c28b
commit
07f49bb863
2 changed files with 75 additions and 0 deletions
74
Mage.Sets/src/mage/cards/c/Cloudkill.java
Normal file
74
Mage.Sets/src/mage/cards/c/Cloudkill.java
Normal file
|
@ -0,0 +1,74 @@
|
|||
package mage.cards.c;
|
||||
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.continuous.BoostAllEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.CommanderCardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class Cloudkill extends CardImpl {
|
||||
|
||||
public Cloudkill(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{B}{B}");
|
||||
|
||||
// All creatures gets -X/-X until end of turn, where X is the greatest mana value of a commander you own on the battlefield or in the command zone.
|
||||
this.getSpellAbility().addEffect(new BoostAllEffect(
|
||||
CloudkillValue.instance, CloudkillValue.instance, Duration.EndOfTurn
|
||||
));
|
||||
}
|
||||
|
||||
private Cloudkill(final Cloudkill card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Cloudkill copy() {
|
||||
return new Cloudkill(this);
|
||||
}
|
||||
}
|
||||
|
||||
enum CloudkillValue implements DynamicValue {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
Player player = game.getPlayer(sourceAbility.getControllerId());
|
||||
return player != null ? -game
|
||||
.getCommanderCardsFromAnyZones(
|
||||
player, CommanderCardType.ANY,
|
||||
Zone.BATTLEFIELD, Zone.COMMAND
|
||||
)
|
||||
.stream()
|
||||
.mapToInt(MageObject::getManaValue)
|
||||
.max()
|
||||
.orElse(0) : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CloudkillValue copy() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "the greatest mana value of a commander you own on the battlefield or in the command zone";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "X";
|
||||
}
|
||||
}
|
|
@ -81,6 +81,7 @@ public final class CommanderLegendsBattleForBaldursGate extends ExpansionSet {
|
|||
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("Cloudkill", 121, Rarity.UNCOMMON, mage.cards.c.Cloudkill.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));
|
||||
cards.add(new SetCardInfo("Cone of Cold", 61, Rarity.UNCOMMON, mage.cards.c.ConeOfCold.class));
|
||||
|
|
Loading…
Add table
Reference in a new issue