Implemented Yorion, Sky Nomad (#6407)

* Implemented Yorion, Sky Nomad

* Implemented Yorion, Sky Nomad (but for real this time)

* updated game creation to use the correct deck size for limited
This commit is contained in:
Evan Kranzler 2020-04-16 08:10:18 -04:00 committed by GitHub
parent 378dfbf89a
commit 8494e98693
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 185 additions and 37 deletions

View file

@ -34,8 +34,8 @@ public class CompanionAbility extends StaticAbility {
return "Companion — " + condition.getRule();
}
public boolean isLegal(Set<Card> cards) {
return condition.isLegal(cards);
public boolean isLegal(Set<Card> cards, int startingSize) {
return condition.isLegal(cards, startingSize);
}
}

View file

@ -17,7 +17,8 @@ public interface CompanionCondition extends Serializable {
/**
* @param deck The set of cards to check.
* @param startingSize
* @return Whether the companion is valid for that deck.
*/
boolean isLegal(Set<Card> deck);
boolean isLegal(Set<Card> deck, int startingSize);
}

View file

@ -12,7 +12,7 @@ import java.util.UUID;
public abstract class GameCanadianHighlanderImpl extends GameImpl {
public GameCanadianHighlanderImpl(MultiplayerAttackOption attackOption, RangeOfInfluence range, Mulligan mulligan, int startLife) {
super(attackOption, range, mulligan, startLife);
super(attackOption, range, mulligan, startLife, 100);
}
public GameCanadianHighlanderImpl(final GameCanadianHighlanderImpl game) {

View file

@ -31,8 +31,8 @@ public abstract class GameCommanderImpl extends GameImpl {
protected boolean startingPlayerSkipsDraw = true;
public GameCommanderImpl(MultiplayerAttackOption attackOption, RangeOfInfluence range, Mulligan mulligan, int startLife) {
super(attackOption, range, mulligan, startLife);
public GameCommanderImpl(MultiplayerAttackOption attackOption, RangeOfInfluence range, Mulligan mulligan, int startLife, int startingSize) {
super(attackOption, range, mulligan, startLife, startingSize);
}
public GameCommanderImpl(final GameCommanderImpl game) {

View file

@ -130,6 +130,7 @@ public abstract class GameImpl implements Game, Serializable {
private int priorityTime;
private final int startLife;
private final int startingSize;
protected PlayerList playerList; // auto-generated from state, don't copy
// infinite loop check (no copy of this attributes neccessary)
@ -144,7 +145,7 @@ public abstract class GameImpl implements Game, Serializable {
// temporary store for income concede commands, don't copy
private final LinkedList<UUID> concedingPlayers = new LinkedList<>();
public GameImpl(MultiplayerAttackOption attackOption, RangeOfInfluence range, Mulligan mulligan, int startLife) {
public GameImpl(MultiplayerAttackOption attackOption, RangeOfInfluence range, Mulligan mulligan, int startLife, int startingSize) {
this.id = UUID.randomUUID();
this.range = range;
this.mulligan = mulligan;
@ -152,6 +153,7 @@ public abstract class GameImpl implements Game, Serializable {
this.state = new GameState();
this.startLife = startLife;
this.executingRollback = false;
this.startingSize = startingSize;
initGameDefaultWatchers();
}
@ -181,6 +183,7 @@ public abstract class GameImpl implements Game, Serializable {
this.saveGame = game.saveGame;
this.startLife = game.startLife;
this.enterWithCounters.putAll(game.enterWithCounters);
this.startingSize = game.startingSize;
}
@Override
@ -939,7 +942,7 @@ public abstract class GameImpl implements Game, Serializable {
for (Ability ability : card.getAbilities(this)) {
if (ability instanceof CompanionAbility) {
CompanionAbility companionAbility = (CompanionAbility) ability;
if (companionAbility.isLegal(new HashSet<>(player.getLibrary().getCards(this)))) {
if (companionAbility.isLegal(new HashSet<>(player.getLibrary().getCards(this)), startingSize)) {
potentialCompanions.add(card);
break;
}

View file

@ -32,7 +32,7 @@ public abstract class GameTinyLeadersImpl extends GameImpl {
protected boolean startingPlayerSkipsDraw = true;
public GameTinyLeadersImpl(MultiplayerAttackOption attackOption, RangeOfInfluence range, Mulligan mulligan, int startLife) {
super(attackOption, range, mulligan, startLife);
super(attackOption, range, mulligan, startLife, 50);
}
public GameTinyLeadersImpl(final GameTinyLeadersImpl game) {