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
← Older edit
Newer edit →
Module:ShipData
(view source)
Revision as of 12:28, 5 October 2017
118 bytes added
,
8 years ago
no edit summary
Line 265:
Line 265:
end
end
+
-- min(hp_max, hp + [4, 4, 4, 5, 6, 7, 7, 8, 8, 9][Math.floor(hp / 10)])
function ShipData:hp_married()
function ShipData:hp_married()
local bonuses = {
local bonuses = {
Line 278:
Line 279:
[9] = 9,
[9] = 9,
}
}
−
local exceptions = {
+
local exceptions = {
[131] = true, -- Yamato
[131] = true, -- Yamato
[143] = true, -- Musashi
[143] = true, -- Musashi
Line 297:
Line 298:
}
}
local hp = self:hp()
local hp = self:hp()
−
if not hp then
+
local hp_max = self:hp_max()
+
if not hp
or not hp_max
then
return nil
return nil
end
end
−
local api_id = self:api_id()
+
-- not using exceptions should work as well
−
if exceptions[api_id] then
+
if exceptions[
self:
api_id
()
] then
−
return
self:
hp_max
()
+
return hp_max
else
else
−
local
hp_digit
= math.floor(hp / 10)
+
local
bonus
=
bonuses[
math.floor(hp / 10)]
−
local bonus = bonuses[hp_digit
]
if bonus then
if bonus then
−
return hp + bonus
+
return
math.min(hp_max,
hp + bonus
)
else
else
return nil
return nil
がか
cssedit, gkautomate,
Interface administrators
,
Widget editors
7,212
edits
Navigation menu
Personal tools
Log in
Request account
Namespaces
Module
Discussion
Variants
Views
Read
View source
View history
More
Search
Content Navigation
Kancolle Wiki
Random page
Recent changes
Batch Uploading
Previous Event
Setsubun Mini-Event
Sortie
Sortie
World 1 (Naval Base Waters)
World 2 (Nansei Island Waters)
World 3 (Northern Waters)
World 7 (South Western Waters)
World 4 (Western Waters)
World 5 (Southern Waters)
World 6 (Central Waters)
Events
Shortcuts
Expeditions
Quests
Ships Maximum Status
Equipment
Construction
Development
Akashi's Improvement Arsenal
Shop
Inventory
Combat Mechanics
Glossary
Drop List
Game Updates
Interviews
Tutorials
How to Register
How To Play
Leveling
Resource Farming
Ship Priority
Equipment Setup
Akashi Upgrades
Event Preparation
Troubleshooting
FAQ
Community
Help
Sandbox
Tools
Upload file
Special pages
Printable version