Line 2: |
Line 2: |
| -- Damage calculations are based on http://kancollecalc.web.fc2.com/damage_formula.html and WikiWiki combat page. | | -- Damage calculations are based on http://kancollecalc.web.fc2.com/damage_formula.html and WikiWiki combat page. |
| -- NB CI rate formula is from WikiWiki combat page (also, 検証、仮説スレ18). | | -- NB CI rate formula is from WikiWiki combat page (also, 検証、仮説スレ18). |
| + | -- Evasion rate formula: 検証、仮説スレ 10, 488. |
| + | -- Accuracy rate formula: 検証、仮説スレ17, 314, http://kancolle.wikia.com/wiki/Sandbox/Accuracy_Evasion_Tables |
| -- | | -- |
| | | |
Line 144: |
Line 146: |
| function Combat:damage(ship, enemy_armor) | | function Combat:damage(ship, enemy_armor) |
| return self:damage_post_cap(self:damage_cap(self:damage_pre_cap(ship)), ship, enemy_armor) | | return self:damage_post_cap(self:damage_cap(self:damage_pre_cap(ship)), ship, enemy_armor) |
| + | end |
| + | |
| + | function Combat:shelling(ship) |
| + | ship.attack_power = 5 + ship._firepower_max + ship.equipment_bonus.firepower + self.combined_firepower + ship.anti_ground_bonus |
| + | return ship |
| + | end |
| + | |
| + | function Combat:torpedo(ship) |
| + | ship.attack_power = 5 + ship._torpedo_max + ship.equipment_bonus.torpedo + self.combined_torpedo |
| + | return ship |
| + | end |
| + | |
| + | function Combat:night_battle(ship) |
| + | if ship.health == self.modifier.health.taiha then |
| + | ship.attack_power = 0 |
| + | else |
| + | ship.attack_power = self.night_contact + ship._firepower_max + ship._torpedo_max + ship.equipment_bonus.firepower + ship.equipment_bonus.torpedo |
| + | end |
| + | return ship |
| end | | end |
| | | |
Line 162: |
Line 183: |
| end | | end |
| | | |
− | function Combat:shelling(ship) | + | function Combat.evasion_rate(ship) |
− | ship.attack_power = 5 + ship._firepower_max + ship.equipment_bonus.firepower + self.combined_firepower + ship.anti_ground_bonus
| + | if ship.morale and ship.morale > 52 then |
− | return ship
| + | return math.floor(100 * 2 * ship._evasion_max / (2 * ship._evasion_max + 40)) |
| + | else |
| + | return math.floor(100 * ship._evasion_max / (ship._evasion_max + 40)) |
| + | end |
| end | | end |
| | | |
− | function Combat:torpedo(ship) | + | function Combat.accuracy_rate(ship) |
− | ship.attack_power = 5 + ship._torpedo_max + ship.equipment_bonus.torpedo + self.combined_torpedo
| + | return math.floor(100 * ((math.sqrt(ship._level) - 1) / 45 + ship._luck / 1000)) |
− | return ship
| |
− | end
| |
− | | |
− | function Combat:night_battle(ship)
| |
− | if ship.health == self.modifier.health.taiha then
| |
− | ship.attack_power = 0
| |
− | else
| |
− | ship.attack_power = self.night_contact + ship._firepower_max + ship._torpedo_max + ship.equipment_bonus.firepower + ship.equipment_bonus.torpedo
| |
− | end
| |
− | return ship
| |
| end | | end |
| | | |