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;
}
boolean xCost = sa.getPayCosts().hasXInAnyCostPart();
boolean xCost = sa.getPayCosts().hasXInAnyCostPart() || sa.getHostCard().hasStartOfKeyword("Strive");
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
// when the AI won't even be able to play the spell in the first place (even if it could afford it)

View File

@@ -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;
}
@@ -118,7 +118,6 @@ public class CopyPermanentAi extends SpellAbilityAi {
final String sourceName = ComputerUtilAbility.getAbilitySourceName(sa);
final boolean canCopyLegendary = sa.hasParam("NonLegendary");
// ////
// Targeting
if (sa.usesTargeting()) {

View File

@@ -163,8 +163,6 @@ public class DiscardAi extends SpellAbilityAi {
return false;
} // discardTargetAI()
@Override
protected boolean doTriggerAINoCost(Player ai, SpellAbility sa, boolean mandatory) {
final TargetRestrictions tgt = sa.getTargetRestrictions();
@@ -211,9 +209,8 @@ public class DiscardAi extends SpellAbilityAi {
return true;
} // discardCheckDrawbackAI()
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
return true;
}

View File

@@ -1412,7 +1412,7 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
@Override
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;
if(addAmount <= 0 || !canReceiveCounters(counterType)) {
if (addAmount <= 0 || !canReceiveCounters(counterType)) {
// As per rule 107.1b
return 0;
}

View File

@@ -1,7 +1,7 @@
Name:Rise of the Hobgoblins
ManaCost:RW RW
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: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.