mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 12:02:01 -08:00
Some minor changes.
This commit is contained in:
parent
58a22fc82c
commit
c2b68a9b6f
2 changed files with 9 additions and 3 deletions
|
|
@ -1078,7 +1078,7 @@ public class ContinuousEffects implements Serializable {
|
||||||
public void addEffect(ContinuousEffect effect, UUID sourceId, Ability source) {
|
public void addEffect(ContinuousEffect effect, UUID sourceId, Ability source) {
|
||||||
if (!(source instanceof MageSingleton)) { // because MageSingletons may never be removed by removing the temporary effecs they are not added to the temporaryEffects to prevent this
|
if (!(source instanceof MageSingleton)) { // because MageSingletons may never be removed by removing the temporary effecs they are not added to the temporaryEffects to prevent this
|
||||||
effect.setTemporary(true);
|
effect.setTemporary(true);
|
||||||
Set abilities = temporaryEffects.get(effect);
|
Set<Ability> abilities = temporaryEffects.get(effect);
|
||||||
if (abilities == null) {
|
if (abilities == null) {
|
||||||
abilities = new HashSet<>();
|
abilities = new HashSet<>();
|
||||||
temporaryEffects.put(effect, abilities);
|
temporaryEffects.put(effect, abilities);
|
||||||
|
|
|
||||||
|
|
@ -136,8 +136,14 @@ public class CopyEffect extends ContinuousEffectImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
permanent.removeAllAbilities(source.getSourceId(), game);
|
permanent.removeAllAbilities(source.getSourceId(), game);
|
||||||
for (Ability ability : copyFromObject.getAbilities()) {
|
if (copyFromObject instanceof Permanent) {
|
||||||
permanent.addAbility(ability, getSourceId(), game, false); // no new Id so consumed replacement effects are known while new continuousEffects.apply happen.
|
for (Ability ability : ((Permanent) copyFromObject).getAbilities(game)) {
|
||||||
|
permanent.addAbility(ability, getSourceId(), game, false); // no new Id so consumed replacement effects are known while new continuousEffects.apply happen.
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (Ability ability : copyFromObject.getAbilities()) {
|
||||||
|
permanent.addAbility(ability, getSourceId(), game, false); // no new Id so consumed replacement effects are known while new continuousEffects.apply happen.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
permanent.getPower().setValue(copyFromObject.getPower().getValue());
|
permanent.getPower().setValue(copyFromObject.getPower().getValue());
|
||||||
permanent.getToughness().setValue(copyFromObject.getToughness().getValue());
|
permanent.getToughness().setValue(copyFromObject.getToughness().getValue());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue