forked from External/mage
[IKO] Implement Companion and 2 companions
Keruga, the Macrosage and Umori, the Collector
This commit is contained in:
parent
395ae9ec11
commit
c3684a732b
21 changed files with 866 additions and 128 deletions
|
|
@ -1,12 +1,11 @@
|
|||
package mage.game;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.common.InfoEffect;
|
||||
import mage.abilities.effects.common.continuous.CommanderReplacementEffect;
|
||||
import mage.abilities.effects.common.cost.CommanderCostModification;
|
||||
import mage.abilities.keyword.CompanionAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.MultiplayerAttackOption;
|
||||
import mage.constants.PhaseStep;
|
||||
|
|
@ -18,6 +17,9 @@ import mage.players.Player;
|
|||
import mage.watchers.common.CommanderInfoWatcher;
|
||||
import mage.watchers.common.CommanderPlaysCountWatcher;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
public abstract class GameCommanderImpl extends GameImpl {
|
||||
|
||||
// private final Map<UUID, Cards> mulliganedCards = new HashMap<>();
|
||||
|
|
@ -54,9 +56,13 @@ public abstract class GameCommanderImpl extends GameImpl {
|
|||
if (player != null) {
|
||||
// add new commanders
|
||||
for (UUID id : player.getSideboard()) {
|
||||
Card commander = this.getCard(id);
|
||||
if (commander != null) {
|
||||
addCommander(commander, player);
|
||||
Card card = this.getCard(id);
|
||||
if (card != null) {
|
||||
// Check for companions. If it is the only card in the sideboard, it is the commander, not a companion.
|
||||
if (player.getSideboard().size() > 1 && card.getAbilities(this).stream().anyMatch(ability -> ability instanceof CompanionAbility)) {
|
||||
continue;
|
||||
}
|
||||
addCommander(card, player);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue