mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 13:02:06 -08:00
Merge origin/master
This commit is contained in:
commit
905fd65ebd
3 changed files with 68 additions and 45 deletions
|
|
@ -120,10 +120,12 @@ public abstract class ExpansionSet implements Serializable {
|
|||
// since it adds lands then commons before uncommons
|
||||
// and rares this should be the least disruptive.
|
||||
List<Card> theBooster = this.createBooster();
|
||||
List<CardInfo> commons = getCardsByRarity(Rarity.COMMON);
|
||||
|
||||
while (15 > theBooster.size()) {
|
||||
addToBooster(theBooster, commons);
|
||||
if (15 > theBooster.size()) {
|
||||
List<CardInfo> commons = getCardsByRarity(Rarity.COMMON);
|
||||
while (15 > theBooster.size()) {
|
||||
addToBooster(theBooster, commons);
|
||||
}
|
||||
}
|
||||
|
||||
while (theBooster.size() > 15) {
|
||||
|
|
@ -235,6 +237,7 @@ public abstract class ExpansionSet implements Serializable {
|
|||
* Can be overwritten to add a replacement for common card in boosters
|
||||
*
|
||||
* @param booster
|
||||
* @param number
|
||||
*/
|
||||
public void addSpecialCommon(List<Card> booster, int number) {
|
||||
|
||||
|
|
@ -329,9 +332,6 @@ public abstract class ExpansionSet implements Serializable {
|
|||
if (numBoosterDoubleFaced > -1) {
|
||||
criteria.doubleFaced(false);
|
||||
}
|
||||
// if (maxCardNumberInBooster != Integer.MAX_VALUE) {
|
||||
// criteria.maxCardNumber(maxCardNumberInBooster);
|
||||
// }
|
||||
savedCardsInfos = CardRepository.instance.findCards(criteria);
|
||||
// Workaround after card number is numeric
|
||||
if (maxCardNumberInBooster != Integer.MAX_VALUE) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
* 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.filter.predicate.permanent;
|
||||
|
||||
import mage.filter.predicate.ObjectSourcePlayer;
|
||||
import mage.filter.predicate.ObjectSourcePlayerPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
* Filters out the id of the enchanted object, if the source is an enchantment
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class AnotherEnchantedPredicate implements ObjectSourcePlayerPredicate<ObjectSourcePlayer<Permanent>> {
|
||||
|
||||
@Override
|
||||
public boolean apply(ObjectSourcePlayer<Permanent> input, Game game) {
|
||||
Permanent enchantment = game.getPermanentOrLKIBattlefield(input.getSourceId());
|
||||
return enchantment != null && !input.getObject().getId().equals(enchantment.getAttachedTo());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Another enchanted";
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue