mirror of
https://github.com/magefree/mage.git
synced 2026-01-25 20:59:14 -08:00
Merge branch 'master' of https://github.com/magefree/mage
This commit is contained in:
commit
a0fb5bfe22
12 changed files with 76 additions and 76 deletions
|
|
@ -50,6 +50,8 @@ public class GhostlyPrison extends CardImpl {
|
|||
super(ownerId, 10, "Ghostly Prison", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}");
|
||||
this.expansionSetCode = "CHK";
|
||||
this.color.setWhite(true);
|
||||
|
||||
// Creatures can't attack you unless their controller pays {2} for each creature he or she controls that's attacking you
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GhostlyPrisonReplacementEffect()));
|
||||
}
|
||||
|
||||
|
|
@ -87,10 +89,10 @@ class GhostlyPrisonReplacementEffect extends ReplacementEffectImpl {
|
|||
if ( event.getType() == GameEvent.EventType.DECLARE_ATTACKER) {
|
||||
Player player = game.getPlayer(event.getPlayerId());
|
||||
if ( player != null && event.getTargetId().equals(source.getControllerId())) {
|
||||
ManaCostsImpl propagandaTax = new ManaCostsImpl("{2}");
|
||||
if ( propagandaTax.canPay(source.getSourceId(), event.getPlayerId(), game) &&
|
||||
player.chooseUse(Outcome.Benefit, "Pay {2} to declare attacker?", game) ) {
|
||||
if (propagandaTax.payOrRollback(source, game, this.getId(), event.getPlayerId())) {
|
||||
ManaCostsImpl attackTax = new ManaCostsImpl("{2}");
|
||||
if ( attackTax.canPay(source.getSourceId(), event.getPlayerId(), game) &&
|
||||
player.chooseUse(Outcome.Benefit, "Pay {2} to attack player?", game) ) {
|
||||
if (attackTax.payOrRollback(source, game, this.getId(), event.getPlayerId())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -103,7 +105,11 @@ class GhostlyPrisonReplacementEffect extends ReplacementEffectImpl {
|
|||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if ( event.getType() == GameEvent.EventType.DECLARE_ATTACKER && event.getTargetId().equals(source.getControllerId()) ) {
|
||||
return true;
|
||||
Player attackedPlayer = game.getPlayer(event.getTargetId());
|
||||
if (attackedPlayer != null) {
|
||||
// only if a player is attacked. Attacking a planeswalker is free
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ import java.util.UUID;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BecomesBlockedAllTriggeredAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.continious.BoostTargetEffect;
|
||||
import mage.abilities.keyword.ChampionAbility;
|
||||
|
|
@ -76,7 +77,9 @@ public class UnstoppableAsh extends CardImpl {
|
|||
this.addAbility(new ChampionAbility(this, new String[]{"Treefolk", "Warrior"}));
|
||||
|
||||
// Whenever a creature you control becomes blocked, it gets +0/+5 until end of turn.
|
||||
this.addAbility(new BecomesBlockedAllTriggeredAbility(new UnstoppableAshEffect(), false, filter, true));
|
||||
Effect effect = new BoostTargetEffect(0, 5, Duration.EndOfTurn);
|
||||
effect.setText("it gets +0/+5 until end of turn");
|
||||
this.addAbility(new BecomesBlockedAllTriggeredAbility(effect, false, filter, true));
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -89,30 +92,3 @@ public class UnstoppableAsh extends CardImpl {
|
|||
return new UnstoppableAsh(this);
|
||||
}
|
||||
}
|
||||
|
||||
class UnstoppableAshEffect extends OneShotEffect {
|
||||
|
||||
UnstoppableAshEffect() {
|
||||
super(Outcome.Neutral);
|
||||
staticText = "it gets +0/+5 until end of turn";
|
||||
}
|
||||
|
||||
UnstoppableAshEffect(final UnstoppableAshEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent creature = game.getPermanent(this.getTargetPointer().getFirst(game, source));
|
||||
if (creature != null) {
|
||||
game.addEffect(new BoostTargetEffect(0, 5, Duration.EndOfTurn), source);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UnstoppableAshEffect copy() {
|
||||
return new UnstoppableAshEffect(this);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,11 +89,11 @@ class PropagandaReplacementEffect extends ReplacementEffectImpl {
|
|||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
Player player = game.getPlayer(event.getPlayerId());
|
||||
if ( player != null ) {
|
||||
ManaCostsImpl propagandaTax = new ManaCostsImpl("{2}");
|
||||
if ( propagandaTax.canPay(source.getSourceId(), event.getPlayerId(), game) &&
|
||||
player.chooseUse(Outcome.Neutral, "Pay {2} to declare attacker?", game) )
|
||||
ManaCostsImpl attackTax = new ManaCostsImpl("{2}");
|
||||
if ( attackTax.canPay(source.getSourceId(), event.getPlayerId(), game) &&
|
||||
player.chooseUse(Outcome.Neutral, "Pay {2} to attack player?", game) )
|
||||
{
|
||||
if (propagandaTax.payOrRollback(source, game, source.getSourceId(), event.getPlayerId()) ) {
|
||||
if (attackTax.payOrRollback(source, game, source.getSourceId(), event.getPlayerId()) ) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -105,7 +105,11 @@ class PropagandaReplacementEffect extends ReplacementEffectImpl {
|
|||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if ( event.getType() == GameEvent.EventType.DECLARE_ATTACKER && event.getTargetId().equals(source.getControllerId())) {
|
||||
return true;
|
||||
Player attackedPlayer = game.getPlayer(event.getTargetId());
|
||||
if (attackedPlayer != null) {
|
||||
// only if a player is attacked. Attacking a planeswalker is free
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ import mage.game.events.GameEvent;
|
|||
*
|
||||
* @author Plopman
|
||||
*/
|
||||
public class SeaMonster extends CardImpl {
|
||||
public class SeaMonster extends CardImpl {
|
||||
|
||||
public SeaMonster(UUID ownerId) {
|
||||
super(ownerId, 85, "Sea Monster", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{U}{U}");
|
||||
|
|
|
|||
|
|
@ -54,9 +54,12 @@ public class WindbornMuse extends CardImpl {
|
|||
this.color.setWhite(true);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new WindbornMuseReplacementEffect()));
|
||||
// Creatures can't attack you unless their controller pays {2} for each creature he or she controls that's attacking you.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new WindbornMuseReplacementEffect()));
|
||||
|
||||
}
|
||||
|
||||
public WindbornMuse(final WindbornMuse card) {
|
||||
|
|
@ -92,11 +95,11 @@ class WindbornMuseReplacementEffect extends ReplacementEffectImpl {
|
|||
if ( event.getType() == GameEvent.EventType.DECLARE_ATTACKER) {
|
||||
Player player = game.getPlayer(event.getPlayerId());
|
||||
if ( player != null && event.getTargetId().equals(source.getControllerId())) {
|
||||
ManaCostsImpl propagandaTax = new ManaCostsImpl("{2}");
|
||||
if ( propagandaTax.canPay(source.getSourceId(), event.getPlayerId(), game) &&
|
||||
player.chooseUse(Outcome.Benefit, "Pay {2} to declare attacker?", game) )
|
||||
ManaCostsImpl attackTax = new ManaCostsImpl("{2}");
|
||||
if ( attackTax.canPay(source.getSourceId(), event.getPlayerId(), game) &&
|
||||
player.chooseUse(Outcome.Benefit, "Pay {2} to attack player?", game) )
|
||||
{
|
||||
if (propagandaTax.payOrRollback(source, game, this.getId(), event.getPlayerId())) {
|
||||
if (attackTax.payOrRollback(source, game, this.getId(), event.getPlayerId())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -109,7 +112,11 @@ class WindbornMuseReplacementEffect extends ReplacementEffectImpl {
|
|||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if ( event.getType() == GameEvent.EventType.DECLARE_ATTACKER && event.getTargetId().equals(source.getControllerId()) ) {
|
||||
return true;
|
||||
Player attackedPlayer = game.getPlayer(event.getTargetId());
|
||||
if (attackedPlayer != null) {
|
||||
// only if a player is attacked. Attacking a planeswalker is free
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -133,10 +133,10 @@ class ElephantGrassReplacementEffect2 extends ReplacementEffectImpl {
|
|||
if ( event.getType() == GameEvent.EventType.DECLARE_ATTACKER) {
|
||||
Player player = game.getPlayer(event.getPlayerId());
|
||||
if ( player != null && event.getTargetId().equals(source.getControllerId())) {
|
||||
ManaCostsImpl cost = new ManaCostsImpl("{2}");
|
||||
if ( cost.canPay(source.getSourceId(), event.getPlayerId(), game) &&
|
||||
player.chooseUse(Outcome.Benefit, "Pay {2} to declare attacker?", game) ) {
|
||||
if (cost.payOrRollback(source, game, this.getId(), event.getPlayerId())) {
|
||||
ManaCostsImpl attackCost = new ManaCostsImpl("{2}");
|
||||
if ( attackCost.canPay(source.getSourceId(), event.getPlayerId(), game) &&
|
||||
player.chooseUse(Outcome.Benefit, "Pay {2} to attack player?", game) ) {
|
||||
if (attackCost.payOrRollback(source, game, this.getId(), event.getPlayerId())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -150,8 +150,12 @@ class ElephantGrassReplacementEffect2 extends ReplacementEffectImpl {
|
|||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if ( event.getType() == GameEvent.EventType.DECLARE_ATTACKER && event.getTargetId().equals(source.getControllerId()) ) {
|
||||
Permanent creature = game.getPermanent(event.getSourceId());
|
||||
if(creature != null && !creature.getColor().isBlack()){
|
||||
return true;
|
||||
if (creature != null && !creature.getColor().isBlack()) {
|
||||
Player attackedPlayer = game.getPlayer(event.getTargetId());
|
||||
if (attackedPlayer != null) {
|
||||
// only if a player is attacked. Attacking a planeswalker is free
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
@ -162,4 +166,4 @@ class ElephantGrassReplacementEffect2 extends ReplacementEffectImpl {
|
|||
return new ElephantGrassReplacementEffect2(this);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue