1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-07 17:00:08 -09:00

* Added Fumiko, the Lowblood-

This commit is contained in:
LevelX2 2014-02-25 03:02:24 +01:00
parent 3c7b414ee6
commit ad2c062552
4 changed files with 167 additions and 10 deletions
Mage.Sets/src/mage/sets
betrayersofkamigawa
championsofkamigawa
Mage/src/mage/abilities

View file

@ -0,0 +1,79 @@
/*
* 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.sets.betrayersofkamigawa;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.common.AttackingCreatureCount;
import mage.abilities.effects.common.combat.AttacksIfAbleAllEffect;
import mage.abilities.keyword.BushidoAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
/**
*
* @author LevelX2
*/
public class FumikoTheLowblood extends CardImpl<FumikoTheLowblood> {
public FumikoTheLowblood(UUID ownerId) {
super(ownerId, 104, "Fumiko the Lowblood", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}{R}");
this.expansionSetCode = "BOK";
this.supertype.add("Legendary");
this.subtype.add("Human");
this.subtype.add("Samurai");
this.color.setRed(true);
this.power = new MageInt(3);
this.toughness = new MageInt(2);
// Fumiko the Lowblood has bushido X, where X is the number of attacking creatures.
this.addAbility(new BushidoAbility(new AttackingCreatureCount("the number of attacking creatures")));
// Creatures your opponents control attack each turn if able.
FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures your opponents control");
filter.add(new ControllerPredicate(TargetController.OPPONENT));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AttacksIfAbleAllEffect(filter)));
}
public FumikoTheLowblood(final FumikoTheLowblood card) {
super(card);
}
@Override
public FumikoTheLowblood copy() {
return new FumikoTheLowblood(this);
}
}

View file

@ -28,20 +28,25 @@
package mage.sets.championsofkamigawa;
import mage.constants.*;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.keyword.BushidoAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.SubLayer;
import mage.constants.Zone;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.UUID;
/**
* @author Loki
*/
@ -57,6 +62,7 @@ public class TakenoSamuraiGeneral extends CardImpl<TakenoSamuraiGeneral> {
this.power = new MageInt(3);
this.toughness = new MageInt(3);
this.addAbility(new BushidoAbility(2));
// Each other Samurai creature you control gets +1/+1 for each point of bushido it has.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new TakenoSamuraiGeneralEffect()));
}
@ -115,8 +121,9 @@ class TakenoSamuraiGeneralEffect extends ContinuousEffectImpl<TakenoSamuraiGener
if (!perm.getId().equals(source.getSourceId())) {
for (Ability ability : perm.getAbilities()) {
if (ability instanceof BushidoAbility) {
perm.addPower(((BushidoAbility) ability).getValue());
perm.addToughness(((BushidoAbility) ability).getValue());
int value = ((BushidoAbility) ability).getValue(source, game);
perm.addPower(value);
perm.addToughness(value);
}
}
}

View file

@ -0,0 +1,55 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package mage.abilities.effects.common.combat;
import mage.abilities.Ability;
import mage.abilities.effects.RequirementEffect;
import mage.constants.Duration;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
/**
*
* @author LevelX2
*/
public class AttacksIfAbleAllEffect extends RequirementEffect<AttacksIfAbleAllEffect> {
private final FilterCreaturePermanent filter;
public AttacksIfAbleAllEffect(FilterCreaturePermanent filter) {
super(Duration.WhileOnBattlefield);
staticText = new StringBuilder(filter.getMessage()).append(" attack each turn if able").toString();
this.filter = filter;
}
public AttacksIfAbleAllEffect(final AttacksIfAbleAllEffect effect) {
super(effect);
this.filter = effect.filter;
}
@Override
public AttacksIfAbleAllEffect copy() {
return new AttacksIfAbleAllEffect(this);
}
@Override
public boolean applies(Permanent permanent, Ability source, Game game) {
return filter.match(permanent, source.getSourceId(), source.getControllerId(), game);
}
@Override
public boolean mustAttack(Game game) {
return true;
}
@Override
public boolean mustBlock(Game game) {
return false;
}
}

View file

@ -27,21 +27,37 @@
*/
package mage.abilities.keyword;
import mage.constants.Duration;
import mage.abilities.Ability;
import mage.abilities.common.BlocksOrBecomesBlockedTriggeredAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.continious.BoostSourceEffect;
import mage.constants.Duration;
import mage.game.Game;
public class BushidoAbility extends BlocksOrBecomesBlockedTriggeredAbility {
private int value;
private DynamicValue value;
private String rule = null;
public BushidoAbility(int value) {
this(new StaticValue(value));
rule = new StringBuilder("Bushido ").append(value).toString();
}
public BushidoAbility(DynamicValue value) {
super(new BoostSourceEffect(value, value, Duration.EndOfTurn), false);
if (rule == null) {
rule = new StringBuilder("{this} has bushido X, where X is ").append(value.getMessage()).toString();
}
rule = new StringBuilder(rule).append(" <i>(When this blocks or becomes blocked, it gets +").append(value.toString()).append("/+").append(value.toString()).append(" until end of turn.)</i>").toString();
this.value = value;
}
public BushidoAbility(final BushidoAbility ability) {
super(ability);
this.value = ability.value;
this.rule = ability.rule;
}
@Override
@ -49,12 +65,12 @@ public class BushidoAbility extends BlocksOrBecomesBlockedTriggeredAbility {
return new BushidoAbility(this);
}
public int getValue() {
return value;
public int getValue(Ability source, Game game) {
return value.calculate(game, source);
}
@Override
public String getRule() {
return "Bushido " + value + " <i>(When this blocks or becomes blocked, it gets +" + value + "/+" + value + " until end of turn.)</i>";
return rule;
}
}