Buffing Code: The buffing code is actually pretty different for each buff/debuff.
Since we're talking about Guilt, we'll use that for our example. The factors considered here are:
1) Base value: 200 (Guilt is considered to be a fairly good thing thing to do... for reference, an attack expected to deal roughly 16% of a target's HP in damage would be 100.)
2) Success rate of the attack. (Note: Accuracy below 50% starts losing value rapidly.)
3) Guilt specific: Threat level (How threatening the target is: basically, it's level, speed, and whether it's a hero, a minion, or normal rank)
4) Guilt specific: How damaged the target is (The more damaged the target is, the higher this evaluation comes back)
5) Guilt specific: Is the target under a kill order? (If yes, higher evaluation)
6) Guilt specific: Is the taret at full health? (Special case of 4: returns a lower evaluation)
7) Guilt specific: Do I or my allies have multi-target damage effects? If NOT, then reduce the evaluation drastically if there is already one Guilted enemy.
whew, okay. Now to explain why Guilt does all that. The first two are relatively straightforward: the base value of 200% is something I came up with myself, and success rate is an evaluation factor in literally everything; in fact, it tends to be a straight multiplier on the evalution. i.e: a 200 evaluation with a 70% chance to work comes out at 140. As noted, chances below 50% start to have an additional penalty: the AI doesn't like gambles very much.
Next up: Guilt checks threat and how damaged the target is because these are the same factors damage effects check. Since Guilt triggers off of dealing damage to the target you applied it to, it makes sense that you'd want to use similar criteria in some regard.
Checking for a Kill Order of course also makes sense: kill orders (at least, when there aren't any bugs
) force allies to attack the target, making them an extra good target for Guilt.
A full health target is a fairly mild penalty, only there to nudge the AI into choosing an already damaged target over an undamaged one in close call cases. For example, I want the AI to choose a 55% success rate 80% HP target over a 60% success rate 100% HP target. Why? Because a target that has already been damaged once will likely be attacked again.
Factor 4 on the list already handles this to some degree: factor 6 is just to underline it a bit for the specific case of full health targets.
Finally, the 7th one: If nobody has multi-target attacks, there isn't a large amount of point to guilting multiple targets, so we strongly discourage that here.
Anyway: I could adjusting the base value, perhaps. 200 is relatively high... but I confess I tend to aim high when dealing with healing effects because I have a phobia about the AI having ways to heal the player, not using them, then the player dying and coming to my forum to yell at me (or worse, just walking away from the game and never coming back.)
Focus Target: The AI will allow itself to target non-focus targets, but only if it seems to have no way to reach who you told it to attack. I'm starting to think there might be a bug in this somewhere, based on discussions here and back on Demon's forum, but I haven't gotten to looking into it yet.
Skill Tagging: What I worry about with this sort of thing is players changing the tagged ability every turn though: that's when you land in "TRPG with a particularly clunky interface" territory. I think there might be an issue where Warmth isn't properly considered in Ignite's AI which will address this specific instance... but yeah, in general, a Ukobach will probably pick Flame Dart over Set Alight, since Ignite (ordinarily) has a relatively low evaluation. (And yes, Warmth is indeed very powerful if there's an unusually large number of targets to burn.
)
Thanks again for the feedback, comments, and compliments everyone.
Work's finally calming down a little, so I should be able to get back to work on the next build here soon.