I am now working on an encounter system. I would like to be able to pre-define each monster type, its stats, level etc.. but i don't want to duplicate the combat function for each type of monster and for different levels.
So my plan is kind of for it to go like this
Game() > EncounterCheck() > Combat() > ExperienceCalculator() > Game()
in game You choose an option that triggers encounter
sends you to encounter check which loads specifc variables into global variable for that encounter type, then triggers combat function where you have your fight then triggers my experience levelup system to see if you need leveling etc. then returns back to game.
My thoughts are mainly how do i upon triggering the encounter function load the exact section of code needed to adjust the variables the best i could come up with is a ton of encounter functions just to store the variable transfer routines that way i dont have to duplicate the entire combat function