simplified and consolidated werewolf triggered abilities

This commit is contained in:
Evan Kranzler 2021-03-03 22:13:16 -05:00
parent 378d596e3c
commit afcdc0f23a
68 changed files with 472 additions and 859 deletions

View file

@ -0,0 +1,35 @@
package mage.abilities.common;
import mage.abilities.condition.common.TwoOrMoreSpellsWereCastLastTurnCondition;
import mage.abilities.effects.common.TransformSourceEffect;
import mage.constants.TargetController;
import mage.game.Game;
/**
* @author TheElk801
*/
public class WerewolfBackTriggeredAbility extends BeginningOfUpkeepTriggeredAbility {
public WerewolfBackTriggeredAbility() {
super(new TransformSourceEffect(false), TargetController.ANY, false);
}
private WerewolfBackTriggeredAbility(final WerewolfBackTriggeredAbility ability) {
super(ability);
}
@Override
public boolean checkInterveningIfClause(Game game) {
return TwoOrMoreSpellsWereCastLastTurnCondition.instance.apply(game, this);
}
@Override
public WerewolfBackTriggeredAbility copy() {
return new WerewolfBackTriggeredAbility(this);
}
@Override
public String getRule() {
return "At the beginning of each upkeep, if a player cast two or more spells last turn, transform {this}.";
}
}

View file

@ -0,0 +1,35 @@
package mage.abilities.common;
import mage.abilities.condition.common.NoSpellsWereCastLastTurnCondition;
import mage.abilities.effects.common.TransformSourceEffect;
import mage.constants.TargetController;
import mage.game.Game;
/**
* @author TheElk801
*/
public class WerewolfFrontTriggeredAbility extends BeginningOfUpkeepTriggeredAbility {
public WerewolfFrontTriggeredAbility() {
super(new TransformSourceEffect(true), TargetController.ANY, false);
}
private WerewolfFrontTriggeredAbility(final WerewolfFrontTriggeredAbility ability) {
super(ability);
}
@Override
public boolean checkInterveningIfClause(Game game) {
return NoSpellsWereCastLastTurnCondition.instance.apply(game, this);
}
@Override
public WerewolfFrontTriggeredAbility copy() {
return new WerewolfFrontTriggeredAbility(this);
}
@Override
public String getRule() {
return "At the beginning of each upkeep, if no spells were cast last turn, transform {this}.";
}
}

View file

@ -14,9 +14,6 @@ import mage.game.permanent.Permanent;
*/
public class TransformAbility extends SimpleStaticAbility {
public static final String NO_SPELLS_TRANSFORM_RULE = "At the beginning of each upkeep, if no spells were cast last turn, transform {this}.";
public static final String TWO_OR_MORE_SPELLS_TRANSFORM_RULE = "At the beginning of each upkeep, if a player cast two or more spells last turn, transform {this}.";
// this state value controls if a permanent enters the battlefield already transformed
public static final String VALUE_KEY_ENTER_TRANSFORMED = "EnterTransformed";
@ -24,7 +21,7 @@ public class TransformAbility extends SimpleStaticAbility {
super(Zone.BATTLEFIELD, new TransformEffect());
}
public TransformAbility(final TransformAbility ability) {
private TransformAbility(final TransformAbility ability) {
super(ability);
}
@ -73,12 +70,12 @@ public class TransformAbility extends SimpleStaticAbility {
class TransformEffect extends ContinuousEffectImpl {
public TransformEffect() {
TransformEffect() {
super(Duration.WhileOnBattlefield, Layer.CopyEffects_1, SubLayer.NA, Outcome.BecomeCreature);
staticText = "";
}
public TransformEffect(final TransformEffect effect) {
private TransformEffect(final TransformEffect effect) {
super(effect);
}
@ -120,5 +117,4 @@ class TransformEffect extends ContinuousEffectImpl {
public String getText(Mode mode) {
return "";
}
}