mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
- Improved LifeGainAI.
This commit is contained in:
@@ -128,16 +128,19 @@ public class LifeGainAi extends SpellAbilityAi {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Save instant-speed life-gain unless it is really worth it
|
|
||||||
if (!SpellAbilityAi.isSorcerySpeed(sa)) {
|
if (SpellAbilityAi.isSorcerySpeed(sa)
|
||||||
final float value = 0.9f * lifeAmount / life;
|
|| sa.getSubAbility() != null
|
||||||
if (value < 0.2f) {
|
|| SpellAbilityAi.playReusable(ai, sa)) {
|
||||||
return false;
|
return true;
|
||||||
} else {
|
|
||||||
return MyRandom.getRandom().nextFloat() < value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
|
// Save instant-speed life-gain unless it is really worth it
|
||||||
|
final float value = 0.9f * lifeAmount / life;
|
||||||
|
if (value < 0.2f) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return MyRandom.getRandom().nextFloat() < value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user