{"id":27312709,"url":"https://github.com/ducdat0507/lootalot","last_synced_at":"2025-04-12T06:42:35.145Z","repository":{"id":254890117,"uuid":"847844293","full_name":"ducdat0507/lootalot","owner":"ducdat0507","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-02T13:32:24.000Z","size":96,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-02T14:32:21.004Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ducdat0507.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-26T16:49:34.000Z","updated_at":"2025-02-06T08:48:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"0529813b-f23a-42db-849d-4de6341f2b8b","html_url":"https://github.com/ducdat0507/lootalot","commit_stats":null,"previous_names":["ducdat0507/lootalot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ducdat0507%2Flootalot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ducdat0507%2Flootalot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ducdat0507%2Flootalot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ducdat0507%2Flootalot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ducdat0507","download_url":"https://codeload.github.com/ducdat0507/lootalot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248530612,"owners_count":21119592,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-12T06:42:34.524Z","updated_at":"2025-04-12T06:42:35.130Z","avatar_url":"https://github.com/ducdat0507.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `lootalot`\n\n`lootalot` is a library for efficiently simulating loot drops. It is suitable for incremental games where a large amount of loot might need to be made at once.\n\n## Try it\nhttps://ducdat0507.github.io/lootalot\n\n## Example usage:\n```js\nimport { LootTable } from 'lootalot';\n\n// Make a loot table for our example monster\n// We'll make 2 pools of items to choose from\nlet table = new LootTable(\n    [\n        // Drop any one of these items at varied chances\n        { item: \"Apple\",  w: 1 },\n        { item: \"Banana\", w: 2 },\n        { item: \"Citrus\", w: 0.5 },\n    ],\n    [\n        // Additionally, drop an extra 150~250 gold\n        { item: \"Gold\", count: [150, 250], step: 50 }\n    ],\n);\n\n// Kill our monster one trillion times, why not?\nlet loot = table.loot(1_000_000_000_000);\n\n// Display our loot\nconsole.log(loot);\n// Result should look like this, actual numbers may vary due to randomness:\n// [\n//     {\n//         \"item\": \"Banana\",\n//         \"count\": 571428528445\n//     },\n//     {\n//         \"item\": \"Apple\",\n//         \"count\": 285714017436\n//     },\n//     {\n//         \"item\": \"Citrus\",\n//         \"count\": 142857454119\n//     },\n//     {\n//         \"item\": \"Gold\",\n//         \"count\": 199999991656400\n//     }\n// ]\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fducdat0507%2Flootalot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fducdat0507%2Flootalot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fducdat0507%2Flootalot/lists"}