mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 13:02:06 -08:00
Fixed wrong targetId in CAST_SPELL, fixed miss code from 7b7bbcadd6;
This commit is contained in:
parent
a0e046bf70
commit
261f32d9b9
5 changed files with 48 additions and 26 deletions
|
|
@ -1380,8 +1380,10 @@ public class ComputerPlayer extends PlayerImpl implements Player {
|
|||
for (Mana avail : available) {
|
||||
if (mana.enough(avail)) {
|
||||
SpellAbility ability = card.getSpellAbility();
|
||||
GameEvent castEvent = GameEvent.getEvent(GameEvent.EventType.CAST_SPELL, ability.getId(), ability, playerId);
|
||||
castEvent.setZone(game.getState().getZone(card.getMainCard().getId()));
|
||||
if (ability != null && ability.canActivate(playerId, game).canActivate()
|
||||
&& !game.getContinuousEffects().preventedByRuleModification(GameEvent.getEvent(GameEvent.EventType.CAST_SPELL, ability.getSourceId(), ability, playerId), ability, game, true)) {
|
||||
&& !game.getContinuousEffects().preventedByRuleModification(castEvent, ability, game, true)) {
|
||||
if (card.isInstant(game)
|
||||
|| card.hasAbility(FlashAbility.getInstance(), game)) {
|
||||
playableInstant.add(card);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue