I'd like to implement something like evasion and parry, which are similar to block but the target takes some Stamina damage instead of HP damage (preferably proportional to the damage that would have been taken). This seems like blocking, but blocking doesn't seem to allow schematics to inject custom behavior.
I tried making a evasion status effect that would auto-apply itself and end on receiving any ability. I can then run a schematic there, which runs before HP is deducted. The problem is, I can't figure out how to get the damage from that ability in the schematic. Is there a way to fetch this? Or else what's the best approach to implement something like this?
Alternatively, status values also have Change Schematics available that are automatically used when their value is changed - and can be limited to e.g. only negative changes or only coming from abilities, etc.
Those schematics will have all that information available as local variables, see the help text of the Change Schematic settings in the status value for details.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
If I want to add this to the source code or access handlers, which class should I look at to add this?
It'd be easiest to go the access handler route via a custom combatant access handler, which has 4 status value related functions to override (responsible for setting/adding values to the status value or it's base value).
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
For the CombatantAccessHandler, I don't see a method to handle adding a status effect - is that somewhere else?
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
E.g. if an attack that doesn't do damage at all but adds a status effect, I might want to check for evasion there as well.
...essentially what blocking does, but with extra schematics for a blocking "cost".
The only way to do that currently is using schematics for your status effect changes and handling everything in there (chance check, etc.). Status changes for your targets can also use schematics, so you can set up a reusable per-effect schematic setup.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
So I made a status value for dodge chance.
Then in the hit chance formula I used a Chance node that the max range of the chance is set to the status value, so dodge is a % chance.
Success ->
Formula set value to zero (so it's a miss)
Set a global Bool to dodge = true
Miss schematic (in the miss slot on abilities) play a whoosh miss sound, checks the global bool for Dodge = True, plays dodge animation, add console line, flying text, then sets bool to False.
I realize that if you want to damage Stamina then you don't want it to be a miss, but if it's just a "cost".. hope that helps brainstorm
As said, it depends on the setup, though - it can be completely fine :)
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
It does seem like I won't be able to display hit chance with this set up, but I think that's acceptable :)
That did not even occur to me since I'm not using the chance preview or separate formulas for crit, use costs are the same for a miss etc.
Couple things if you're going to use it,
I made a separate flying text schematic for miss to check variable and not double up on saying miss/dodge, but I think I saw a miss get suppressed when multiple attacks happened from multiple enemies. Probably need a wait 0 at the end of miss schem to give a frame for variable change.
Anyway that makes me think it would need to be set up with object variable instead for the dodge bool, and for area affect abils especially probably need per combatant flag, even tho I think the hit chancd is separate on AE per combatant.
Edit, then I realized I can just turn off the Miss flying text in Battle Text ->flying text settings and play it in the miss schematic where I play the dodge flying text, problem solved oops!
But then again I suppose it's not possible normally if we want to make something like "remove after successfully dodging 5 attacks".
Add a boolean there to conditionally allow counting missed abilities maybe? :P
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!