mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 13:02:06 -08:00
[CLB] Implemented Raised by Giants
This commit is contained in:
parent
b2d7afcfe8
commit
6437ca119c
5 changed files with 73 additions and 22 deletions
|
|
@ -366,7 +366,9 @@ public abstract class ContinuousEffectImpl extends EffectImpl implements Continu
|
|||
|
||||
@Override
|
||||
public void addDependencyType(DependencyType dependencyType) {
|
||||
dependencyTypes.add(dependencyType);
|
||||
if (dependencyType != null) {
|
||||
dependencyTypes.add(dependencyType);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
package mage.abilities.effects.common.continuous;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
|
|
@ -12,32 +10,30 @@ import mage.game.permanent.Permanent;
|
|||
/**
|
||||
* @author Galatolol
|
||||
*/
|
||||
|
||||
public class AddCardSubtypeAllEffect extends ContinuousEffectImpl {
|
||||
|
||||
private FilterPermanent filter;
|
||||
private SubType addedSubtype;
|
||||
private final FilterPermanent filter;
|
||||
private final SubType addedSubtype;
|
||||
|
||||
public AddCardSubtypeAllEffect(FilterPermanent _filter, SubType _addedSubtype, DependencyType _dependency) {
|
||||
public AddCardSubtypeAllEffect(FilterPermanent filter, SubType addedSubtype, DependencyType dependency) {
|
||||
super(Duration.WhileOnBattlefield, Layer.TypeChangingEffects_4, SubLayer.NA, Outcome.Benefit);
|
||||
filter = _filter;
|
||||
staticText = "";
|
||||
addedSubtype = _addedSubtype;
|
||||
addDependencyType(_dependency);
|
||||
this.filter = filter;
|
||||
this.addedSubtype = addedSubtype;
|
||||
addDependencyType(dependency);
|
||||
}
|
||||
|
||||
public AddCardSubtypeAllEffect(final AddCardSubtypeAllEffect effect) {
|
||||
super(effect);
|
||||
filter = effect.filter.copy();
|
||||
filter = effect.filter;
|
||||
addedSubtype = effect.addedSubtype;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
for (Permanent perm : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game)) {
|
||||
if (perm != null) {
|
||||
perm.addSubType(game, addedSubtype);
|
||||
}
|
||||
for (Permanent perm : game.getBattlefield().getActivePermanents(
|
||||
filter, source.getControllerId(), source, game
|
||||
)) {
|
||||
perm.addSubType(game, addedSubtype);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
@ -46,5 +42,4 @@ public class AddCardSubtypeAllEffect extends ContinuousEffectImpl {
|
|||
public AddCardSubtypeAllEffect copy() {
|
||||
return new AddCardSubtypeAllEffect(this);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,10 +8,7 @@ import mage.constants.TargetController;
|
|||
import mage.counters.CounterType;
|
||||
import mage.filter.common.*;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.AnotherPredicate;
|
||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||
import mage.filter.predicate.mageobject.KickedSpellPredicate;
|
||||
import mage.filter.predicate.mageobject.MulticoloredPredicate;
|
||||
import mage.filter.predicate.mageobject.*;
|
||||
import mage.filter.predicate.other.AnotherTargetPredicate;
|
||||
import mage.filter.predicate.permanent.TappedPredicate;
|
||||
import mage.filter.predicate.permanent.TokenPredicate;
|
||||
|
|
@ -631,6 +628,14 @@ public final class StaticFilters {
|
|||
FILTER_PERMANENT_CREATURES_CONTROLLED.setLockedFilter(true);
|
||||
}
|
||||
|
||||
public static final FilterCreaturePermanent FILTER_CREATURES_OWNED_COMMANDER = new FilterCreaturePermanent("commander creatures you own");
|
||||
|
||||
static {
|
||||
FILTER_CREATURES_OWNED_COMMANDER.add(TargetController.YOU.getOwnerPredicate());
|
||||
FILTER_CREATURES_OWNED_COMMANDER.add(CommanderPredicate.instance);
|
||||
FILTER_CREATURES_OWNED_COMMANDER.setLockedFilter(true);
|
||||
}
|
||||
|
||||
public static final FilterCreaturePermanent FILTER_PERMANENT_CREATURE_NON_BLACK = new FilterCreaturePermanent("nonblack creature");
|
||||
|
||||
static {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue