Merge branch 'assorted-fixes' into 'master'

- AI: Don't hold land drops till main 2 if playing with the Momir avatar

See merge request core-developers/forge!385
This commit is contained in:
Michael Kamensky
2018-04-12 05:42:41 +00:00

View File

@@ -1180,6 +1180,13 @@ public class AiController {
} }
private boolean isSafeToHoldLandDropForMain2(Card landToPlay) { private boolean isSafeToHoldLandDropForMain2(Card landToPlay) {
boolean hasMomir = !CardLists.filter(player.getCardsIn(ZoneType.Command),
CardPredicates.nameEquals("Momir Vig, Simic Visionary Avatar")).isEmpty();
if (hasMomir) {
// Don't do this in Momir variants since it messes with the AI decision making for the avatar.
return false;
}
if (!MyRandom.percentTrue(getIntProperty(AiProps.HOLD_LAND_DROP_FOR_MAIN2_IF_UNUSED))) { if (!MyRandom.percentTrue(getIntProperty(AiProps.HOLD_LAND_DROP_FOR_MAIN2_IF_UNUSED))) {
// check against the chance specified in the profile // check against the chance specified in the profile
return false; return false;