mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
Merge 8ec88bfe00 into 520c3a36e5
This commit is contained in:
commit
6df34fe1a9
2 changed files with 99 additions and 0 deletions
98
Mage.Sets/src/mage/cards/x/Xenosquirrels.java
Normal file
98
Mage.Sets/src/mage/cards/x/Xenosquirrels.java
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
package mage.cards.x;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.effects.common.counter.RemoveCounterSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.RollDieEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author tiera3 - based on SnickeringSquirrel.java, Magmasaur.java, JinnieFayJetmirsSecond.java
|
||||
*/
|
||||
public final class Xenosquirrels extends CardImpl {
|
||||
|
||||
public Xenosquirrels(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}");
|
||||
this.subtype.add(SubType.ALIEN, SubType.SQUIRREL);
|
||||
this.power = new MageInt(0);
|
||||
this.toughness = new MageInt(0);
|
||||
|
||||
// Xenosquirrels enters with two +1/+1 counters on it.
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(
|
||||
CounterType.P1P1.createInstance(2), true
|
||||
), "with two +1/+1 counters on it"));
|
||||
|
||||
// After you roll a die, you may remove a +1/+1 counter from Xenosquirrels. If you do, increase or decrease the result by 1.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new XenosquirrelsEffect()));
|
||||
}
|
||||
|
||||
private Xenosquirrels(final Xenosquirrels card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Xenosquirrels copy() {
|
||||
return new Xenosquirrels(this);
|
||||
}
|
||||
}
|
||||
|
||||
class XenosquirrelsEffect extends ReplacementEffectImpl {
|
||||
|
||||
XenosquirrelsEffect() {
|
||||
super(Duration.WhileOnBattlefield, Outcome.Benefit);
|
||||
staticText = "After you roll a die, you may remove a +1/+1 counter from Xenosquirrels. If you do, increase or decrease the result by 1.";
|
||||
}
|
||||
|
||||
private XenosquirrelsEffect(final XenosquirrelsEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Player dieRoller = game.getPlayer(event.getPlayerId());
|
||||
if (controller == null || dieRoller == null || controller != dieRoller) {
|
||||
return false;
|
||||
}
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (permanent == null || 0 == permanent.getCounters(game).getCount(CounterType.P1P1) ) {
|
||||
return false;
|
||||
}
|
||||
if (controller.chooseUse(outcome, "Remove a +1/+1 counter from " + permanent.getLogName() + " to increase or decrease the result of a die ("
|
||||
+ event.getAmount() + ") by 1?", source, game)) {
|
||||
permanent.removeCounters(CounterType.P1P1.getName(), 1, source, game);
|
||||
((RollDieEvent) event).incResultModifier( player.chooseUse(
|
||||
outcome, "Increase or Decrease " + event.getAmount() + " by 1", null,
|
||||
"Increase", "Decrease", source, game ) ? 1 : -1 );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checksEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.ROLL_DIE
|
||||
&& ((RollDieEvent) event).getRollDieType() == RollDieType.NUMERICAL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
return source.isControlledBy(event.getPlayerId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public XenosquirrelsEffect copy() {
|
||||
return new XenosquirrelsEffect(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -69,5 +69,6 @@ public final class Unfinity extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("The Space Family Goblinson", 179, Rarity.UNCOMMON, mage.cards.t.TheSpaceFamilyGoblinson.class));
|
||||
cards.add(new SetCardInfo("Vegetation Abomination", 160, Rarity.COMMON, mage.cards.v.VegetationAbomination.class));
|
||||
cards.add(new SetCardInfo("Watery Grave", 278, Rarity.RARE, mage.cards.w.WateryGrave.class));
|
||||
cards.add(new SetCardInfo("Xenosquirrels", 96, Rarity.COMMON, mage.cards.x.Xenosquirrels.class));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue