Merge remote-tracking branch 'origin/master'

This commit is contained in:
Oleg Agafonov 2019-01-13 02:48:57 +04:00
commit 5f18b8e8ce
6 changed files with 16 additions and 6 deletions

View file

@ -102,7 +102,7 @@ class CryOfTheCarnariumReplacementEffect extends ReplacementEffectImpl {
Permanent permanent = ((ZoneChangeEvent) event).getTarget();
if (permanent != null) {
Player player = game.getPlayer(permanent.getControllerId());
if (player == null) {
if (player != null) {
return player.moveCards(permanent, Zone.EXILED, source, game);
}
}

View file

@ -2,6 +2,7 @@ package mage.cards.h;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.SpellAbility;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CastSourceTriggeredAbility;
@ -80,7 +81,11 @@ class HydroidKrasisEffect extends OneShotEffect {
if (player == null) {
return false;
}
int halfCost = Math.floorDiv(source.getManaCostsToPay().getX(), 2);
Object obj = getValue(CastSourceTriggeredAbility.SOURCE_CAST_SPELL_ABILITY);
if (!(obj instanceof SpellAbility)) {
return false;
}
int halfCost = Math.floorDiv(((SpellAbility) obj).getManaCostsToPay().getX(), 2);
player.drawCards(halfCost, game);
player.gainLife(halfCost, game, source);
return true;

View file

@ -45,6 +45,6 @@ enum MassManipulationAdjuster implements TargetAdjuster {
@Override
public void adjustTargets(Ability ability, Game game) {
ability.getTargets().clear();
ability.addTarget(new TargetCreatureOrPlaneswalker(ability.getManaCosts().getX()));
ability.addTarget(new TargetCreatureOrPlaneswalker(ability.getManaCostsToPay().getX()));
}
}

View file

@ -17,7 +17,9 @@ import java.util.Set;
public enum AddendumCondition implements Condition {
instance;
private static final Set<TurnPhase> turnPhases = EnumSet.of(TurnPhase.PRECOMBAT_MAIN, TurnPhase.POSTCOMBAT_MAIN);
private static final Set<TurnPhase> turnPhases = EnumSet.of(
TurnPhase.PRECOMBAT_MAIN, TurnPhase.POSTCOMBAT_MAIN
);
@Override
public boolean apply(Game game, Ability source) {
@ -25,6 +27,9 @@ public enum AddendumCondition implements Condition {
!turnPhases.contains(game.getTurn().getPhase().getType())) {
return false;
}
if (CastFromEverywhereSourceCondition.instance.apply(game, source)) {
return true;
}
Spell spell = game.getSpell(source.getSourceId());
return spell != null && !spell.isCopy();
}

View file

@ -34,7 +34,7 @@ public class SearchLibraryGraveyardPutInHandEffect extends OneShotEffect {
super(Outcome.Benefit);
this.filter = filter;
this.forceToSearchBoth = forceToSearchBoth;
staticText = (youMay ? "You may" : "") + "search your library and" + (forceToSearchBoth ? "" : "/or") + " graveyard for a card named " + filter.getMessage()
staticText = (youMay ? "You may" : "") + " search your library and" + (forceToSearchBoth ? "" : "/or") + " graveyard for a card named " + filter.getMessage()
+ ", reveal it, and put it into your hand. " + (forceToSearchBoth ? "Then shuffle your library" : "If you search your library this way, shuffle it");
}

View file

@ -23,7 +23,7 @@ public class TargetCreatureOrPlaneswalker extends TargetPermanent {
}
public TargetCreatureOrPlaneswalker(int minNumTargets, int maxNumTargets) {
this(1, 1, new FilterCreatureOrPlaneswalkerPermanent(), false);
this(minNumTargets, maxNumTargets, new FilterCreatureOrPlaneswalkerPermanent(), false);
}
public TargetCreatureOrPlaneswalker(int minNumTargets, int maxNumTargets, FilterCreatureOrPlaneswalkerPermanent filter, boolean notTarget) {