Merge pull request #55 from magefree/master

merge
This commit is contained in:
theelk801 2017-09-05 10:09:00 -04:00 committed by GitHub
commit 01f7914f54
4 changed files with 21 additions and 25 deletions

View file

@ -196,7 +196,7 @@ public enum UserManager {
Calendar calendarRemove = Calendar.getInstance();
calendarRemove.add(Calendar.MINUTE, -8);
List<User> toRemove = new ArrayList<>();
logger.info("Start Check Expired");
logger.debug("Start Check Expired");
ArrayList<User> userList = new ArrayList<>();
final Lock r = lock.readLock();
r.lock();
@ -227,7 +227,7 @@ public enum UserManager {
handleException(ex);
}
}
logger.info("Users to remove " + toRemove.size());
logger.debug("Users to remove " + toRemove.size());
final Lock w = lock.readLock();
w.lock();
try {
@ -237,7 +237,7 @@ public enum UserManager {
} finally {
w.unlock();
}
logger.info("End Check Expired");
logger.debug("End Check Expired");
} catch (Exception ex) {
handleException(ex);
}

View file

@ -30,12 +30,10 @@ package mage.cards.a;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.costs.common.TapTargetCost;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.keyword.DoubleStrikeAbility;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.KickerAbility;
import mage.abilities.keyword.TrampleAbility;
import mage.abilities.text.TextPartSubType;
import mage.cards.CardImpl;
@ -48,7 +46,6 @@ import mage.filter.predicate.permanent.TappedPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.targetpointer.FixedTarget;
/**
@ -75,7 +72,6 @@ public class AtarkaWorldRender extends CardImpl {
FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Dragon you control");
filter.add(new TextPartSubtypePredicate(textPart1));
filter.add(Predicates.not(new TappedPredicate()));
this.addAbility(new KickerAbility(new TapTargetCost(new TargetControlledCreaturePermanent(1, 1, filter, true))));
this.addAbility(new AtarkaWorldRenderEffect(filter));
}

View file

@ -64,7 +64,7 @@ public class CaughtInTheBrights extends CardImpl {
// Enchant creature
TargetPermanent auraTarget = new TargetCreaturePermanent();
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.Benefit));
this.getSpellAbility().addEffect(new AttachEffect(Outcome.LoseAbility));
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);

View file

@ -38,10 +38,15 @@ import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.ComparisonType;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
@ -58,8 +63,8 @@ public class PowderKeg extends CardImpl {
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(CounterType.FUSE.createInstance(), true), TargetController.YOU, true));
// {T}, Sacrifice Powder Keg: Destroy each artifact and creature with converted mana cost equal to the number of fuse counters on Powder Keg.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PowderKegEffect(), new SacrificeSourceCost());
ability.addCost(new TapSourceCost());
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PowderKegEffect(), new TapSourceCost());
ability.addCost(new SacrificeSourceCost());
this.addAbility(ability);
}
@ -77,7 +82,7 @@ class PowderKegEffect extends OneShotEffect {
public PowderKegEffect() {
super(Outcome.DestroyPermanent);
staticText = "Destroy each artifact and creature with converted mana cost equal to the number of fuse counters on Powder Keg {this}";
staticText = "Destroy each artifact and creature with converted mana cost equal to the number of fuse counters on {this}";
}
public PowderKegEffect(final PowderKegEffect effect) {
@ -86,22 +91,17 @@ class PowderKegEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Permanent p = game.getBattlefield().getPermanent(source.getSourceId());
if (p == null) {
p = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD);
if (p == null) {
return false;
}
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
if (sourcePermanent == null) {
return false;
}
int count = p.getCounters(game).getCount(CounterType.FUSE);
for (Permanent perm : game.getBattlefield().getAllActivePermanents()) {
if (perm.getConvertedManaCost() == count && ((perm.isArtifact())
|| (perm.isCreature()))) {
perm.destroy(source.getSourceId(), game, false);
}
int count = sourcePermanent.getCounters(game).getCount(CounterType.FUSE);
FilterPermanent filter = new FilterPermanent();
filter.add(Predicates.or(new CardTypePredicate(CardType.ARTIFACT), new CardTypePredicate(CardType.CREATURE)));
filter.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, count));
for (Permanent perm : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
perm.destroy(source.getSourceId(), game, false);
}
return true;
}