Talk:Making a Re-Patch/@comment-24859478-20140424183837/@comment-5173028-20140424185255

don't forget we have a "Reply" button :p

as for your question. You are half right about every fight being new.

There are certain things that are common for each fight, that there is no need to write all over again from scratch for every single battle. Like displaying what moves you can use, displaying enemy and your hp, dealing and taking damage, etc. etc. which is why we have

things like *common_main and *cmd_main for example

however yeah each fight is obviously different as not all the monsters have the same movesets do the same damage, hp,etc. etc.

so for example *cmd_main is basically (command main) it shows you all of your commands and actions you can take (struggle, attack, skills, etc. etc.)

in said sub-route it will take your chosen action and store it as a value for a variable (%cmd1) so when it leaves that subroute and goes back it will determine what action to take. Most of the times the action wouldn't matter if you were fighting say the Ant Queen or Alraune Priestess. Since the result of you attacking would be the same the action doesn't have to be coded twice and thus you send them down the same path *common_attack

the way it knows as far as how to make it back the fight you are currently in is due to the $tatie character variable and that's why you set that variable at the beginning of a fight. So there is no way the code will get confused and go down a path it shouldn't go (like into another fight) since that would either lead to a crash or hell it might go on normally but it will probably bloat at some point and when it DOES crash you won't know where the error came from later on down the line.