mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
- The AI will no longer use gain life abilities if the amount is zero or less.
This commit is contained in:
@@ -143,11 +143,16 @@ public class AbilityFactory_AlterLife {
|
|||||||
|
|
||||||
public static boolean gainLifeCanPlayAI(final AbilityFactory af, final SpellAbility sa){
|
public static boolean gainLifeCanPlayAI(final AbilityFactory af, final SpellAbility sa){
|
||||||
Random r = new Random();
|
Random r = new Random();
|
||||||
|
HashMap<String,String> params = af.getMapParams();
|
||||||
Ability_Cost abCost = sa.getPayCosts();
|
Ability_Cost abCost = sa.getPayCosts();
|
||||||
final Card source = sa.getSourceCard();
|
final Card source = sa.getSourceCard();
|
||||||
int life = AllZone.ComputerPlayer.getLife();
|
int life = AllZone.ComputerPlayer.getLife();
|
||||||
|
int lifeAmount = AbilityFactory.calculateAmount(af.getHostCard(), params.get("LifeAmount"), sa);
|
||||||
String amountStr = af.getMapParams().get("LifeAmount");
|
String amountStr = af.getMapParams().get("LifeAmount");
|
||||||
|
|
||||||
|
//don't use it if no life to gain
|
||||||
|
if (lifeAmount <= 0) return false;
|
||||||
|
|
||||||
if (abCost != null){
|
if (abCost != null){
|
||||||
// AI currently disabled for these costs
|
// AI currently disabled for these costs
|
||||||
if (abCost.getSacCost()){
|
if (abCost.getSacCost()){
|
||||||
|
|||||||
Reference in New Issue
Block a user