- little refactor

This commit is contained in:
jeffwadsworth 2019-01-08 03:34:25 -06:00
parent b73529fbc4
commit 56081e1fc8
3 changed files with 18 additions and 28 deletions

View file

@ -1,4 +1,3 @@
package mage.cards.a;
import java.util.UUID;
@ -15,7 +14,7 @@ import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.util.CardUtil;
import mage.game.events.GameEvent.EventType;
/**
*
@ -63,15 +62,9 @@ class AngrathsMaraudersEffect extends ReplacementEffectImpl {
@Override
public boolean checksEventType(GameEvent event, Game game) {
switch (event.getType()) {
case DAMAGE_PLAYER:
return true;
case DAMAGE_CREATURE:
return true;
case DAMAGE_PLANESWALKER:
return true;
}
return false;
return event.getType().equals(EventType.DAMAGED_PLAYER)
|| event.getType().equals(EventType.DAMAGED_CREATURE)
|| event.getType().equals(EventType.DAMAGED_PLANESWALKER);
}
@Override
@ -81,7 +74,7 @@ class AngrathsMaraudersEffect extends ReplacementEffectImpl {
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
event.setAmount(CardUtil.addWithOverflowCheck(event.getAmount(), event.getAmount()));
event.setAmount(event.getAmount() * 2);
return false;
}
}

View file

@ -1,4 +1,3 @@
package mage.cards.g;
import java.util.UUID;
@ -66,12 +65,8 @@ class GildedCerodonCondition implements Condition {
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null
&& (!game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game).isEmpty()
|| controller.getGraveyard().count(filter2, game) > 0)) {
return true;
}
return false;
return (!game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game).isEmpty()
|| !controller.getGraveyard().getCards(filter2, game).isEmpty());
}
@Override

View file

@ -1,4 +1,3 @@
package mage.cards.h;
import java.util.UUID;
@ -33,7 +32,10 @@ public final class Helldozer extends CardImpl {
this.toughness = new MageInt(5);
// {B}{B}{B}, {tap}: Destroy target land. If that land was nonbasic, untap Helldozer.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new HelldozerEffect(), new ManaCostsImpl("{B}{B}{B}"));
Ability ability = new SimpleActivatedAbility(
Zone.BATTLEFIELD,
new HelldozerEffect(),
new ManaCostsImpl("{B}{B}{B}"));
ability.addTarget(new TargetLandPermanent());
ability.addCost(new TapSourceCost());
this.addAbility(ability);
@ -70,13 +72,13 @@ class HelldozerEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Permanent helldozer = game.getPermanent(source.getSourceId());
Permanent landTarget = game.getPermanent(source.getFirstTarget());
if (landTarget == null) {
return false;
}
boolean wasNonBasic = !landTarget.isBasic();
landTarget.destroy(id, game, false);
if (wasNonBasic && helldozer != null) {
return helldozer.untap(game);
if (landTarget != null) {
boolean wasNonBasic = !landTarget.isBasic();
landTarget.destroy(source.getSourceId(), game, false);
if (wasNonBasic
&& helldozer != null) {
return helldozer.untap(game);
}
}
return false;
}