diff --git a/src/database/items.lua b/src/database/items.lua new file mode 100644 index 0000000..35bf472 --- /dev/null +++ b/src/database/items.lua @@ -0,0 +1,21 @@ +return { + -- Weapons + wPolar = { + name = "Polar Star", + map = "Pole", + getText = "Got the =Polar Star=!", + command = "= 1, 'No applicable items!') + + -- Select an item. + local selected = _.sample(applicable) + local index = self._indexMap[selected] + table.remove(self._left, index) + self._indexMap[selected] = nil + + return selected +end + +return C diff --git a/src/main.lua b/src/main.lua index af6bf22..0037285 100644 --- a/src/main.lua +++ b/src/main.lua @@ -20,26 +20,6 @@ function logNotice(...) _log(3, 'NOTICE: ', ...) end function logInfo(...) _log(4, 'INFO: ', ...) end function logDebug(...) _log(5, 'DEBUG: ', ...) end -local ITEM_DATA = { - -- Weapons - wPolar = { - name = "Polar Star", - map = "Pole", - getText = "Got the =Polar Star=!", - command = "