execute targeted trigger passing in item on stack
parent
d521ecb329
commit
e2dcaf6651
|
@ -4,6 +4,7 @@ import magic.model.MagicGame;
|
|||
import magic.model.event.MagicEvent;
|
||||
import magic.model.trigger.MagicTriggerType;
|
||||
import magic.model.choice.MagicTargetChoice;
|
||||
import magic.model.stack.MagicItemOnStack;
|
||||
|
||||
public class MagicExecuteFirstEventAction extends MagicAction {
|
||||
|
||||
|
@ -20,8 +21,9 @@ public class MagicExecuteFirstEventAction extends MagicAction {
|
|||
game.executeEvent(firstEvent,choiceResults);
|
||||
if (firstEvent.getChoice() instanceof MagicTargetChoice) {
|
||||
final MagicTargetChoice tchoice = (MagicTargetChoice)firstEvent.getChoice();
|
||||
if (tchoice.isTargeted()) {
|
||||
game.executeTrigger(MagicTriggerType.WhenTargeted, firstEvent.getSource());
|
||||
final MagicItemOnStack item = game.getStack().get(firstEvent);
|
||||
if (tchoice.isTargeted() && item != null) {
|
||||
game.executeTrigger(MagicTriggerType.WhenTargeted, item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue