Модуль:Prototypes/Хранилище/Предмет: различия между версиями
Pok (обсуждение | вклад) мНет описания правки |
Pok (обсуждение | вклад) мНет описания правки |
||
| Строка 94: | Строка 94: | ||
result = result .. processAllSelectors(selectedChild.children) | result = result .. processAllSelectors(selectedChild.children) | ||
elseif selectedChild["!type"] == "NestedSelector" and selectedChild.tableId then | elseif selectedChild["!type"] == "NestedSelector" and selectedChild.tableId then | ||
local nestedRolls | local nestedRolls | ||
if selectedChild.rolls then | |||
if selectedChild.rolls.value then | |||
nestedRolls = selectedChild.rolls.value | |||
elseif selectedChild.rolls.range then | |||
local rangeParts = {string.match(selectedChild.rolls.range, "(%d+),%s*(%d+)")} | |||
nestedRolls = math.random(tonumber(rangeParts[1]), tonumber(rangeParts[2])) | |||
else | |||
nestedRolls = 1 | |||
end | |||
else | |||
nestedRolls = 1 | |||
end | |||
result = result .. getTableOutput(selectedChild.tableId, nestedRolls) | result = result .. getTableOutput(selectedChild.tableId, nestedRolls) | ||
end | end | ||
| Строка 113: | Строка 125: | ||
result = result .. processAllSelectors(child.children) | result = result .. processAllSelectors(child.children) | ||
elseif child["!type"] == "NestedSelector" and child.tableId then | elseif child["!type"] == "NestedSelector" and child.tableId then | ||
local nestedRolls | local nestedRolls | ||
if child.rolls then | |||
if child.rolls.value then | |||
nestedRolls = child.rolls.value | |||
elseif child.rolls.range then | |||
local rangeParts = {string.match(child.rolls.range, "(%d+),%s*(%d+)")} | |||
nestedRolls = math.random(tonumber(rangeParts[1]), tonumber(rangeParts[2])) | |||
else | |||
nestedRolls = 1 | |||
end | |||
else | |||
nestedRolls = 1 | |||
end | |||
result = result .. getTableOutput(child.tableId, nestedRolls) | result = result .. getTableOutput(child.tableId, nestedRolls) | ||
end | end | ||