Refactor: Add proper support for modifying and querying base P/T (#9409)

This commit is contained in:
Alex Vasile 2022-09-01 19:57:30 -04:00 committed by GitHub
parent d83eb41073
commit 07a142c9e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
415 changed files with 1844 additions and 2095 deletions

View file

@ -1,5 +1,6 @@
package mage.game.permanent;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.costs.mana.ManaCost;
@ -25,8 +26,8 @@ public class PermanentToken extends PermanentImpl {
this.token = token.copy();
this.token.getAbilities().newOriginalId(); // neccessary if token has ability like DevourAbility()
this.token.getAbilities().setSourceId(objectId);
this.power.modifyBaseValue(token.getPower().getBaseValueModified());
this.toughness.modifyBaseValue(token.getToughness().getBaseValueModified());
this.power = new MageInt(token.getPower().getModifiedBaseValue());
this.toughness = new MageInt(token.getToughness().getModifiedBaseValue());
this.copyFromToken(this.token, game, false); // needed to have at this time (e.g. for subtypes for entersTheBattlefield replacement effects)
// token's ZCC must be synced with original token to keep abilities settings