forked from External/mage
Implementing Blitz mechanic (WIP) (#8835)
* added blitz mechanic (mostly copy/paste of dash) * renamed class * reworked alt cost abilities, greatly reduced redundant code * updated text generation * removed all skips * added test for blitz * changed blitz implementation * [SNC] Implemented Tenacious Underdog
This commit is contained in:
parent
76daf4bd5a
commit
0e3252d256
31 changed files with 620 additions and 722 deletions
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.abilities.condition.common;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
|
|
@ -6,24 +5,21 @@ import mage.abilities.condition.Condition;
|
|||
import mage.abilities.keyword.DashAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.game.Game;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
/**
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public enum DashedCondition implements Condition {
|
||||
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Card card = game.getCard(source.getSourceId());
|
||||
if (card != null) {
|
||||
return card.getAbilities(game).stream()
|
||||
.filter(DashAbility.class::isInstance)
|
||||
.anyMatch(d -> ((DashAbility) d).isActivated(source, game));
|
||||
|
||||
}
|
||||
return false;
|
||||
return card != null
|
||||
&& CardUtil.castStream(card
|
||||
.getAbilities(game)
|
||||
.stream(), DashAbility.class)
|
||||
.anyMatch(ability -> ability.isActivated(source, game));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue