use of mage.abilities.keyword.EquipAbility in project mage by magefree.
the class FulgentDistractionEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
for (UUID target : targetPointer.getTargets(game, source)) {
Permanent creature = game.getPermanent(target);
List<UUID> copiedAttachments = new ArrayList<>(creature.getAttachments());
for (UUID equipmentId : copiedAttachments) {
Permanent equipment = game.getPermanent(equipmentId);
boolean isEquipment = false;
for (Ability ability : equipment.getAbilities()) {
if (ability instanceof EquipAbility) {
isEquipment = true;
}
}
if (isEquipment) {
creature.removeAttachment(equipmentId, source, game);
}
}
creature.tap(source, game);
}
return true;
}
use of mage.abilities.keyword.EquipAbility in project mage by magefree.
the class ArterialAlchemyEffect method apply.
@Override
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
switch(layer) {
case TypeChangingEffects_4:
permanent.addSubType(game, SubType.EQUIPMENT);
break;
case AbilityAddingRemovingEffects_6:
permanent.addAbility(new SimpleStaticAbility(new BoostEquippedEffect(2, 0)), source.getSourceId(), game);
permanent.addAbility(new EquipAbility(2), source.getSourceId(), game);
break;
}
}
return true;
}
Aggregations