mirror of
https://github.com/correl/mage.git
synced 2024-11-22 03:00:11 +00:00
Ogre Marauder fixes (#10471)
- performs effect even if opponent can't pay or chose not to pay - grants "can't be blocked" ability, rather than creating continuous effect, as per Oracle text
This commit is contained in:
parent
978adac13d
commit
7f8526192f
1 changed files with 12 additions and 7 deletions
|
@ -10,7 +10,8 @@ import mage.abilities.costs.Cost;
|
|||
import mage.abilities.costs.common.SacrificeTargetCost;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.combat.CantBeBlockedSourceEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
|
||||
import mage.abilities.keyword.CantBeBlockedSourceAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
|
@ -73,13 +74,17 @@ class OgreMarauderEffect extends OneShotEffect {
|
|||
Player defender = game.getPlayer(defendingPlayerId);
|
||||
if (defender != null && sourceObject != null) {
|
||||
Cost cost = new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT));
|
||||
boolean paid = false;
|
||||
if (cost.canPay(source, source, defendingPlayerId, game)
|
||||
&& defender.chooseUse(Outcome.LoseAbility, "Sacrifice a creature to prevent that " + sourceObject.getLogName() + " can't be blocked?", source, game)) {
|
||||
if (!cost.pay(source, game, source, defendingPlayerId, false, null)) {
|
||||
// cost was not payed - so source can't be blocked
|
||||
ContinuousEffect effect = new CantBeBlockedSourceEffect(Duration.EndOfTurn);
|
||||
game.addEffect(effect, source);
|
||||
}
|
||||
&& defender.chooseUse(Outcome.LoseAbility, "Sacrifice a creature to prevent "
|
||||
+ sourceObject.getLogName() + " from gaining \"" + sourceObject.getName() + " can't be blocked\"?",
|
||||
source, game)) {
|
||||
paid = cost.pay(source, game, source, defendingPlayerId, false, null);
|
||||
}
|
||||
if (!paid) {
|
||||
// cost was not paid - so source gains "this can't be blocked"
|
||||
ContinuousEffect effect = new GainAbilitySourceEffect(new CantBeBlockedSourceAbility(), Duration.EndOfTurn);
|
||||
game.addEffect(effect, source);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue