• Welcome to the Kancolle Wiki!
  • If you have any questions regarding site content, account registration, etc., please visit the KanColle Wiki Discord

Changes

Jump to navigation Jump to search
Return basic attack power (w/ ASW & NB pre-cap modifiers) from main functions (no flooring), change ASW, carrier shelling and aerial formulas
Line 245: Line 245:  
end
 
end
   −
function ShipCapabilities:_attack_power_cap(attack_power, cap)
+
-- Basic attack power for shelling and carrier shelling.
--if attack_power > cap then
  −
-- return math.floor(cap + math.sqrt(attack_power - cap))
  −
--end
  −
return math.floor(attack_power)
  −
end
  −
 
   
function ShipCapabilities:day_battle()
 
function ShipCapabilities:day_battle()
 
if not self:_is_submarine() then
 
if not self:_is_submarine() then
Line 270: Line 264:  
end
 
end
 
end
 
end
return 1, self:_attack_power_cap(firepower + 5, 150)
+
return 1, 5 + firepower
 
end
 
end
 
else
 
else
Line 301: Line 295:  
end
 
end
 
if has_planes then
 
if has_planes then
return is_installation and 3 or 2, self:_attack_power_cap(1.5 * (firepower + torpedo) + bombing * 2 + 55, 150)
+
return is_installation and 3 or 2, 55 + math.floor(1.5 * (firepower + torpedo + math.floor(1.3 * bombing)))
 
end
 
end
 
end
 
end
Line 311: Line 305:  
function ShipCapabilities:format_day_battle(mode, attack_power)
 
function ShipCapabilities:format_day_battle(mode, attack_power)
 
if mode then
 
if mode then
return format{self._attack_template, mode = self._day_battle_modes[mode], attack_power = attack_power}
+
return format{self._attack_template, mode = self._day_battle_modes[mode], attack_power = math.floor(attack_power)}
 
elseif mode == false then
 
elseif mode == false then
 
return "No Action"
 
return "No Action"
Line 318: Line 312:  
end
 
end
    +
-- Basic attack power for closing torpedo.
 
function ShipCapabilities:closing_torpedo()
 
function ShipCapabilities:closing_torpedo()
 
local torpedo = self._ship:torpedo_leveled()
 
local torpedo = self._ship:torpedo_leveled()
Line 330: Line 325:  
end
 
end
 
end
 
end
return self:_attack_power_cap(torpedo + 5, 150)
+
return 5 + torpedo
 
end
 
end
 
return false
 
return false
Line 337: Line 332:  
function ShipCapabilities:format_torpedo(attack_power)
 
function ShipCapabilities:format_torpedo(attack_power)
 
if attack_power then
 
if attack_power then
return tostring(attack_power)
+
return tostring(math.floor(attack_power))
 
end
 
end
 
return "No"
 
return "No"
Line 344: Line 339:  
ShipCapabilities.format_closing_torpedo = ShipCapabilities.format_torpedo
 
ShipCapabilities.format_closing_torpedo = ShipCapabilities.format_torpedo
    +
-- Detect possible day time special attack modifiers (post-cap).
 
function ShipCapabilities:artillery_spotting()
 
function ShipCapabilities:artillery_spotting()
 
local total_space = self._ship:total_space()
 
local total_space = self._ship:total_space()
Line 393: Line 389:  
end
 
end
    +
-- Basic attack power for night battle carrier shelling.
 +
-- Or basic attack power for night battle attack * detected night special attack modifier (pre-cap).
 
function ShipCapabilities:night_battle()
 
function ShipCapabilities:night_battle()
 
local main_guns, secondary_guns, torpedoes, has_planes, firepower, torpedo = 0, 0, 0, false, self._ship:firepower_leveled(), self._ship:torpedo_leveled()
 
local main_guns, secondary_guns, torpedoes, has_planes, firepower, torpedo = 0, 0, 0, false, self._ship:firepower_leveled(), self._ship:torpedo_leveled()
Line 426: Line 424:  
if self:_is_carrier() then
 
if self:_is_carrier() then
 
if has_planes and self._ship:night_bombing() then
 
if has_planes and self._ship:night_bombing() then
return 8, self:_attack_power_cap(firepower + torpedo, 300)
+
return 8, firepower + torpedo
 
end
 
end
 
return false
 
return false
 
else
 
else
 
if torpedoes >= 2 and torpedo > 0 then
 
if torpedoes >= 2 and torpedo > 0 then
return 7, self:_attack_power_cap((firepower + torpedo) * 1.5, 300)
+
return 7, (firepower + torpedo) * 1.5
 
elseif main_guns >= 3 and firepower > 0 then
 
elseif main_guns >= 3 and firepower > 0 then
return 4, self:_attack_power_cap((firepower + torpedo) * 2, 300)
+
return 4, (firepower + torpedo) * 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, self:_attack_power_cap((firepower + torpedo) * 1.75, 300)
+
return 5, (firepower + torpedo) * 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, self:_attack_power_cap((firepower + torpedo) * 1.3, 300)
+
return 6, (firepower + torpedo) * 1.3
 
elseif main_guns + secondary_guns >= 2 and firepower > 0 then
 
elseif main_guns + secondary_guns >= 2 and firepower > 0 then
return 3, self:_attack_power_cap((firepower + torpedo) * 1.2, 300)
+
return 3, (firepower + torpedo) * 1.2
 
elseif torpedoes > 0 and torpedo > 0 then
 
elseif torpedoes > 0 and torpedo > 0 then
return 2, self:_attack_power_cap(firepower + torpedo, 300)
+
return 2, firepower + torpedo
 
elseif firepower > 0 then
 
elseif firepower > 0 then
return 1, self:_attack_power_cap(firepower + torpedo, 300)
+
return 1, firepower + torpedo
 
else
 
else
 
return false
 
return false
Line 454: Line 452:  
local multiplier = self._night_battle_attack_counts[mode]
 
local multiplier = self._night_battle_attack_counts[mode]
 
if multiplier then
 
if multiplier then
attack_power = tostring(attack_power) .. " " .. multiplier
+
attack_power = tostring(math.floor(attack_power)) .. " " .. multiplier
 
end
 
end
 
return format{self._attack_template, mode = self._night_battle_modes[mode], attack_power = attack_power}
 
return format{self._attack_template, mode = self._night_battle_modes[mode], attack_power = attack_power}
Line 463: Line 461:  
end
 
end
    +
-- Basic attack power for opening torpedo.
 
function ShipCapabilities:opening_torpedo()
 
function ShipCapabilities:opening_torpedo()
 
local torpedo = self._ship:torpedo_leveled()
 
local torpedo = self._ship:torpedo_leveled()
Line 488: Line 487:  
end
 
end
 
if opening_torpedo then
 
if opening_torpedo then
return self:_attack_power_cap(torpedo + 5, 150)
+
return 5 + torpedo
 
end
 
end
 
return false
 
return false
Line 495: Line 494:  
ShipCapabilities.format_opening_torpedo = ShipCapabilities.format_torpedo
 
ShipCapabilities.format_opening_torpedo = ShipCapabilities.format_torpedo
    +
-- Basic attack power for ASW attack * sonar w/ depth charge modifier (pre-cap).
 
function ShipCapabilities:asw_attack()
 
function ShipCapabilities:asw_attack()
 
local base_asw
 
local base_asw
Line 501: Line 501:  
return false
 
return false
 
elseif self:_is_asw_surface_ship() then
 
elseif self:_is_asw_surface_ship() then
base_asw = 25
+
base_asw = 13
 
elseif self:_is_asw_aviation_ship() then
 
elseif self:_is_asw_aviation_ship() then
base_asw = 10
+
base_asw = 8
 
if not self._ship:night_bombing() then
 
if not self._ship:night_bombing() then
 
night = false
 
night = false
Line 511: Line 511:  
end
 
end
 
local asw_leveled = self._ship:asw_leveled()
 
local asw_leveled = self._ship:asw_leveled()
local ship_asw, equipment_asw, depth_charge, sonar, bomber = (asw_leveled or 0) / 5, 0, false, false, false
+
local ship_asw, equipment_asw, depth_charge, sonar, bomber = (asw_leveled or 0), 0, false, false, false
 
for i = 1, self._ship:slots() or 0 do
 
for i = 1, self._ship:slots() or 0 do
 
local equipment, size = self._ship:slot(i)
 
local equipment, size = self._ship:slot(i)
Line 534: Line 534:  
depth_charge_sonar_boost = 1.15
 
depth_charge_sonar_boost = 1.15
 
end
 
end
return self:_attack_power_cap(depth_charge_sonar_boost * (base_asw + 2 * equipment_asw + ship_asw / 5), 100), day, night, not asw_leveled
+
return depth_charge_sonar_boost * (base_asw + 1.5 * equipment_asw + 2 * math.sqrt(ship_asw)), day, night, not asw_leveled
 
end
 
end
    
function ShipCapabilities:format_asw_attack(attack_power, day, night, uncertain)
 
function ShipCapabilities:format_asw_attack(attack_power, day, night, uncertain)
 
if attack_power then
 
if attack_power then
 +
attack_power = math.floor(attack_power)
 
local phases = {}
 
local phases = {}
 
if day then
 
if day then
Line 557: Line 558:  
end
 
end
    +
-- Basic attack power for opening airstrike (returns an array with attack values per each bomber).
 
function ShipCapabilities:opening_airstrike()
 
function ShipCapabilities:opening_airstrike()
 
if not self:_is_aviation_ship() then
 
if not self:_is_aviation_ship() then
Line 566: Line 568:  
if size and size > 0 and equipment and self:_is_bomber(equipment) then
 
if size and size > 0 and equipment and self:_is_bomber(equipment) then
 
local equipment_torpedo, equipment_bombing = equipment:torpedo() or 0, equipment:bombing() or 0
 
local equipment_torpedo, equipment_bombing = equipment:torpedo() or 0, equipment:bombing() or 0
local attack_power = (equipment_torpedo + equipment_bombing) * math.sqrt(size) + 25
   
if self:_is_torpedo_bomber(equipment) then
 
if self:_is_torpedo_bomber(equipment) then
table.insert(airstrikes, self:_attack_power_cap(attack_power * 1.5, 150))
+
table.insert(airstrikes, 1.5 * (25 + equipment_torpedo * math.sqrt(size))) -- 0.8 is also possible
 
else
 
else
table.insert(airstrikes, self:_attack_power_cap(attack_power, 150))
+
table.insert(airstrikes, 25 + equipment_bombing * math.sqrt(size))
 
end
 
end
 
end
 
end
Line 584: Line 585:  
local result = {}
 
local result = {}
 
for _, attack in ipairs(attacks) do
 
for _, attack in ipairs(attacks) do
table.insert(result, tostring(attack))
+
table.insert(result, tostring(math.floor(attack)))
 
end
 
end
 
return table.concat(result, ",")
 
return table.concat(result, ",")
cssedit, gkautomate
7,064

edits

Navigation menu