mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 21:12:04 -08:00
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:
parent
378dfbf89a
commit
8494e98693
31 changed files with 185 additions and 37 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue