Board Thread:General Discussion/@comment-26461371-20151027095940/@comment-26154973-20151027201500

It's hard to say how it exactly works, there is evidence for +5 effect for each piece of equipment (my guess for enemy searchlight is that it's also linear and just add -10), as well as for the absence of effect from lookouts for post-60 luck, so code-wise you can do something like

function f(params) {

const types = { torpedo: { cap: 60, k: 70 }, mixed: { cap: 70, k: 70 }, main: { cap: 55, k: 50 }, }

const k = types[params.type].k,         cap = types[params.type].cap, capped_luck = params.luck > cap ? cap : params.luck, base_rate = Math.sqrt(k * capped_luck), max_base_rate = Math.sqrt(k * cap), after_lookouts_rate = params.lookouts ? max_base_rate - base_rate < 5 ? max_base_rate : base_rate + 5 : base_rate, rate = after_lookouts_rate + (params.flagship ? 12.5 : 0) + (params.chuuha ? 20 : 0) + (params.searchlight ? 5 : 0) + (params.starshell ? 5 : 0) + (params.enemy_searchlight ? -10 : 0), final_rate = rate > 99 ? 99 : rate;

return Math.round(final_rate);

}