Theoretical subroutine for bartending

I’ve hoped to use a bartending system from Va11-Ha11-A mixed with guessing cliental preferences and necessity to find topics that would interest clients: which, essentially, boils down to approval counters that should, then, be changed into positive or negative ticks to resources and reputations based on the collective level of garnered approval.

From what I’ve gathered in advice to starting coders, this should be delegated to a subroutine instead of constant *temp spams and writing code for every client. Problem is, I have no idea what code would work best for this subroutine and whether I should keep it in a separate file or not.

How I imagine this working:

  • you get a limited amount of clients each day, each with unique approval counters. each client starts with a default medium level of approval counter.

  • after the end of the shift, this approval is summed up and tiered. I imagined four tiers, with first being negative, second neutral and last two being varying degrees of positive. Depending on a tier, you get a flat (no fairmath) boost or loss to your reputation and resources that determine certain available endings (I hope to add the importance of nepotism in calculation, but that’s neither here, nor there).

  • lather, rinse, repeat for six days. I imagined approval and resources being a cumulative value that either grows or lowers with each passing day.

What code for a subroutine would help me achieve this? And what would be the simplest way to achieve the desired result?