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

View file

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

View file

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

View file

@ -38,10 +38,15 @@ import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.ComparisonType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.TargetController; import mage.constants.TargetController;
import mage.constants.Zone; import mage.constants.Zone;
import mage.counters.CounterType; 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.Game;
import mage.game.permanent.Permanent; 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)); 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. // {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 ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PowderKegEffect(), new TapSourceCost());
ability.addCost(new TapSourceCost()); ability.addCost(new SacrificeSourceCost());
this.addAbility(ability); this.addAbility(ability);
} }
@ -77,7 +82,7 @@ class PowderKegEffect extends OneShotEffect {
public PowderKegEffect() { public PowderKegEffect() {
super(Outcome.DestroyPermanent); 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) { public PowderKegEffect(final PowderKegEffect effect) {
@ -86,22 +91,17 @@ class PowderKegEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Permanent p = game.getBattlefield().getPermanent(source.getSourceId()); Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
if (p == null) { if (sourcePermanent == null) {
p = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD);
if (p == null) {
return false; return false;
} }
} int count = sourcePermanent.getCounters(game).getCount(CounterType.FUSE);
FilterPermanent filter = new FilterPermanent();
int count = p.getCounters(game).getCount(CounterType.FUSE); filter.add(Predicates.or(new CardTypePredicate(CardType.ARTIFACT), new CardTypePredicate(CardType.CREATURE)));
for (Permanent perm : game.getBattlefield().getAllActivePermanents()) { filter.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, count));
if (perm.getConvertedManaCost() == count && ((perm.isArtifact()) for (Permanent perm : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
|| (perm.isCreature()))) {
perm.destroy(source.getSourceId(), game, false); perm.destroy(source.getSourceId(), game, false);
} }
}
return true; return true;
} }