Fix Strive check

This commit is contained in:
tool4EvEr
2021-07-29 19:38:53 +02:00
parent 024db5c198
commit 4980bb235c
5 changed files with 6 additions and 10 deletions

View File

@@ -746,7 +746,7 @@ public class AiController {
return AiPlayDecision.CantPlaySa; return AiPlayDecision.CantPlaySa;
} }
boolean xCost = sa.getPayCosts().hasXInAnyCostPart(); boolean xCost = sa.getPayCosts().hasXInAnyCostPart() || sa.getHostCard().hasStartOfKeyword("Strive");
if (!xCost && !ComputerUtilCost.canPayCost(sa, player)) { if (!xCost && !ComputerUtilCost.canPayCost(sa, player)) {
// for most costs, it's OK to check if they can be paid early in order to avoid running a heavy API check // for most costs, it's OK to check if they can be paid early in order to avoid running a heavy API check
// when the AI won't even be able to play the spell in the first place (even if it could afford it) // when the AI won't even be able to play the spell in the first place (even if it could afford it)

View File

@@ -45,7 +45,7 @@ public class CopyPermanentAi extends SpellAbilityAi {
} }
if ("MomirAvatar".equals(aiLogic)) { if ("MomirAvatar".equals(aiLogic)) {
return SpecialCardAi.MomirVigAvatar.consider(aiPlayer, sa); return SpecialCardAi.MomirVigAvatar.consider(aiPlayer, sa);
} else if ("MimicVat".equals(aiLogic)) { } else if ("MimicVat".equals(aiLogic)) {
return SpecialCardAi.MimicVat.considerCopy(aiPlayer, sa); return SpecialCardAi.MimicVat.considerCopy(aiPlayer, sa);
} else if ("AtEOT".equals(aiLogic)) { } else if ("AtEOT".equals(aiLogic)) {
@@ -59,7 +59,7 @@ public class CopyPermanentAi extends SpellAbilityAi {
} }
} }
if (sa.hasParam("AtEOT") && !aiPlayer.getGame().getPhaseHandler().is(PhaseType.MAIN1)) { if (sa.hasParam("AtEOT") && !ph.is(PhaseType.MAIN1)) {
return false; return false;
} }
@@ -118,7 +118,6 @@ public class CopyPermanentAi extends SpellAbilityAi {
final String sourceName = ComputerUtilAbility.getAbilitySourceName(sa); final String sourceName = ComputerUtilAbility.getAbilitySourceName(sa);
final boolean canCopyLegendary = sa.hasParam("NonLegendary"); final boolean canCopyLegendary = sa.hasParam("NonLegendary");
// //// // ////
// Targeting // Targeting
if (sa.usesTargeting()) { if (sa.usesTargeting()) {

View File

@@ -163,8 +163,6 @@ public class DiscardAi extends SpellAbilityAi {
return false; return false;
} // discardTargetAI() } // discardTargetAI()
@Override @Override
protected boolean doTriggerAINoCost(Player ai, SpellAbility sa, boolean mandatory) { protected boolean doTriggerAINoCost(Player ai, SpellAbility sa, boolean mandatory) {
final TargetRestrictions tgt = sa.getTargetRestrictions(); final TargetRestrictions tgt = sa.getTargetRestrictions();
@@ -211,9 +209,8 @@ public class DiscardAi extends SpellAbilityAi {
return true; return true;
} // discardCheckDrawbackAI() } // discardCheckDrawbackAI()
public boolean confirmAction(Player player, SpellAbility sa, PlayerActionConfirmMode mode, String message) { public boolean confirmAction(Player player, SpellAbility sa, PlayerActionConfirmMode mode, String message) {
if ( mode == PlayerActionConfirmMode.Random ) { // if ( mode == PlayerActionConfirmMode.Random ) {
// TODO For now AI will always discard Random used currently with: Balduvian Horde and similar cards // TODO For now AI will always discard Random used currently with: Balduvian Horde and similar cards
return true; return true;
} }

View File

@@ -1412,7 +1412,7 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
@Override @Override
public int addCounter(final CounterType counterType, final int n, final Player source, final SpellAbility cause, final boolean applyMultiplier, final boolean fireEvents, GameEntityCounterTable table) { public int addCounter(final CounterType counterType, final int n, final Player source, final SpellAbility cause, final boolean applyMultiplier, final boolean fireEvents, GameEntityCounterTable table) {
int addAmount = n; int addAmount = n;
if(addAmount <= 0 || !canReceiveCounters(counterType)) { if (addAmount <= 0 || !canReceiveCounters(counterType)) {
// As per rule 107.1b // As per rule 107.1b
return 0; return 0;
} }

View File

@@ -1,7 +1,7 @@
Name:Rise of the Hobgoblins Name:Rise of the Hobgoblins
ManaCost:RW RW ManaCost:RW RW
Types:Enchantment Types:Enchantment
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigToken | OptionalDecider$ You | TriggerDescription$ When CARDNAME enters the battlefield, you may pay {X}. If you do, create X 1/1 red and white Goblin Soldier creature tokens. T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigToken | TriggerDescription$ When CARDNAME enters the battlefield, you may pay {X}. If you do, create X 1/1 red and white Goblin Soldier creature tokens.
SVar:TrigToken:AB$ Token | Cost$ X | TokenAmount$ X | TokenScript$ rw_1_1_goblin_soldier | TokenOwner$ You | LegacyImage$ rw 1 1 goblin soldier eve SVar:TrigToken:AB$ Token | Cost$ X | TokenAmount$ X | TokenScript$ rw_1_1_goblin_soldier | TokenOwner$ You | LegacyImage$ rw 1 1 goblin soldier eve
SVar:X:Count$xPaid SVar:X:Count$xPaid
A:AB$ PumpAll | Cost$ RW | ValidCards$ Creature.Red+YouCtrl,Creature.White+YouCtrl | KW$ First Strike | SpellDescription$ Red creatures and white creatures you control gain first strike until end of turn. A:AB$ PumpAll | Cost$ RW | ValidCards$ Creature.Red+YouCtrl,Creature.White+YouCtrl | KW$ First Strike | SpellDescription$ Red creatures and white creatures you control gain first strike until end of turn.