diff --git a/Mage.Client/src/main/java/mage/client/dialog/AddLandDialog.java b/Mage.Client/src/main/java/mage/client/dialog/AddLandDialog.java index c365da6d9d..b2a742e4bf 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/AddLandDialog.java +++ b/Mage.Client/src/main/java/mage/client/dialog/AddLandDialog.java @@ -480,19 +480,32 @@ public class AddLandDialog extends MageDialog { white += m.getWhite(); } int total = red + green + black + blue + white; - int redcards = Math.round(land_number * ((float) red / (float) total)); - total -= red; - land_number -= redcards; - int greencards = Math.round(land_number * ((float) green / (float) total)); - total -= green; - land_number -= greencards; - int blackcards = Math.round(land_number * ((float) black / (float) total)); - total -= black; - land_number -= blackcards; - int bluecards = Math.round(land_number * ((float) blue / (float) total)); - total -= blue; - land_number -= bluecards; - int whitecards = land_number; + + int redcards = 0; + int greencards = 0; + int blackcards = 0; + int bluecards = 0; + int whitecards = 0; + if (total > 0) { + redcards = Math.round(land_number * ((float) red / (float) total)); + total -= red; + land_number -= redcards; + + greencards = Math.round(land_number * ((float) green / (float) total)); + total -= green; + land_number -= greencards; + + blackcards = Math.round(land_number * ((float) black / (float) total)); + total -= black; + land_number -= blackcards; + + bluecards = Math.round(land_number * ((float) blue / (float) total)); + total -= blue; + land_number -= bluecards; + + whitecards = land_number; + } + spnMountain.setValue(redcards); spnForest.setValue(greencards); spnSwamp.setValue(blackcards); diff --git a/Mage.Sets/src/mage/cards/t/TezzeretCruelMachinist.java b/Mage.Sets/src/mage/cards/t/TezzeretCruelMachinist.java index 8ff5f60fe7..c47ecd602a 100644 --- a/Mage.Sets/src/mage/cards/t/TezzeretCruelMachinist.java +++ b/Mage.Sets/src/mage/cards/t/TezzeretCruelMachinist.java @@ -1,6 +1,5 @@ package mage.cards.t; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; @@ -9,20 +8,8 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.continuous.AddCardTypeTargetEffect; import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; -import mage.cards.Card; -import mage.constants.SubType; -import mage.constants.SuperType; -import mage.cards.CardImpl; -import mage.cards.CardSetInfo; -import mage.cards.Cards; -import mage.cards.CardsImpl; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Layer; -import static mage.constants.Layer.TypeChangingEffects_4; -import mage.constants.Outcome; -import mage.constants.SubLayer; -import mage.constants.Zone; +import mage.cards.*; +import mage.constants.*; import mage.filter.StaticFilters; import mage.game.Game; import mage.game.permanent.Permanent; @@ -32,8 +19,9 @@ import mage.target.TargetPermanent; import mage.target.common.TargetCardInHand; import mage.target.targetpointer.FixedTarget; +import java.util.UUID; + /** - * * @author TheElk801 */ public final class TezzeretCruelMachinist extends CardImpl { @@ -188,9 +176,8 @@ class TezzeretCruelMachinistPowerToughnessEffect extends SetPowerToughnessTarget && target.isFaceDown(game)) { target.getPower().setValue(5); target.getToughness().setValue(5); - break; + return true; } - return true; } return false; }