mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 20:41:58 -08:00
[MID] Implemented Candlelit Cavalry
This commit is contained in:
parent
e4b16ccc8a
commit
c3531dbb2c
9 changed files with 143 additions and 49 deletions
|
|
@ -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