@Override public Set<UUID> isDependentTo(List<ContinuousEffect> allEffectsInLayer) { return allEffectsInLayer .stream() .filter(effect -> effect.getDependencyTypes().contains(DependencyType.AuraAddingRemoving)) .map(Effect::getId) .collect(Collectors.toSet()); } }
@Override public Set<UUID> isDependentTo(List<ContinuousEffect> allEffectsInLayer) { return allEffectsInLayer .stream() .filter(effect -> effect.getDependencyTypes().contains(DependencyType.BecomePlains)) .map(Effect::getId) .collect(Collectors.toSet()); } }
@Override public Set<UUID> isDependentTo(List<ContinuousEffect> allEffectsInLayer) { return allEffectsInLayer .stream() .filter(effect -> effect.getDependencyTypes().contains(DependencyType.BecomePlains)) .map(Effect::getId) .collect(Collectors.toSet()); } }
@Override public EnumSet<DependencyType> getDependencyTypes() { if (effect != null) { return effect.getDependencyTypes(); } return super.getDependencyTypes(); }
@Override public Set<UUID> isDependentTo(List<ContinuousEffect> allEffectsInLayer) { Set<UUID> dependentTo = new HashSet<>(); for (ContinuousEffect effect : allEffectsInLayer) { for (DependencyType dependencyType : effect.getDependencyTypes()) { if (checkDependencyTypes.contains(dependencyType)) { dependentTo.add(effect.getId()); } } } return dependentTo; } }
@Override public Set<UUID> isDependentTo(List<ContinuousEffect> allEffectsInLayer) { Set<UUID> dependentToEffects = new HashSet<UUID>(); if (dependendToTypes != null) { for (ContinuousEffect effect : allEffectsInLayer) { if (!effect.getId().equals(this.getId())) { for (DependencyType dependencyType : effect.getDependencyTypes()) { if (dependendToTypes.contains(dependencyType)) { dependentToEffects.add(effect.getId()); break; } } } } } return dependentToEffects; /* return allEffectsInLayer.stream() .filter(effect -> effect.getDependencyTypes().contains(dependendToTypes)) .map(Effect::getId) .collect(Collectors.toSet()); } return new HashSet<>();*/ }
public LivingLands(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{G}"); // All Forests are 1/1 creatures that are still lands. ContinuousEffect effect = new BecomesCreatureAllEffect( new CreatureToken(1, 1), "lands", filter, Duration.WhileOnBattlefield, false); effect.getDependencyTypes().add(DependencyType.BecomeForest); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); }
public TheloniteDruid(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.CLERIC); this.subtype.add(SubType.DRUID); this.power = new MageInt(1); this.toughness = new MageInt(1); // {1}{G}, {tap}, Sacrifice a creature: Forests you control become 2/3 creatures until end of turn. They're still lands. ContinuousEffect effect = new BecomesCreatureAllEffect( new CreatureToken(2, 3), "Forests", filter, Duration.EndOfTurn, false); effect.getDependencyTypes().add(DependencyType.BecomeForest); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{1}{G}")); ability.addCost(new TapSourceCost()); ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT))); this.addAbility(ability); }
public AmbushCommander(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{G}{G}"); this.subtype.add(SubType.ELF); this.power = new MageInt(2); this.toughness = new MageInt(2); // Forests you control are 1/1 green Elf creatures that are still lands. ContinuousEffect effect = new BecomesCreatureAllEffect( new CreatureToken(1, 1, "1/1 green Elf creature").withColor("G").withSubType(SubType.ELF), "lands", filter2, Duration.WhileOnBattlefield, true); effect.getDependencyTypes().add(DependencyType.BecomeForest); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); // {1}{G}, Sacrifice an Elf: Target creature gets +3/+3 until end of turn. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(3, 3, Duration.EndOfTurn), new ManaCostsImpl("{1}{G}")); ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, filter, true))); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); }