mirror of
https://github.com/magefree/mage.git
synced 2025-12-28 14:32:06 -08:00
Layered copy effect is now removed, if source permanent leaves battlefield.
This commit is contained in:
parent
d7cab00905
commit
6c21bf7ea6
1 changed files with 11 additions and 1 deletions
|
|
@ -50,7 +50,7 @@ public class CopyEffect extends ContinuousEffectImpl<CopyEffect> {
|
|||
private UUID sourceId;
|
||||
|
||||
public CopyEffect(Permanent target, UUID sourceId) {
|
||||
super(Duration.WhileOnBattlefield, Layer.CopyEffects_1, SubLayer.NA, Outcome.BecomeCreature);
|
||||
super(Duration.Custom, Layer.CopyEffects_1, SubLayer.NA, Outcome.BecomeCreature);
|
||||
this.target = target;
|
||||
this.sourceId = sourceId;
|
||||
}
|
||||
|
|
@ -99,6 +99,16 @@ public class CopyEffect extends ContinuousEffectImpl<CopyEffect> {
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInactive(Ability source, Game game) {
|
||||
// The copy effect is added, if the copy takes place. If source leaves battlefield, the copy effect must cease to exist
|
||||
Permanent permanent = game.getPermanent(this.sourceId);
|
||||
if (permanent == null) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CopyEffect copy() {
|
||||
return new CopyEffect(this);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue