I'm developing RPG(Role-Playing Game) game and I'm planning make a formula for 'How much damage is being converted'.
I'm not previliged to put embedded images, but I hope you check out the image here(It will make my question clear) >> image about my situation
- each '<---->' line is the duration of damage
- The blue-highlighted part means the part of damage that is converted
- The blue number next to '<---->' line means the ratio of damage converted.
First, let me get my keywords clear.
Duration
'Duration' means 'The time it takes for all damage to be applied'. In my game, character's damage isn't applied instantly. For example if character does 100 damage and the duration of damage is 5 second, the damage will be applied like 20(1s), 20(2s), 20(3s), 20(4s), 20(5s). As a result, it takes as much time as 'duration' before all damage is applied.
Conversion
'Conversion' is my game's system which changes the type of damage(ex. fire -> water). Conversion doesn't affect the damage that is already applied. It only affects the remaining damage. For example if conversion happens at 3s in example for 'Duration', damage applied in 1s, 2s is not affected by conversion, and only remaining 60(at 3s, 4s, 5s) will be affected.
Cooldown (of conversion)
'Cooldown' means 'The time it takes for the next conversion to take place'. For example, if cooldown is 5s, the conversion will happen 0s, 5s, 10s, ... and so on.
My main question is this : Can I calculate average ratio of damage being converted from knowing duration and cooldown?
As you can see in the image, I tried to calculate average ratio of 2 cases. Case1 with 3s duration and 4s cooldown and Case2 with 4s duration and 3s cooldown.
In the image I set minimum time unit to 1s since I'm dealing with average, the result would be equal regardless of minimum time unit.
I found out that average ratio of conversion is proportional to duration, and is inversely proportional to cooldown. However I couldn't go any further. Please let me know if you have any good idea.