mirror of
https://github.com/correl/mage.git
synced 2025-04-06 09:13:45 -09:00
- Fixed #6034
This commit is contained in:
parent
d2115b0425
commit
75b82018e1
2 changed files with 5 additions and 4 deletions
Mage/src/main/java/mage/abilities
|
@ -81,6 +81,7 @@ public class DiesAttachedTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
&& zEvent.getTargetId().equals(attachment.getAttachedTo())) {
|
&& zEvent.getTargetId().equals(attachment.getAttachedTo())) {
|
||||||
Permanent attachedTo = game.getPermanentOrLKIBattlefield(attachment.getAttachedTo());
|
Permanent attachedTo = game.getPermanentOrLKIBattlefield(attachment.getAttachedTo());
|
||||||
if (attachedTo != null
|
if (attachedTo != null
|
||||||
|
&& game.getState().getZone(attachedTo.getId()) == (Zone.GRAVEYARD) // Demonic Vigor
|
||||||
&& attachmentCard != null
|
&& attachmentCard != null
|
||||||
&& attachment.getAttachedToZoneChangeCounter() == attachedTo.getZoneChangeCounter(game)
|
&& attachment.getAttachedToZoneChangeCounter() == attachedTo.getZoneChangeCounter(game)
|
||||||
&& attachment.getZoneChangeCounter(game) == attachmentCard.getZoneChangeCounter(game)) {
|
&& attachment.getZoneChangeCounter(game) == attachmentCard.getZoneChangeCounter(game)) {
|
||||||
|
@ -92,6 +93,7 @@ public class DiesAttachedTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
for (Effect effect : getEffects()) {
|
for (Effect effect : getEffects()) {
|
||||||
if (zEvent.getTarget() != null) {
|
if (zEvent.getTarget() != null) {
|
||||||
effect.setValue("attachedTo", zEvent.getTarget());
|
effect.setValue("attachedTo", zEvent.getTarget());
|
||||||
|
effect.setValue("zcc", zEvent.getTarget().getZoneChangeCounter(game) + 1); // zone change info from battlefield
|
||||||
if (setTargetPointer == SetTargetPointer.ATTACHED_TO_CONTROLLER) {
|
if (setTargetPointer == SetTargetPointer.ATTACHED_TO_CONTROLLER) {
|
||||||
Permanent attachment = game.getPermanentOrLKIBattlefield(getSourceId());
|
Permanent attachment = game.getPermanentOrLKIBattlefield(getSourceId());
|
||||||
if (attachment != null
|
if (attachment != null
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
|
|
||||||
|
|
||||||
package mage.abilities.effects.common;
|
package mage.abilities.effects.common;
|
||||||
|
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
|
@ -34,8 +32,9 @@ public class ReturnToHandAttachedEffect extends OneShotEffect {
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Object object = getValue("attachedTo");
|
Object object = getValue("attachedTo");
|
||||||
if (object instanceof Permanent) {
|
if (object instanceof Permanent) {
|
||||||
Card card = game.getCard(((Permanent)object).getId());
|
Card card = game.getCard(((Permanent) object).getId());
|
||||||
if (card != null) {
|
if (card != null
|
||||||
|
&& getValue("zcc").equals(game.getState().getZoneChangeCounter(card.getId()))) { // Necrogenesis, etc.
|
||||||
if (card.moveToZone(Zone.HAND, source.getSourceId(), game, false)) {
|
if (card.moveToZone(Zone.HAND, source.getSourceId(), game, false)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue