[BNG] Added 11 blue cards.

This commit is contained in:
LevelX2 2014-01-24 12:10:06 +01:00
parent f671da13d6
commit 4f4ce32fa6
15 changed files with 992 additions and 10 deletions

View file

@ -12,7 +12,7 @@ import mage.game.Game;
public class PermanentsOnBattlefieldCount implements DynamicValue {
private FilterPermanent filter;
private Integer amount;
private Integer multiplier;
public PermanentsOnBattlefieldCount() {
this(new FilterPermanent(), 1);
@ -22,21 +22,21 @@ public class PermanentsOnBattlefieldCount implements DynamicValue {
this(filter, 1);
}
public PermanentsOnBattlefieldCount(FilterPermanent filter, Integer amount) {
public PermanentsOnBattlefieldCount(FilterPermanent filter, Integer multiplier) {
this.filter = filter;
this.amount = amount;
this.multiplier = multiplier;
}
public PermanentsOnBattlefieldCount(final PermanentsOnBattlefieldCount dynamicValue) {
this.filter = dynamicValue.filter;
this.amount = dynamicValue.amount;
this.multiplier = dynamicValue.multiplier;
}
@Override
public int calculate(Game game, Ability sourceAbility) {
int value = game.getBattlefield().count(filter, sourceAbility.getSourceId(), sourceAbility.getControllerId(), game);
if (amount != null) {
value *= amount;
if (multiplier != null) {
value *= multiplier;
}
return value;
}
@ -48,8 +48,8 @@ public class PermanentsOnBattlefieldCount implements DynamicValue {
@Override
public String toString() {
if (amount != null) {
return amount.toString();
if (multiplier != null) {
return multiplier.toString();
}
return "X";
}

View file

@ -0,0 +1,92 @@
/*
* Copyright 2010 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
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* 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.
*/
package mage.abilities.effects.common.combat;
import mage.abilities.Ability;
import mage.abilities.MageSingleton;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.keyword.FlyingAbility;
import mage.constants.AttachmentType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
/**
*
* @author LevelX2
*/
public class CanBlockOnlyFlyingAttachedEffect extends ReplacementEffectImpl<CanBlockOnlyFlyingAttachedEffect> implements MageSingleton {
public CanBlockOnlyFlyingAttachedEffect(AttachmentType attachmentType) {
super(Duration.WhileOnBattlefield, Outcome.Detriment);
if (attachmentType.equals(AttachmentType.AURA)) {
this.staticText = "Enchanted creature can block only creatures with flying";
} else {
this.staticText = "Equiped creature can block only creatures with flying";
}
}
public CanBlockOnlyFlyingAttachedEffect(final CanBlockOnlyFlyingAttachedEffect effect) {
super(effect);
}
@Override
public CanBlockOnlyFlyingAttachedEffect copy() {
return new CanBlockOnlyFlyingAttachedEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
return true;
}
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
return true;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
if (event.getType() == EventType.DECLARE_BLOCKER) {
Permanent attachment = game.getPermanent(source.getSourceId());
if (attachment != null && attachment.getAttachedTo() != null
&& event.getSourceId().equals(attachment.getAttachedTo())) {
Permanent permanent = game.getPermanent(event.getTargetId());
if (permanent != null && !permanent.getAbilities().containsKey(FlyingAbility.getInstance().getId())) {
return true;
}
}
}
return false;
}
}

View file

@ -55,7 +55,7 @@ public class GainControlTargetEffect extends ContinuousEffectImpl<GainControlTar
/**
*
* @param duration
* @param fixedControl Controlling player is fixed even if the controller of the ability chnages
* @param fixedControl Controlling player is fixed even if the controller of the ability changes later
*/
public GainControlTargetEffect(Duration duration, boolean fixedControl) {
this(duration, fixedControl, null);