[ONE] Implement Vraska, Betrayal's Sting (#9933)

This commit is contained in:
PurpleCrowbar 2023-02-09 18:19:30 +00:00 committed by GitHub
parent c671a48efa
commit f697f92a63
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 119 additions and 6 deletions

View file

@ -23,6 +23,7 @@ public class BecomesCreatureTargetEffect extends ContinuousEffectImpl {
protected boolean loseName;
protected boolean keepAbilities;
protected boolean removeSubtypes = false;
protected boolean loseOtherCardTypes;
public BecomesCreatureTargetEffect(Token token, boolean loseAllAbilities, boolean stillALand, Duration duration) {
this(token, loseAllAbilities, stillALand, duration, false);
@ -32,23 +33,29 @@ public class BecomesCreatureTargetEffect extends ContinuousEffectImpl {
this(token, loseAllAbilities, stillALand, duration, loseName, false);
}
public BecomesCreatureTargetEffect(Token token, boolean loseAllAbilities, boolean stillALand, Duration duration, boolean loseName, boolean keepAbilities) {
this(token, loseAllAbilities, stillALand, duration, loseName, keepAbilities, false);
}
/**
* @param token
* @param loseAllAbilities loses all subtypes, colors and abilities
* @param stillALand add rule text, "it's still a land"
* @param loseName permanent lose name and get's it from token
* @param keepAbilities lose types/colors, but keep abilities (example:
* @param loseName permanent loses name and gets it from token
* @param keepAbilities lose subtypes/colors, but keep abilities (example:
* Scale Up)
* @param duration
* @param loseOtherCardTypes permanent loses other (original) card types, exclusively obtains card types of token
*/
public BecomesCreatureTargetEffect(Token token, boolean loseAllAbilities, boolean stillALand, Duration duration, boolean loseName,
boolean keepAbilities) {
boolean keepAbilities, boolean loseOtherCardTypes) {
super(duration, Outcome.BecomeCreature);
this.token = token;
this.loseAllAbilities = loseAllAbilities;
this.addStillALandText = stillALand;
this.loseName = loseName;
this.keepAbilities = keepAbilities;
this.loseOtherCardTypes = loseOtherCardTypes;
this.dependencyTypes.add(DependencyType.BecomeCreature);
}
@ -59,6 +66,7 @@ public class BecomesCreatureTargetEffect extends ContinuousEffectImpl {
this.addStillALandText = effect.addStillALandText;
this.loseName = effect.loseName;
this.keepAbilities = effect.keepAbilities;
this.loseOtherCardTypes = effect.loseOtherCardTypes;
this.dependencyTypes.add(DependencyType.BecomeCreature);
}
@ -83,12 +91,15 @@ public class BecomesCreatureTargetEffect extends ContinuousEffectImpl {
break;
case TypeChangingEffects_4:
if (loseOtherCardTypes) {
permanent.removeAllCardTypes(game);
}
if (loseAllAbilities || keepAbilities || removeSubtypes) {
permanent.removeAllSubTypes(game);
}
for (CardType t : token.getCardType(game)) {
permanent.addCardType(game, t);
}
if (loseAllAbilities || removeSubtypes) {
permanent.removeAllCreatureTypes(game);
}
permanent.copySubTypesFrom(game, token);
for (SuperType t : token.getSuperType()) {