Condition in Case Statement

Hi I needed help with some logic and how to approach this.
Case 8
EXIT CAVE (while taking damage from nearby monsters)

Case 9
MAKE WEAPON

Case 10
GO TO BANK A

Case 11
DEPOSIT WEAPON

Case 12
WITHDRAW MORE MATERIALS

Now I want to add a condition where After

Case 9
MAKE WEAPON

If Player Health is less than 30
GO TO HOSPITAL
and
Then GET HEALED

THEN I want it to return to Case 3 and carry on with the rest of the function.

I’m lost on how to approach this.
Thank you.

You can’t really jump around from case to case (unless you’re falling through, but that is specific to one other case and is generally discouraged). But what you can do is put all of the actions of Case 3 in a function. Then for Case 3, and any time you want to “return to Case 3”, you simply call that function.

1 Like