Merge branch 'master' into fix_hints_on_ward

# Conflicts:
#	Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java
This commit is contained in:
Alex Vasile 2022-05-12 09:24:22 -06:00
commit b8c9f8eaa8
206 changed files with 356 additions and 234 deletions

View file

@ -4,6 +4,7 @@ package mage.abilities.effects.mana;
import mage.Mana;
import mage.abilities.Ability;
import mage.choices.ManaChoice;
import mage.constants.ManaType;
import mage.game.Game;
import mage.players.Player;
@ -12,6 +13,32 @@ import java.util.List;
public class AddManaOfTwoDifferentColorsEffect extends ManaEffect {
// Performing this calculation here since it never changes and should not be recalcualted each time.
private static final List<ManaType> colorsToCycle = new ArrayList<>();
private static final List<Mana> netMana = new ArrayList<>();
static {
// Add the colored mana in order to cycle through them
colorsToCycle.add(ManaType.WHITE);
colorsToCycle.add(ManaType.BLUE);
colorsToCycle.add(ManaType.BLACK);
colorsToCycle.add(ManaType.RED);
colorsToCycle.add(ManaType.GREEN);
// Create the possible combinations of two mana
for (ManaType manaType1 : colorsToCycle) {
for (ManaType manaType2 : colorsToCycle) {
// Mana types must be different
if (manaType1 == manaType2) {
continue;
}
Mana manaCombo = new Mana(manaType1);
manaCombo.increase(manaType2);
netMana.add(manaCombo);
}
}
}
public AddManaOfTwoDifferentColorsEffect() {
super();
staticText = "Add two mana of different colors.";
@ -23,8 +50,6 @@ public class AddManaOfTwoDifferentColorsEffect extends ManaEffect {
@Override
public List<Mana> getNetMana(Game game, Ability source) {
List<Mana> netMana = new ArrayList<>();
netMana.add(Mana.AnyMana(2));
return netMana;
}

View file

@ -16,24 +16,39 @@ import mage.target.common.TargetControlledCreaturePermanent;
public class EquipAbility extends ActivatedAbilityImpl {
private String costReduceText = null;
private final boolean showAbilityHint;
public EquipAbility(int cost) {
this(Outcome.AddAbility, new GenericManaCost(cost));
this(cost, true);
}
public EquipAbility(int cost, boolean showAbilityHint) {
this(Outcome.AddAbility, new GenericManaCost(cost), showAbilityHint);
}
public EquipAbility(Outcome outcome, Cost cost) {
this(outcome, cost, new TargetControlledCreaturePermanent());
this(outcome, cost, true);
}
public EquipAbility(Outcome outcome, Cost cost, boolean showAbilityHint) {
this(outcome, cost, new TargetControlledCreaturePermanent(), showAbilityHint);
}
public EquipAbility(Outcome outcome, Cost cost, Target target) {
this(outcome, cost, target, true);
}
public EquipAbility(Outcome outcome, Cost cost, Target target, boolean showAbilityHint) {
super(Zone.BATTLEFIELD, new AttachEffect(outcome, "Equip"), cost);
this.addTarget(target);
this.timing = TimingRule.SORCERY;
this.showAbilityHint = showAbilityHint;
}
public EquipAbility(final EquipAbility ability) {
super(ability);
this.costReduceText = ability.costReduceText;
this.showAbilityHint = ability.showAbilityHint;
}
public void setCostReduceText(String text) {
@ -68,7 +83,9 @@ public class EquipAbility extends ActivatedAbilityImpl {
if (maxActivationsPerTurn == 1) {
sb.append(". Activate only once each turn.");
}
sb.append(reminderText);
if (showAbilityHint) {
sb.append(reminderText);
}
return sb.toString();
}
}

View file

@ -168,7 +168,7 @@ public class Library implements Serializable {
}
public Set<Card> getTopCards(Game game, int amount) {
Set<Card> cards = new HashSet<>();
Set<Card> cards = new LinkedHashSet<>();
Iterator<UUID> it = library.iterator();
int count = 0;
while (it.hasNext() && count < amount) {