forked from External/mage
[MID] Implemented Candlelit Cavalry
This commit is contained in:
parent
e4b16ccc8a
commit
c3531dbb2c
9 changed files with 143 additions and 49 deletions
49
Mage.Sets/src/mage/cards/c/CandlelitCavalry.java
Normal file
49
Mage.Sets/src/mage/cards/c/CandlelitCavalry.java
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
package mage.cards.c;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.BeginningOfCombatTriggeredAbility;
|
||||
import mage.abilities.condition.common.CovenCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
|
||||
import mage.abilities.hint.common.CovenHint;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class CandlelitCavalry extends CardImpl {
|
||||
|
||||
public CandlelitCavalry(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{G}");
|
||||
|
||||
this.subtype.add(SubType.HUMAN);
|
||||
this.subtype.add(SubType.KNIGHT);
|
||||
this.power = new MageInt(5);
|
||||
this.toughness = new MageInt(5);
|
||||
|
||||
// Coven — At the beginning of combat on your turn, if you control three or more creatures with different powers, Candlelit Cavalry gains trample until end of turn.
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
|
||||
new BeginningOfCombatTriggeredAbility(
|
||||
new GainAbilitySourceEffect(
|
||||
TrampleAbility.getInstance(), Duration.EndOfTurn
|
||||
), TargetController.YOU, false
|
||||
), CovenCondition.instance, AbilityWord.COVEN.formatWord() +
|
||||
"At the beginning of combat on your turn, if you control three or more creatures " +
|
||||
"with different powers, {this} gains trample until end of turn."
|
||||
).addHint(CovenHint.instance));
|
||||
}
|
||||
|
||||
private CandlelitCavalry(final CandlelitCavalry card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CandlelitCavalry copy() {
|
||||
return new CandlelitCavalry(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -6,17 +6,15 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.hint.Hint;
|
||||
import mage.abilities.hint.common.CovenHint;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
|
|
@ -28,7 +26,7 @@ public final class GoldenRatio extends CardImpl {
|
|||
|
||||
// Draw a card for each different power among creatures you control.
|
||||
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(GoldenRatioValue.instance));
|
||||
this.getSpellAbility().addHint(GoldenRatioHint.instance);
|
||||
this.getSpellAbility().addHint(CovenHint.instance);
|
||||
}
|
||||
|
||||
private GoldenRatio(final GoldenRatio card) {
|
||||
|
|
@ -76,32 +74,3 @@ enum GoldenRatioValue implements DynamicValue {
|
|||
return "1";
|
||||
}
|
||||
}
|
||||
|
||||
enum GoldenRatioHint implements Hint {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public String getText(Game game, Ability ability) {
|
||||
List<String> values = game
|
||||
.getBattlefield()
|
||||
.getActivePermanents(
|
||||
StaticFilters.FILTER_CONTROLLED_CREATURE,
|
||||
ability.getControllerId(), ability.getSourceId(), game
|
||||
)
|
||||
.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.map(MageObject::getPower)
|
||||
.map(MageInt::getValue)
|
||||
.distinct()
|
||||
.sorted()
|
||||
.map(String::valueOf)
|
||||
.collect(Collectors.toList());
|
||||
return "Different powers among creatures you control: " + +values.size()
|
||||
+ (values.size() > 0 ? " (" + String.join(", ", values) + ')' : "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public GoldenRatioHint copy() {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -152,23 +152,19 @@ enum KianneDeanOfSubstanceHint implements Hint {
|
|||
|
||||
@Override
|
||||
public String getText(Game game, Ability ability) {
|
||||
List<Integer> values = game.getExile()
|
||||
List<String> values = game.getExile()
|
||||
.getAllCards(game)
|
||||
.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.filter(card -> card.isOwnedBy(ability.getControllerId()))
|
||||
.filter(card -> card.getCounters(game).containsKey(CounterType.STUDY))
|
||||
.map(MageObject::getManaValue)
|
||||
.mapToInt(MageObject::getManaValue)
|
||||
.distinct()
|
||||
.sorted()
|
||||
.mapToObj(String::valueOf)
|
||||
.collect(Collectors.toList());
|
||||
String message = "" + values.size();
|
||||
if (values.size() > 0) {
|
||||
message += " (";
|
||||
message += values.stream().map(i -> "" + i).reduce((a, b) -> a + ", " + b).orElse("");
|
||||
message += ')';
|
||||
}
|
||||
return "Mana values of cards exiled with study counters: " + message;
|
||||
return "Mana values of cards exiled with study counters: " + values.size()
|
||||
+ (values.size() > 0 ? " (" + String.join(", ", values) + ')' : "");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ public final class InnistradMidnightHunt extends ExpansionSet {
|
|||
this.ratioBoosterMythic = 8;
|
||||
this.numBoosterDoubleFaced = 1;
|
||||
|
||||
cards.add(new SetCardInfo("Candlelit Cavalry", 175, Rarity.COMMON, mage.cards.c.CandlelitCavalry.class));
|
||||
cards.add(new SetCardInfo("Champion of the Perished", 91, Rarity.RARE, mage.cards.c.ChampionOfThePerished.class));
|
||||
cards.add(new SetCardInfo("Consider", 44, Rarity.COMMON, mage.cards.c.Consider.class));
|
||||
cards.add(new SetCardInfo("Forest", 276, Rarity.LAND, mage.cards.basiclands.Forest.class, FULL_ART_BFZ_VARIOUS));
|
||||
|
|
|
|||
|
|
@ -0,0 +1,38 @@
|
|||
package mage.abilities.condition.common;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public enum CovenCondition implements Condition {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return game
|
||||
.getBattlefield()
|
||||
.getActivePermanents(
|
||||
StaticFilters.FILTER_CONTROLLED_CREATURE,
|
||||
source.getControllerId(), source.getSourceId(), game
|
||||
)
|
||||
.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.map(MageObject::getPower)
|
||||
.mapToInt(MageInt::getValue)
|
||||
.distinct()
|
||||
.count() >= 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "if you control three or more creatures with different powers";
|
||||
}
|
||||
}
|
||||
|
|
@ -41,16 +41,13 @@ public enum CardTypesInGraveyardHint implements Hint {
|
|||
.map(CardType::toString)
|
||||
.sorted()
|
||||
.collect(Collectors.toList());
|
||||
String message = "" + types.size();
|
||||
if (types.size() > 0) {
|
||||
message += " (" + String.join(", ", types) + ')';
|
||||
}
|
||||
return "Card types in " + this.message + ": " + message;
|
||||
return "Card types in " + this.message + ": " + types.size()
|
||||
+ (types.size() > 0 ? " (" + String.join(", ", types) + ')' : "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Hint copy() {
|
||||
return YOU;
|
||||
return this;
|
||||
}
|
||||
|
||||
private final Stream<Card> getStream(Game game, Ability ability) {
|
||||
|
|
|
|||
44
Mage/src/main/java/mage/abilities/hint/common/CovenHint.java
Normal file
44
Mage/src/main/java/mage/abilities/hint/common/CovenHint.java
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
package mage.abilities.hint.common;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.hint.Hint;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public enum CovenHint implements Hint {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public String getText(Game game, Ability ability) {
|
||||
List<String> powers = game
|
||||
.getBattlefield()
|
||||
.getActivePermanents(
|
||||
StaticFilters.FILTER_CONTROLLED_CREATURE,
|
||||
ability.getControllerId(), ability.getSourceId(), game
|
||||
)
|
||||
.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.map(MageObject::getPower)
|
||||
.mapToInt(MageInt::getValue)
|
||||
.distinct()
|
||||
.sorted()
|
||||
.mapToObj(String::valueOf)
|
||||
.collect(Collectors.toList());
|
||||
return "Different powers among creatures you control: " + powers.size()
|
||||
+ (powers.size() > 0 ? " (" + String.join(", ", powers) + ')' : "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Hint copy() {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
|
@ -8,7 +8,6 @@ import mage.game.Game;
|
|||
|
||||
/**
|
||||
* @author TheElk801
|
||||
* TODO: add this to other morbid cards
|
||||
*/
|
||||
public enum MorbidHint implements Hint {
|
||||
instance;
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ public enum AbilityWord {
|
|||
COHORT("Cohort"),
|
||||
CONSTELLATION("Constellation"),
|
||||
CONVERGE("Converge"),
|
||||
COVEN("Coven"),
|
||||
DELIRIUM("Delirium"),
|
||||
DOMAIN("Domain"),
|
||||
EMINENCE("Eminence"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue