"Thirsty, we drank."
Each individual sentence here contains an example of an absolute construction. Other examples are:
Its hair flowing in the wind, the horse raced along the beach.
Preoccupied with his thoughts of the fast-approaching tour of the Rockies, Bill did not notice the horse.
Its hair in glorious disarray, the horse raced along the beach.
Happy with her ice cream, Sally did not hear her mother calling.
Adjectives used in this role are understandably named 'absolute adjectives' (see Dr. Goodword’s Language Blog), but there is scope for confusion here due to ambiguity.
The absolute construction usually sounds unnatural with a bare adjective (especially a short one):
?Sad, he left.
Exhausted, he had to sit down.
Sad at not being picked, he left.
However, here, the repetition makes the whole acceptable, though obviously in an unusual style, more suitable for poetry than natural-sounding narrative.
Your quoted line makes literary use of repetition, parallel structures and change of normal word order and shortening and parataxis. In normal language the line would be:
We drank when we were thirsty,and ate when we were hungry, and slept when we were tired.
A list of sixty traditional rhetorical devices: http://www.virtualsalt.com/rhetoric.htm
Recognized literary device? Recognized or not, the line has a stylistic effect, out of the ordinary, it draws attention, stays in your mind, pleases, and is the art of all great narrator talents.
https://en.m.wikipedia.org/?title=Rhetoric
Guess it comes from latin construct named ablative absolute:
Tarquinio regnante, Pythagoras venit.
(Tarquinius reigning, Pythagoras came. or When Tarquinius was king, Pythagoras came.)
The food being good, they ate well.