Line 2: |
Line 2: |
| local shipdb = require("Module:ShipDatabase") | | local shipdb = require("Module:ShipDatabase") |
| shipmodule.data = shipdb.KanmusuData | | shipmodule.data = shipdb.KanmusuData |
| + | |
| + | local function hp_married(hp, hp_max) |
| + | return math.min(hp_max, hp + ({4, 4, 4, 5, 6, 7, 7, 8, 8, 9})[math.floor(hp / 10) + 1]) |
| + | end |
| | | |
| function shipmodule.getIDNum(frame) | | function shipmodule.getIDNum(frame) |
Line 101: |
Line 105: |
| local statBox = '<td style="{{border-radius|4px 12px 12px 4px}} padding-left: 5px; padding-right: 5px; border: 1px solid #a3965c; text-align: left; vertical-align: baseline;">' | | local statBox = '<td style="{{border-radius|4px 12px 12px 4px}} padding-left: 5px; padding-right: 5px; border: 1px solid #a3965c; text-align: left; vertical-align: baseline;">' |
| -- HP & FP | | -- HP & FP |
− | local HPinfo = statLabel .. 'HP [[File:IcoHP.png|HP]]</th>' .. statBox .. shipmodule.data[shipNum]["hp"][1] .. '→' .. shipmodule.data[shipNum]["hp"][2] .. '</td>' | + | local hp = shipmodule.data[shipNum]["hp"][1] |
| + | local hp_max = shipmodule.data[shipNum]["hp"][2] |
| + | local hp_m = hp_married(hp, hp_max) |
| + | local HPinfo = statLabel .. 'HP [[File:IcoHP.png|HP]]</th>' .. statBox .. hp .. '→' .. hp_m .. '</td>' |
| local FPinfo = statLabel .. 'FP [[File:IcoAtk.png|Firepower]]</th>' .. statBox .. shipmodule.data[shipNum]["fp"][1] .. '→' .. shipmodule.data[shipNum]["fp"][2] .. '</td>' | | local FPinfo = statLabel .. 'FP [[File:IcoAtk.png|Firepower]]</th>' .. statBox .. shipmodule.data[shipNum]["fp"][1] .. '→' .. shipmodule.data[shipNum]["fp"][2] .. '</td>' |
| | | |