mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 21:12:04 -08:00
commit
22e376699e
35 changed files with 97 additions and 104 deletions
|
|
@ -13,7 +13,9 @@ import mage.watchers.common.CastFromHandWatcher;
|
|||
*
|
||||
* @author Loki
|
||||
*/
|
||||
public class CastFromHandSourceCondition implements Condition {
|
||||
public enum CastFromHandSourceCondition implements Condition {
|
||||
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,9 @@ import mage.players.Player;
|
|||
|
||||
import java.util.UUID;
|
||||
|
||||
public class MoreCardsInHandThanOpponentsCondition implements Condition {
|
||||
public enum MoreCardsInHandThanOpponentsCondition implements Condition {
|
||||
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
|
|
|
|||
|
|
@ -28,21 +28,21 @@
|
|||
|
||||
package mage.abilities.condition.common;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author fireshoes
|
||||
*/
|
||||
|
||||
public class OpponentHasMoreLifeCondition implements Condition {
|
||||
public enum OpponentHasMoreLifeCondition implements Condition {
|
||||
|
||||
public OpponentHasMoreLifeCondition() {
|
||||
}
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
|
|
|
|||
|
|
@ -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…
Add table
Add a link
Reference in a new issue