Line 335: |
Line 335: |
| [2] = 1.17, | | [2] = 1.17, |
| [3] = 1.20, | | [3] = 1.20, |
− | } | + | }, |
| + | |
| + | day_battle = 1, |
| + | opening_torpedo = 2, |
| + | closing_torpedo = 3, |
| + | night_battle = 4, |
| + | asw = 5, |
| + | opening_airstrike = 6, |
| + | day_battle = 7, |
| | | |
| } | | } |
Line 354: |
Line 362: |
| end | | end |
| | | |
− | function Combat2:damage(basic_attack_power_fn, ship, enemy, critical) | + | function Combat2:damage(type, ship, enemy, critical) |
| | | |
| local vs_installation = enemy and enemy:is_installation() | | local vs_installation = enemy and enemy:is_installation() |
Line 371: |
Line 379: |
| local attack_power = 0 | | local attack_power = 0 |
| | | |
− | if basic_attack_power_fn == ShipCapabilities.day_battle then | + | if type == Combat2.day_battle then |
| spotting = ship._spotting or 1 | | spotting = ship._spotting or 1 |
| ap = ship._ap or 1 | | ap = ship._ap or 1 |
| expert = 1 + ((ship._expert_n or 0) + (ship._expert_first and 1 or 0)) / 10 | | expert = 1 + ((ship._expert_n or 0) + (ship._expert_first and 1 or 0)) / 10 |
− | _, attack_power = basic_attack_power_fn(ship, vs_installation, fleet.firepower) | + | _, attack_power = ship:day_battle(vs_installation, fleet.firepower) |
− | elseif basic_attack_power_fn == ShipCapabilities.closing_torpedo or basic_attack_power_fn == ShipCapabilities.opening_torpedo then | + | elseif type == Combat2.closing_torpedo or type == Combat2.opening_torpedo then |
| if not fleet.torpedo then | | if not fleet.torpedo then |
| return false | | return false |
| end | | end |
| formation = fleet.salvo | | formation = fleet.salvo |
− | attack_power = basic_attack_power_fn(ship, fleet.torpedo) | + | attack_power = Combat2.closing_torpedo and ship:closing_torpedo(fleet.torpedo) or Combat2.opening_torpedo and ship:opening_torpedo(fleet.torpedo) |
− | elseif basic_attack_power_fn == ShipCapabilities.format_asw_attack then | + | elseif type == Combat2.asw then |
| formation = fleet.asw | | formation = fleet.asw |
| cap = 100 | | cap = 100 |
− | attack_power = basic_attack_power_fn(ship) | + | attack_power = ship:asw_attack() |
− | elseif basic_attack_power_fn == ShipCapabilities.night_battle then | + | elseif type == Combat2.night_battle then |
| if health == Combat2.health.taiha then | | if health == Combat2.health.taiha then |
| return false | | return false |
Line 393: |
Line 401: |
| engagement = 1 | | engagement = 1 |
| cap = 300 | | cap = 300 |
− | _, attack_power = basic_attack_power_fn(ship, vs_installation, self.stage.night_contact) | + | _, attack_power = ship:night_battle(vs_installation, self.stage.night_contact) |
− | elseif basic_attack_power_fn == ShipCapabilities.opening_airstrike then | + | elseif type == Combat2.opening_airstrike then |
| expert = 1 + ((ship._expert_n or 0) + (ship._expert_first and 1 or 0)) / 10 | | expert = 1 + ((ship._expert_n or 0) + (ship._expert_first and 1 or 0)) / 10 |
| contact = self.stage.contact and Combat2.contact[self.stage.contact] or 1 | | contact = self.stage.contact and Combat2.contact[self.stage.contact] or 1 |
− | attack_power = basic_attack_power_fn(ship) | + | attack_power = ship:opening_airstrike() |
| end | | end |
| | | |