mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 20:41:58 -08:00
parent
53aababd44
commit
98aaa78081
4 changed files with 129 additions and 40 deletions
|
|
@ -10,6 +10,7 @@ import mage.game.Game;
|
|||
import mage.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.cards.AdventureCard;
|
||||
|
||||
/**
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
|
|
@ -69,12 +70,14 @@ public abstract class AsThoughEffectImpl extends ContinuousEffectImpl implements
|
|||
}
|
||||
|
||||
/**
|
||||
* Internal method to do the neccessary to allow the card from objectId to be cast or played (if it's a land) without paying any mana.
|
||||
* Additional costs (like sacrificing or discarding) have still to be payed.
|
||||
* Checks if the card is of the correct type or in the correct zone have to be done before.
|
||||
* Internal method to do the necessary to allow the card from objectId to be
|
||||
* cast or played (if it's a land) without paying any mana. Additional costs
|
||||
* (like sacrificing or discarding) have still to be payed. Checks if the
|
||||
* card is of the correct type or in the correct zone have to be done
|
||||
* before.
|
||||
*
|
||||
* @param objectId sourceId of the card to play
|
||||
* @param source source ability that allows this effect
|
||||
* @param objectId sourceId of the card to play
|
||||
* @param source source ability that allows this effect
|
||||
* @param affectedControllerId player allowed to play the card
|
||||
* @param game
|
||||
* @return
|
||||
|
|
@ -93,12 +96,21 @@ public abstract class AsThoughEffectImpl extends ContinuousEffectImpl implements
|
|||
player.setCastSourceIdWithAlternateMana(rightCard.getId(), null, rightCard.getSpellAbility().getCosts());
|
||||
} else if (card instanceof ModalDoubleFacesCard) {
|
||||
Card leftCard = ((ModalDoubleFacesCard) card).getLeftHalfCard();
|
||||
player.setCastSourceIdWithAlternateMana(leftCard.getId(), null, leftCard.getSpellAbility().getCosts());
|
||||
Card rightCard = ((ModalDoubleFacesCard) card).getRightHalfCard();
|
||||
player.setCastSourceIdWithAlternateMana(rightCard.getId(), null, rightCard.getSpellAbility().getCosts());
|
||||
} else {
|
||||
player.setCastSourceIdWithAlternateMana(objectId, null, card.getSpellAbility().getCosts());
|
||||
// some MDFC's are land. IE: sea gate restoration
|
||||
if (!leftCard.isLand(game)) {
|
||||
player.setCastSourceIdWithAlternateMana(leftCard.getId(), null, leftCard.getSpellAbility().getCosts());
|
||||
}
|
||||
if (!rightCard.isLand(game)) {
|
||||
player.setCastSourceIdWithAlternateMana(rightCard.getId(), null, rightCard.getSpellAbility().getCosts());
|
||||
}
|
||||
} else if (card instanceof AdventureCard) {
|
||||
Card creatureCard = card.getMainCard();
|
||||
Card spellCard = ((AdventureCard) card).getSpellCard();
|
||||
player.setCastSourceIdWithAlternateMana(creatureCard.getId(), null, creatureCard.getSpellAbility().getCosts());
|
||||
player.setCastSourceIdWithAlternateMana(spellCard.getId(), null, spellCard.getSpellAbility().getCosts());
|
||||
}
|
||||
player.setCastSourceIdWithAlternateMana(objectId, null, card.getSpellAbility().getCosts());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -231,21 +231,27 @@ public class ForetellAbility extends SpecialAction {
|
|||
} else if (card instanceof ModalDoubleFacesCard) {
|
||||
if (foretellCost != null) {
|
||||
ModalDoubleFacesCardHalf leftHalfCard = ((ModalDoubleFacesCard) card).getLeftHalfCard();
|
||||
ForetellCostAbility ability = new ForetellCostAbility(foretellCost);
|
||||
ability.setSourceId(leftHalfCard.getId());
|
||||
ability.setControllerId(source.getControllerId());
|
||||
ability.setSpellAbilityType(leftHalfCard.getSpellAbility().getSpellAbilityType());
|
||||
ability.setAbilityName(leftHalfCard.getName());
|
||||
game.getState().addOtherAbility(leftHalfCard, ability);
|
||||
// some MDFC's are land IE: sea gate restoration
|
||||
if (!leftHalfCard.isLand(game)) {
|
||||
ForetellCostAbility ability = new ForetellCostAbility(foretellCost);
|
||||
ability.setSourceId(leftHalfCard.getId());
|
||||
ability.setControllerId(source.getControllerId());
|
||||
ability.setSpellAbilityType(leftHalfCard.getSpellAbility().getSpellAbilityType());
|
||||
ability.setAbilityName(leftHalfCard.getName());
|
||||
game.getState().addOtherAbility(leftHalfCard, ability);
|
||||
}
|
||||
}
|
||||
if (foretellSplitCost != null) {
|
||||
ModalDoubleFacesCardHalf rightHalfCard = ((ModalDoubleFacesCard) card).getRightHalfCard();
|
||||
ForetellCostAbility ability = new ForetellCostAbility(foretellSplitCost);
|
||||
ability.setSourceId(rightHalfCard.getId());
|
||||
ability.setControllerId(source.getControllerId());
|
||||
ability.setSpellAbilityType(rightHalfCard.getSpellAbility().getSpellAbilityType());
|
||||
ability.setAbilityName(rightHalfCard.getName());
|
||||
game.getState().addOtherAbility(rightHalfCard, ability);
|
||||
// some MDFC's are land IE: sea gate restoration
|
||||
if (!rightHalfCard.isLand(game)) {
|
||||
ForetellCostAbility ability = new ForetellCostAbility(foretellSplitCost);
|
||||
ability.setSourceId(rightHalfCard.getId());
|
||||
ability.setControllerId(source.getControllerId());
|
||||
ability.setSpellAbilityType(rightHalfCard.getSpellAbility().getSpellAbilityType());
|
||||
ability.setAbilityName(rightHalfCard.getName());
|
||||
game.getState().addOtherAbility(rightHalfCard, ability);
|
||||
}
|
||||
}
|
||||
} else if (card instanceof AdventureCard) {
|
||||
if (foretellCost != null) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue