AI Fix for Hero of Leina Tower
(Until I get more comfortable adding to the code, I'll put changes I made here for review, just to make sure I don't break anything or do anything sloppily.)
I added some logic to CountersPutAi.doTriggerAINoCost so that the AI will be able to play Hero of Leina Tower's ability. With this fix, dumps all of its available mana into the ability when it triggers. I tried to do it the same way as DamageDealAi.doTriggerAINoCost.
Does anyone anticipate any problems with any of this?
I added some logic to CountersPutAi.doTriggerAINoCost so that the AI will be able to play Hero of Leina Tower's ability. With this fix, dumps all of its available mana into the ability when it triggers. I tried to do it the same way as DamageDealAi.doTriggerAINoCost.
- Code: Select all
if (abTgt == null) {
(...)
if (amountStr.equals("X") && ((sa.hasParam(amountStr) && sa.getSVar(amountStr).equals("Count$xPaid")) || source.getSVar(amountStr).equals("Count$xPaid") )) {
// Spend all remaining mana to add X counters (eg. Hero of Leina Tower)
source.setSVar("PayX", Integer.toString(ComputerUtilMana.determineLeftoverMana(sa, ai)));
}
(...)
} else (...)
Does anyone anticipate any problems with any of this?