mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 20:41:58 -08:00
* Lightning Storm - Fixed that opponents of the caster can't activate the ability on the stack.
This commit is contained in:
parent
9221e4eb64
commit
e5812a850b
3 changed files with 106 additions and 13 deletions
|
|
@ -191,7 +191,7 @@ public abstract class ActivatedAbilityImpl extends AbilityImpl implements Activa
|
|||
//20091005 - 602.5d/602.5e
|
||||
if (timing == TimingRule.INSTANT || game.canPlaySorcery(playerId)
|
||||
|| game.getContinuousEffects().asThough(sourceId, AsThoughEffectType.ACTIVATE_AS_INSTANT, this, controllerId, game)) {
|
||||
if (costs.canPay(this, sourceId, controllerId, game) && canChooseTarget(game)) {
|
||||
if (costs.canPay(this, sourceId, playerId, game) && canChooseTarget(game)) {
|
||||
this.activatorId = playerId;
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1184,18 +1184,23 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (ability.getAbilityType().equals(AbilityType.SPECIAL_ACTION)) {
|
||||
result = specialAction((SpecialAction) ability.copy(), game);
|
||||
} else if (ability.getAbilityType().equals(AbilityType.MANA)) {
|
||||
result = playManaAbility((ManaAbility) ability.copy(), game);
|
||||
} else if (ability.getAbilityType().equals(AbilityType.SPELL)) {
|
||||
if (ability instanceof FlashbackAbility) {
|
||||
switch (ability.getAbilityType()) {
|
||||
case SPECIAL_ACTION:
|
||||
result = specialAction((SpecialAction) ability.copy(), game);
|
||||
break;
|
||||
case MANA:
|
||||
result = playManaAbility((ManaAbility) ability.copy(), game);
|
||||
break;
|
||||
case SPELL:
|
||||
if (ability instanceof FlashbackAbility) {
|
||||
result = playAbility(ability.copy(), game);
|
||||
} else {
|
||||
result = cast((SpellAbility) ability, game, false);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
result = playAbility(ability.copy(), game);
|
||||
} else {
|
||||
result = cast((SpellAbility) ability, game, false);
|
||||
}
|
||||
} else {
|
||||
result = playAbility(ability.copy(), game);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2398,7 +2403,7 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
}
|
||||
if (canBeCastRegularly) {
|
||||
ManaOptions abilityOptions = copy.getManaCostsToPay().getOptions();
|
||||
if (abilityOptions.size() == 0) {
|
||||
if (abilityOptions.isEmpty()) {
|
||||
return true;
|
||||
} else {
|
||||
if (available == null) {
|
||||
|
|
@ -2639,6 +2644,16 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
}
|
||||
}
|
||||
}
|
||||
// activated abilities from stack objects
|
||||
for (StackObject stackObject : game.getState().getStack()) {
|
||||
for (ActivatedAbility ability : stackObject.getAbilities().getActivatedAbilities(Zone.STACK)) {
|
||||
if (ability instanceof ActivatedAbility
|
||||
&& canPlay(ability, availableMana, game.getObject(ability.getSourceId()), game)) {
|
||||
playableActivated.put(ability.toString(), ability);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
// activated abilities from objects in the command zone (emblems or commanders)
|
||||
for (CommandObject commandObject : game.getState().getCommand()) {
|
||||
for (ActivatedAbility ability : commandObject.getAbilities().getActivatedAbilities(Zone.COMMAND)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue