Excel RPG Battle Math Issue

Started by
0 comments, last by Siolis 18 years, 7 months ago
I’m working in Excel and I’m trying to do battle processing math in the design doc stage. The trouble i'm having is that I’m trying to work out the percentage difference between two numbers so i know how much Attack power i need to remove from an attacking party. Long and short of it is that i having two numbers: X Agility Stat of A - Y Agility Stat of B And i want to know how much X is of Y in percent, i.e. if X was 100 and Y was 200 then Z would be 50%. What i've currently got is the following in two cells (Cell3 and Cell4) while Cell1 and Cell2 are X and Y: =IF(Cell1=Cell2, 50, IF(Cell1>Cell2, ((Cell2/Cell1)*100)/2, 100-Cell4)) =IF(Cell1=Cell2, 50, IF(Cell1<Cell2, ((Cell1/Cell2)*100)/2, 100-Cell3)) This should make it so that if Cell1 is grater than Cell2 that it gives me the percentage of Cell2 from Cell1, if Cell1 is less than Cell2 that it gives me the percentage of Cell1 from Cell2. The last part of the IF statements make it so that if Cell1 is not grater than Cell2 or vice verse respectively that it just makes the opposite percentage value in its respective cell. What this little set also dose is generate a limiter, i.e. if A is twice as high as B then the percent returned 100% in Cell3 and 0% in Cell4 and vice versa so someone who is twice as slow as their target cant hope to hit it and if they are twice as fast can rest assured that they will never miss. The problem I’m having is that although it returns the right answer if you are twice as fast as your target, when i make the target twice as fast as you, the dam equation comes back at me with a 75% chance of hitting it which is just wrong. Can anyone see something i can’t? Siolis
RPG: I'm going to rewrite this genre even if it kills me.
Advertisement
Nvr mind, i fixed it, i just had to switch the cell division. =]

Siolis
RPG: I'm going to rewrite this genre even if it kills me.

This topic is closed to new replies.

Advertisement