Line 146: |
Line 146: |
| } | | } |
| | | |
− | function format_damage(ship_, damage_type_fn, night_attack, setup, equip_setup, hide_normal_damage) | + | function format_damage(ship_, damage_type_fn, night_attack, setup, equip_setup, spotting, hide_normal_damage) |
| if not setup then return "" end | | if not setup then return "" end |
| local combat = Combat:new(night_attack) | | local combat = Combat:new(night_attack) |
Line 158: |
Line 158: |
| setup.spotting = setup.spotting or 1 | | setup.spotting = setup.spotting or 1 |
| local equip_damage_pre = combat:damage(damage_type_fn(combat, Combat.ship(ship_, equip, night_attack))) | | local equip_damage_pre = combat:damage(damage_type_fn(combat, Combat.ship(ship_, equip, night_attack))) |
− | local equip_damage = combat:damage(damage_type_fn(combat, Combat.ship(ship_, equip, night_attack, not night_attack and setup.spotting))) | + | local equip_damage = combat:damage(damage_type_fn(combat, Combat.ship(ship_, equip, night_attack, spotting))) |
| local equip_damage_string = | | local equip_damage_string = |
| equip_damage_pre >= combat.cap | | equip_damage_pre >= combat.cap |
Line 282: |
Line 282: |
| torp = ship._torpedo_max or "", | | torp = ship._torpedo_max or "", |
| fp_plus_torp = ship._firepower_max + (ship._torpedo_max or 0), | | fp_plus_torp = ship._firepower_max + (ship._torpedo_max or 0), |
− | db_attack = format_damage(ship, Combat.shelling, nil, setup, "main", true), | + | db_attack = format_damage(ship, Combat.shelling, nil, setup, "main", setup.spotting, true), |
| db_torp = format_damage(ship, Combat.torpedo, nil, setup, "torpedo"), | | db_torp = format_damage(ship, Combat.torpedo, nil, setup, "torpedo"), |
| nb_da = format_damage(ship, Combat.night_battle, Combat.modifier.night_attack.double, setup, "main"), | | nb_da = format_damage(ship, Combat.night_battle, Combat.modifier.night_attack.double, setup, "main"), |