mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 20:41:58 -08:00
initial commit for changing CDAs interacting with Scarab God/God-Pharaoh's gift (untested)(#4082)
This commit is contained in:
parent
aa6e4dfd6a
commit
6b2c20b29e
9 changed files with 28 additions and 5 deletions
|
|
@ -17,8 +17,11 @@ import mage.util.SubTypeList;
|
|||
|
||||
import java.io.Serializable;
|
||||
import java.util.EnumSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
|
||||
|
||||
public interface MageObject extends MageItem, Serializable {
|
||||
|
||||
|
|
@ -198,6 +201,8 @@ public interface MageObject extends MageItem, Serializable {
|
|||
|
||||
TextPart addTextPart(TextPart textPart);
|
||||
|
||||
public void removePTCDA();
|
||||
|
||||
default void changeSubType(SubType fromSubType, SubType toSubType) {
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ package mage;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Abilities;
|
||||
|
|
@ -38,12 +39,15 @@ import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
|
|||
import mage.abilities.costs.mana.ManaCost;
|
||||
import mage.abilities.costs.mana.ManaCosts;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.keyword.ChangelingAbility;
|
||||
import mage.abilities.mana.ActivatedManaAbilityImpl;
|
||||
import mage.abilities.text.TextPart;
|
||||
import mage.abilities.text.TextPartSubType;
|
||||
import mage.cards.FrameStyle;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubLayer;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.SubTypeSet;
|
||||
import mage.constants.SuperType;
|
||||
|
|
@ -338,4 +342,15 @@ public abstract class MageObjectImpl implements MageObject {
|
|||
}
|
||||
}
|
||||
|
||||
public void removePTCDA() {
|
||||
for (Iterator<Ability> iter = this.getAbilities().iterator(); iter.hasNext();) {
|
||||
Ability ability = iter.next();
|
||||
for (Effect effect : ability.getEffects()) {
|
||||
if (effect instanceof ContinuousEffect && ((ContinuousEffect) effect).getSublayer() == SubLayer.CharacteristicDefining_7a) {
|
||||
iter.remove();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -233,9 +233,11 @@ public class CreateTokenCopyTargetEffect extends OneShotEffect {
|
|||
token.addAbility(FlyingAbility.getInstance());
|
||||
}
|
||||
if (tokenPower != Integer.MIN_VALUE) {
|
||||
token.removePTCDA();
|
||||
token.getPower().modifyBaseValue(tokenPower);
|
||||
}
|
||||
if (tokenToughness != Integer.MIN_VALUE) {
|
||||
token.removePTCDA();
|
||||
token.getToughness().modifyBaseValue(tokenToughness);
|
||||
}
|
||||
if (additionalSubType != null && !token.hasSubtype(additionalSubType, game)) {
|
||||
|
|
|
|||
|
|
@ -119,6 +119,7 @@ class EternalizeEffect extends OneShotEffect {
|
|||
token.getSubtype(game).add(0, SubType.ZOMBIE);
|
||||
}
|
||||
token.getManaCost().clear();
|
||||
token.removePTCDA();
|
||||
token.getPower().modifyBaseValue(4);
|
||||
token.getToughness().modifyBaseValue(4);
|
||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.ETERNALIZED_CREATURE, token.getId(), source.getSourceId(), controller.getId()));
|
||||
|
|
|
|||
|
|
@ -310,8 +310,4 @@ public class Token extends MageObjectImpl {
|
|||
this.setExpansionSetCodeForImage(setCode);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue