forked from magefree/mage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'magefree:master' into master
- Loading branch information
Showing
18 changed files
with
574 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
package mage.cards.b; | ||
|
||
import mage.MageInt; | ||
import mage.abilities.Ability; | ||
import mage.abilities.common.EntersBattlefieldAbility; | ||
import mage.abilities.common.SimpleActivatedAbility; | ||
import mage.abilities.common.SimpleStaticAbility; | ||
import mage.abilities.costs.common.RemoveCountersSourceCost; | ||
import mage.abilities.costs.common.TapSourceCost; | ||
import mage.abilities.effects.ReplacementEffectImpl; | ||
import mage.abilities.effects.common.EntersBattlefieldWithXCountersEffect; | ||
import mage.abilities.effects.common.counter.AddCountersTargetEffect; | ||
import mage.cards.CardImpl; | ||
import mage.cards.CardSetInfo; | ||
import mage.constants.*; | ||
import mage.counters.CounterType; | ||
import mage.filter.StaticFilters; | ||
import mage.game.Game; | ||
import mage.game.events.GameEvent; | ||
import mage.game.permanent.Permanent; | ||
import mage.target.TargetPermanent; | ||
import mage.util.CardUtil; | ||
|
||
import java.util.UUID; | ||
|
||
/** | ||
* | ||
* @author Grath | ||
*/ | ||
public final class BenevolentHydra extends CardImpl { | ||
|
||
public BenevolentHydra(UUID ownerId, CardSetInfo setInfo) { | ||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{X}{G}{G}"); | ||
|
||
this.subtype.add(SubType.HYDRA); | ||
this.power = new MageInt(1); | ||
this.toughness = new MageInt(1); | ||
|
||
// Hungering Hydra enters the battlefield with X +1/+1 counters on it. | ||
this.addAbility(new EntersBattlefieldAbility( | ||
new EntersBattlefieldWithXCountersEffect(CounterType.P1P1.createInstance()) | ||
)); | ||
|
||
// If one or more +1/+1 counters would be put on another creature you control, that many plus one +1/+1 counters are put on it instead. | ||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BenevolentHydraEffect())); | ||
|
||
// {T}, Remove a +1/+1 counter from Benevolent Hydra: Put a +1/+1 counter on another target creature you control. | ||
Ability ability = new SimpleActivatedAbility(new AddCountersTargetEffect(CounterType.P1P1.createInstance()).setText("Put a +1/+1 counter on another target creature you control"), new TapSourceCost()); | ||
ability.addCost(new RemoveCountersSourceCost(CounterType.P1P1.createInstance())); | ||
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_CONTROLLED_ANOTHER_CREATURE)); | ||
this.addAbility(ability); | ||
} | ||
|
||
private BenevolentHydra(final BenevolentHydra card) { | ||
super(card); | ||
} | ||
|
||
@Override | ||
public BenevolentHydra copy() { | ||
return new BenevolentHydra(this); | ||
} | ||
} | ||
|
||
class BenevolentHydraEffect extends ReplacementEffectImpl { | ||
|
||
BenevolentHydraEffect() { | ||
super(Duration.WhileOnBattlefield, Outcome.BoostCreature, false); | ||
staticText = "If one or more +1/+1 counters would be put on another creature you control, that many plus one +1/+1 counters are put on it instead"; | ||
} | ||
|
||
BenevolentHydraEffect(final BenevolentHydraEffect effect) { | ||
super(effect); | ||
} | ||
|
||
@Override | ||
public boolean replaceEvent(GameEvent event, Ability source, Game game) { | ||
event.setAmountForCounters(CardUtil.overflowInc(event.getAmount(), 1), true); | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean checksEventType(GameEvent event, Game game) { | ||
return event.getType() == GameEvent.EventType.ADD_COUNTERS; | ||
} | ||
|
||
@Override | ||
public boolean applies(GameEvent event, Ability source, Game game) { | ||
if (event.getData().equals(CounterType.P1P1.getName()) && event.getAmount() > 0) { | ||
Permanent permanent = game.getPermanent(event.getTargetId()); | ||
if (permanent == null) { | ||
permanent = game.getPermanentEntering(event.getTargetId()); | ||
} | ||
return permanent != null && permanent.isControlledBy(source.getControllerId()) | ||
&& permanent.isCreature(game) && !event.getTargetId().equals(source.getSourceId()); | ||
} | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean apply(Game game, Ability source) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public BenevolentHydraEffect copy() { | ||
return new BenevolentHydraEffect(this); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
|
||
package mage.cards.c; | ||
|
||
import mage.MageInt; | ||
import mage.abilities.Ability; | ||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; | ||
import mage.abilities.effects.OneShotEffect; | ||
import mage.cards.CardImpl; | ||
import mage.cards.CardSetInfo; | ||
import mage.constants.CardType; | ||
import mage.constants.Outcome; | ||
import mage.constants.SubType; | ||
import mage.constants.TargetController; | ||
import mage.game.Game; | ||
import mage.players.Player; | ||
|
||
import java.util.UUID; | ||
|
||
/** | ||
* | ||
* @author Grath | ||
*/ | ||
public final class CreepingBloodsucker extends CardImpl { | ||
|
||
public CreepingBloodsucker(UUID ownerId, CardSetInfo setInfo) { | ||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{B}"); | ||
this.subtype.add(SubType.VAMPIRE); | ||
|
||
this.power = new MageInt(1); | ||
this.toughness = new MageInt(2); | ||
|
||
// At the beginning of your upkeep, Creeping Bloodsucker deals 1 damage to each opponent. You gain life equal to the damage dealt this way. | ||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new CreepingBloodsuckerEffect(), TargetController.YOU, false)); | ||
} | ||
|
||
private CreepingBloodsucker(final CreepingBloodsucker card) { | ||
super(card); | ||
} | ||
|
||
@Override | ||
public CreepingBloodsucker copy() { | ||
return new CreepingBloodsucker(this); | ||
} | ||
} | ||
|
||
class CreepingBloodsuckerEffect extends OneShotEffect { | ||
public CreepingBloodsuckerEffect() { | ||
super(Outcome.Damage); | ||
staticText = "{this} deals 1 damage to each opponent. You gain life equal to the damage dealt this way"; | ||
} | ||
|
||
public CreepingBloodsuckerEffect(final CreepingBloodsuckerEffect effect) { | ||
super(effect); | ||
} | ||
|
||
@Override | ||
public boolean apply(Game game, Ability source) { | ||
int damageDealt = 0; | ||
Player player = game.getPlayer(source.getControllerId()); | ||
for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { | ||
if (player.hasOpponent(playerId, game)) { | ||
damageDealt += game.getPlayer(playerId).damage(1, source.getSourceId(), source, game); | ||
} | ||
} | ||
if (damageDealt > 0) { | ||
game.getPlayer(source.getControllerId()).gainLife(damageDealt, game, source); | ||
} | ||
return true; | ||
} | ||
|
||
@Override | ||
public CreepingBloodsuckerEffect copy() { | ||
return new CreepingBloodsuckerEffect(this); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
package mage.cards.d; | ||
|
||
import mage.MageInt; | ||
import mage.abilities.Ability; | ||
import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility; | ||
import mage.abilities.common.SimpleActivatedAbility; | ||
import mage.abilities.costs.common.TapSourceCost; | ||
import mage.abilities.costs.mana.ManaCostsImpl; | ||
import mage.abilities.effects.common.ExileTargetForSourceEffect; | ||
import mage.abilities.effects.common.GainLifeEffect; | ||
import mage.abilities.effects.common.ReturnToBattlefieldUnderOwnerControlTargetEffect; | ||
import mage.cards.CardImpl; | ||
import mage.cards.CardSetInfo; | ||
import mage.constants.CardType; | ||
import mage.constants.SubType; | ||
import mage.filter.common.FilterControlledCreaturePermanent; | ||
import mage.filter.common.FilterCreaturePermanent; | ||
import mage.filter.predicate.mageobject.AnotherPredicate; | ||
import mage.target.common.TargetControlledCreaturePermanent; | ||
|
||
import java.util.UUID; | ||
|
||
/** | ||
* @author Grath | ||
*/ | ||
public final class DistinguishedConjurer extends CardImpl { | ||
|
||
private static final FilterCreaturePermanent filter | ||
= new FilterCreaturePermanent("another creature"); | ||
private static final FilterControlledCreaturePermanent filter2 | ||
= new FilterControlledCreaturePermanent("another target creature you control"); | ||
|
||
static { | ||
filter.add(AnotherPredicate.instance); | ||
filter2.add(AnotherPredicate.instance); | ||
} | ||
|
||
public DistinguishedConjurer(UUID ownerId, CardSetInfo setInfo) { | ||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}"); | ||
|
||
this.subtype.add(SubType.HUMAN); | ||
this.subtype.add(SubType.WIZARD); | ||
this.power = new MageInt(1); | ||
this.toughness = new MageInt(2); | ||
|
||
// Whenever another creature enters the battlefield under your control, you gain 1 life. | ||
this.addAbility(new EntersBattlefieldControlledTriggeredAbility(new GainLifeEffect(1), filter)); | ||
|
||
// {4}{W}, {T}: Exile another target creature you control, then return it to the battlefield under its owner’s control. | ||
Ability ability = new SimpleActivatedAbility(new ExileTargetForSourceEffect(), new ManaCostsImpl<>("{4}{W}")); | ||
ability.addCost(new TapSourceCost()); | ||
ability.addEffect(new ReturnToBattlefieldUnderOwnerControlTargetEffect(false, false).concatBy(", then")); | ||
ability.addTarget(new TargetControlledCreaturePermanent(filter2)); | ||
this.addAbility(ability); | ||
} | ||
|
||
private DistinguishedConjurer(final DistinguishedConjurer card) { | ||
super(card); | ||
} | ||
|
||
@Override | ||
public DistinguishedConjurer copy() { | ||
return new DistinguishedConjurer(this); | ||
} | ||
} |
Oops, something went wrong.