mirror of
https://github.com/correl/mage.git
synced 2025-01-12 19:25:44 +00:00
removed contains cardtype calls
This commit is contained in:
parent
ea6ba3c0a9
commit
f22ebd3677
3 changed files with 6 additions and 18 deletions
|
@ -65,9 +65,7 @@ public class AddCardTypeSourceEffect extends ContinuousEffectImpl {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (permanent != null && affectedObjectList.contains(new MageObjectReference(permanent, game))) {
|
||||
if (!permanent.getCardType().contains(addedCardType)) {
|
||||
permanent.addCardType(addedCardType);
|
||||
}
|
||||
permanent.addCardType(addedCardType);
|
||||
return true;
|
||||
} else if (this.getDuration() == Duration.Custom) {
|
||||
this.discard();
|
||||
|
|
|
@ -42,7 +42,6 @@ import mage.game.permanent.Permanent;
|
|||
import mage.game.permanent.token.Token;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public class BecomesCreatureSourceEffect extends ContinuousEffectImpl implements SourceEffect {
|
||||
|
@ -113,12 +112,8 @@ public class BecomesCreatureSourceEffect extends ContinuousEffectImpl implements
|
|||
if (losePreviousTypes) {
|
||||
permanent.getCardType().clear();
|
||||
}
|
||||
if (!token.getCardType().isEmpty()) {
|
||||
for (CardType t : token.getCardType()) {
|
||||
if (!permanent.getCardType().contains(t)) {
|
||||
permanent.addCardType(t);
|
||||
}
|
||||
}
|
||||
for (CardType t : token.getCardType()) {
|
||||
permanent.addCardType(t);
|
||||
}
|
||||
if (type != null && type.isEmpty() || type == null && permanent.isLand()) {
|
||||
permanent.getSubtype(game).retainAll(CardRepository.instance.getLandTypes());
|
||||
|
@ -137,11 +132,10 @@ public class BecomesCreatureSourceEffect extends ContinuousEffectImpl implements
|
|||
break;
|
||||
case AbilityAddingRemovingEffects_6:
|
||||
if (sublayer == SubLayer.NA) {
|
||||
if (!token.getAbilities().isEmpty()) {
|
||||
for (Ability ability : token.getAbilities()) {
|
||||
permanent.addAbility(ability, source.getSourceId(), game);
|
||||
}
|
||||
for (Ability ability : token.getAbilities()) {
|
||||
permanent.addAbility(ability, source.getSourceId(), game);
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case PTChangingEffects_7:
|
||||
|
|
|
@ -46,17 +46,13 @@ public class CardTypeApplier extends ApplyToPermanent {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Permanent permanent) {
|
||||
if (!permanent.getCardType().contains(cardType)) {
|
||||
permanent.addCardType(cardType);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, MageObject mageObject) {
|
||||
if (!mageObject.getCardType().contains(cardType)) {
|
||||
mageObject.addCardType(cardType);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue