mirror of
https://github.com/correl/mage.git
synced 2025-01-13 19:11:33 +00:00
Fixed bug in BecomesCreatureTargetEffect not changing P/T to zero if token has such a P/T.
This commit is contained in:
parent
8d135fafbb
commit
e0ff641952
1 changed files with 19 additions and 16 deletions
|
@ -48,6 +48,12 @@ public class BecomesCreatureTargetEffect extends ContinuousEffectImpl<BecomesCre
|
||||||
protected Token token;
|
protected Token token;
|
||||||
protected String type;
|
protected String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param token
|
||||||
|
* @param subType - subType the target remains (used in rule text), if set the subtypes are not cleared
|
||||||
|
* @param duration
|
||||||
|
*/
|
||||||
public BecomesCreatureTargetEffect(Token token, String type, Duration duration) {
|
public BecomesCreatureTargetEffect(Token token, String type, Duration duration) {
|
||||||
super(duration, Outcome.BecomeCreature);
|
super(duration, Outcome.BecomeCreature);
|
||||||
this.token = token;
|
this.token = token;
|
||||||
|
@ -74,6 +80,12 @@ public class BecomesCreatureTargetEffect extends ContinuousEffectImpl<BecomesCre
|
||||||
switch (layer) {
|
switch (layer) {
|
||||||
case TypeChangingEffects_4:
|
case TypeChangingEffects_4:
|
||||||
if (sublayer == SubLayer.NA) {
|
if (sublayer == SubLayer.NA) {
|
||||||
|
if (type == null) {
|
||||||
|
permanent.getSubtype().clear();
|
||||||
|
if (token.getSubtype().size() > 0) {
|
||||||
|
permanent.getSubtype().addAll(token.getSubtype());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
if (token.getCardType().size() > 0) {
|
if (token.getCardType().size() > 0) {
|
||||||
for (CardType t : token.getCardType()) {
|
for (CardType t : token.getCardType()) {
|
||||||
if (!permanent.getCardType().contains(t)) {
|
if (!permanent.getCardType().contains(t)) {
|
||||||
|
@ -81,11 +93,6 @@ public class BecomesCreatureTargetEffect extends ContinuousEffectImpl<BecomesCre
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (type == null) {
|
|
||||||
permanent.getSubtype().clear();
|
|
||||||
}
|
|
||||||
if (token.getSubtype().size() > 0) {
|
|
||||||
permanent.getSubtype().addAll(token.getSubtype());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -106,12 +113,8 @@ public class BecomesCreatureTargetEffect extends ContinuousEffectImpl<BecomesCre
|
||||||
break;
|
break;
|
||||||
case PTChangingEffects_7:
|
case PTChangingEffects_7:
|
||||||
if (sublayer == SubLayer.SetPT_7b) {
|
if (sublayer == SubLayer.SetPT_7b) {
|
||||||
int power = token.getPower().getValue();
|
permanent.getToughness().setValue(token.getToughness().getValue());
|
||||||
int toughness = token.getToughness().getValue();
|
permanent.getPower().setValue(token.getPower().getValue());
|
||||||
if (power != 0 && toughness != 0) {
|
|
||||||
permanent.getPower().setValue(power);
|
|
||||||
permanent.getToughness().setValue(toughness);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue