12,814
edits
(Update for v1.1) |
(getTabletTable: Apply formatting when familiar has no max hit) |
||
(7 intermediate revisions by the same user not shown) | |||
Line 20: | Line 20: | ||
local rowArray = {} | local rowArray = {} | ||
for i, Fam in ipairs(Familiars) do | for i, Fam in ipairs(Familiars) do | ||
local item = Items.getItemByID(Fam. | local item = Items.getItemByID(Fam.productID) | ||
if item ~= nil then | if item ~= nil then | ||
local rowText = '|-' | local rowText = '|-' | ||
rowText = rowText..'\r\n|data-sort-value="'..item.name..'"|'..Icons.Icon({item.name, type='mark', notext=true, size='50'}) | rowText = rowText..'\r\n|data-sort-value="'..item.name..'"|'..Icons.Icon({item.name, type='mark', notext=true, size='50'}) | ||
rowText = rowText..'||'..Icons.Icon({item.name, 'Mark of the ' .. item.name, type='mark', noicon=true}) | rowText = rowText..'||' .. Icons.getExpansionIcon(Fam.id) .. Icons.Icon({item.name, 'Mark of the ' .. item.name, type='mark', noicon=true}) | ||
rowText = rowText..'||style="text-align:right"|'..Fam.level | rowText = rowText..'||style="text-align:right"|'..Fam.level | ||
local discoveredArray = {} | local discoveredArray = {} | ||
Line 52: | Line 52: | ||
local rowArray = {} | local rowArray = {} | ||
for i, Fam in ipairs(Familiars) do | for i, Fam in ipairs(Familiars) do | ||
local item = Items.getItemByID(Fam. | local item = Items.getItemByID(Fam.productID) | ||
if item ~= nil then | if item ~= nil then | ||
local maxHit, maxHitText = Items._getItemStat(item, 'summoningMaxhit'), '' | local maxHit, maxHitText = Items._getItemStat(item, 'summoningMaxhit'), '' | ||
if maxHit | if maxHit == nil then | ||
maxHitText = 'class="table-na" data-sort-value="-1"| N/A' | |||
else | |||
maxHit = maxHit * 10 | maxHit = maxHit * 10 | ||
maxHitText = 'style="text-align:right" | maxHitText = 'style="text-align:right;" data-sort-value="' .. maxHit .. '"|' .. Shared.formatnum(maxHit) | ||
end | end | ||
local effectDesc = Constants.getModifiersText( | local effectDesc = Constants.getModifiersText(item.modifiers, false) | ||
local rowText = '|-' | local rowText = '|-' | ||
rowText = rowText..'\r\n|data-sort-value="'..item.name..'"|'..Icons.Icon({item.name, type='item', notext=true, size='50'}) | rowText = rowText..'\r\n|data-sort-value="'..item.name..'"|'..Icons.Icon({item.name, type='item', notext=true, size='50'}) | ||
rowText = rowText..'||'..Icons.Icon({item.name, type='item', noicon=true}) | rowText = rowText..'||' .. Icons.getExpansionIcon(Fam.id) .. Icons.Icon({item.name, type='item', noicon=true}) | ||
rowText = rowText..'||style="text-align:right"|'..Fam.level | rowText = rowText..'||style="text-align:right"|'..Fam.level | ||
rowText = rowText..'||style="text-align:right"|'..Fam.tier | rowText = rowText..'||style="text-align:right"|'..Fam.tier | ||
rowText = rowText..'||'.. | rowText = rowText..'||'..effectDesc..'||'..maxHitText | ||
-- Create item requirements text | -- Create item requirements text | ||
Line 79: | Line 81: | ||
-- Other costs | -- Other costs | ||
local recipeGPCost = SkillData.Summoning. | local recipeGPCost = SkillData.Summoning.recipeGPCost | ||
if Fam.gpCost > 0 then | if Fam.gpCost > 0 then | ||
table.insert(OtherCostArray, Icons.GP(Fam.gpCost)) | table.insert(OtherCostArray, Icons.GP(Fam.gpCost)) | ||
Line 141: | Line 143: | ||
local rowText = '|-' | local rowText = '|-' | ||
rowText = rowText..'\r\n|data-sort-value="'..FamName1..'"|'..Icons.Icon({FamName1, type='item', notext=true, size='30'}) | rowText = rowText..'\r\n|data-sort-value="'..FamName1..'"|'..Icons.Icon({FamName1, type='item', notext=true, size='30'}) | ||
rowText = rowText..'||'..Icons.Icon({FamName1, type='item', noicon=true}) | rowText = rowText..'||' .. Icons.getExpansionIcon(Fam1.id) .. Icons.Icon({FamName1, type='item', noicon=true}) | ||
rowText = rowText..'||data-sort-value="'..FamName2..'"|'..Icons.Icon({FamName2, type='item', notext=true, size='30'}) | rowText = rowText..'||data-sort-value="'..FamName2..'"|'..Icons.Icon({FamName2, type='item', notext=true, size='30'}) | ||
rowText = rowText..'||'..Icons.Icon({FamName2, type='item', noicon=true}) | rowText = rowText..'||' .. Icons.getExpansionIcon(Fam2.id) .. Icons.Icon({FamName2, type='item', noicon=true}) | ||
rowText = rowText..'||'..synDesc | rowText = rowText..'||'..synDesc | ||
Line 173: | Line 175: | ||
local familiarItem = Items.getItem(famName) | local familiarItem = Items.getItem(famName) | ||
if familiarItem == nil then | if familiarItem == nil then | ||
return ' | return Shared.printError('Not a valid familiar') | ||
else | else | ||
for i, recipe in ipairs(SkillData.Summoning.recipes) do | for i, recipe in ipairs(SkillData.Summoning.recipes) do | ||
Line 182: | Line 184: | ||
end | end | ||
if familiarID == nil then | if familiarID == nil then | ||
return ' | return Shared.printError('Not a valid familiar') | ||
else | else | ||
return p._getSynergyTable(familiarID) | return p._getSynergyTable(familiarID) | ||
Line 201: | Line 203: | ||
local famSkills = Constants.getModifierSkills(item.modifiers) | local famSkills = Constants.getModifierSkills(item.modifiers) | ||
if Shared.contains(famSkills, skill) then | if Shared.contains(famSkills, skill) then | ||
table.insert(rowArray, {Fam1 = item.name, Fam2 = nil, Descrip = Constants.getModifiersText(item.modifiers, false)}) | table.insert(rowArray, {Fam1 = item.name, FamID1 = item.id, Fam2 = nil, FamID2 = nil, Descrip = Constants.getModifiersText(item.modifiers, false)}) | ||
end | end | ||
end | end | ||
Line 211: | Line 213: | ||
local synSkills = Constants.getModifierSkills(syn.modifiers) | local synSkills = Constants.getModifierSkills(syn.modifiers) | ||
if Shared.contains(synSkills, skill) then | if Shared.contains(synSkills, skill) then | ||
local FamName1 = famNames[syn. | local FamName1 = famNames[syn.summonIDs[1]] or 'Unknown' | ||
local FamName2 = famNames[syn. | local FamName2 = famNames[syn.summonIDs[2]] or 'Unknown' | ||
local synDesc = syn.customDescription | local synDesc = syn.customDescription | ||
if synDesc == nil then | if synDesc == nil then | ||
Line 218: | Line 220: | ||
synDesc = Constants.getModifiersText(syn.modifiers, false) or '' | synDesc = Constants.getModifiersText(syn.modifiers, false) or '' | ||
end | end | ||
table.insert(rowArray, {Fam1 = FamName1, Fam2 = FamName2, Descrip = synDesc}) | table.insert(rowArray, {Fam1 = FamName1, FamID1 = syn.summonIDs[1], Fam2 = FamName2, FamID2 = syn.summonIDs[2], Descrip = synDesc}) | ||
end | end | ||
end | end | ||
Line 234: | Line 236: | ||
table.insert(resultPart, '\r\n|-') | table.insert(resultPart, '\r\n|-') | ||
table.insert(resultPart, '\r\n|data-sort-value="'..rowItem.Fam1..'"|'..Icons.Icon({rowItem.Fam1, type='item', notext=true, size='30'})) | table.insert(resultPart, '\r\n|data-sort-value="'..rowItem.Fam1..'"|'..Icons.Icon({rowItem.Fam1, type='item', notext=true, size='30'})) | ||
table.insert(resultPart, '||'..Icons.Icon({rowItem.Fam1, type='item', noicon=true})) | table.insert(resultPart, '||' .. Icons.getExpansionIcon(rowItem.FamID1) .. Icons.Icon({rowItem.Fam1, type='item', noicon=true})) | ||
if rowItem.Fam2 ~= nil then | if rowItem.Fam2 ~= nil then | ||
table.insert(resultPart, '||data-sort-value="'..rowItem.Fam2..'"|'..Icons.Icon({rowItem.Fam2, type='item', notext=true, size='30'})) | table.insert(resultPart, '||data-sort-value="'..rowItem.Fam2..'"|'..Icons.Icon({rowItem.Fam2, type='item', notext=true, size='30'})) | ||
table.insert(resultPart, '||'..Icons.Icon({rowItem.Fam2, type='item', noicon=true})) | table.insert(resultPart, '||' .. Icons.getExpansionIcon(rowItem.FamID2) .. Icons.Icon({rowItem.Fam2, type='item', noicon=true})) | ||
else | else | ||
table.insert(resultPart, '|| || ') | table.insert(resultPart, '|| || ') |