mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
- Little improvements in AF GainLife AI.
This commit is contained in:
@@ -177,13 +177,16 @@ public class AbilityFactory_AlterLife {
|
|||||||
if (abCost.getLifeCost() && life > 5) return false;
|
if (abCost.getLifeCost() && life > 5) return false;
|
||||||
if (abCost.getDiscardCost() && life > 5) return false;
|
if (abCost.getDiscardCost() && life > 5) return false;
|
||||||
|
|
||||||
if (abCost.getSubCounter() && life > 7){
|
if (abCost.getSubCounter()){
|
||||||
// A card has a 25% chance per counter to be able to pass through here
|
//non +1/+1 counters should be used
|
||||||
// 4+ counters will always pass. 0 counters will never
|
if (abCost.getCounterType().equals(Counters.P1P1)){
|
||||||
|
// A card has a 25% chance per counter to be able to pass through here
|
||||||
|
// 4+ counters will always pass. 0 counters will never
|
||||||
int currentNum = source.getCounters(abCost.getCounterType());
|
int currentNum = source.getCounters(abCost.getCounterType());
|
||||||
double percent = .25 * (currentNum / abCost.getCounterNum());
|
double percent = .25 * (currentNum / abCost.getCounterNum());
|
||||||
if (percent <= r.nextFloat())
|
if (percent <= r.nextFloat())
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user