mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
Fix Osgir looping too much
This commit is contained in:
@@ -736,6 +736,7 @@ public class ComputerUtil {
|
||||
CardCollection typeList = CardLists.getValidCards(ai.getCardsIn(ZoneType.Battlefield), type.split(";"), activate.getController(), activate, sa);
|
||||
|
||||
// don't bounce the card we're pumping
|
||||
// TODO unless it can be used as a save
|
||||
typeList = ComputerUtilCost.paymentChoicesWithoutTargets(typeList, sa, ai);
|
||||
|
||||
if (typeList.size() < amount) {
|
||||
|
||||
@@ -12,6 +12,7 @@ import forge.ai.AiPlayDecision;
|
||||
import forge.ai.ComputerUtil;
|
||||
import forge.ai.ComputerUtilAbility;
|
||||
import forge.ai.ComputerUtilCard;
|
||||
import forge.ai.ComputerUtilCost;
|
||||
import forge.ai.SpecialCardAi;
|
||||
import forge.ai.SpellAbilityAi;
|
||||
import forge.game.Game;
|
||||
@@ -35,7 +36,6 @@ import forge.game.zone.ZoneType;
|
||||
public class CopyPermanentAi extends SpellAbilityAi {
|
||||
@Override
|
||||
protected boolean canPlayAI(Player aiPlayer, SpellAbility sa) {
|
||||
// TODO - I'm sure someone can do this AI better
|
||||
Card source = sa.getHostCard();
|
||||
PhaseHandler ph = aiPlayer.getGame().getPhaseHandler();
|
||||
String aiLogic = sa.getParamOrDefault("AILogic", "");
|
||||
@@ -77,6 +77,13 @@ public class CopyPermanentAi extends SpellAbilityAi {
|
||||
}
|
||||
}
|
||||
|
||||
if (sa.costHasManaX() && sa.getSVar("X").equals("Count$xPaid")) {
|
||||
// Set PayX here to maximum value. (Osgir)
|
||||
final int xPay = ComputerUtilCost.getMaxXValue(sa, aiPlayer);
|
||||
|
||||
sa.setXManaCostPaid(xPay);
|
||||
}
|
||||
|
||||
if (sa.usesTargeting() && sa.hasParam("TargetingPlayer")) {
|
||||
sa.resetTargets();
|
||||
Player targetingPlayer = AbilityUtils.getDefinedPlayers(source, sa.getParam("TargetingPlayer"), sa).get(0);
|
||||
@@ -106,7 +113,7 @@ public class CopyPermanentAi extends SpellAbilityAi {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return this.doTriggerAINoCost(aiPlayer, sa, false);
|
||||
return doTriggerAINoCost(aiPlayer, sa, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -67,8 +67,7 @@ public class CostExile extends CostPartWithList {
|
||||
CardCollectionView typeList;
|
||||
if (this.sameZone) {
|
||||
typeList = game.getCardsIn(this.from);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
typeList = payer.getCardsIn(this.from);
|
||||
}
|
||||
|
||||
@@ -140,7 +139,7 @@ public class CostExile extends CostPartWithList {
|
||||
return list.contains(source);
|
||||
}
|
||||
|
||||
if (!type.contains("X")) {
|
||||
if (!type.contains("X") || ability.getXManaCostPaid() != null) {
|
||||
list = CardLists.getValidCards(list, type.split(";"), payer, source, ability);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,6 @@ Name:Tragic Lesson
|
||||
ManaCost:2 U
|
||||
Types:Instant
|
||||
A:SP$ Draw | Cost$ 2 U | NumCards$ 2 | SpellDescription$ Draw two cards. Then discard a card unless you return a land you control to its owner's hand. | SubAbility$ DBDiscard
|
||||
SVar:DBDiscard:DB$Discard | Defined$ You | NumCards$ 1 | Mode$ TgtChoose | UnlessCost$ Return<1/Land> | UnlessPayer$ You
|
||||
SVar:DBDiscard:DB$ Discard | Defined$ You | NumCards$ 1 | Mode$ TgtChoose | UnlessCost$ Return<1/Land> | UnlessPayer$ You
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/tragic_lesson.jpg
|
||||
Oracle:Draw two cards. Then discard a card unless you return a land you control to its owner's hand.
|
||||
Reference in New Issue
Block a user