forked from External/mage
[LTR] Implement Fangorn, Tree Shepherd
This commit is contained in:
parent
4f62890cae
commit
27e3010139
6 changed files with 143 additions and 54 deletions
|
|
@ -3,8 +3,8 @@ package mage.abilities.common;
|
|||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
|
@ -20,7 +20,7 @@ import java.util.stream.Collectors;
|
|||
*/
|
||||
public class AttacksWithCreaturesTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
private final FilterCreaturePermanent filter;
|
||||
private final FilterPermanent filter;
|
||||
private final int minAttackers;
|
||||
private final boolean setTargetPointer;
|
||||
|
||||
|
|
@ -28,15 +28,15 @@ public class AttacksWithCreaturesTriggeredAbility extends TriggeredAbilityImpl {
|
|||
this(effect, minAttackers, StaticFilters.FILTER_PERMANENT_CREATURES);
|
||||
}
|
||||
|
||||
public AttacksWithCreaturesTriggeredAbility(Effect effect, int minAttackers, FilterCreaturePermanent filter) {
|
||||
public AttacksWithCreaturesTriggeredAbility(Effect effect, int minAttackers, FilterPermanent filter) {
|
||||
this(Zone.BATTLEFIELD, effect, minAttackers, filter);
|
||||
}
|
||||
|
||||
public AttacksWithCreaturesTriggeredAbility(Zone zone, Effect effect, int minAttackers, FilterCreaturePermanent filter) {
|
||||
public AttacksWithCreaturesTriggeredAbility(Zone zone, Effect effect, int minAttackers, FilterPermanent filter) {
|
||||
this(zone, effect, minAttackers, filter, false);
|
||||
}
|
||||
|
||||
public AttacksWithCreaturesTriggeredAbility(Zone zone, Effect effect, int minAttackers, FilterCreaturePermanent filter, boolean setTargetPointer) {
|
||||
public AttacksWithCreaturesTriggeredAbility(Zone zone, Effect effect, int minAttackers, FilterPermanent filter, boolean setTargetPointer) {
|
||||
super(zone, effect);
|
||||
this.filter = filter;
|
||||
this.minAttackers = minAttackers;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,40 @@
|
|||
package mage.abilities.effects.common.continuous;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.constants.*;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public class YouDontLoseManaEffect extends ContinuousEffectImpl {
|
||||
|
||||
private final ManaType manaType;
|
||||
|
||||
public YouDontLoseManaEffect(ManaType manaType) {
|
||||
super(Duration.WhileOnBattlefield, Layer.RulesEffects, SubLayer.NA, Outcome.Detriment);
|
||||
staticText = "you don't lose unspent " + manaType + " mana as steps and phases end";
|
||||
this.manaType = manaType;
|
||||
}
|
||||
|
||||
private YouDontLoseManaEffect(final YouDontLoseManaEffect effect) {
|
||||
super(effect);
|
||||
this.manaType = effect.manaType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public YouDontLoseManaEffect copy() {
|
||||
return new YouDontLoseManaEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
player.getManaPool().addDoNotEmptyManaType(manaType);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue