mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 19:41:59 -08:00
* Some minor changes to return code handling.
This commit is contained in:
parent
647cd9bc6d
commit
d5f4df7f54
9 changed files with 37 additions and 39 deletions
|
|
@ -98,15 +98,14 @@ public class HazoretsFavor extends CardImpl {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent creature = game.getPermanent(source.getFirstTarget());
|
||||
Permanent creature = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||
if (creature != null) {
|
||||
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice boosted " + creature.getName(), source.getControllerId());
|
||||
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("Sacrifice boosted " + creature.getName(), source.getControllerId());
|
||||
sacrificeEffect.setTargetPointer(new FixedTarget(creature, game));
|
||||
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(sacrificeEffect);
|
||||
game.addDelayedTriggeredAbility(delayedAbility, source);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -95,8 +95,8 @@ class NehebTheEternalManaEffect extends ManaEffect {
|
|||
int amount = dynamicValue.calculate(game, source, this);
|
||||
if (amount > 0) {
|
||||
controller.getManaPool().addMana(Mana.RedMana(amount), game, source);
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -129,7 +129,8 @@ class RingsOfBrighthearthEffect extends OneShotEffect {
|
|||
Player player = game.getPlayer(source.getControllerId());
|
||||
ManaCostsImpl cost = new ManaCostsImpl("{2}");
|
||||
if (player != null) {
|
||||
if (player.chooseUse(Outcome.Benefit, "Pay " + cost.getText() + "? If you do, copy that ability. You may choose new targets for the copy.", source, game)) {
|
||||
if (cost.canPay(source, source.getSourceId(), player.getId(), game)
|
||||
&& player.chooseUse(Outcome.Benefit, "Pay " + cost.getText() + "? If you do, copy that ability. You may choose new targets for the copy.", source, game)) {
|
||||
if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null)) {
|
||||
StackAbility ability = (StackAbility) getValue("stackAbility");
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
|
|
@ -142,6 +143,7 @@ class RingsOfBrighthearthEffect extends OneShotEffect {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,12 +28,12 @@
|
|||
package mage.cards.r;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.Mana;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.common.ManaEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.predicate.mageobject.NamePredicate;
|
||||
import mage.game.Game;
|
||||
|
|
@ -48,7 +48,6 @@ public class RiteOfFlame extends CardImpl {
|
|||
public RiteOfFlame(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{R}");
|
||||
|
||||
|
||||
// Add {R}{R} to your mana pool, then add {R} to your mana pool for each card named Rite of Flame in each graveyard.
|
||||
this.getSpellAbility().addEffect(new RiteOfFlameManaEffect());
|
||||
}
|
||||
|
|
@ -64,6 +63,7 @@ public class RiteOfFlame extends CardImpl {
|
|||
}
|
||||
|
||||
class RiteOfFlameManaEffect extends ManaEffect {
|
||||
|
||||
private static final FilterCard filter = new FilterCard();
|
||||
|
||||
static {
|
||||
|
|
@ -90,6 +90,7 @@ class RiteOfFlameManaEffect extends ManaEffect {
|
|||
}
|
||||
}
|
||||
controller.getManaPool().addMana(Mana.RedMana(count + 2), game, source);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
*/
|
||||
package mage.cards.s;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.DelayedTriggeredAbility;
|
||||
|
|
@ -46,8 +47,6 @@ import mage.target.Target;
|
|||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Plopman
|
||||
|
|
@ -100,7 +99,7 @@ class SaffiEriksdotterEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
DelayedTriggeredAbility delayedAbility = new SaffiEriksdotterDelayedTriggeredAbility(new FixedTarget(this.getTargetPointer().getFirst(game, source)));
|
||||
game.addDelayedTriggeredAbility(delayedAbility, source);
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -92,6 +92,7 @@ class SeasonsPastEffect extends OneShotEffect {
|
|||
SeasonsPastTarget target = new SeasonsPastTarget();
|
||||
controller.choose(outcome, target, source.getSourceId(), game);
|
||||
controller.moveCards(new CardsImpl(target.getTargets()), Zone.HAND, source, game);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -119,18 +119,17 @@ class SelvalaHeartOfTheWildsEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source));
|
||||
if (permanent == null) {
|
||||
permanent = (Permanent) game.getLastKnownInformation(targetPointer.getFirst(game, source), Zone.BATTLEFIELD);
|
||||
}
|
||||
if (permanent != null
|
||||
&& filter2.match(permanent, game)) {
|
||||
Permanent permanent = game.getPermanentOrLKIBattlefield(targetPointer.getFirst(game, source));
|
||||
if (permanent != null) {
|
||||
if (filter2.match(permanent, game)) {
|
||||
Player permanentController = game.getPlayer(permanent.getControllerId());
|
||||
if (permanentController.chooseUse(Outcome.DrawCard, "Would you like to draw a card?", source, game)) {
|
||||
if (permanentController != null
|
||||
&& permanentController.chooseUse(Outcome.DrawCard, "Would you like to draw a card?", source, game)) {
|
||||
permanentController.drawCards(1, game);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,9 +25,9 @@
|
|||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.cards.s;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
|
|
@ -39,12 +39,10 @@ import mage.cards.CardSetInfo;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.constants.TargetController;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.target.common.TargetCardInYourGraveyard;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Loki
|
||||
|
|
@ -68,8 +66,8 @@ public class SheoldredWhisperingOne extends CardImpl {
|
|||
this.addAbility(ability);
|
||||
|
||||
// At the beginning of each opponent's upkeep, that player sacrifices a creature.
|
||||
ability = new BeginningOfUpkeepTriggeredAbility(new SacrificeEffect(new FilterCreaturePermanent(), 1, "that player "), TargetController.OPPONENT, false);
|
||||
this.addAbility(ability);
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(
|
||||
new SacrificeEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 1, "that player"), TargetController.OPPONENT, false));
|
||||
}
|
||||
|
||||
public SheoldredWhisperingOne(final SheoldredWhisperingOne card) {
|
||||
|
|
|
|||
|
|
@ -73,7 +73,6 @@ public class SacrificeEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(targetPointer.getFirst(game, source));
|
||||
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue