[EMN] Added the missing green cards.

This commit is contained in:
LevelX2 2016-07-09 15:39:59 +02:00
parent 4818830e5c
commit 4c363bee23
21 changed files with 1338 additions and 35 deletions

View file

@ -33,7 +33,6 @@ import mage.constants.Outcome;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.PermanentCard;
import org.apache.log4j.Logger;
/**
*
@ -41,8 +40,6 @@ import org.apache.log4j.Logger;
*/
public class TransformSourceEffect extends OneShotEffect {
private static final Logger logger = Logger.getLogger(TransformSourceEffect.class);
private boolean withoutTrigger;
private boolean fromDayToNight;

View file

@ -0,0 +1,91 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package mage.abilities.effects.common;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.effects.OneShotEffect;
import mage.constants.Outcome;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.PermanentCard;
import mage.target.Target;
import mage.util.CardUtil;
/**
*
* @author LevelX2
*/
public class TransformTargetEffect extends OneShotEffect {
private boolean withoutTrigger;
public TransformTargetEffect() {
this(true);
}
public TransformTargetEffect(boolean withoutTrigger) {
super(Outcome.Transform);
this.withoutTrigger = withoutTrigger;
}
public TransformTargetEffect(final TransformTargetEffect effect) {
super(effect);
this.withoutTrigger = effect.withoutTrigger;
}
@Override
public TransformTargetEffect copy() {
return new TransformTargetEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
if (permanent != null) {
if (permanent.canTransform(game)) {
// check not to transform twice the same side
if (withoutTrigger) {
permanent.setTransformed(!permanent.isTransformed());
} else {
permanent.transform(game);
}
if (!game.isSimulation()) {
if (permanent.isTransformed()) {
if (permanent.getSecondCardFace() != null) {
if (permanent instanceof PermanentCard) {
game.informPlayers(((PermanentCard) permanent).getCard().getLogName() + " transforms into " + permanent.getSecondCardFace().getLogName());
}
}
} else {
game.informPlayers(permanent.getSecondCardFace().getLogName() + " transforms into " + permanent.getLogName());
}
}
}
return true;
}
return false;
}
@Override
public String getText(Mode mode) {
if (staticText != null && staticText.length() > 0) {
return staticText;
}
Target target = mode.getTargets().get(0);
if (target.getMaxNumberOfTargets() > 1) {
if (target.getMaxNumberOfTargets() == target.getNumberOfTargets()) {
return "transform " + CardUtil.numberToText(target.getNumberOfTargets()) + " target " + target.getTargetName();
} else {
return "transform up to " + CardUtil.numberToText(target.getMaxNumberOfTargets()) + " target " + target.getTargetName();
}
} else {
return "transform target " + mode.getTargets().get(0).getTargetName();
}
}
}

View file

@ -41,7 +41,6 @@ import mage.util.CardUtil;
*
* @author LevelX2
*/
public class CanBlockAdditionalCreatureEffect extends ContinuousEffectImpl {
protected int amount;
@ -97,16 +96,19 @@ public class CanBlockAdditionalCreatureEffect extends ContinuousEffectImpl {
private String setText() {
String text = "{this} can block ";
switch(amount) {
switch (amount) {
case 0:
text += "any number of creatures";
break;
default:
text += CardUtil.numberToText(amount, "an") + " additional creature" + (amount > 1 ? "s" : "");
}
if(duration == Duration.EndOfTurn) {
if (duration.equals(Duration.EndOfTurn)) {
text += " this turn";
}
if (duration.equals(Duration.WhileOnBattlefield)) {
text += " each combat";
}
return text;
}

View file

@ -25,7 +25,6 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.abilities.effects.common.combat;
import java.util.UUID;
@ -35,32 +34,29 @@ import mage.constants.Duration;
import mage.game.Game;
import mage.game.permanent.Permanent;
/**
* http://tappedout.net/mtg-questions/must-be-blocked-if-able-effect-makes-other-attacking-creatures-essentially-unblockable/
*
* When you Declare Blockers, you choose an arrangement for your blockers,
* then check to see if there are any restrictions or requirements.
* When you Declare Blockers, you choose an arrangement for your blockers, then
* check to see if there are any restrictions or requirements.
*
* If any restrictions are violated, the block is illegal. (For example,
* trying to block with Sightless Ghoul)
* If any requirements are violated, the least possible number of requirements
* must be violated, otherwise the block is illegal. (For example, your opponent
* control two creatures that he has cast Deadly Allure on, but you control only
* one creature. Blocking either one will violate a requirement, "This creature
* must be blocked this turn if able", but it will also violate the least
* possible number of requirements, thus it is legal.)
* If the block is illegal, the game state backs up and you declare blockers
* again. (Note that while you can, in some cases, circumvent requirements
* such as "This creature must be blocked" or "This creature must block
* any attacking creature" you can never circumvent restrictions: "This creature
* can't block" or "Only one creature may block this turn.")
* Because you declare ALL your blockers at once, THEN check for
* restrictions/requirements, you may block Deadly Allure'd creatures
* with only one creature, if you choose.
* This still works with Lure: This card sets up a requirement that ALL
* creatures must block it if able. Any block that violates more than
* the minimum number of requirements is still illegal.
* If any restrictions are violated, the block is illegal. (For example, trying
* to block with Sightless Ghoul) If any requirements are violated, the least
* possible number of requirements must be violated, otherwise the block is
* illegal. (For example, your opponent control two creatures that he has cast
* Deadly Allure on, but you control only one creature. Blocking either one will
* violate a requirement, "This creature must be blocked this turn if able", but
* it will also violate the least possible number of requirements, thus it is
* legal.) If the block is illegal, the game state backs up and you declare
* blockers again. (Note that while you can, in some cases, circumvent
* requirements such as "This creature must be blocked" or "This creature must
* block any attacking creature" you can never circumvent restrictions: "This
* creature can't block" or "Only one creature may block this turn.") Because
* you declare ALL your blockers at once, THEN check for
* restrictions/requirements, you may block Deadly Allure'd creatures with only
* one creature, if you choose. This still works with Lure: This card sets up a
* requirement that ALL creatures must block it if able. Any block that violates
* more than the minimum number of requirements is still illegal.
*
* @author LevelX2
*/
@ -72,7 +68,7 @@ public class MustBeBlockedByAtLeastOneSourceEffect extends RequirementEffect {
public MustBeBlockedByAtLeastOneSourceEffect(Duration duration) {
super(duration);
staticText = "{this} must be blocked this turn if able";
staticText = "{this} must be blocked " + (duration.equals(Duration.EndOfTurn) ? "this turn " : "") + "if able";
}
public MustBeBlockedByAtLeastOneSourceEffect(final MustBeBlockedByAtLeastOneSourceEffect effect) {