mirror of
https://github.com/correl/mage.git
synced 2025-04-11 17:00:08 -09:00
Accursed Witch, Vengeful Strangler - fixed rollback error on some usage;
This commit is contained in:
parent
c49ca90b84
commit
6aaf461362
2 changed files with 17 additions and 16 deletions
Mage.Sets/src/mage/cards
|
@ -78,15 +78,17 @@ class AccursedWitchReturnTransformedEffect extends OneShotEffect {
|
|||
if (controller == null || !(game.getState().getZone(source.getSourceId()) == Zone.GRAVEYARD) || attachTo == null) {
|
||||
return false;
|
||||
}
|
||||
game.getState().setValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + source.getSourceId(), Boolean.TRUE);
|
||||
UUID secondFaceId = game.getCard(source.getSourceId()).getSecondCardFace().getId();
|
||||
game.getState().setValue("attachTo:" + secondFaceId, attachTo.getId());
|
||||
//note: should check for null after game.getCard
|
||||
|
||||
Card card = game.getCard(source.getSourceId());
|
||||
if (card != null) {
|
||||
if (controller.moveCards(card, Zone.BATTLEFIELD, source, game)) {
|
||||
attachTo.addAttachment(card.getId(), source, game);
|
||||
}
|
||||
if (card == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
game.getState().setValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + source.getSourceId(), Boolean.TRUE);
|
||||
UUID secondFaceId = card.getSecondCardFace().getId();
|
||||
game.getState().setValue("attachTo:" + secondFaceId, attachTo.getId());
|
||||
if (controller.moveCards(card, Zone.BATTLEFIELD, source, game)) {
|
||||
attachTo.addAttachment(card.getId(), source, game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -86,19 +86,18 @@ class VengefulStranglerEffect extends OneShotEffect {
|
|||
|| game.getState().getZone(source.getSourceId()) != Zone.GRAVEYARD) {
|
||||
return false;
|
||||
}
|
||||
game.getState().setValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + source.getSourceId(), Boolean.TRUE);
|
||||
UUID secondFaceId = game.getCard(source.getSourceId()).getSecondCardFace().getId();
|
||||
game.getState().setValue("attachTo:" + secondFaceId, permanent.getId());
|
||||
|
||||
Card card = game.getCard(source.getSourceId());
|
||||
if (card == null) {
|
||||
return false;
|
||||
}
|
||||
controller.moveCards(card, Zone.BATTLEFIELD, source, game);
|
||||
Permanent sourcePermanent = game.getPermanent(card.getId());
|
||||
if (sourcePermanent == null) {
|
||||
return false;
|
||||
|
||||
game.getState().setValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + source.getSourceId(), Boolean.TRUE);
|
||||
UUID secondFaceId = game.getCard(source.getSourceId()).getSecondCardFace().getId();
|
||||
game.getState().setValue("attachTo:" + secondFaceId, permanent.getId());
|
||||
if (controller.moveCards(card, Zone.BATTLEFIELD, source, game)) {
|
||||
permanent.addAttachment(card.getId(), source, game);
|
||||
}
|
||||
permanent.addAttachment(card.getId(), source, game);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue