MerricB said:
One of the tricky points I'm facing at the moment is the XP code. It's an integer between 0 and 100.
Now, it should prove difficult to make that like D&D, however the game uses a template to show your stats - which isn't in the code Morrus sent me - and that assumes a value between 0 and 100 for XP.
Alright, given the above, since the interface is a template which assumes 0 to 100, why not create a method that returns a value from 0 to 100? I realize that he didn't use methods (functions) in his code originally, so you'll have to do it awkwardly, but it should be easy to have the variable returned be a number from 0 to 100 and have the "real" number for level ups be based on the actual information.
That way theres no need to edit the template, you just need to declare new variables and have the 0 to 100 value "just" be the value returned to the template. Wouldn't that work?
Edit:
Alright, assuming since this program doesn't use methods that the template just reads exp for it's display (0 to 100), then here is what I would do (supposing this would work, correct me where I'm wrong). First, leave the exp variable initialized, and delete all use of exp and replace it with the method "SetExperience". SetExperience will be called for when every instance of "gain 1 to 5 exp) occurs in the code, except that SetExperience uses our rules instead of the games current rules. When SetExperience is called, it should edit the current characters experience (a new variable) unless it is a creature, in which case nothing happens. Once this is done (and that's the most difficult part, finding all of the instances and properly changing them), and the method is finished, include in the method have the old exp variable equal (experience/experience needed to level up). This way, every time experience is updated, the exp variable (0 to 100) is updated to display the % (rounded to an integer).