mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
[CHK] 2 cards
This commit is contained in:
parent
dda09ee5c1
commit
a76f676be6
4 changed files with 558 additions and 174 deletions
110
Mage.Sets/src/mage/sets/championsofkamigawa/JunkyoBell.java
Normal file
110
Mage.Sets/src/mage/sets/championsofkamigawa/JunkyoBell.java
Normal file
|
@ -0,0 +1,110 @@
|
|||
/*
|
||||
* 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.championsofkamigawa;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.Constants;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.DelayedTriggeredAbility;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
|
||||
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.SacrificeTargetEffect;
|
||||
import mage.abilities.effects.common.continious.BoostTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.common.FilterSpiritOrArcaneCard;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
* @author LevelX
|
||||
*/
|
||||
public class JunkyoBell extends CardImpl<JunkyoBell> {
|
||||
|
||||
public JunkyoBell(UUID ownerId) {
|
||||
super(ownerId, 258, "Junkyo Bell", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}");
|
||||
this.expansionSetCode = "CHK";
|
||||
|
||||
// At the beginning of your upkeep, you may have target creature you control get +X/+X until end of turn,
|
||||
// where X is the number of creatures you control. If you do, sacrifice that creature at the beginning of the next end step.
|
||||
PermanentsOnBattlefieldCount amount = new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent());
|
||||
Ability ability = new BeginningOfUpkeepTriggeredAbility(new BoostTargetEffect(amount, amount, Constants.Duration.EndOfTurn), Constants.TargetController.YOU, true);
|
||||
ability.addTarget(new TargetControlledCreaturePermanent());
|
||||
ability.addEffect(new JunkyoBellSacrificeEffect());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public JunkyoBell(final JunkyoBell card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JunkyoBell copy() {
|
||||
return new JunkyoBell(this);
|
||||
}
|
||||
|
||||
|
||||
private class JunkyoBellSacrificeEffect extends OneShotEffect<JunkyoBellSacrificeEffect> {
|
||||
|
||||
public JunkyoBellSacrificeEffect() {
|
||||
super(Constants.Outcome.Sacrifice);
|
||||
this.staticText = "If you do, sacrifice that creature at the beginning of the next end step";
|
||||
}
|
||||
|
||||
public JunkyoBellSacrificeEffect(final JunkyoBellSacrificeEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JunkyoBellSacrificeEffect copy() {
|
||||
return new JunkyoBellSacrificeEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent creature = game.getPermanent(source.getFirstTarget());
|
||||
if (creature != null) {
|
||||
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice boosted " + creature.getName());
|
||||
sacrificeEffect.setTargetPointer(new FixedTarget(source.getFirstTarget()));
|
||||
DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(sacrificeEffect);
|
||||
delayedAbility.setSourceId(source.getSourceId());
|
||||
delayedAbility.setControllerId(source.getControllerId());
|
||||
game.addDelayedTriggeredAbility(delayedAbility);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
223
Mage.Sets/src/mage/sets/championsofkamigawa/NightDealings.java
Normal file
223
Mage.Sets/src/mage/sets/championsofkamigawa/NightDealings.java
Normal file
|
@ -0,0 +1,223 @@
|
|||
/*
|
||||
* 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.championsofkamigawa;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.Constants;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.Constants.Zone;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.common.RemoveVariableCountersSourceCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.Filter;
|
||||
import mage.filter.common.FilterArtifactCard;
|
||||
import mage.filter.common.FilterNonlandCard;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.stack.StackObject;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCardInLibrary;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Loki
|
||||
*/
|
||||
public class NightDealings extends CardImpl<NightDealings> {
|
||||
|
||||
public NightDealings (UUID ownerId) {
|
||||
super(ownerId, 132, "Night Dealings", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}{B}");
|
||||
this.expansionSetCode = "CHK";
|
||||
this.color.setBlack(true);
|
||||
// Whenever a source you control deals damage to another player, put that many theft counters on Night Dealings.
|
||||
this.addAbility((new NightDealingsTriggeredAbility()));
|
||||
|
||||
// {2}{B}{B}, Remove X theft counters from Night Dealings: Search your library for a nonland card with converted mana cost X, reveal it, and put it into your hand. Then shuffle your library.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new NightDealingsSearchEffect(), new ManaCostsImpl("{2}{B}{B}"));
|
||||
ability.addCost(new RemoveVariableCountersSourceCost(CounterType.THEFT.createInstance(1)));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public NightDealings (final NightDealings card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NightDealings copy() {
|
||||
return new NightDealings(this);
|
||||
}
|
||||
|
||||
|
||||
private class NightDealingsTriggeredAbility extends TriggeredAbilityImpl<NightDealingsTriggeredAbility> {
|
||||
|
||||
public NightDealingsTriggeredAbility() {
|
||||
super(Constants.Zone.BATTLEFIELD, new NightDealingsEffect());
|
||||
}
|
||||
|
||||
public NightDealingsTriggeredAbility(final NightDealingsTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NightDealingsTriggeredAbility copy() {
|
||||
return new NightDealingsTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER) {
|
||||
// to another player
|
||||
if (this.getControllerId() != event.getTargetId()) {
|
||||
// a source you control
|
||||
UUID sourceControllerId = null;
|
||||
Permanent permanent = game.getPermanent(event.getSourceId());
|
||||
if (permanent != null) {
|
||||
sourceControllerId = permanent.getControllerId();
|
||||
} else {
|
||||
StackObject sourceStackObject = game.getStack().getStackObject(event.getSourceId());
|
||||
if (sourceStackObject != null) {
|
||||
sourceControllerId = sourceStackObject.getControllerId();
|
||||
}
|
||||
}
|
||||
if (sourceControllerId != null && sourceControllerId == this.getControllerId()) {
|
||||
// save amount of damage to effect
|
||||
this.getEffects().get(0).setValue("damageAmount", event.getAmount());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever a source you control deals damage to another player, " + super.getRule();
|
||||
}
|
||||
}
|
||||
|
||||
private class NightDealingsEffect extends OneShotEffect<NightDealingsEffect> {
|
||||
|
||||
public NightDealingsEffect() {
|
||||
super(Constants.Outcome.Damage);
|
||||
this.staticText = "put that many theft counters on Night Dealings";
|
||||
}
|
||||
|
||||
public NightDealingsEffect(final NightDealingsEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NightDealingsEffect copy() {
|
||||
return new NightDealingsEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Integer damageAmount = (Integer) this.getValue("damageAmount");
|
||||
if (damageAmount != null) {
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (permanent != null) {
|
||||
permanent.addCounters(CounterType.THEFT.createInstance(damageAmount), game);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private class NightDealingsSearchEffect extends OneShotEffect<NightDealingsSearchEffect> {
|
||||
|
||||
public NightDealingsSearchEffect() {
|
||||
super(Constants.Outcome.DrawCard);
|
||||
this.staticText = "Search your library for a nonland card with converted mana cost X, reveal it, and put it into your hand. Then shuffle your library";
|
||||
}
|
||||
|
||||
public NightDealingsSearchEffect(final NightDealingsSearchEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NightDealingsSearchEffect copy() {
|
||||
return new NightDealingsSearchEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int cmc = 0;
|
||||
for (Cost cost : source.getCosts()) {
|
||||
if (cost instanceof RemoveVariableCountersSourceCost) {
|
||||
cmc = ((RemoveVariableCountersSourceCost)cost).getAmount();
|
||||
}
|
||||
}
|
||||
|
||||
FilterNonlandCard filter = new FilterNonlandCard("nonland card with converted mana cost X = " + cmc);
|
||||
filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, cmc));
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(filter);
|
||||
|
||||
if (player.searchLibrary(target, game)) {
|
||||
Card card = player.getLibrary().getCard(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
card.moveToZone(Zone.HAND, source.getId(), game, false);
|
||||
|
||||
String name = "Reveal";
|
||||
Cards cards = new CardsImpl();
|
||||
cards.add(card);
|
||||
Card sourceCard = game.getCard(source.getSourceId());
|
||||
if (sourceCard != null) {
|
||||
name = sourceCard.getName();
|
||||
}
|
||||
player.revealCards(name, cards, game);
|
||||
}
|
||||
player.shuffleLibrary(game);
|
||||
return true;
|
||||
}
|
||||
player.shuffleLibrary(game);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,174 +1,178 @@
|
|||
/*
|
||||
* 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.counters;
|
||||
|
||||
import mage.counters.common.*;
|
||||
|
||||
/**
|
||||
* Enum for counters, names and instances.
|
||||
*
|
||||
* @author nantuko
|
||||
*/
|
||||
public enum CounterType {
|
||||
P1P1(new PlusOneCounter().name),
|
||||
M1M1(new MinusOneCounter().name),
|
||||
POISON(new PoisonCounter().name),
|
||||
CHARGE(new ChargeCounter().name),
|
||||
LORE(new LoreCounter().name),
|
||||
LOYALTY(new LoyaltyCounter().name),
|
||||
LEVEL(new LevelCounter().name),
|
||||
TIME(new TimeCounter().name),
|
||||
FADE(new FadeCounter().name),
|
||||
FATE(new FateCounter().name),
|
||||
FEATHER(new FeatherCounter().name),
|
||||
QUEST(new QuestCounter().name),
|
||||
ARROWHEAD(new ArrowheadCounter().name),
|
||||
AIM(new AimCounter().name),
|
||||
EON(new EonCounter().name),
|
||||
AWAKENING(new AwakeningCounter().name),
|
||||
DEVOTION(new DevotionCounter().name),
|
||||
DIVINITY(new DivinityCounter().name),
|
||||
WISH(new WishCounter().name),
|
||||
HOOFPRINT(new HoofprintCounter().name),
|
||||
HATCHLING(new HatchlingCounter().name),
|
||||
KI(new KiCounter().name),
|
||||
SLIME(new SlimeCounter().name),
|
||||
SPORE(new SporeCounter().name),
|
||||
STUDY(new StudyCounter().name),
|
||||
EYEBALL(new EyeballCounter().name),
|
||||
ELIXIR(new ElixirCounter().name),
|
||||
PAIN(new PainCounter().name),
|
||||
DESPAIR(new DespairCounter().name),
|
||||
PAGE(new PageCounter().name),
|
||||
PRESSURE(new PressureCounter().name),
|
||||
PETRIFICATION(new PetrificationCounter().name),
|
||||
MINING(new MiningCounter().name);
|
||||
|
||||
private String name;
|
||||
|
||||
private CounterType(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get counter string name.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create instance of counter type with amount equal to 1.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Counter createInstance() {
|
||||
return createInstance(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create instance of counter type with defined amount of counters of the given type.
|
||||
*
|
||||
* @param amount amount of counters of the given type.
|
||||
* @return
|
||||
*/
|
||||
public Counter createInstance(int amount) {
|
||||
switch(this) {
|
||||
case P1P1:
|
||||
return new PlusOneCounter(amount);
|
||||
case M1M1:
|
||||
return new MinusOneCounter(amount);
|
||||
case POISON:
|
||||
return new PoisonCounter(amount);
|
||||
case CHARGE:
|
||||
return new ChargeCounter(amount);
|
||||
case LORE:
|
||||
return new LoreCounter(amount);
|
||||
case LOYALTY:
|
||||
return new LoyaltyCounter(amount);
|
||||
case LEVEL:
|
||||
return new LevelCounter(amount);
|
||||
case TIME:
|
||||
return new TimeCounter(amount);
|
||||
case FADE:
|
||||
return new FadeCounter(amount);
|
||||
case FATE:
|
||||
return new FateCounter(amount);
|
||||
case FEATHER:
|
||||
return new FeatherCounter(amount);
|
||||
case QUEST:
|
||||
return new QuestCounter(amount);
|
||||
case ARROWHEAD:
|
||||
return new ArrowheadCounter(amount);
|
||||
case AIM:
|
||||
return new AimCounter(amount);
|
||||
case EON:
|
||||
return new EonCounter(amount);
|
||||
case AWAKENING:
|
||||
return new AwakeningCounter(amount);
|
||||
case DEVOTION:
|
||||
return new DevotionCounter(amount);
|
||||
case DIVINITY:
|
||||
return new DivinityCounter(amount);
|
||||
case WISH:
|
||||
return new WishCounter(amount);
|
||||
case HOOFPRINT:
|
||||
return new HoofprintCounter(amount);
|
||||
case HATCHLING:
|
||||
return new HatchlingCounter(amount);
|
||||
case KI:
|
||||
return new KiCounter(amount);
|
||||
case SLIME:
|
||||
return new SlimeCounter(amount);
|
||||
case SPORE:
|
||||
return new SporeCounter(amount);
|
||||
case STUDY:
|
||||
return new StudyCounter(amount);
|
||||
case EYEBALL:
|
||||
return new EyeballCounter(amount);
|
||||
case ELIXIR:
|
||||
return new ElixirCounter(amount);
|
||||
case PAIN:
|
||||
return new PainCounter(amount);
|
||||
case DESPAIR:
|
||||
return new DespairCounter(amount);
|
||||
case PAGE:
|
||||
return new PageCounter(amount);
|
||||
case PRESSURE:
|
||||
return new PressureCounter(amount);
|
||||
case PETRIFICATION:
|
||||
return new PetrificationCounter(amount);
|
||||
case MINING:
|
||||
return new MiningCounter(amount);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* 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.counters;
|
||||
|
||||
import mage.counters.common.*;
|
||||
|
||||
/**
|
||||
* Enum for counters, names and instances.
|
||||
*
|
||||
* @author nantuko
|
||||
*/
|
||||
public enum CounterType {
|
||||
P1P1(new PlusOneCounter().name),
|
||||
M1M1(new MinusOneCounter().name),
|
||||
POISON(new PoisonCounter().name),
|
||||
CHARGE(new ChargeCounter().name),
|
||||
LORE(new LoreCounter().name),
|
||||
LOYALTY(new LoyaltyCounter().name),
|
||||
LEVEL(new LevelCounter().name),
|
||||
TIME(new TimeCounter().name),
|
||||
FADE(new FadeCounter().name),
|
||||
FATE(new FateCounter().name),
|
||||
FEATHER(new FeatherCounter().name),
|
||||
QUEST(new QuestCounter().name),
|
||||
ARROWHEAD(new ArrowheadCounter().name),
|
||||
AIM(new AimCounter().name),
|
||||
EON(new EonCounter().name),
|
||||
AWAKENING(new AwakeningCounter().name),
|
||||
DEVOTION(new DevotionCounter().name),
|
||||
DIVINITY(new DivinityCounter().name),
|
||||
WISH(new WishCounter().name),
|
||||
HOOFPRINT(new HoofprintCounter().name),
|
||||
HATCHLING(new HatchlingCounter().name),
|
||||
KI(new KiCounter().name),
|
||||
SLIME(new SlimeCounter().name),
|
||||
SPORE(new SporeCounter().name),
|
||||
STUDY(new StudyCounter().name),
|
||||
EYEBALL(new EyeballCounter().name),
|
||||
ELIXIR(new ElixirCounter().name),
|
||||
PAIN(new PainCounter().name),
|
||||
DESPAIR(new DespairCounter().name),
|
||||
PAGE(new PageCounter().name),
|
||||
PRESSURE(new PressureCounter().name),
|
||||
PETRIFICATION(new PetrificationCounter().name),
|
||||
MINING(new MiningCounter().name),
|
||||
THEFT(new TheftCounter().name);
|
||||
|
||||
private String name;
|
||||
|
||||
private CounterType(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get counter string name.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create instance of counter type with amount equal to 1.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Counter createInstance() {
|
||||
return createInstance(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create instance of counter type with defined amount of counters of the given type.
|
||||
*
|
||||
* @param amount amount of counters of the given type.
|
||||
* @return
|
||||
*/
|
||||
public Counter createInstance(int amount) {
|
||||
switch(this) {
|
||||
case P1P1:
|
||||
return new PlusOneCounter(amount);
|
||||
case M1M1:
|
||||
return new MinusOneCounter(amount);
|
||||
case POISON:
|
||||
return new PoisonCounter(amount);
|
||||
case CHARGE:
|
||||
return new ChargeCounter(amount);
|
||||
case LORE:
|
||||
return new LoreCounter(amount);
|
||||
case LOYALTY:
|
||||
return new LoyaltyCounter(amount);
|
||||
case LEVEL:
|
||||
return new LevelCounter(amount);
|
||||
case TIME:
|
||||
return new TimeCounter(amount);
|
||||
case FADE:
|
||||
return new FadeCounter(amount);
|
||||
case FATE:
|
||||
return new FateCounter(amount);
|
||||
case FEATHER:
|
||||
return new FeatherCounter(amount);
|
||||
case QUEST:
|
||||
return new QuestCounter(amount);
|
||||
case ARROWHEAD:
|
||||
return new ArrowheadCounter(amount);
|
||||
case AIM:
|
||||
return new AimCounter(amount);
|
||||
case EON:
|
||||
return new EonCounter(amount);
|
||||
case AWAKENING:
|
||||
return new AwakeningCounter(amount);
|
||||
case DEVOTION:
|
||||
return new DevotionCounter(amount);
|
||||
case DIVINITY:
|
||||
return new DivinityCounter(amount);
|
||||
case WISH:
|
||||
return new WishCounter(amount);
|
||||
case HOOFPRINT:
|
||||
return new HoofprintCounter(amount);
|
||||
case HATCHLING:
|
||||
return new HatchlingCounter(amount);
|
||||
case KI:
|
||||
return new KiCounter(amount);
|
||||
case SLIME:
|
||||
return new SlimeCounter(amount);
|
||||
case SPORE:
|
||||
return new SporeCounter(amount);
|
||||
case STUDY:
|
||||
return new StudyCounter(amount);
|
||||
case EYEBALL:
|
||||
return new EyeballCounter(amount);
|
||||
case ELIXIR:
|
||||
return new ElixirCounter(amount);
|
||||
case PAIN:
|
||||
return new PainCounter(amount);
|
||||
case DESPAIR:
|
||||
return new DespairCounter(amount);
|
||||
case PAGE:
|
||||
return new PageCounter(amount);
|
||||
case PRESSURE:
|
||||
return new PressureCounter(amount);
|
||||
case PETRIFICATION:
|
||||
return new PetrificationCounter(amount);
|
||||
case MINING:
|
||||
return new MiningCounter(amount);
|
||||
case THEFT:
|
||||
return new TheftCounter(amount);
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
47
Mage/src/mage/counters/common/TheftCounter.java
Normal file
47
Mage/src/mage/counters/common/TheftCounter.java
Normal file
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
* 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.counters.common;
|
||||
|
||||
import mage.counters.Counter;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class TheftCounter extends Counter<TheftCounter> {
|
||||
|
||||
public TheftCounter() {
|
||||
super("Theft");
|
||||
this.count = 1;
|
||||
}
|
||||
|
||||
public TheftCounter(int amount) {
|
||||
super("Theft");
|
||||
this.count = amount;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue