mirror of
https://github.com/correl/mage.git
synced 2025-01-13 19:11:33 +00:00
Fix: multiple token copies of Aurelia didn't trigger additional combat
Cause: the checkTrigger was trying to find the source as a card but if the source was a token, getCard wouldn't find anything, causing sourceCard to be null. The first token copy would trigger, but additional copies attacking for the first time were using the same counter in game.getState because sourceCard was null. By using getPermanent, checkTrigger can now find the token that was the source of the trigger and can accurately track amountAttacks for each Aurelia permanent.
This commit is contained in:
parent
ecbe7e68a6
commit
eebd6b3af4
1 changed files with 2 additions and 1 deletions
|
@ -48,6 +48,7 @@ import mage.filter.common.FilterControlledCreaturePermanent;
|
|||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -118,7 +119,7 @@ class AureliaAttacksTriggeredAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (event.getSourceId().equals(this.getSourceId()) ) {
|
||||
Card sourceCard = game.getCard(getSourceId());
|
||||
Permanent sourceCard = game.getPermanent(getSourceId());
|
||||
Integer amountAttacks = (Integer) game.getState().getValue(getValueKey(sourceCard, game));
|
||||
if (amountAttacks == null || amountAttacks < 1) {
|
||||
if (amountAttacks == null) {
|
||||
|
|
Loading…
Reference in a new issue