mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 05:09:16 -08:00
Merge origin/master
This commit is contained in:
commit
87b8c9719d
2 changed files with 55 additions and 5 deletions
|
|
@ -29,9 +29,22 @@ package mage.sets.alarareborn;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AttacksTriggeredAbility;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostTargetEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -45,12 +58,11 @@ public class SkyclawThrash extends CardImpl {
|
|||
this.subtype.add("Viashino");
|
||||
this.subtype.add("Warrior");
|
||||
|
||||
|
||||
|
||||
this.power = new MageInt(4);
|
||||
this.toughness = new MageInt(4);
|
||||
|
||||
// Whenever Skyclaw Thrash attacks, flip a coin. If you win the flip, Skyclaw Thrash gets +1/+1 and gains flying until end of turn.
|
||||
this.addAbility(new AttacksTriggeredAbility(new SkyclawThrashEffect(), false));
|
||||
}
|
||||
|
||||
public SkyclawThrash(final SkyclawThrash card) {
|
||||
|
|
@ -62,3 +74,38 @@ public class SkyclawThrash extends CardImpl {
|
|||
return new SkyclawThrash(this);
|
||||
}
|
||||
}
|
||||
|
||||
class SkyclawThrashEffect extends OneShotEffect {
|
||||
|
||||
public SkyclawThrashEffect() {
|
||||
super(Outcome.Benefit);
|
||||
this.staticText = "flip a coin. If you win the flip, {this} gets +1/+1 and gains flying until end of turn";
|
||||
}
|
||||
|
||||
public SkyclawThrashEffect(final SkyclawThrashEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SkyclawThrashEffect copy() {
|
||||
return new SkyclawThrashEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||
if (controller.flipCoin(game) && sourcePermanent != null) {
|
||||
ContinuousEffect effect = new BoostTargetEffect(1, 1, Duration.EndOfTurn);
|
||||
effect.setTargetPointer(new FixedTarget(sourcePermanent, game));
|
||||
game.addEffect(effect, source);
|
||||
effect = new GainAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn);
|
||||
effect.setTargetPointer(new FixedTarget(sourcePermanent, game));
|
||||
game.addEffect(effect, source);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -123,12 +123,15 @@ class ReinsOfTheVinesteedEffect extends OneShotEffect {
|
|||
sb.delete(sb.length() - 2, sb.length());
|
||||
FILTER.setMessage(sb.toString());
|
||||
TargetPermanent target = new TargetPermanent(FILTER);
|
||||
target.setNotTarget(true);
|
||||
if (controller != null
|
||||
&& controller.choose(Outcome.PutCardInPlay, target, source.getSourceId(), game)) {
|
||||
Permanent targetPermanent = game.getPermanent(target.getFirstTarget());
|
||||
game.getState().setValue("attachTo:" + aura.getId(), targetPermanent);
|
||||
aura.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), controller.getId());
|
||||
return targetPermanent.addAttachment(aura.getId(), game);
|
||||
if (!targetPermanent.cantBeEnchantedBy(aura, game)) {
|
||||
game.getState().setValue("attachTo:" + aura.getId(), targetPermanent);
|
||||
aura.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), controller.getId());
|
||||
return targetPermanent.addAttachment(aura.getId(), game);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue