Модуль:Prototypes/Оружия: различия между версиями
Pok (обсуждение | вклад) мНет описания правки |
AsnDen (обсуждение | вклад) м Поправил опечатку |
||
| (не показана 1 промежуточная версия 1 участника) | |||
| Строка 54: | Строка 54: | ||
if mode == "melee" then | if mode == "melee" then | ||
local resultParts = {} | |||
local melee = entry.MeleeWeapon | local melee = entry.MeleeWeapon | ||
if | if melee and melee.damage and melee.damage.types then | ||
local oneHandDamage = melee.damage.types | |||
table.insert(resultParts, "В одной руке: " .. formatDamageList(oneHandDamage)) | |||
if entry.IncreaseDamageOnWield | |||
and entry.IncreaseDamageOnWield.damage | |||
and entry.IncreaseDamageOnWield.damage.types then | |||
local twoHandDamage = combineDamageTables(oneHandDamage, entry.IncreaseDamageOnWield.damage.types) | |||
table.insert(resultParts, "В двух руках: " .. formatDamageList(twoHandDamage)) | |||
end | |||
local attackRate = melee.attackRate or 1 | |||
table.insert(resultParts, "Скорость атаки: " .. formatAttackRate(attackRate)) | |||
local | |||
table.insert(resultParts, " | |||
end | end | ||
| Строка 75: | Строка 75: | ||
and entry.DamageOtherOnHit.damage.types then | and entry.DamageOtherOnHit.damage.types then | ||
local throwingDamage = entry.DamageOtherOnHit.damage.types | local throwingDamage = entry.DamageOtherOnHit.damage.types | ||
table.insert(resultParts, " | table.insert(resultParts, "Метательный: " .. formatDamageList(throwingDamage)) | ||
end | end | ||
if #resultParts == 0 then | |||
table. | return "Нет данных для оружия '" .. tostring(id) .. "'." | ||
else | |||
return frame:preprocess(table.concat(resultParts, "<br>")) | |||
end | |||
elseif mode == "attackRate" then | elseif mode == "attackRate" then | ||
local melee = entry.MeleeWeapon | local melee = entry.MeleeWeapon | ||
if | if melee then | ||
local attackRate = melee.attackRate or 1 | |||
return frame:preprocess(formatAttackRate(attackRate)) | |||
else | |||
return "нет" | return "нет" | ||
end | end | ||
else | else | ||
return "Неверный режим: " .. tostring(mode) | return "Неверный режим: " .. tostring(mode) | ||