mirror of
https://github.com/correl/mage.git
synced 2025-04-02 03:18:09 -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())) {
|
||||
Permanent attachedTo = game.getPermanentOrLKIBattlefield(attachment.getAttachedTo());
|
||||
if (attachedTo != null
|
||||
&& game.getState().getZone(attachedTo.getId()) == (Zone.GRAVEYARD) // Demonic Vigor
|
||||
&& attachmentCard != null
|
||||
&& attachment.getAttachedToZoneChangeCounter() == attachedTo.getZoneChangeCounter(game)
|
||||
&& attachment.getZoneChangeCounter(game) == attachmentCard.getZoneChangeCounter(game)) {
|
||||
|
@ -92,6 +93,7 @@ public class DiesAttachedTriggeredAbility extends TriggeredAbilityImpl {
|
|||
for (Effect effect : getEffects()) {
|
||||
if (zEvent.getTarget() != null) {
|
||||
effect.setValue("attachedTo", zEvent.getTarget());
|
||||
effect.setValue("zcc", zEvent.getTarget().getZoneChangeCounter(game) + 1); // zone change info from battlefield
|
||||
if (setTargetPointer == SetTargetPointer.ATTACHED_TO_CONTROLLER) {
|
||||
Permanent attachment = game.getPermanentOrLKIBattlefield(getSourceId());
|
||||
if (attachment != null
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
package mage.abilities.effects.common;
|
||||
|
||||
import mage.constants.Outcome;
|
||||
|
@ -34,8 +32,9 @@ public class ReturnToHandAttachedEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Object object = getValue("attachedTo");
|
||||
if (object instanceof Permanent) {
|
||||
Card card = game.getCard(((Permanent)object).getId());
|
||||
if (card != null) {
|
||||
Card card = game.getCard(((Permanent) object).getId());
|
||||
if (card != null
|
||||
&& getValue("zcc").equals(game.getState().getZoneChangeCounter(card.getId()))) { // Necrogenesis, etc.
|
||||
if (card.moveToZone(Zone.HAND, source.getSourceId(), game, false)) {
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue