mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 13:02:06 -08:00
Unstable Shapeshifter fixed some bugs and clean up.
This commit is contained in:
parent
0ed441b11f
commit
777025bea4
2 changed files with 21 additions and 6 deletions
|
|
@ -1489,6 +1489,18 @@ public abstract class GameImpl implements Game, Serializable {
|
|||
Ability newAbility = source.copy();
|
||||
newEffect.init(newAbility, this);
|
||||
|
||||
// If there are already copy effects with dration = Custom to the same object, remove the existing effects because they no longer have any effect
|
||||
if (Duration.Custom.equals(duration)) {
|
||||
for (Effect effect : getState().getContinuousEffects().getLayeredEffects(this)) {
|
||||
if (effect instanceof CopyEffect) {
|
||||
CopyEffect copyEffect = (CopyEffect) effect;
|
||||
// there is another copy effect that copies to the same permanent
|
||||
if (copyEffect.getSourceId().equals(copyToPermanentId) && copyEffect.getDuration().equals(Duration.Custom)) {
|
||||
copyEffect.discard();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
state.addEffect(newEffect, newAbility);
|
||||
return newBluePrint;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue