Line 147: |
Line 147: |
| | | |
| 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, hide_normal_damage) |
| + | if not setup then return "" end |
| local combat = Combat:new(night_attack) | | local combat = Combat:new(night_attack) |
| local normal_damage = combat:damage(damage_type_fn(combat, Combat.ship(ship_, {}, night_attack))) | | local normal_damage = combat:damage(damage_type_fn(combat, Combat.ship(ship_, {}, night_attack))) |
Line 157: |
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, setup.spotting))) | + | local equip_damage = combat:damage(damage_type_fn(combat, Combat.ship(ship_, equip, night_attack, not night_attack and setup.spotting))) |
| local equip_damage_string = | | local equip_damage_string = |
| equip_damage_pre >= combat.cap | | equip_damage_pre >= combat.cap |