@Override public void watch(GameEvent event, Game game) { if (event.getType() == EventType.DAMAGED_PLAYER) { DamagedPlayerEvent dEvent = (DamagedPlayerEvent) event; if (dEvent.isCombatDamage()) { Permanent creature = game.getPermanent(dEvent.getSourceId()); if (creature != null && !allSubtypes.contains(creature.getControllerId())) { if (creature.getAbilities().containsKey(ChangelingAbility.getInstance().getId()) || creature.isAllCreatureTypes()) { allSubtypes.add(creature.getControllerId()); } else { Set<SubType> subtypes = damagingSubtypes.getOrDefault(creature.getControllerId(), new LinkedHashSet<>()); subtypes.addAll(creature.getSubtype(game)); damagingSubtypes.put(creature.getControllerId(), subtypes); } } } } }
@Override public boolean apply(Game game, Ability source) { for (Iterator<MageObjectReference> it = affectedObjectList.iterator(); it.hasNext();) { Permanent permanent = it.next().getPermanent(game); if (permanent != null) { permanent.addAbility(ChangelingAbility.getInstance(), source.getSourceId(), game, false); } else { it.remove(); } } return true; } }
public CribSwapShapeshifterWhiteToken() { super("Shapeshifter", "1/1 colorless Shapeshifter creature token with changeling"); this.setOriginalExpansionSetCode("LRW"); cardType.add(CardType.CREATURE); subtype.add(SubType.SHAPESHIFTER); power = new MageInt(1); toughness = new MageInt(1); addAbility(ChangelingAbility.getInstance()); }
public DrJuliusJumblemorph(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}{W}"); this.addSuperType(SuperType.LEGENDARY); this.power = new MageInt(4); this.toughness = new MageInt(4); // Dr. Julius Jumblemorph is every creature type (even if this card isn't on the battlefield). this.addAbility(ChangelingAbility.getInstance()); // Whenever a host enters the battlefield under your control, you may search your library and/or graveyard for a card with augment and combine it with that host. If you search your library this way, shuffle it. // TODO: Host currently isn't implemented, so this ability currently would never trigger }
boolean changeling = false; boolean changeling2 = false; if (creature.getAbilities().containsKey(ChangelingAbility.getInstance().getId()) || creature.isAllCreatureTypes()) { changeling = true; if (creature2.getAbilities().containsKey(ChangelingAbility.getInstance().getId()) || creature2.isAllCreatureTypes()) { changeling2 = true;
public WoodlandChangeling(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{G}"); this.subtype.add(SubType.SHAPESHIFTER); this.power = new MageInt(2); this.toughness = new MageInt(2); // Changeling this.addAbility(ChangelingAbility.getInstance()); }
public MistformUltimus(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}"); this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.ILLUSION); this.power = new MageInt(3); this.toughness = new MageInt(3); // Mistform Ultimus is every creature type. this.addAbility(ChangelingAbility.getInstance()); }
default boolean shareSubtypes(Card otherCard, Game game) { if (otherCard == null) { throw new IllegalArgumentException("Params can't be null"); } if (this.isCreature() && otherCard.isCreature()) { if (this.getAbilities().contains(ChangelingAbility.getInstance()) || this.isAllCreatureTypes() || otherCard.getAbilities().contains(ChangelingAbility.getInstance()) || otherCard.isAllCreatureTypes()) { return true; } } for (SubType subtype : this.getSubtype(game)) { if (otherCard.hasSubtype(subtype, game)) { return true; } } return false; }
private int getAmount(List<Permanent> permanents, Permanent target, Game game) { int amount = 0; SubTypeList targetSubtype = target.getSubtype(game); if (target.getAbilities().contains(ChangelingAbility.getInstance()) || target.isAllCreatureTypes()) { return permanents.size() - 1; } for (Permanent permanent : permanents) { if (!permanent.getId().equals(target.getId())) { for (SubType subtype : targetSubtype) { if (subtype.getSubTypeSet() == SubTypeSet.CreatureType) { if (permanent.hasSubtype(subtype, game)) { amount++; break; } } } } } return amount; } }
public ChangelingSentinel(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{W}"); this.subtype.add(SubType.SHAPESHIFTER); this.power = new MageInt(3); this.toughness = new MageInt(2); this.addAbility(ChangelingAbility.getInstance()); this.addAbility(VigilanceAbility.getInstance()); }
public BladesOfVelisVel(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.TRIBAL,CardType.INSTANT},"{1}{R}"); this.subtype.add(SubType.SHAPESHIFTER); // Changeling this.addAbility(ChangelingAbility.getInstance()); // Up to two target creatures each get +2/+0 and gain all creature types until end of turn. Effect effect = new BoostTargetEffect(2,0, Duration.EndOfTurn); effect.setText("Up to two target creatures each get +2/+0"); this.getSpellAbility().addEffect(effect); effect = new GainAbilityTargetEffect(ChangelingAbility.getInstance(), Duration.EndOfTurn, "and gain all creature types until end of turn"); this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetCreaturePermanent(0,2)); }
public GameTrailChangeling(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{G}{G}"); this.subtype.add(SubType.SHAPESHIFTER); this.power = new MageInt(4); this.toughness = new MageInt(4); this.addAbility(ChangelingAbility.getInstance()); this.addAbility(TrampleAbility.getInstance()); }
public ChangelingTitan(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{G}"); this.subtype.add(SubType.SHAPESHIFTER); this.power = new MageInt(7); this.toughness = new MageInt(7); // Changeling this.addAbility(ChangelingAbility.getInstance()); // Champion a creature this.addAbility(new ChampionAbility(this, true)); }
public AvianChangeling(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W}"); this.subtype.add(SubType.SHAPESHIFTER); this.power = new MageInt(2); this.toughness = new MageInt(2); this.addAbility(ChangelingAbility.getInstance()); this.addAbility(FlyingAbility.getInstance()); }
@Override public boolean hasSubtype(SubType value, Game game) { if (value == null) { return false; } SubTypeList subtypes = this.getSubtype(game); if (subtypes.contains(value)) { return true; } else { // checking for Changeling // first make sure input parameter is a creature subtype // if not, then ChangelingAbility doesn't matter if (value.getSubTypeSet() != SubTypeSet.CreatureType) { return false; } // as it is creature subtype, then check the existence of Changeling return abilities.contains(ChangelingAbility.getInstance()) || isAllCreatureTypes(); } }
public ChangelingBerserker(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{R}"); this.subtype.add(SubType.SHAPESHIFTER); this.power = new MageInt(5); this.toughness = new MageInt(3); // Changeling this.addAbility(ChangelingAbility.getInstance()); // Haste this.addAbility(HasteAbility.getInstance()); // Champion a creature this.addAbility(new ChampionAbility(this, true)); }
public ChangelingHero(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{W}"); this.subtype.add(SubType.SHAPESHIFTER); this.power = new MageInt(4); this.toughness = new MageInt(4); // Changeling this.addAbility(ChangelingAbility.getInstance()); // Champion a creature this.addAbility(new ChampionAbility(this, true)); // Lifelink this.addAbility(LifelinkAbility.getInstance()); }
public MirrorEntity(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W}"); this.subtype.add(SubType.SHAPESHIFTER); this.power = new MageInt(1); this.toughness = new MageInt(1); // Changeling this.addAbility(ChangelingAbility.getInstance()); // {X}: Until end of turn, creatures you control have base power and toughness X/X and gain all creature types. DynamicValue variableMana = ManacostVariableValue.instance; Effect effect = new SetPowerToughnessAllEffect(variableMana, variableMana, Duration.EndOfTurn, filter, true); effect.setText("Until end of turn, creatures you control have base power and toughness X/X"); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new VariableManaCost()); effect = new GainAbilityAllEffect(ChangelingAbility.getInstance(), Duration.EndOfTurn, filter, false, Layer.TypeChangingEffects_4, SubLayer.NA); effect.setText("and gain all creature types"); ability.addEffect(effect); this.addAbility(ability); }
public CairnWanderer(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}"); this.subtype.add(SubType.SHAPESHIFTER); this.power = new MageInt(4); this.toughness = new MageInt(4); // Changeling this.addAbility(ChangelingAbility.getInstance()); // As long as a creature card with flying is in a graveyard, Cairn Wanderer has flying. The same is true for fear, first strike, double strike, deathtouch, haste, landwalk, lifelink, protection, reach, trample, shroud, and vigilance. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CairnWandererEffect())); }
public TaureanMauler(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}"); this.subtype.add(SubType.SHAPESHIFTER); this.power = new MageInt(2); this.toughness = new MageInt(2); // Changeling this.addAbility(ChangelingAbility.getInstance()); // Whenever an opponent casts a spell, you may put a +1/+1 counter on Taurean Mauler. this.addAbility(new SpellCastOpponentTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), true)); }