mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
- Added code support for cards dependent on the maximum total CMC of targets (e.g. March from the Tomb). Basic AI support also added (but can most likely be made smarter, feel free to improve).
- Note that the relevant SA parameter has been renamed to "MaxTotalTargetCMC" (from "WithTotalCMC") to avoid confusion with the ChangeZone parameter "WithTotalCMC" that means "the total CMC of a single card".
This commit is contained in:
@@ -1021,6 +1021,14 @@ public class ChangeZoneAi extends SpellAbilityAi {
|
||||
}
|
||||
}
|
||||
|
||||
// if max CMC exceeded, stop choosing
|
||||
if (sa.hasParam("MaxTotalTargetCMC")) {
|
||||
if (choice.getCMC() > sa.getTargetRestrictions().getMaxTotalCMC(choice, sa) - sa.getTargets().getTotalTargetedCMC()) {
|
||||
list.remove(choice);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
list.remove(choice);
|
||||
sa.getTargets().add(choice);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user