1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-13 01:01:11 -09:00

* Leonin Arbiter - Fixed a bug that AI doesn't pay {2} to search library.

This commit is contained in:
LevelX2 2014-07-19 10:25:22 +02:00
parent bfca0b2b04
commit 22697295a8
2 changed files with 9 additions and 5 deletions
Mage.Sets/src/mage/sets
magic2015
scarsofmirrodin

View file

@ -33,6 +33,7 @@ import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.dynamicvalue.common.SourcePermanentPowerCount; import mage.abilities.dynamicvalue.common.SourcePermanentPowerCount;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.continious.GainAbilityAttachedEffect; import mage.abilities.effects.common.continious.GainAbilityAttachedEffect;
@ -69,7 +70,9 @@ public class BurningAnger extends CardImpl {
this.addAbility(ability); this.addAbility(ability);
// Enchanted creature has "{T}: This creature deals damage equal to its power to target creature or player." // Enchanted creature has "{T}: This creature deals damage equal to its power to target creature or player."
Ability gainedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new SourcePermanentPowerCount()), new TapSourceCost()); Effect effect = new DamageTargetEffect(new SourcePermanentPowerCount());
effect.setText("{this} deals damage equal to its power to target creature or player");
Ability gainedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost());
gainedAbility.addTarget(new TargetCreatureOrPlayer()); gainedAbility.addTarget(new TargetCreatureOrPlayer());
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(gainedAbility, AttachmentType.AURA, Duration.WhileOnBattlefield, this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(gainedAbility, AttachmentType.AURA, Duration.WhileOnBattlefield,
"Enchanted creature has \"{T}: This creature deals damage equal to its power to target creature or player.\""))); "Enchanted creature has \"{T}: This creature deals damage equal to its power to target creature or player.\"")));

View file

@ -62,6 +62,7 @@ public class LeoninArbiter extends CardImpl {
this.power = new MageInt(2); this.power = new MageInt(2);
this.toughness = new MageInt(2); this.toughness = new MageInt(2);
// Players can't search libraries. Any player may pay {2} for that player to ignore this effect until end of turn.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new LeoninArbiterReplacementEffect())); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new LeoninArbiterReplacementEffect()));
} }
@ -78,7 +79,7 @@ public class LeoninArbiter extends CardImpl {
class LeoninArbiterReplacementEffect extends ReplacementEffectImpl { class LeoninArbiterReplacementEffect extends ReplacementEffectImpl {
private static final String effectText = "Players can't search libraries. Any player may pay {2} for that player to ignore this effect until end of turn"; private static final String effectText = "Players can't search libraries. Any player may pay {2} for that player to ignore this effect until end of turn";
private List<UUID> paidPlayers = new ArrayList<UUID>(); private final List<UUID> paidPlayers = new ArrayList<>();
LeoninArbiterReplacementEffect ( ) { LeoninArbiterReplacementEffect ( ) {
super(Duration.WhileOnBattlefield, Outcome.Neutral); super(Duration.WhileOnBattlefield, Outcome.Neutral);
@ -87,7 +88,7 @@ class LeoninArbiterReplacementEffect extends ReplacementEffectImpl {
LeoninArbiterReplacementEffect ( LeoninArbiterReplacementEffect effect ) { LeoninArbiterReplacementEffect ( LeoninArbiterReplacementEffect effect ) {
super(effect); super(effect);
this.paidPlayers = effect.paidPlayers; this.paidPlayers.addAll(effect.paidPlayers);
} }
@Override @Override
@ -105,7 +106,7 @@ class LeoninArbiterReplacementEffect extends ReplacementEffectImpl {
if ( arbiterTax.canPay(source.getSourceId(), event.getPlayerId(), game) && if ( arbiterTax.canPay(source.getSourceId(), event.getPlayerId(), game) &&
player.chooseUse(Outcome.Neutral, "Pay {2} to search your library?", game) ) player.chooseUse(Outcome.Neutral, "Pay {2} to search your library?", game) )
{ {
if (arbiterTax.payOrRollback(source, game, this.getId(), event.getPlayerId()) ) { if (arbiterTax.payOrRollback(source, game, source.getSourceId(), event.getPlayerId()) ) {
paidPlayers.add(event.getPlayerId()); paidPlayers.add(event.getPlayerId());
return false; return false;
} }
@ -121,7 +122,7 @@ class LeoninArbiterReplacementEffect extends ReplacementEffectImpl {
if ( event.getType() == EventType.SEARCH_LIBRARY ) { if ( event.getType() == EventType.SEARCH_LIBRARY ) {
return true; return true;
} }
if ( event.getType() == EventType.END_TURN_STEP_POST ) { if ( event.getType() == EventType.END_PHASE_POST) {
this.paidPlayers.clear(); this.paidPlayers.clear();
} }
return false; return false;