foul-magics/Mage/src/main/java/mage/cards/OmenCard.java
Jmlundeen 0df5f17603
[TDM] Implement omen mechanic (#13501)
* Abstract AdventureCard to SingleFaceSplitCard

* Fix AdventureCardSpellImpl

* Finish converting adventure card and adventure spell

* Update Brightcap Badger

change finalize call to adventure card

* Update Darksteel Monolith

being cast from hand condition referencing AdventureCardSpell

* Update Tlincalli Hunter

exiled creature condition referencing AdventureCardSpell

* Update Twice Upon a Time

finalizeAdventure called from Adventure card

* Finish abstracting Adventure

missed some more references to adventure cards

* Implement Omen cards

* Implement Dirgur Island Dragon

* Missed some adventureSpellName references

* OmenCardSpell had wrong comma symbol

* Add tests for Omen Cards

* Rename two part card components

change from SingleFaceSplitCard to CardWithSpellOption

* Update comments and variable name
2025-04-08 08:54:18 -04:00

34 lines
1.1 KiB
Java

package mage.cards;
import mage.abilities.SpellAbility;
import mage.constants.CardType;
import mage.constants.SpellAbilityType;
import mage.constants.Zone;
import mage.game.Game;
import java.util.UUID;
public abstract class OmenCard extends CardWithSpellOption {
public OmenCard(UUID ownerId, CardSetInfo setInfo, CardType[] types, CardType[] typesSpell, String costs, String omenName, String costsSpell) {
super(ownerId, setInfo, types, costs);
this.spellCard = new OmenSpellCard(ownerId, setInfo, omenName, typesSpell, costsSpell, this);
}
public OmenCard(OmenCard card) {
super(card);
}
public void finalizeOmen() {
spellCard.finalizeSpell();
}
@Override
public boolean cast(Game game, Zone fromZone, SpellAbility ability, UUID controllerId) {
if (ability.getSpellAbilityType() == SpellAbilityType.OMEN_SPELL) {
return this.getSpellCard().cast(game, fromZone, ability, controllerId);
}
this.getSpellCard().getSpellAbility().setControllerId(controllerId);
return super.cast(game, fromZone, ability, controllerId);
}
}