mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
Merge origin/master
This commit is contained in:
commit
8afd51fa04
24 changed files with 246 additions and 289 deletions
|
|
@ -38,13 +38,33 @@ import mage.game.permanent.Permanent;
|
|||
*/
|
||||
public class BecomesBlackZombieAdditionEffect extends ContinuousEffectImpl {
|
||||
|
||||
private boolean giveBlackColor = true;
|
||||
|
||||
public BecomesBlackZombieAdditionEffect() {
|
||||
super(Duration.Custom, Outcome.Neutral);
|
||||
staticText = "That creature is a black Zombie in addition to its other colors and types";
|
||||
this.giveBlackColor = true;
|
||||
updateText();
|
||||
}
|
||||
|
||||
public BecomesBlackZombieAdditionEffect(boolean giveBlackColor) {
|
||||
this();
|
||||
this.giveBlackColor = giveBlackColor;
|
||||
updateText();
|
||||
}
|
||||
|
||||
|
||||
public BecomesBlackZombieAdditionEffect(final BecomesBlackZombieAdditionEffect effect) {
|
||||
super(effect);
|
||||
this.giveBlackColor = effect.giveBlackColor;
|
||||
updateText();
|
||||
}
|
||||
|
||||
private void updateText() {
|
||||
if (this.giveBlackColor) {
|
||||
this.staticText = "That creature is a black Zombie in addition to its other colors and types";
|
||||
} else {
|
||||
this.staticText = "That creature is a Zombie in addition to its other types";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -73,7 +93,7 @@ public class BecomesBlackZombieAdditionEffect extends ContinuousEffectImpl {
|
|||
}
|
||||
break;
|
||||
case ColorChangingEffects_5:
|
||||
if (sublayer == SubLayer.NA) {
|
||||
if (sublayer == SubLayer.NA && this.giveBlackColor) {
|
||||
creature.getColor(game).setBlack(true);
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ import mage.game.permanent.token.Token;
|
|||
public class BecomesCreatureAttachedEffect extends ContinuousEffectImpl {
|
||||
|
||||
public enum LoseType {
|
||||
NONE, ALL, ALL_BUT_COLOR, ABILITIES, ABILITIES_SUBTYPE_AND_PT, ABILITIES_AND_PT
|
||||
NONE, ALL, ALL_BUT_COLOR, ABILITIES, ABILITIES_SUBTYPE, COLOR
|
||||
}
|
||||
|
||||
protected Token token;
|
||||
|
|
@ -98,7 +98,7 @@ public class BecomesCreatureAttachedEffect extends ContinuousEffectImpl {
|
|||
switch (loseType) {
|
||||
case ALL:
|
||||
case ALL_BUT_COLOR:
|
||||
case ABILITIES_SUBTYPE_AND_PT:
|
||||
case ABILITIES_SUBTYPE:
|
||||
permanent.getSubtype(game).retainAll(SubType.getLandTypes(false));
|
||||
break;
|
||||
}
|
||||
|
|
@ -107,12 +107,12 @@ public class BecomesCreatureAttachedEffect extends ContinuousEffectImpl {
|
|||
permanent.getSubtype(game).add(t);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
case ColorChangingEffects_5:
|
||||
if (sublayer == SubLayer.NA) {
|
||||
if (loseType == LoseType.ALL) {
|
||||
if (loseType == LoseType.ALL || loseType == LoseType.COLOR) {
|
||||
permanent.getColor(game).setBlack(false);
|
||||
permanent.getColor(game).setGreen(false);
|
||||
permanent.getColor(game).setBlue(false);
|
||||
|
|
@ -124,29 +124,29 @@ public class BecomesCreatureAttachedEffect extends ContinuousEffectImpl {
|
|||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case AbilityAddingRemovingEffects_6:
|
||||
if (sublayer == SubLayer.NA) {
|
||||
switch (loseType) {
|
||||
case ALL:
|
||||
case ALL_BUT_COLOR:
|
||||
case ABILITIES:
|
||||
case ABILITIES_AND_PT:
|
||||
case ABILITIES_SUBTYPE_AND_PT:
|
||||
case ABILITIES_SUBTYPE:
|
||||
permanent.removeAllAbilities(source.getSourceId(), game);
|
||||
break;
|
||||
}
|
||||
for (Ability ability : token.getAbilities()) {
|
||||
permanent.addAbility(ability, source.getSourceId(), game);
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
case PTChangingEffects_7:
|
||||
if (sublayer == SubLayer.SetPT_7b) {
|
||||
permanent.getPower().setValue(token.getPower().getValue());
|
||||
permanent.getToughness().setValue(token.getToughness().getValue());
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue