mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 11:32:00 -08:00
Fixed Awakening of Vitu-Ghazi that it doesn't change the name of the land it is cast on
This commit is contained in:
parent
e058a9d02e
commit
0ef003a4a7
2 changed files with 24 additions and 4 deletions
|
|
@ -28,7 +28,7 @@ public final class AwakeningOfVituGhazi extends CardImpl {
|
||||||
// Put nine +1/+1 counters on target land you control. It becomes a legendary 0/0 Elemental creature with haste named Vitu-Ghazi. It's still a land.
|
// Put nine +1/+1 counters on target land you control. It becomes a legendary 0/0 Elemental creature with haste named Vitu-Ghazi. It's still a land.
|
||||||
this.getSpellAbility().addEffect(new AddCountersTargetEffect(CounterType.P1P1.createInstance(9)));
|
this.getSpellAbility().addEffect(new AddCountersTargetEffect(CounterType.P1P1.createInstance(9)));
|
||||||
this.getSpellAbility().addEffect(new BecomesCreatureTargetEffect(
|
this.getSpellAbility().addEffect(new BecomesCreatureTargetEffect(
|
||||||
new AwakeningOfVituGhaziToken(), false, true, Duration.Custom
|
new AwakeningOfVituGhaziToken(), false, true, Duration.Custom, true
|
||||||
).setText("It becomes a legendary 0/0 Elemental creature with haste named Vitu-Ghazi. It's still a land."));
|
).setText("It becomes a legendary 0/0 Elemental creature with haste named Vitu-Ghazi. It's still a land."));
|
||||||
this.getSpellAbility().addTarget(new TargetPermanent(StaticFilters.FILTER_CONTROLLED_PERMANENT_LAND));
|
this.getSpellAbility().addTarget(new TargetPermanent(StaticFilters.FILTER_CONTROLLED_PERMANENT_LAND));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,25 +20,34 @@ public class BecomesCreatureTargetEffect extends ContinuousEffectImpl {
|
||||||
protected Token token;
|
protected Token token;
|
||||||
protected boolean loseAllAbilities;
|
protected boolean loseAllAbilities;
|
||||||
protected boolean addStillALandText;
|
protected boolean addStillALandText;
|
||||||
|
protected boolean loseName;
|
||||||
|
|
||||||
|
|
||||||
|
public BecomesCreatureTargetEffect(Token token, boolean loseAllAbilities, boolean stillALand, Duration duration) {
|
||||||
|
this(token, loseAllAbilities, stillALand, duration, false);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param token
|
* @param token
|
||||||
* @param loseAllAbilities loses all subtypes and colors
|
* @param loseAllAbilities loses all subtypes and colors
|
||||||
* @param stillALand add rule text, "it's still a land"
|
* @param stillALand add rule text, "it's still a land"
|
||||||
|
* @param loseName permanent lose name and get's it from token
|
||||||
* @param duration
|
* @param duration
|
||||||
*/
|
*/
|
||||||
public BecomesCreatureTargetEffect(Token token, boolean loseAllAbilities, boolean stillALand, Duration duration) {
|
public BecomesCreatureTargetEffect(Token token, boolean loseAllAbilities, boolean stillALand, Duration duration, boolean loseName) {
|
||||||
super(duration, Outcome.BecomeCreature);
|
super(duration, Outcome.BecomeCreature);
|
||||||
this.token = token;
|
this.token = token;
|
||||||
this.loseAllAbilities = loseAllAbilities;
|
this.loseAllAbilities = loseAllAbilities;
|
||||||
this.addStillALandText = stillALand;
|
this.addStillALandText = stillALand;
|
||||||
|
this.loseName = loseName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BecomesCreatureTargetEffect(final BecomesCreatureTargetEffect effect) {
|
public BecomesCreatureTargetEffect(final BecomesCreatureTargetEffect effect) {
|
||||||
super(effect);
|
super(effect);
|
||||||
token = effect.token.copy();
|
this.token = effect.token.copy();
|
||||||
this.loseAllAbilities = effect.loseAllAbilities;
|
this.loseAllAbilities = effect.loseAllAbilities;
|
||||||
this.addStillALandText = effect.addStillALandText;
|
this.addStillALandText = effect.addStillALandText;
|
||||||
|
this.loseName = effect.loseName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -53,6 +62,13 @@ public class BecomesCreatureTargetEffect extends ContinuousEffectImpl {
|
||||||
Permanent permanent = game.getPermanent(permanentId);
|
Permanent permanent = game.getPermanent(permanentId);
|
||||||
if (permanent != null) {
|
if (permanent != null) {
|
||||||
switch (layer) {
|
switch (layer) {
|
||||||
|
case TextChangingEffects_3:
|
||||||
|
if (sublayer == SubLayer.NA) {
|
||||||
|
if (loseName) {
|
||||||
|
permanent.setName(token.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
case TypeChangingEffects_4:
|
case TypeChangingEffects_4:
|
||||||
if (sublayer == SubLayer.NA) {
|
if (sublayer == SubLayer.NA) {
|
||||||
if (loseAllAbilities) {
|
if (loseAllAbilities) {
|
||||||
|
|
@ -125,7 +141,11 @@ public class BecomesCreatureTargetEffect extends ContinuousEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasLayer(Layer layer) {
|
public boolean hasLayer(Layer layer) {
|
||||||
return layer == Layer.PTChangingEffects_7 || layer == Layer.AbilityAddingRemovingEffects_6 || layer == Layer.ColorChangingEffects_5 || layer == Layer.TypeChangingEffects_4;
|
return layer == Layer.PTChangingEffects_7
|
||||||
|
|| layer == Layer.AbilityAddingRemovingEffects_6
|
||||||
|
|| layer == Layer.ColorChangingEffects_5
|
||||||
|
|| layer == Layer.TypeChangingEffects_4
|
||||||
|
|| layer == Layer.TextChangingEffects_3;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue