So to make my question as easy to understand as possible, I am in the process of writing what will start out as a table-top/text based style RPG game. I already have formulas for all my battle mechanics worked out except one. Essentially what I am trying to do is as follows:
Let's say I'm simulating a battle. During this battle, 2 values will start at a certain number, and based on decisions/calculations throughout the battle, these 2 values will decrease.
More plainly - Character Health Points. Say a character starts with 150 HP, and based on calculations, an enemy does 10 damage, taking the characters HP to 140 HP. What I would like to happen is, say I always calculate the value of enemy damage done in cell D10, and I put the character's starting HP in E10, and every time D10 is recalculated for a new attack, I want to recalculate E10 to reflect this, so if the next enemy attack calculated in D10 was 15, E10 would be recalculated to reflect 140-15= 125hp, basically keeping E10's value in realtime based on D10's calculated value.
Is this possible, and if so, how? Thanks in advance for any assistance.
- Greg