congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
ChangelingAbility
Code IndexAdd Tabnine to your IDE (free)

How to use
ChangelingAbility
in
mage.abilities.keyword

Best Java code snippets using mage.abilities.keyword.ChangelingAbility (Showing top 20 results out of 315)

origin: magefree/mage

@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);
        }
      }
    }
  }
}
origin: magefree/mage

  @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;
  }
}
origin: magefree/mage

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());
}
origin: magefree/mage

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
}
origin: magefree/mage

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;
origin: magefree/mage

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());
}
origin: magefree/mage

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());
}
origin: magefree/mage

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;
}
origin: magefree/mage

  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;
  }
}
origin: magefree/mage

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());
}
origin: magefree/mage

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));        
}
origin: magefree/mage

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());
}
origin: magefree/mage

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));
}
origin: magefree/mage

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());
}
origin: magefree/mage

@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();
  }
}
origin: magefree/mage

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));
}
origin: magefree/mage

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());
}
origin: magefree/mage

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);
}
origin: magefree/mage

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()));
}
origin: magefree/mage

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));
  
}
mage.abilities.keywordChangelingAbility

Javadoc

October 1, 2012 702.71. Changeling 702.71a Changeling is a characteristic-defining ability. "Changeling" means "This object is every creature type." This ability works everywhere, even outside the game. See rule 604.3. 702.71b Multiple instances of changeling on the same object are redundant.

Most used methods

  • getId
  • getInstance

Popular in Java

  • Creating JSON documents from java classes using gson
  • onRequestPermissionsResult (Fragment)
  • getContentResolver (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • Notification (javax.management)
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now