Модуль:Prototypes/Оружия: различия между версиями
Pok (обсуждение | вклад) Новая страница: «local weaponData = mw.loadData("Модуль:IanComradeBot/prototypes/weapon.json/data") local p = {} local function formatDamageList(damageTable) local lines = {} for dmgType, value in pairs(damageTable) do table.insert(lines, "<li>{{ColorPalette|Damage|" .. dmgType .. "|" .. value .. "}} {{#invoke:Ftl|main|translation|damage-type-" .. dmgType .. "}}</li>") end return table.concat(lines) end function p.main(frame) local mode =...» |
Pok (обсуждение | вклад) мНет описания правки |
||
| Строка 28: | Строка 28: | ||
if not entry then | if not entry then | ||
return " | return "нет" | ||
end | end | ||
| Строка 53: | Строка 53: | ||
result = result .. "В двух руках:" .. "<ul>" .. formatDamageList(twoHandDamage) .. "</ul>" | result = result .. "В двух руках:" .. "<ul>" .. formatDamageList(twoHandDamage) .. "</ul>" | ||
end | end | ||
local attackRate = melee.attackRate or 1 | |||
result = result .. "Скорость атаки:" .. "<ul><li>{{ColorPalette|Weapon|attackRate|" .. tostring(attackRate) .. "}}</li></ul>" | |||
return frame:preprocess(result) | return frame:preprocess(result) | ||
| Строка 58: | Строка 61: | ||
local melee = entry.MeleeWeapon | local melee = entry.MeleeWeapon | ||
if not melee then | if not melee then | ||
return " | return "нет" | ||
end | end | ||