Модуль:Prototypes/Роль/Лодаут: различия между версиями
Pok (обсуждение | вклад) мНет описания правки |
Pok (обсуждение | вклад) мНет описания правки |
||
| Строка 55: | Строка 55: | ||
end | end | ||
if loadout and loadout.equipment then | if loadout and loadout.equipment then | ||
local eqValue = loadout.equipment[searchKey] | local skipLoadout = false | ||
if loadout.effects then | |||
for _, effect in ipairs(loadout.effects) do | |||
if effect.proto == "EffectSpeciesVox" then | |||
skipLoadout = true | |||
break | |||
end | |||
end | |||
end | |||
if not skipLoadout then | |||
local eqValue = loadout.equipment[searchKey] | |||
if eqValue then | |||
local extraInfo = "" | |||
if loadout.effects then | |||
for _, effect in ipairs(loadout.effects) do | |||
if effect["!type"] == "GroupLoadoutEffect" then | |||
local proto = effect.proto | |||
if proto then | |||
for _, candidate in ipairs(gearloadout) do | |||
if candidate.id == proto then | |||
if candidate.effects then | |||
for _, eff in ipairs(candidate.effects) do | |||
if eff["!type"] == "JobRequirementLoadoutEffect" and eff.requirement then | |||
local req = eff.requirement | |||
if req["!type"] == "DepartmentTimeRequirement" and req.department and req.time then | |||
extraInfo = extraInfo .. "<b>{{ucfirst:{{#invoke:Ftl|main|translation|department-" .. req.department .. "}}}}</b>: " .. req.time .. "<br>" | |||
elseif req["!type"] == "RoleTimeRequirement" and req.role and req.time then | |||
extraInfo = extraInfo .. "<b>{{ucfirst:{{#invoke:Ftl|main|translation|" .. req.role .. "}}}}</b>: " .. req.time .. "<br>" | |||
end | |||
end | end | ||
end | end | ||
end | end | ||
break | |||
end | end | ||
end | end | ||
end | end | ||
| Строка 83: | Строка 94: | ||
end | end | ||
end | end | ||
local infoOutput = "" | |||
if extraInfo ~= "" then | |||
infoOutput = '<div class="роль-лодаут__time">{{AltTooltip|[[Файл:Small_watch.png|link=]]|' .. extraInfo .. '}}</div>' | |||
end | |||
table.insert(results, infoOutput .. '{{#invoke:Prototypes/Предмет/Содержание|image|' .. eqValue .. '}} [[File:Slot.png|64px|link=]]') | |||
end | end | ||
end | end | ||
end | end | ||