Needed Amount To Kill
Thanks for your code! I don't calculate it precisely because 1. It may gain some energy after I fire, which is unpredictable. 2. Some bullet power is better than another, for example, 2.95 is better than 3.00 as it exploits bugs in BasicSurfer. Therefore my algorithm is doing this: If and only if my current bullet power is enough to kill him, I lower my bullet power to some "Good" power which is still enough to kill him ;) Yes doing so waste a lot of energy to overkill him, meanwhile, I won't risk hitting him and leave 0.03 energy only because he hit me one more time. Anyway, I should test BOTH algorithm to see the real effect ;)
You can roll a value to x.y5 to create that bug. As I know the you gain 3 * damageGiven energy not 3 * firePower and energy doesn't effect the total score. I would say don't waste energy.