[OTC] Implement Thunderclap Drake

This commit is contained in:
Susucre 2024-04-09 13:08:10 +02:00
parent 803243ae64
commit e62d1c2124
5 changed files with 162 additions and 39 deletions

View file

@ -33,7 +33,7 @@ public class CopyNextSpellDelayedTriggeredAbility extends DelayedTriggeredAbilit
this.rule = rule;
}
private CopyNextSpellDelayedTriggeredAbility(final CopyNextSpellDelayedTriggeredAbility ability) {
protected CopyNextSpellDelayedTriggeredAbility(final CopyNextSpellDelayedTriggeredAbility ability) {
super(ability);
this.filter = ability.filter;
this.rule = ability.rule;

View file

@ -0,0 +1,46 @@
package mage.abilities.dynamicvalue.common;
import mage.abilities.Ability;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect;
import mage.abilities.hint.Hint;
import mage.abilities.hint.ValueHint;
import mage.constants.CommanderCardType;
import mage.game.Game;
import mage.players.Player;
import mage.watchers.common.CommanderPlaysCountWatcher;
public enum CommanderCastFromCommandZoneValue implements DynamicValue {
instance;
private static final Hint hint = new ValueHint("Number of times you cast your commander from command zone", instance);
public static Hint getHint() {
return hint;
}
@Override
public int calculate(Game game, Ability sourceAbility, Effect effect) {
Player player = game.getPlayer(sourceAbility.getControllerId());
CommanderPlaysCountWatcher watcher = game.getState().getWatcher(CommanderPlaysCountWatcher.class);
if (player == null || watcher == null) {
return 0;
}
return game
.getCommandersIds(player, CommanderCardType.COMMANDER_OR_OATHBREAKER, false)
.stream()
.mapToInt(watcher::getPlaysCount)
.sum();
}
@Override
public DynamicValue copy() {
return instance;
}
@Override
public String getMessage() {
return "";
}
}