mirror of
https://github.com/magefree/mage.git
synced 2025-12-26 05:22:02 -08:00
* Kicker abilities - fixed that AI can't cast cards with kicker for normal cost (AI don't use kicker now);
This commit is contained in:
parent
3c9e967642
commit
2dd64cf5cd
8 changed files with 139 additions and 26 deletions
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.abilities.keyword;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
|
|
@ -13,9 +12,12 @@ import mage.abilities.costs.common.TapTargetCost;
|
|||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
import mage.filter.predicate.mageobject.SharesColorWithSourcePredicate;
|
||||
import mage.filter.predicate.permanent.TappedPredicate;
|
||||
import mage.game.Game;
|
||||
|
|
@ -29,9 +31,6 @@ import java.util.HashSet;
|
|||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
|
||||
/*
|
||||
* 702.77. Conspire
|
||||
|
|
@ -61,7 +60,6 @@ public class ConspireAbility extends StaticAbility implements OptionalAdditional
|
|||
}
|
||||
|
||||
public enum ConspireTargets {
|
||||
|
||||
NONE,
|
||||
ONE,
|
||||
MORE
|
||||
|
|
@ -140,10 +138,11 @@ public class ConspireAbility extends StaticAbility implements OptionalAdditional
|
|||
Player player = game.getPlayer(getControllerId());
|
||||
if (player != null) {
|
||||
resetConspire(ability, game);
|
||||
// AI supports conspire
|
||||
if (conspireCost.canPay(ability, getSourceId(), getControllerId(), game)
|
||||
&& player.chooseUse(Outcome.Benefit, "Pay " + conspireCost.getText(false) + " ?", ability, game)) {
|
||||
activateConspire(ability, game);
|
||||
for (Iterator it = conspireCost.iterator(); it.hasNext();) {
|
||||
for (Iterator it = conspireCost.iterator(); it.hasNext(); ) {
|
||||
Cost cost = (Cost) it.next();
|
||||
ability.getCosts().add(cost.copy());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -181,8 +181,10 @@ public class KickerAbility extends StaticAbility implements OptionalAdditionalSo
|
|||
int activatedCount = getKickedCounter(game, ability);
|
||||
times = (activatedCount + 1) + (activatedCount == 0 ? " time " : " times ");
|
||||
}
|
||||
// TODO: add AI support to find max number of possible activations (from available mana)
|
||||
// canPay checks only single mana available, not total mana usage
|
||||
if (kickerCost.canPay(ability, sourceId, controllerId, game)
|
||||
&& player.chooseUse(Outcome.Benefit, "Pay " + times + kickerCost.getText(false) + " ?", ability, game)) {
|
||||
&& player.chooseUse(/*Outcome.Benefit*/Outcome.AIDontUseIt, "Pay " + times + kickerCost.getText(false) + " ?", ability, game)) {
|
||||
this.activateKicker(kickerCost, ability, game);
|
||||
if (kickerCost instanceof Costs) {
|
||||
for (Iterator itKickerCost = ((Costs) kickerCost).iterator(); itKickerCost.hasNext(); ) {
|
||||
|
|
|
|||
|
|
@ -89,7 +89,6 @@ public class ReplicateAbility extends StaticAbility implements OptionalAdditiona
|
|||
times = (numActivations + 1) + (numActivations == 0 ? " time " : " times ");
|
||||
}
|
||||
|
||||
// test costs
|
||||
// TODO: add AI support to find max number of possible activations (from available mana)
|
||||
// canPay checks only single mana available, not total mana usage
|
||||
if (additionalCost.canPay(ability, sourceId, controllerId, game)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue