mirror of
https://github.com/magefree/mage.git
synced 2025-12-26 21:42:07 -08:00
[KHM] Implemented Birgi, God of Storytelling
This commit is contained in:
parent
8e47f00716
commit
6837a02518
4 changed files with 138 additions and 1 deletions
|
|
@ -1,15 +1,21 @@
|
|||
package mage.abilities.keyword;
|
||||
|
||||
import mage.abilities.ActivatedAbilityImpl;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.BoastCondition;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.InfoEffect;
|
||||
import mage.abilities.hint.common.BoastHint;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.watchers.common.AttackedThisTurnWatcher;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* @author weirddan455
|
||||
*/
|
||||
|
|
@ -42,8 +48,47 @@ public class BoastAbility extends ActivatedAbilityImpl {
|
|||
return super.hasMoreActivationsThisTurn(game);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxActivationsPerTurn(Game game) {
|
||||
if (!game.isActivePlayer(getControllerId())) {
|
||||
return 1;
|
||||
}
|
||||
Permanent permanent = game.getPermanent(getSourceId());
|
||||
if (permanent != null && !permanent.isCreature()) {
|
||||
return 1;
|
||||
}
|
||||
return game.getBattlefield()
|
||||
.getActivePermanents(
|
||||
StaticFilters.FILTER_CONTROLLED_PERMANENT,
|
||||
getControllerId(), getSourceId(), game
|
||||
).stream()
|
||||
.map(p -> p.getAbilities(game))
|
||||
.flatMap(Collection::stream)
|
||||
.anyMatch(BoastTwiceAbility.class::isInstance) ? 2 : 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Boast — " + super.getRule() + " <i>(Activate this ability only if this creature attacked this turn and only once each turn.)</i>";
|
||||
}
|
||||
|
||||
private static final class BoastTwiceAbility extends SimpleStaticAbility {
|
||||
|
||||
private BoastTwiceAbility() {
|
||||
super(new InfoEffect("Creatures you control can boast twice during each of your turns rather than once."));
|
||||
}
|
||||
|
||||
private BoastTwiceAbility(final BoastTwiceAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BoastTwiceAbility copy() {
|
||||
return new BoastTwiceAbility(this);
|
||||
}
|
||||
}
|
||||
|
||||
public static BoastTwiceAbility makeBoastTwiceAbility() {
|
||||
return new BoastTwiceAbility();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue