Line 111: |
Line 111: |
| local hp = shipmodule.data[shipNum]["hp"][1] | | local hp = shipmodule.data[shipNum]["hp"][1] |
| local maxHp = shipmodule.data[shipNum]["hp"][2] | | local maxHp = shipmodule.data[shipNum]["hp"][2] |
− | local marriedHp = getMarriedHp(hp, maxHp) | + | local HPinfo |
− | local maxModHp = math.min(hp + 2, maxHp)
| + | if maxHp then |
− | local maxModMarriedHp = math.min(marriedHp + 2, maxHp)
| + | local marriedHp = getMarriedHp(hp, maxHp) |
− | local hpSpan1 = tooltip(hp, string.format('%d with DE modernization', maxModHp))
| + | local maxModHp = math.min(hp + 2, maxHp) |
− | local hpSpan2 = tooltip(marriedHp, string.format('Married, %d with DE modernization', maxModMarriedHp))
| + | local maxModMarriedHp = math.min(marriedHp + 2, maxHp) |
− | local HPinfo = statLabel .. 'HP [[File:IcoHP.png|HP]]</th>' .. statBox .. hpSpan1 .. '→' .. hpSpan2 .. '</td>'
| + | local hpSpan1 = tooltip(hp, string.format('%d with DE modernization', maxModHp)) |
| + | local hpSpan2 = tooltip(marriedHp, string.format('Married, %d with DE modernization', maxModMarriedHp)) |
| + | HPinfo = statLabel .. 'HP [[File:IcoHP.png|HP]]</th>' .. statBox .. hpSpan1 .. '→' .. hpSpan2 .. '</td>' |
| + | else |
| + | HPinfo = statLabel .. 'HP [[File:IcoHP.png|HP]]</th>' .. statBox .. hp .. '</td>' |
| + | end |
| | | |
| 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>' |