Skip to content

Commit

Permalink
Implement False Dawn (APC) (#11301)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssk97 authored Oct 14, 2023
1 parent 7bc5105 commit 679fdda
Show file tree
Hide file tree
Showing 2 changed files with 116 additions and 0 deletions.
115 changes: 115 additions & 0 deletions Mage.Sets/src/mage/cards/f/FalseDawn.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@

package mage.cards.f;

import java.util.UUID;

import mage.Mana;
import mage.abilities.Ability;
import mage.abilities.effects.AsThoughEffectImpl;
import mage.abilities.effects.AsThoughManaEffect;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.ManaEvent;
import mage.players.ManaPoolItem;

/**
*
* @author notgreat
*/
public final class FalseDawn extends CardImpl {

public FalseDawn(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{W}");

this.getSpellAbility().addEffect(new FalseDawnManaAddEffect());
this.getSpellAbility().addEffect(new FalseDawnManaSpendEffect());
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1).concatBy("<br>"));
}

private FalseDawn(final FalseDawn card) {
super(card);
}

@Override
public FalseDawn copy() {
return new FalseDawn(this);
}
}
class FalseDawnManaAddEffect extends ReplacementEffectImpl {

FalseDawnManaAddEffect() {
super(Duration.EndOfTurn, Outcome.Neutral);
staticText = "Until end of turn, spells and abilities you control that would add colored mana instead add "+
"that much white mana.";
}

private FalseDawnManaAddEffect(final FalseDawnManaAddEffect effect) {
super(effect);
}

@Override
public FalseDawnManaAddEffect copy() {
return new FalseDawnManaAddEffect(this);
}

@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
Mana mana = ((ManaEvent) event).getMana();
mana.setWhite(mana.countColored());
mana.setBlue(0);
mana.setBlack(0);
mana.setRed(0);
mana.setGreen(0);
return false;
}

@Override
public boolean checksEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.ADD_MANA;
}

@Override
public boolean applies(GameEvent event, Ability source, Game game) {
return game.getControllerId(event.getSourceId()).equals(source.getControllerId());
}
}
//Based on Celestial Dawn
class FalseDawnManaSpendEffect extends AsThoughEffectImpl implements AsThoughManaEffect {

public FalseDawnManaSpendEffect() {
super(AsThoughEffectType.SPEND_OTHER_MANA, Duration.EndOfTurn, Outcome.Benefit);
staticText = "Until end of turn, you may spend white mana as though it were mana of any color.";
}

private FalseDawnManaSpendEffect(final FalseDawnManaSpendEffect effect) {
super(effect);
}

@Override
public boolean apply(Game game, Ability source) {
return true;
}

@Override
public FalseDawnManaSpendEffect copy() {
return new FalseDawnManaSpendEffect(this);
}

@Override
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
return source.isControlledBy(affectedControllerId);
}

@Override
public ManaType getAsThoughManaType(ManaType manaType, ManaPoolItem mana, UUID affectedControllerId, Ability source, Game game) {
if (mana.getWhite() > 0) {
return ManaType.WHITE;
}
return null;
}
}
1 change: 1 addition & 0 deletions Mage.Sets/src/mage/sets/Apocalypse.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ private Apocalypse() {
cards.add(new SetCardInfo("Emblazoned Golem", 136, Rarity.UNCOMMON, mage.cards.e.EmblazonedGolem.class));
cards.add(new SetCardInfo("Enlistment Officer", 9, Rarity.UNCOMMON, mage.cards.e.EnlistmentOfficer.class));
cards.add(new SetCardInfo("Evasive Action", 23, Rarity.UNCOMMON, mage.cards.e.EvasiveAction.class));
cards.add(new SetCardInfo("False Dawn", 10, Rarity.RARE, mage.cards.f.FalseDawn.class));
cards.add(new SetCardInfo("Fervent Charge", 98, Rarity.RARE, mage.cards.f.FerventCharge.class));
cards.add(new SetCardInfo("Fire // Ice", 128, Rarity.UNCOMMON, mage.cards.f.FireIce.class));
cards.add(new SetCardInfo("Flowstone Charger", 99, Rarity.UNCOMMON, mage.cards.f.FlowstoneCharger.class));
Expand Down

0 comments on commit 679fdda

Please sign in to comment.