mirror of
https://github.com/magefree/mage.git
synced 2026-01-23 19:59:54 -08:00
added addCardType to MageObject
This commit is contained in:
parent
cf6fe27f7d
commit
8b90f87af6
52 changed files with 72 additions and 72 deletions
|
|
@ -107,7 +107,7 @@ class AnimateArtifactContinuousEffect extends ContinuousEffectImpl {
|
|||
Permanent permanent = game.getPermanent(enchantment.getAttachedTo());
|
||||
if (permanent != null && !permanent.isCreature()) {
|
||||
if (sublayer == SubLayer.NA) {
|
||||
permanent.getCardType().add(CardType.CREATURE);
|
||||
permanent.addCardType(CardType.CREATURE);
|
||||
permanent.getPower().setValue(permanent.getConvertedManaCost());
|
||||
permanent.getToughness().setValue(permanent.getConvertedManaCost());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ class ChimericCoilsEffect extends ContinuousEffectImpl {
|
|||
switch (layer) {
|
||||
case TypeChangingEffects_4:
|
||||
if (sublayer == SubLayer.NA) {
|
||||
permanent.getCardType().add(CardType.CREATURE);
|
||||
permanent.addCardType(CardType.CREATURE);
|
||||
permanent.getSubtype(game).add("Construct");
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ class ChimericStaffEffect extends ContinuousEffectImpl {
|
|||
switch (layer) {
|
||||
case TypeChangingEffects_4:
|
||||
if (sublayer == SubLayer.NA) {
|
||||
permanent.getCardType().add(CardType.CREATURE);
|
||||
permanent.addCardType(CardType.CREATURE);
|
||||
permanent.getSubtype(game).add("Construct");
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ public class EnchantedEvening extends CardImpl {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, game)) {
|
||||
if (permanent != null && !permanent.getCardType().contains(addedCardType)) {
|
||||
permanent.getCardType().add(addedCardType);
|
||||
permanent.addCardType(addedCardType);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -85,6 +85,6 @@ class CamaridToken extends Token {
|
|||
this.getToughness().modifyBaseValue(1);
|
||||
this.color.setBlue(true);
|
||||
this.getSubtype(null).add("Camarid");
|
||||
this.getCardType().add(CardType.CREATURE);
|
||||
this.addCardType(CardType.CREATURE);
|
||||
}
|
||||
}
|
||||
|
|
@ -130,7 +130,7 @@ class BecomesColorlessLandEffect extends ContinuousEffectImpl {
|
|||
case TypeChangingEffects_4:
|
||||
boolean isLand = permanent.isLand();
|
||||
permanent.getCardType().clear();
|
||||
permanent.getCardType().add(CardType.LAND);
|
||||
permanent.addCardType(CardType.LAND);
|
||||
if (!isLand) {
|
||||
permanent.getSubtype(game).clear();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ class CatWarriorToken extends Token {
|
|||
this.color.setGreen(true);
|
||||
this.getSubtype(null).add("Cat");
|
||||
this.getSubtype(null).add("Warrior");
|
||||
this.getCardType().add(CardType.CREATURE);
|
||||
this.addCardType(CardType.CREATURE);
|
||||
this.addAbility(new ForestwalkAbility());
|
||||
}
|
||||
}
|
||||
|
|
@ -117,6 +117,6 @@ class RagavanToken extends Token {
|
|||
this.getToughness().modifyBaseValue(1);
|
||||
this.color.setRed(true);
|
||||
this.getSubtype(null).add("Monkey");
|
||||
this.getCardType().add(CardType.CREATURE);
|
||||
this.addCardType(CardType.CREATURE);
|
||||
}
|
||||
}
|
||||
|
|
@ -110,7 +110,7 @@ class KarnSilverGolemEffect extends ContinuousEffectImpl {
|
|||
case TypeChangingEffects_4:
|
||||
if (sublayer == SubLayer.NA) {
|
||||
if (!artifact.isCreature()) {
|
||||
artifact.getCardType().add(CardType.CREATURE);
|
||||
artifact.addCardType(CardType.CREATURE);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -28,8 +28,6 @@
|
|||
|
||||
package mage.cards.l;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObjectReference;
|
||||
import mage.abilities.Ability;
|
||||
|
|
@ -39,12 +37,7 @@ import mage.abilities.effects.common.counter.AddCountersTargetEffect;
|
|||
import mage.abilities.keyword.TrampleAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Layer;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubLayer;
|
||||
import mage.constants.Zone;
|
||||
import mage.constants.*;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
import mage.game.Game;
|
||||
|
|
@ -56,6 +49,9 @@ import mage.game.permanent.token.Token;
|
|||
import mage.target.Target;
|
||||
import mage.target.common.TargetLandPermanent;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Loki
|
||||
|
|
@ -138,7 +134,7 @@ class LiegeOfTheTangleEffect extends ContinuousEffectImpl {
|
|||
switch (layer) {
|
||||
case TypeChangingEffects_4:
|
||||
if (sublayer == SubLayer.NA) {
|
||||
perm.getCardType().addAll(token.getCardType());
|
||||
perm.addCardTypes(token.getCardType());
|
||||
perm.getSubtype(game).addAll(token.getSubtype(game));
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -100,13 +100,13 @@ class LifeAndLimbEffect extends ContinuousEffectImpl {
|
|||
switch (layer) {
|
||||
case TypeChangingEffects_4:
|
||||
if (!permanent.isCreature()) {
|
||||
permanent.getCardType().add(CardType.CREATURE);
|
||||
permanent.addCardType(CardType.CREATURE);
|
||||
}
|
||||
if (!permanent.getSubtype(game).contains("Saproling")) {
|
||||
permanent.getSubtype(game).add("Saproling");
|
||||
}
|
||||
if (!permanent.isLand()) {
|
||||
permanent.getCardType().add(CardType.LAND);
|
||||
permanent.addCardType(CardType.LAND);
|
||||
}
|
||||
if (!permanent.getSubtype(game).contains("Forest")) {
|
||||
permanent.getSubtype(game).add("Forest");
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ class MarchOfTheMachinesEffect extends ContinuousEffectImpl {
|
|||
for(Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, game)){
|
||||
if(permanent != null){
|
||||
affectedObjectList.add(new MageObjectReference(permanent, game));
|
||||
permanent.getCardType().add(CardType.CREATURE);
|
||||
permanent.addCardType(CardType.CREATURE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ class PermanentsAreArtifactsEffect extends ContinuousEffectImpl {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
for (Permanent perm : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) {
|
||||
perm.getCardType().add(CardType.ARTIFACT);
|
||||
perm.addCardType(CardType.ARTIFACT);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ class BecomesCreatureAllEffect extends ContinuousEffectImpl {
|
|||
for (Iterator<MageObjectReference> it = affectedObjectList.iterator(); it.hasNext();) {
|
||||
Permanent permanent = it.next().getPermanent(game);
|
||||
if (permanent != null) {
|
||||
permanent.getCardType().add(CardType.CREATURE);
|
||||
permanent.addCardType(CardType.CREATURE);
|
||||
} else {
|
||||
it.remove();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ class NissaSageAnimistToken extends Token {
|
|||
this.getToughness().modifyBaseValue(4);
|
||||
this.color.setGreen(true);
|
||||
this.getSubtype(null).add("Elemental");
|
||||
this.getCardType().add(CardType.CREATURE);
|
||||
this.addCardType(CardType.CREATURE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -160,7 +160,7 @@ class NissaSageAnimistMinusSevenEffect extends ContinuousEffectImpl {
|
|||
switch (layer) {
|
||||
case TypeChangingEffects_4:
|
||||
if (!permanent.isCreature()) {
|
||||
permanent.getCardType().add(CardType.CREATURE);
|
||||
permanent.addCardType(CardType.CREATURE);
|
||||
}
|
||||
if (!permanent.getSubtype(game).contains("Elemental")) {
|
||||
permanent.getSubtype(game).add("Elemental");
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ class OpalescenceEffect extends ContinuousEffectImpl {
|
|||
case TypeChangingEffects_4:
|
||||
if (sublayer == SubLayer.NA) {
|
||||
if (!permanent.isCreature()) {
|
||||
permanent.getCardType().add(CardType.CREATURE);
|
||||
permanent.addCardType(CardType.CREATURE);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ public class PhyrexianMetamorph extends CardImpl {
|
|||
@Override
|
||||
public boolean apply(Game game, MageObject mageObject) {
|
||||
if (!mageObject.isArtifact()) {
|
||||
mageObject.getCardType().add(CardType.ARTIFACT);
|
||||
mageObject.addCardType(CardType.ARTIFACT);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ class SarkhanTheDragonspeakerEffect extends ContinuousEffectImpl {
|
|||
case TypeChangingEffects_4:
|
||||
if (sublayer == SubLayer.NA) {
|
||||
permanent.getCardType().clear();
|
||||
permanent.getCardType().add(CardType.CREATURE);
|
||||
permanent.addCardType(CardType.CREATURE);
|
||||
permanent.getSubtype(game).clear();
|
||||
permanent.getSubtype(game).add("Dragon");
|
||||
permanent.getSuperType().clear();
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ public class SlumberingTora extends CardImpl {
|
|||
switch (layer) {
|
||||
case TypeChangingEffects_4:
|
||||
if (sublayer == SubLayer.NA) {
|
||||
permanent.getCardType().add(CardType.CREATURE);
|
||||
permanent.addCardType(CardType.CREATURE);
|
||||
permanent.getSubtype(game).add("Cat");
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ class BecomesColorlessForestLandEffect extends ContinuousEffectImpl {
|
|||
break;
|
||||
case TypeChangingEffects_4:
|
||||
permanent.getCardType().clear();
|
||||
permanent.getCardType().add(CardType.LAND);
|
||||
permanent.addCardType(CardType.LAND);
|
||||
permanent.getSubtype(game).clear();
|
||||
permanent.getSubtype(game).add("Forest");
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ class StarfieldOfNyxEffect extends ContinuousEffectImpl {
|
|||
case TypeChangingEffects_4:
|
||||
if (sublayer == SubLayer.NA) {
|
||||
if (!permanent.isCreature()) {
|
||||
permanent.getCardType().add(CardType.CREATURE);
|
||||
permanent.addCardType(CardType.CREATURE);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -91,8 +91,8 @@ class StartYourEnginesEffect extends ContinuousEffectImpl {
|
|||
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(source.getControllerId())) {
|
||||
if (permanent != null && permanent.getSubtype(game).contains("Vehicle")) {
|
||||
if (sublayer == SubLayer.NA) {
|
||||
permanent.getCardType().add(CardType.ARTIFACT);
|
||||
permanent.getCardType().add(CardType.CREATURE);// TODO: Chcek if giving CREATURE Type is correct
|
||||
permanent.addCardType(CardType.ARTIFACT);
|
||||
permanent.addCardType(CardType.CREATURE);// TODO: Chcek if giving CREATURE Type is correct
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ class SydriGalvanicGeniusEffect extends ContinuousEffectImpl {
|
|||
case TypeChangingEffects_4:
|
||||
if (sublayer == SubLayer.NA) {
|
||||
if (!artifact.isCreature()) {
|
||||
artifact.getCardType().add(CardType.CREATURE);
|
||||
artifact.addCardType(CardType.CREATURE);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ class TestamentOfFaithBecomesCreatureSourceEffect extends ContinuousEffectImpl i
|
|||
if (!token.getCardType().isEmpty()) {
|
||||
for (CardType t : token.getCardType()) {
|
||||
if (!permanent.getCardType().contains(t)) {
|
||||
permanent.getCardType().add(t);
|
||||
permanent.addCardType(t);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -160,10 +160,10 @@ class TezzeretTheSeekerEffect3 extends ContinuousEffectImpl {
|
|||
case TypeChangingEffects_4:
|
||||
if (sublayer == SubLayer.NA) {
|
||||
if (!permanent.isArtifact()) {
|
||||
permanent.getCardType().add(CardType.ARTIFACT);
|
||||
permanent.addCardType(CardType.ARTIFACT);
|
||||
}
|
||||
if (!permanent.isCreature()) {
|
||||
permanent.getCardType().add(CardType.CREATURE);
|
||||
permanent.addCardType(CardType.CREATURE);
|
||||
}
|
||||
permanent.getSubtype(game).clear();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ class TitaniasSongEffect extends ContinuousEffectImpl {
|
|||
for(Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, game)){
|
||||
if(permanent != null){
|
||||
affectedObjectList.add(new MageObjectReference(permanent, game));
|
||||
permanent.getCardType().add(CardType.CREATURE);
|
||||
permanent.addCardType(CardType.CREATURE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ class VolrathsShapeshifterEffect extends ContinuousEffectImpl {
|
|||
permanent.setName(card.getName());
|
||||
|
||||
for (CardType type : card.getCardType()) {
|
||||
permanent.getCardType().add(type);
|
||||
permanent.addCardType(type);
|
||||
}
|
||||
|
||||
permanent.getSubtype(game).clear();
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ class WireflyToken extends Token {
|
|||
this.getPower().modifyBaseValue(2);
|
||||
this.getToughness().modifyBaseValue(2);
|
||||
this.getSubtype(null).add("Insect");
|
||||
this.getCardType().add(CardType.ARTIFACT);
|
||||
this.getCardType().add(CardType.CREATURE);
|
||||
this.addCardType(CardType.ARTIFACT);
|
||||
this.addCardType(CardType.CREATURE);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@ class XenicPoltergeistEffect extends ContinuousEffectImpl {
|
|||
UUID permanentId = targetPointer.getFirst(game, source);
|
||||
Permanent permanent = game.getPermanentOrLKIBattlefield(permanentId);
|
||||
if(permanent != null){
|
||||
permanent.getCardType().add(CardType.CREATURE);
|
||||
permanent.addCardType(CardType.CREATURE);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -27,8 +27,6 @@
|
|||
*/
|
||||
package mage.sets;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import mage.cards.CardGraphicInfo;
|
||||
import mage.cards.ExpansionSet;
|
||||
import mage.cards.repository.CardCriteria;
|
||||
|
|
@ -37,6 +35,9 @@ import mage.cards.repository.CardRepository;
|
|||
import mage.constants.Rarity;
|
||||
import mage.constants.SetType;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author fireshoes
|
||||
|
|
@ -105,7 +106,7 @@ public class Amonkhet extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Island", 258, Rarity.LAND, mage.cards.basiclands.Island.class, new CardGraphicInfo(null, true)));
|
||||
cards.add(new SetCardInfo("Island", 259, Rarity.LAND, mage.cards.basiclands.Island.class, new CardGraphicInfo(null, true)));
|
||||
cards.add(new SetCardInfo("Island", 260, Rarity.LAND, mage.cards.basiclands.Island.class, new CardGraphicInfo(null, true)));
|
||||
cards.add(new SetCardInfo("Kefnet the Mindful", 59, Rarity.MYTHIC, mage.cards.k.KefnetTheMindful.class));
|
||||
// cards.add(new SetCardInfo("Kefnet the Mindful", 59, Rarity.MYTHIC, mage.cards.k.KefnetTheMindful.class));
|
||||
cards.add(new SetCardInfo("Kefnet's Monument", 231, Rarity.UNCOMMON, mage.cards.k.KefnetsMonument.class));
|
||||
cards.add(new SetCardInfo("Lay Bare the Heart", 96, Rarity.UNCOMMON, mage.cards.l.LayBareTheHeart.class));
|
||||
cards.add(new SetCardInfo("Liliana, Death Wielder", 274, Rarity.MYTHIC, mage.cards.l.LilianaDeathWielder.class));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue