Tuesday, April 16, 2024

Simple They Said... Simples...

The plan for yesterday was a simple one. Just get ability-use to cost the right amount of each pool, and deduct it from whoever uses it. That should be a simple way back into the code, right? Right?

So.... No. I spent a solid few hours working back through my code to find the right place to trigger that, which was surprisingly a lot more complicated than you'd think. Do I do it when the monster is *thinking* about doing it? No, that's clearly a bad place to do it, what if they move before they use the ability? That's going to be dumb. Should I place it at the time that the ability is technically used? That's also kind of dumb, cause the animations have already happened... (to make it seem like things happen in the right order, animations are done first, THEN the actual attack is applied, though the outcome is already known at that point - but I'm getting really into the weeds of the code here). So, clearly, I need to add in another possible step to process in the combat-sequence which is to apply the cost of using an ability, so that it all appears to happen in the right sequence:

Plan - > move -> animate actions-> apply ability cost -> determine outcome [any following animations/actions/etc here]

After getting through most of the code, I _almost_ got it working last night, which included going back into editor code fixing that so that it was saving my inputs correctly, tweaking the code in the app that imports that section of combat abilities and finally, this morning, to tweaking a few statements to turn them from integer to floating point operations (cause... goddamit... why can't you do that automatically for me Java) and I finally got the satisfaction of seeing a spider throw out some sticky webs at the players, and its action bar went down as it should.

Huzzah.

No comments:

Post a Comment

Simple They Said... Simples...

The plan for yesterday was a simple one. Just get ability-use to cost the right amount of each pool, and deduct it from whoever uses it. Tha...