mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 21:12:04 -08:00
Work in progress changes to support As Foretold
* Modifies how cards with no mana cost are handled. You can now begin to cast them if there is an AlternativeCost that would allow you to play them.
This commit is contained in:
parent
1ce32eb24e
commit
b33e03862a
4 changed files with 230 additions and 7 deletions
|
|
@ -61,8 +61,8 @@ public abstract class EffectImpl implements Effect {
|
|||
public EffectImpl(final EffectImpl effect) {
|
||||
this.id = effect.id;
|
||||
this.outcome = effect.outcome;
|
||||
this.effectType = effect.effectType;
|
||||
this.staticText = effect.staticText;
|
||||
this.effectType = effect.effectType;
|
||||
this.targetPointer = effect.targetPointer.copy();
|
||||
if (effect.values != null) {
|
||||
values = new HashMap<>();
|
||||
|
|
|
|||
|
|
@ -1281,9 +1281,6 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
if (Zone.GRAVEYARD == zone && canPlayCardsFromGraveyard()) {
|
||||
for (ActivatedAbility ability : candidateAbilites.getPlayableAbilities(Zone.HAND)) {
|
||||
if (canUse || ability.getAbilityType() == AbilityType.SPECIAL_ACTION) {
|
||||
if (ability.getManaCosts().isEmpty() && ability.getCosts().isEmpty() && ability instanceof SpellAbility) {
|
||||
continue; // You can't play spells from graveyard that have no costs
|
||||
}
|
||||
if (ability.canActivate(playerId, game)) {
|
||||
output.put(ability.getId(), ability);
|
||||
}
|
||||
|
|
@ -1293,9 +1290,6 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
if (zone != Zone.BATTLEFIELD && game.getContinuousEffects().asThough(object.getId(), AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, this.getId(), game)) {
|
||||
for (Ability ability : candidateAbilites) {
|
||||
if (canUse || ability.getAbilityType() == AbilityType.SPECIAL_ACTION) {
|
||||
if (ability.getManaCosts().isEmpty() && ability.getCosts().isEmpty() && ability instanceof SpellAbility && !(Objects.equals(ability.getSourceId(), getCastSourceIdWithAlternateMana()))) {
|
||||
continue; // You can't play spells that have no costs, unless you can play them without paying their mana costs
|
||||
}
|
||||
ability.setControllerId(this.getId());
|
||||
if (ability instanceof ActivatedAbility && ability.getZone().match(Zone.HAND)
|
||||
&& ((ActivatedAbility) ability).canActivate(playerId, game)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue