forked from External/mage
- Fixed #6056. Please test when you can. Now you will see other abilities/spellAbilities from cards presented during the cast from exile. Overload, Emerge, Surge, etc.
This commit is contained in:
parent
76da8dd539
commit
2de7c136ea
11 changed files with 135 additions and 66 deletions
|
|
@ -1462,6 +1462,12 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
for (Ability ability : object.getAbilities()) {
|
||||
if (ability instanceof SpellAbility) {
|
||||
switch (((SpellAbility) ability).getSpellAbilityType()) {
|
||||
case BASE_ALTERNATE:
|
||||
ActivationStatus as = ((SpellAbility) ability).canActivate(playerId, game);
|
||||
if (as.canActivate()) {
|
||||
useable.put(ability.getId(), (SpellAbility) ability); // example: Chandra, Torch of Defiance +1 loyal ability
|
||||
}
|
||||
return useable;
|
||||
case SPLIT_FUSED:
|
||||
if (zone == Zone.HAND) {
|
||||
if (ability.canChooseTarget(game)) {
|
||||
|
|
@ -1502,7 +1508,7 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
// Get the usable activated abilities for a *single card object*, that is, either a card or half of a split card.
|
||||
// Also called on the whole split card but only passing the fuse ability and other whole-split-card shared abilities
|
||||
// as candidates.
|
||||
private void getUseableActivatedAbilitiesHalfImpl(MageObject object, Zone zone, Game game, Abilities<Ability> candidateAbilites,
|
||||
private void getUseableActivatedAbilitiesHalfImpl(MageObject object, Zone zone, Game game, Abilities<Ability> candidateAbilites,
|
||||
LinkedHashMap<UUID, ActivatedAbility> output) {
|
||||
boolean canUse = !(object instanceof Permanent) || ((Permanent) object).canUseActivatedAbilities(game);
|
||||
ManaOptions availableMana = null;
|
||||
|
|
@ -4345,4 +4351,9 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
public FilterMana getPhyrexianColors() {
|
||||
return this.phyrexianColors;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SpellAbility chooseAbilityForCast(Card card, Game game, boolean noMana) {
|
||||
return card.getSpellAbility();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue