mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
Zada, Hedron Grinder - Fixed some problems with targeting handling (fixes #1790).
This commit is contained in:
parent
74c310de3e
commit
c12157962d
2 changed files with 5 additions and 4 deletions
|
@ -183,19 +183,20 @@ class ZadaHedronGrinderEffect extends OneShotEffect {
|
|||
for (Permanent creature : game.getState().getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) {
|
||||
if (!creature.getId().equals(source.getSourceId()) && usedTarget.canTarget(source.getControllerId(), creature.getId(), source, game)) {
|
||||
Spell copy = spell.copySpell(source.getControllerId());
|
||||
game.getStack().push(copy);
|
||||
setTarget:
|
||||
for (Mode mode : spell.getSpellAbility().getModes().getSelectedModes()) {
|
||||
for (Mode mode : copy.getSpellAbility().getModes().getSelectedModes()) {
|
||||
for (Target target : mode.getTargets()) {
|
||||
if (target.getClass().equals(usedTarget.getClass())) {
|
||||
target.clearChosen(); // For targets with Max > 1 we need to clear before the text is comapred
|
||||
if (target.getMessage().equals(usedTarget.getMessage())) {
|
||||
target.add(creature.getId(), game);
|
||||
target.addTarget(creature.getId(), copy.getSpellAbility(), game, false);
|
||||
break setTarget;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
game.getStack().push(copy);
|
||||
|
||||
String activateMessage = copy.getActivatedMessage(game);
|
||||
if (activateMessage.startsWith(" casts ")) {
|
||||
activateMessage = activateMessage.substring(6);
|
||||
|
|
|
@ -105,7 +105,7 @@ class CreaturesYouControlBecomesTargetTriggeredAbility extends TriggeredAbilityI
|
|||
if (object != null && object instanceof Spell) {
|
||||
Card c = (Spell) object;
|
||||
if (c.getCardType().contains(CardType.INSTANT) || c.getCardType().contains(CardType.SORCERY)) {
|
||||
if (getTargets().size() == 0) {
|
||||
if (getTargets().isEmpty()) {
|
||||
for (Effect effect : getEffects()) {
|
||||
effect.setTargetPointer(new FixedTarget(event.getTargetId()));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue