mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- Blank Abilities used with Unless Costs will now know the Targets from the Source Ability
- Check life cost now uses calculateAmount instead of xCount - Added Essence Vortex
This commit is contained in:
@@ -136,16 +136,24 @@ public class CostUtil {
|
||||
* the source
|
||||
* @param remainingLife
|
||||
* the remaining life
|
||||
* @param sourceAbility TODO
|
||||
* @return true, if successful
|
||||
*/
|
||||
public static boolean checkLifeCost(final Cost cost, final Card source, final int remainingLife) {
|
||||
public static boolean checkLifeCost(final Cost cost, final Card source, final int remainingLife, SpellAbility sourceAbility) {
|
||||
// TODO - Pass in SA for everything else that calls this function
|
||||
if (cost == null) {
|
||||
return true;
|
||||
}
|
||||
for (final CostPart part : cost.getCostParts()) {
|
||||
if (part instanceof CostPayLife) {
|
||||
final CostPayLife payLife = (CostPayLife) part;
|
||||
if ((AllZone.getComputerPlayer().getLife() - payLife.convertAmount()) < remainingLife) {
|
||||
|
||||
Integer amount = payLife.convertAmount();
|
||||
if (amount == null) {
|
||||
amount = AbilityFactory.calculateAmount(source, payLife.getAmount(), sourceAbility);
|
||||
}
|
||||
|
||||
if ((AllZone.getComputerPlayer().getLife() - amount) < remainingLife) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user