don't know how to spell algorithm, so my apologies if it is wrong, one of those words someone made up to confuse people! But going to the subject. I have been trying all sorts of ways of getting a specific value from 4 or 5 diffrent values. Let me explain. I have a stamina stat, a health stat, and a moral stat. I also have another stat called rob_exp. Now, what happens is, a user selects a crime to do from a form. so each crime has a value, robbing a shop has a crime id of 1, rob a person, crime id value of 2, and so on. Now, each crime value also has a success rate needed to do the crime.
stamina has a value 1 to 100
health has a value 1 to 100
moral has a value 1 to 100
rob_exp has a value that increments after each crime. so it could be from 1 to whatever.
Now when the user selects the crime to do, a switch case call finds its value which it the players final value will need to be above to do the crime. It also gets the min amount of money they will get from the crime, and the maximum.
Now, a process will get the players individual stats. Stamina and moral and rob_exp will be the most signifcant values. now i need all the values to be messed about with to produce a value out of 100%, this value will be the players success rate.
Now, we add an element of luck, so that if the player has the amount they need, they still have to pass the luck test, otherwise they could keep doing the crime and pass it. This will come in the form of a random number, so if the number was above a certain limit say 5, then they have done the crime etc.
I really can't work out how to do it! And i got a C in my GCSE maths! Any help is appreciated.