"Implement" Ante

This commit is contained in:
Noah Gleason 2018-07-14 22:20:21 -04:00
parent 1592a9d173
commit 2666b6b3e2
No known key found for this signature in database
GPG key ID: EC030EC6B0650A40
4 changed files with 64 additions and 3 deletions

View file

@ -0,0 +1,38 @@
package mage.cards.a;
import java.util.UUID;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.InfoEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
/**
*
* @author noahg
*/
public final class AmuletOfQuoz extends CardImpl {
public AmuletOfQuoz(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{6}");
// Remove Amulet of Quoz from your deck before playing if you're not playing for ante.
// {T}, Sacrifice Amulet of Quoz: Target opponent may ante the top card of their library. If they dont, you flip a coin. If you win the flip, that player loses the game. If you lose the flip, you lose the game. Activate this ability only during your upkeep.
this.getSpellAbility().addEffect(new InfoEffect("Remove Amulet of Quoz from your deck before playing if " +
"you're not playing for ante.\nSacrifice Amulet of Quoz: Target opponent may ante the top card of " +
"their library. If they dont, you flip a coin. If you win the flip, that player loses the game. If " +
"you lose the flip, you lose the game. Activate this ability only during your upkeep."));
}
public AmuletOfQuoz(final AmuletOfQuoz card) {
super(card);
}
@Override
public AmuletOfQuoz copy() {
return new AmuletOfQuoz(this);
}
}

View file

@ -30,6 +30,7 @@ public final class IceAge extends ExpansionSet {
cards.add(new SetCardInfo("Adarkar Wastes", 351, Rarity.RARE, mage.cards.a.AdarkarWastes.class));
cards.add(new SetCardInfo("Aegis of the Meek", 307, Rarity.RARE, mage.cards.a.AegisOfTheMeek.class));
cards.add(new SetCardInfo("Altar of Bone", 281, Rarity.RARE, mage.cards.a.AltarOfBone.class));
cards.add(new SetCardInfo("Amulet of Quoz", 308, Rarity.RARE, mage.cards.a.AmuletOfQuoz.class));
cards.add(new SetCardInfo("Anarchy", 170, Rarity.UNCOMMON, mage.cards.a.Anarchy.class));
cards.add(new SetCardInfo("Arenson's Aura", 3, Rarity.COMMON, mage.cards.a.ArensonsAura.class));
cards.add(new SetCardInfo("Armor of Faith", 4, Rarity.COMMON, mage.cards.a.ArmorOfFaith.class));

View file

@ -75,6 +75,10 @@ public abstract class GameImpl implements Game, Serializable {
private static final Logger logger = Logger.getLogger(GameImpl.class);
private static final Set<String> ANTE_CARDS = new HashSet<>(Arrays.asList("Amulet of Quoz", "Bronze Tablet",
"Contract from Below", "Darkpact", "Demonic Attorney", "Jeweled Bird", "Rebirth", "Tempest Efreet",
"Timmerian Fiends"));
private transient Object customData;
protected boolean simulation = false;
@ -887,9 +891,29 @@ public abstract class GameImpl implements Game, Serializable {
initTimer(player.getId());
}
}
//Ante
for (Player player : state.getPlayers().values()) {
List<Card> cardsInLibrary = player.getLibrary().getCards(this);
for (Card card : cardsInLibrary){
if (ANTE_CARDS.contains(card.getName())){
fireInformEvent("Removed "+card.getIdName()+" from "+player.getName()+"'s deck (not playing for ante).");
player.getLibrary().remove(card.getId(), this);
}
}
Set<Card> cardsInSideboard = player.getSideboard().getCards(this);
for (Card card : cardsInSideboard){
if (ANTE_CARDS.contains(card.getName())){
fireInformEvent("Removed "+card.getIdName()+" from "+player.getName()+"'s sideboard (not playing for ante).");
player.getSideboard().remove(card);
}
}
}
if (startMessage == null || startMessage.isEmpty()) {
startMessage = "Game has started";
}
fireStatusEvent(startMessage, false);
saveState(false);

View file

@ -148,9 +148,7 @@ public class Library implements Serializable {
public void set(Library newLibrary) {
library.clear();
for (UUID card : newLibrary.getCardList()) {
library.add(card);
}
library.addAll(newLibrary.getCardList());
}
public List<UUID> getCardList() {