forked from External/mage
* Overload - Fixed that Overload ability can't be used to cast a spell without mana to pay.
This commit is contained in:
parent
209f3bc8c8
commit
ea7921c3de
4 changed files with 14 additions and 5 deletions
|
|
@ -37,6 +37,7 @@ import mage.game.Game;
|
|||
import mage.game.events.GameEvent;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -44,7 +45,7 @@ import java.util.UUID;
|
|||
*/
|
||||
public class SpellAbility extends ActivatedAbilityImpl {
|
||||
|
||||
private SpellAbilityType spellAbilityType;
|
||||
protected SpellAbilityType spellAbilityType;
|
||||
|
||||
public SpellAbility(ManaCost cost, String cardName) {
|
||||
this(cost, cardName, Zone.HAND);
|
||||
|
|
@ -102,7 +103,13 @@ public class SpellAbility extends ActivatedAbilityImpl {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Alternate spell abilities (Flashback, Overload) can't be cast with no mana to pay option
|
||||
if (getSpellAbilityType().equals(SpellAbilityType.BASE_ALTERNATE)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null && getSourceId().equals(player.getCastSourceIdWithoutMana())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (costs.canPay(this, sourceId, controllerId, game)) {
|
||||
if (getSpellAbilityType().equals(SpellAbilityType.SPLIT_FUSED)) {
|
||||
SplitCard splitCard = (SplitCard) game.getCard(getSourceId());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue