Changes

m
no edit summary
Line 10: Line 10:  
     table.insert(result, haystack)
 
     table.insert(result, haystack)
 
     return result
 
     return result
 +
end
 +
 +
function NanaminFunctions.add_to_fighter_power(current_fp, equip, planes)
 +
    --Only fighter planes, dive bombers, torpedo bombers and seaplane bombers with an AA stat are counted
 +
    local types_allowed = { [6] = true, [7] = true, [8] = true, [11] = true }
 +
    if types_allowed[equip:type()] and equip:aa() then
 +
        current_fp = current_fp + math.floor(math.sqrt(planes) * equip:aa())
 +
    end
 +
    return current_fp
 +
end
 +
 +
function NanaminFunctions.add_to_elos(current_elos, equip)
 +
    --[[Effective LoS = Dive Bomber LoS x (1.04) + Torpedo Bomber LoS x (1.37)
 +
    + Carrier-based Recon Plane LoS x (1.66) + Recon Seaplane LoS x (2.00)
 +
    + Seaplane Bomber LoS x (1.78) + Small Radar LoS x (1.00) + Large Radar LoS x (0.99)
 +
    + Searchlight LoS x (0.91) + √(base LoS of each ship) * (1.69)
 +
    + (HQ Lv. rounded up to the next multiple of 5) x (-0.61)--]]
 +
    local multiplier = { [7] = 1.04, [8] = 1.04, [9] = 1.66, [10] = 2.00, [11] = 1.78, [12] = 1.00, [13] = 0.99, [29] = 0.91 }
 +
    if multiplier[equip:type()] ~= nil and equip:los() then
 +
        current_elos = current_elos + (equip:los() * multiplier[equip:type()])
 +
    end
 +
    return current_elos
 
end
 
end
    
return NanaminFunctions
 
return NanaminFunctions
48

edits