I'm making a game that can fuse few guns to create an equal gun and I need to compute the fused properties.
First off I thought this was easy - I just took the inverse of the sum of the inverses of the times between shots and took the mean of the damages:
Lets say we have 2 guns:
Gun 1: Damage: 10, Time between shots: 2 seconds
Gun 2: Damage: 20, Time between shots: 3 seconds
Combined: Damage: 15, Time between shots: 1.2 seconds
And it works, Gun 1 has damage per second of 5, Gun 2 has damage per second of 6.66 and the combined gun has damage per second of 12.5 =/= 11.66.
How do I find this? I need to find the damage for n number of guns, not just 2.
In addition, this is not the only gun type I have... I also have a chain lightning gun which shoots and then its shot jumps from target to target (with a max of targets) and the damage reduces by a set number every jump.
So the gun:
Damage: 1000, Targets: 4, Reduction: 0.5, Time between shots: 5 seconds
Will shoot the target for 1000, jump to another for 500, and more for 250 and 125 resulting in 1875 damage or 375 damage per second.
How can I find the properties of few merged chain lightning guns that can have different properties? I know its something exponential, and exact solution might not be feasible, an approximation a script can perform will be good enough.
I have not found a tag for this, so please tag it who knows the right tag.