I’ve properly changed the HasSufficientStamina hack into decorators instead:
The “enough stamina to” decorator essentially turns the action it decorates into a condition, stifling it from actually doing the action and just querying the amount of stamina it costs to do. It then accumulates that stamina cost (among siblings in the sequence) in another variable and check if the unit has enough stamina to match the accumulated cost. If not, it returns failure.
I wanted the decorator shapes to look nice when stacked on top of each other, so this is how I designed them to look like:
Here, a bunch of (test dummy) decorators are in the Retreat sequence, and a few more are in the health check condition.