Merge branch 'master' into Zzooouhh-banding-final

This commit is contained in:
L_J 2018-02-15 00:49:08 +01:00 committed by GitHub
commit 3dbd5a72c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 175 additions and 110 deletions

View file

@ -1,16 +1,16 @@
/*
* Copyright 2011 BetaSteward_at_googlemail.com. All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
@ -55,14 +55,14 @@ public class ContestedWarZone extends CardImpl {
private static final FilterAttackingCreature filter = new FilterAttackingCreature("Attacking creatures");
public ContestedWarZone(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.LAND},null);
super(ownerId, setInfo, new CardType[]{CardType.LAND}, null);
// Whenever a creature deals combat damage to you, that creature's controller gains control of Contested War Zone.
this.addAbility(new ContestedWarZoneAbility());
// {T}: Add {C} to your mana pool.
this.addAbility(new ColorlessManaAbility());
// {1}, {T}: Attacking creatures get +1/+0 until end of turn.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 0, Duration.EndOfTurn, filter, false), new ManaCostsImpl("{1}"));
ability.addCost(new TapSourceCost());
@ -84,7 +84,7 @@ class ContestedWarZoneAbility extends TriggeredAbilityImpl {
public ContestedWarZoneAbility() {
super(Zone.BATTLEFIELD, new ContestedWarZoneEffect());
}
}
public ContestedWarZoneAbility(final ContestedWarZoneAbility ability) {
super(ability);
@ -102,7 +102,7 @@ class ContestedWarZoneAbility extends TriggeredAbilityImpl {
@Override
public boolean checkTrigger(GameEvent event, Game game) {
DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event;
if (damageEvent.isCombatDamage()) {
Permanent permanent = game.getPermanent(event.getSourceId());
if (damageEvent.getPlayerId().equals(getControllerId()) && permanent != null && permanent.isCreature()) {
@ -137,7 +137,7 @@ class ContestedWarZoneEffect extends ContinuousEffectImpl {
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = (Permanent) source.getSourceObjectIfItStillExists(game);
Permanent permanent = game.getPermanent(source.getSourceId());
UUID controllerId = (UUID) game.getState().getValue(source.getSourceId().toString());
if (permanent != null && controllerId != null) {
return permanent.changeControllerId(controllerId, game);

View file

@ -45,7 +45,7 @@ import mage.target.common.TargetCreatureOrPlayer;
/**
*
* @author KholdFuzion
*
*/
public class DrainLife extends CardImpl {
@ -55,10 +55,8 @@ public class DrainLife extends CardImpl {
filterBlack.setBlack(true);
}
public DrainLife(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{X}{1}{B}");
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{1}{B}");
// Spend only black mana on X.
// Drain Life deals X damage to target creature or player. You gain life equal to the damage dealt, but not more life than the player's life total before Drain Life dealt damage or the creature's toughness.
@ -84,7 +82,7 @@ class DrainLifeEffect extends OneShotEffect {
public DrainLifeEffect() {
super(Outcome.Damage);
staticText = "Drain Life deals X damage to target creature or player. You gain life equal to the damage dealt, but not more life than the player's life total before Drain Life dealt damage or the creature's toughness.";
staticText = "Spend only black mana on X.<br>{this} deals X damage to target creature or player. You gain life equal to the damage dealt, but not more life than the player's life total before Drain Life dealt damage or the creature's toughness";
}
public DrainLifeEffect(final DrainLifeEffect effect) {
@ -97,7 +95,7 @@ class DrainLifeEffect extends OneShotEffect {
int lifetogain = amount;
if (amount > 0) {
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
if (permanent != null ) {
if (permanent != null) {
if (permanent.getToughness().getValue() < amount) {
lifetogain = permanent.getToughness().getValue();
}

View file

@ -147,8 +147,8 @@ class EyeOfTheStormEffect1 extends OneShotEffect {
if (spell != null && eyeOfTheStorm != null) {
Player spellController = game.getPlayer(spell.getControllerId());
Card card = spell.getCard();
if (spellController == null
|| card == null
if (spellController == null
|| card == null
|| !instantOrSorceryfilter.match(card, game)) {
return false;
}
@ -159,14 +159,14 @@ class EyeOfTheStormEffect1 extends OneShotEffect {
eyeOfTheStorm.imprint(card.getId(), game);// technically, using the imprint functionality here is not correct.
if (eyeOfTheStorm.getImprinted() != null
if (eyeOfTheStorm.getImprinted() != null
&& !eyeOfTheStorm.getImprinted().isEmpty()) {
CardsImpl copiedCards = new CardsImpl();
for (UUID uuid : eyeOfTheStorm.getImprinted()) {
card = game.getCard(uuid);
// Check if owner of card is still in game
if (card != null
if (card != null
&& game.getPlayer(card.getOwnerId()) != null) {
if (card.isSplitCard()) {
copiedCards.add(((SplitCard) card).getLeftHalfCard());
@ -178,7 +178,7 @@ class EyeOfTheStormEffect1 extends OneShotEffect {
}
boolean continueCasting = true;
while (continueCasting) {
while (spellController.isInGame() && continueCasting) {
continueCasting = copiedCards.size() > 1 && spellController.chooseUse(outcome, "Cast one of the copied cards without paying its mana cost?", source, game);
Card cardToCopy;

View file

@ -2,10 +2,8 @@ package mage.cards.g;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.condition.Condition;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.effects.common.ReturnToHandTargetEffect;
@ -16,7 +14,6 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.filter.common.FilterCreatureCard;
import mage.game.Game;
import mage.target.common.TargetCardInGraveyard;
public class GraveScrabbler extends CardImpl {
@ -35,7 +32,7 @@ public class GraveScrabbler extends CardImpl {
//you may return target creature card from a graveyard to its owner's hand.
TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect(), true);
ability.addTarget(new TargetCardInGraveyard(new FilterCreatureCard("creature card in a graveyard")));
this.addAbility(new ConditionalTriggeredAbility(ability, MadnessPaidCondition.instance,
this.addAbility(new ConditionalTriggeredAbility(ability, MadnessAbility.GetCondition(),
"When {this} enters the battlefield, if its madness cost was paid, you may return target creature card from a graveyard to its owner's hand."));
}
@ -49,21 +46,3 @@ public class GraveScrabbler extends CardImpl {
}
}
enum MadnessPaidCondition implements Condition {
instance;
@Override
public boolean apply(Game game, Ability source) {
Card card = game.getCard(source.getSourceId());
if (card != null) {
for (Ability ability : card.getAbilities()) {
if (ability instanceof MadnessAbility) {
return ((MadnessAbility) ability).getCosts().isPaid();
}
}
}
return false;
}
}

View file

@ -44,14 +44,13 @@ import mage.target.targetpointer.SecondTargetPointer;
public class Lunge extends CardImpl {
public Lunge(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{R}");
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{R}");
// Lunge deals 2 damage to target creature and 2 damage to target player.
this.getSpellAbility().addEffect(new DamageTargetEffect(2));
this.getSpellAbility().addEffect(new DamageTargetEffect(2).setUseOnlyTargetPointer(true));
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
Effect effect = new DamageTargetEffect(2);
Effect effect = new DamageTargetEffect(2).setUseOnlyTargetPointer(true);
effect.setTargetPointer(new SecondTargetPointer());
effect.setText("and 2 damage to target player");
this.getSpellAbility().addEffect(effect);