Line 290: |
Line 290: |
| end | | end |
| end | | end |
− | local anti_installation_modifier = 1 | + | local result = 5 + (fleet_firepower or 0) + firepower |
| if vs_installation then | | if vs_installation then |
| local anti_installation = self:_anti_installation() | | local anti_installation = self:_anti_installation() |
− | anti_installation_modifier = anti_installation.type_3_shell_equiped and 2.5 or 1 | + | result = result * (anti_installation.type_3_shell_equiped and 2.5 or 1) + (anti_installation.wg_equiped and 75 or 0) |
− | firepower = firepower + (anti_installation.wg_equiped and 75 or 0)
| |
| end | | end |
− | return 1, (5 + (fleet_firepower or 0) + firepower) * anti_installation_modifier | + | return 1, result |
| end | | end |
| else | | else |
Line 484: |
Line 483: |
| end | | end |
| end | | end |
− | end
| |
− | local anti_installation_modifier = 1
| |
− | if vs_installation then
| |
− | torpedo = 0
| |
− | local anti_installation = self:_anti_installation()
| |
− | anti_installation_modifier = anti_installation.type_3_shell_equiped and 2.5 or 1
| |
− | firepower = firepower + (anti_installation.wg_equiped and 75 or 0)
| |
| end | | end |
| if contact then | | if contact then |
Line 501: |
Line 493: |
| return false | | return false |
| else | | else |
| + | local anti_installation_modifier = 1 |
| + | local anti_installation_bonus = 0 |
| + | if vs_installation then |
| + | torpedo = 0 |
| + | local anti_installation = self:_anti_installation() |
| + | anti_installation_modifier = anti_installation.type_3_shell_equiped and 2.5 or 1 |
| + | anti_installation_bonus = anti_installation.wg_equiped and 75 or 0 |
| + | end |
| if torpedoes >= 2 and torpedo > 0 then | | if torpedoes >= 2 and torpedo > 0 then |
− | return 7, (firepower + torpedo) * 1.5 | + | if vs_installation then |
| + | return false |
| + | else |
| + | return 7, (firepower + torpedo) * 1.5 |
| + | end |
| elseif main_guns >= 3 and firepower > 0 then | | elseif main_guns >= 3 and firepower > 0 then |
− | return 4, (firepower + torpedo) * 2 * anti_installation_modifier | + | return 4, ((firepower + torpedo) * anti_installation_modifier + anti_installation_bonus) * 2 |
| elseif main_guns >= 2 and secondary_guns >= 1 and firepower > 0 then | | elseif main_guns >= 2 and secondary_guns >= 1 and firepower > 0 then |
− | return 5, (firepower + torpedo) * 1.75 * anti_installation_modifier | + | return 5, ((firepower + torpedo) * anti_installation_modifier + anti_installation_bonus) * 1.75 |
| elseif main_guns >= 1 and torpedoes == 1 and firepower > 0 and torpedo > 0 then | | elseif main_guns >= 1 and torpedoes == 1 and firepower > 0 and torpedo > 0 then |
− | return 6, (firepower + torpedo) * 1.3 | + | if vs_installation then |
| + | return false |
| + | else |
| + | return 6, (firepower + torpedo) * 1.3 |
| + | end |
| elseif main_guns + secondary_guns >= 2 and firepower > 0 then | | elseif main_guns + secondary_guns >= 2 and firepower > 0 then |
− | return 3, (firepower + torpedo) * 1.2 * anti_installation_modifier | + | return 3, ((firepower + torpedo) * anti_installation_modifier + anti_installation_bonus) * 1.2 |
| elseif torpedoes > 0 and torpedo > 0 then | | elseif torpedoes > 0 and torpedo > 0 then |
− | return 2, firepower + torpedo | + | if vs_installation then |
| + | return false |
| + | else |
| + | return 2, firepower + torpedo |
| + | end |
| elseif firepower > 0 then | | elseif firepower > 0 then |
− | return 1, (firepower + torpedo) * anti_installation_modifier | + | return 1, (firepower + torpedo) * anti_installation_modifier + anti_installation_bonus |
| else | | else |
| return false | | return false |