mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 13:02:06 -08:00
[ACR] Implement The Capitoline Triad (#12510)
* Implement-ACR-The-Capitoline-Triad --------- Co-authored-by: Grath <1895280+Grath@users.noreply.github.com>
This commit is contained in:
parent
0bba44b54f
commit
f42fc0f388
5 changed files with 295 additions and 0 deletions
|
|
@ -0,0 +1,75 @@
|
|||
package mage.abilities.dynamicvalue.common;
|
||||
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author grimreap124
|
||||
*/
|
||||
public class ManaValueInGraveyard implements DynamicValue {
|
||||
|
||||
private final FilterCard filter;
|
||||
private final Integer multiplier;
|
||||
|
||||
public ManaValueInGraveyard() {
|
||||
this(StaticFilters.FILTER_CARD, 1);
|
||||
}
|
||||
|
||||
public ManaValueInGraveyard(FilterCard filter) {
|
||||
this(filter, 1);
|
||||
}
|
||||
|
||||
public ManaValueInGraveyard(FilterCard filter, Integer multiplier) {
|
||||
this.filter = filter;
|
||||
this.multiplier = multiplier;
|
||||
}
|
||||
|
||||
protected ManaValueInGraveyard(final ManaValueInGraveyard dynamicValue) {
|
||||
this.filter = dynamicValue.filter;
|
||||
this.multiplier = dynamicValue.multiplier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
UUID playerId = sourceAbility.getControllerId();
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player == null) {
|
||||
return 0;
|
||||
}
|
||||
int value = player.getGraveyard().stream().map(game::getCard).filter(Objects::nonNull)
|
||||
.filter(card -> filter.match(card, playerId, game)).mapToInt(MageObject::getManaValue).sum();
|
||||
if (multiplier != null) {
|
||||
value *= multiplier;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ManaValueInGraveyard copy() {
|
||||
return new ManaValueInGraveyard(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return multiplier == null ? "X" : multiplier.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return (multiplier == null ? "the mana value of " : "") + filter.getMessage() + " in your graveyard";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSign() {
|
||||
return multiplier == null ? 1 : multiplier;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package mage.game.command.emblems;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.common.continuous.*;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.command.Emblem;
|
||||
|
||||
/*
|
||||
* @author grimreap124
|
||||
*/
|
||||
public final class TheCapitolineTriadEmblem extends Emblem {
|
||||
|
||||
public TheCapitolineTriadEmblem() {
|
||||
super("Emblem Capitoline Triad");
|
||||
// You get an emblem with "Creatures you control have base power and toughness 9/9."
|
||||
Ability ability = new SimpleStaticAbility(Zone.COMMAND,
|
||||
new SetBasePowerToughnessAllEffect(9, 9, Duration.EndOfGame, StaticFilters.FILTER_PERMANENT_CREATURES_CONTROLLED).setText("Creatures you control have base power and toughness 9/9."));
|
||||
getAbilities().add(ability);
|
||||
}
|
||||
|
||||
private TheCapitolineTriadEmblem(final TheCapitolineTriadEmblem card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TheCapitolineTriadEmblem copy() {
|
||||
return new TheCapitolineTriadEmblem(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -134,6 +134,7 @@
|
|||
|Generate|EMBLEM:MH3|Emblem Tamiyo|||TamiyoSeasonedScholarEmblem|
|
||||
|Generate|EMBLEM:M3C|Emblem Garruk|||GarrukApexPredatorEmblem|
|
||||
|Generate|EMBLEM:M3C|Emblem Vivien|||VivienReidEmblem|
|
||||
|Generate|EMBLEM:ACR|Emblem Capitoline Triad|||TheCapitolineTriadEmblem|
|
||||
|Generate|EMBLEM:BLB|Emblem Ral|||RalCracklingWitEmblem|
|
||||
|
||||
# ALL PLANES
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue