mirror of
https://github.com/magefree/mage.git
synced 2026-01-23 19:59:54 -08:00
* Prison Term - Fixed tht the enchantment did not move to new creature.
This commit is contained in:
parent
a4677f2cbb
commit
39f39479c1
1 changed files with 9 additions and 7 deletions
|
|
@ -110,12 +110,14 @@ class PrisonTermEffect extends OneShotEffect<PrisonTermEffect> {
|
|||
Player you = game.getPlayer(source.getControllerId());
|
||||
Permanent opponentCreature = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||
Permanent prisonTerm = game.getPermanent(source.getSourceId());
|
||||
if (you != null
|
||||
&& opponentCreature != null
|
||||
&& prisonTerm != null
|
||||
&& opponentCreature.getCardType().contains(CardType.CREATURE)) {
|
||||
game.getState().setValue("attachTo:" + prisonTerm.getId(), opponentCreature);
|
||||
return opponentCreature.addAttachment(prisonTerm.getId(), game);
|
||||
if (you != null && opponentCreature != null && prisonTerm != null) {
|
||||
Permanent oldCreature = game.getPermanent(prisonTerm.getAttachedTo());
|
||||
if (oldCreature == null) {
|
||||
return false;
|
||||
}
|
||||
if (oldCreature.removeAttachment(prisonTerm.getId(), game)) {
|
||||
return opponentCreature.addAttachment(prisonTerm.getId(), game);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
@ -124,4 +126,4 @@ class PrisonTermEffect extends OneShotEffect<PrisonTermEffect> {
|
|||
public PrisonTermEffect copy() {
|
||||
return new PrisonTermEffect(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue