forked from External/mage
Reworking effects which allow casting spells from a selection of cards (ready for review) (#8136)
* added function for casting spells with specific attributes from a selection of cards * updated cascade to use new method * refactored various cards to use new methods * added TestPlayer method * fixed a small error * text fix * broke out some repeated code * added missing notTarget setting * add additional retain zone check * some more cards refactored * more refactoring * added interface for split/modal cards * reworked spell casting methods * reworked multiple cast to prevent unnecessary dialogs * fixed test failures due to change in functionality * add AI code * small nonfunctional change * reworked Kaya, the Inexorable * added currently failing test * added more tests * updated Geode Golem implementation * fixed adventure/cascade interaction, added/updated tests * some nonfunctional refactoring * added interface for subcards * [AFC] Implemented Fevered Suspicion * [AFC] Implemented Extract Brain * [AFC] updated Arcane Endeavor implementation * [C17] reworked implementation of Izzet Chemister * [ZEN] reworked implemented of Chandra Ablaze * additional merge fix * [SLD] updated Eleven, the Mage * [NEO] Implemented Discover the Impossible * [NEO] Implemented The Dragon-Kami Reborn / Dragon-Kami's Egg * [NEO] Implemented Invoke Calamity * [AFR] Implemented Rod of Absorption * [VOC] Implemented Spectral Arcanist * [VOC] added additional printings * [NEO] added all variants * [SLD] updated implementation of Ken, Burning Brawler
This commit is contained in:
parent
7fb089db48
commit
bbb9382150
83 changed files with 2551 additions and 2059 deletions
|
|
@ -5,6 +5,7 @@ import mage.abilities.AbilitiesImpl;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SpellAbilityType;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.ZoneChangeEvent;
|
||||
|
|
@ -13,7 +14,7 @@ import java.util.List;
|
|||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
* @author phulin
|
||||
*/
|
||||
public abstract class AdventureCard extends CardImpl {
|
||||
|
||||
|
|
@ -90,13 +91,11 @@ public abstract class AdventureCard extends CardImpl {
|
|||
|
||||
@Override
|
||||
public boolean cast(Game game, Zone fromZone, SpellAbility ability, UUID controllerId) {
|
||||
switch (ability.getSpellAbilityType()) {
|
||||
case ADVENTURE_SPELL:
|
||||
return this.getSpellCard().cast(game, fromZone, ability, controllerId);
|
||||
default:
|
||||
this.getSpellCard().getSpellAbility().setControllerId(controllerId);
|
||||
return super.cast(game, fromZone, ability, controllerId);
|
||||
if (ability.getSpellAbilityType() == SpellAbilityType.ADVENTURE_SPELL) {
|
||||
return this.getSpellCard().cast(game, fromZone, ability, controllerId);
|
||||
}
|
||||
this.getSpellCard().getSpellAbility().setControllerId(controllerId);
|
||||
return super.cast(game, fromZone, ability, controllerId);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -1,15 +1,10 @@
|
|||
package mage.cards;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author phulin
|
||||
*/
|
||||
public interface AdventureCardSpell extends Card {
|
||||
public interface AdventureCardSpell extends SubCard<AdventureCard> {
|
||||
|
||||
@Override
|
||||
AdventureCardSpell copy();
|
||||
|
||||
void setParentCard(AdventureCard card);
|
||||
|
||||
AdventureCard getParentCard();
|
||||
}
|
||||
|
|
|
|||
11
Mage/src/main/java/mage/cards/CardWithHalves.java
Normal file
11
Mage/src/main/java/mage/cards/CardWithHalves.java
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
package mage.cards;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public interface CardWithHalves extends Card {
|
||||
|
||||
Card getLeftHalfCard();
|
||||
|
||||
Card getRightHalfCard();
|
||||
}
|
||||
|
|
@ -45,4 +45,6 @@ public interface Cards extends Set<UUID>, Serializable {
|
|||
Cards copy();
|
||||
|
||||
void retainZone(Zone zone, Game game);
|
||||
|
||||
void removeZone(Zone zone, Game game);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -210,4 +210,9 @@ public class CardsImpl extends LinkedHashSet<UUID> implements Cards, Serializabl
|
|||
public void retainZone(Zone zone, Game game) {
|
||||
removeIf(uuid -> game.getState().getZone(uuid) != zone);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeZone(Zone zone, Game game) {
|
||||
removeIf(uuid -> game.getState().getZone(uuid) == zone);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import java.util.UUID;
|
|||
/**
|
||||
* @author JayDi85
|
||||
*/
|
||||
public abstract class ModalDoubleFacesCard extends CardImpl {
|
||||
public abstract class ModalDoubleFacesCard extends CardImpl implements CardWithHalves {
|
||||
|
||||
protected Card leftHalfCard; // main card in all zone
|
||||
protected Card rightHalfCard; // second side card, can be only in stack and battlefield zones
|
||||
|
|
|
|||
|
|
@ -5,15 +5,11 @@ import mage.MageInt;
|
|||
/**
|
||||
* @author JayDi85
|
||||
*/
|
||||
public interface ModalDoubleFacesCardHalf extends Card {
|
||||
public interface ModalDoubleFacesCardHalf extends SubCard<ModalDoubleFacesCard> {
|
||||
|
||||
@Override
|
||||
ModalDoubleFacesCardHalf copy();
|
||||
|
||||
void setParentCard(ModalDoubleFacesCard card);
|
||||
|
||||
ModalDoubleFacesCard getParentCard();
|
||||
|
||||
void setPT(int power, int toughness);
|
||||
|
||||
void setPT(MageInt power, MageInt toughness);
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ import java.util.UUID;
|
|||
/**
|
||||
* @author LevelX2
|
||||
*/
|
||||
public abstract class SplitCard extends CardImpl {
|
||||
public abstract class SplitCard extends CardImpl implements CardWithHalves {
|
||||
|
||||
protected Card leftHalfCard;
|
||||
protected Card rightHalfCard;
|
||||
|
|
|
|||
|
|
@ -3,12 +3,8 @@ package mage.cards;
|
|||
/**
|
||||
* @author LevelX2
|
||||
*/
|
||||
public interface SplitCardHalf extends Card {
|
||||
public interface SplitCardHalf extends SubCard<SplitCard> {
|
||||
|
||||
@Override
|
||||
SplitCardHalf copy();
|
||||
|
||||
void setParentCard(SplitCard card);
|
||||
|
||||
SplitCard getParentCard();
|
||||
}
|
||||
|
|
|
|||
8
Mage/src/main/java/mage/cards/SubCard.java
Normal file
8
Mage/src/main/java/mage/cards/SubCard.java
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
package mage.cards;
|
||||
|
||||
public interface SubCard<T extends Card> extends Card {
|
||||
|
||||
void setParentCard(T card);
|
||||
|
||||
T getParentCard();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue