{"id":14961418,"url":"https://github.com/thepat02/diceengine","last_synced_at":"2025-10-24T20:31:39.762Z","repository":{"id":255100173,"uuid":"848522227","full_name":"ThePat02/DiceEngine","owner":"ThePat02","description":"A simple Dice Roller for the Godot Engine 4.x written in `GDScript`!","archived":false,"fork":false,"pushed_at":"2024-09-26T18:35:15.000Z","size":19,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-31T04:16:29.604Z","etag":null,"topics":["dice","godot","godot-engine"],"latest_commit_sha":null,"homepage":"","language":"GDScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ThePat02.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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-27T23:17:11.000Z","updated_at":"2024-11-24T04:01:54.000Z","dependencies_parsed_at":"2024-08-28T01:45:26.707Z","dependency_job_id":"f14f5054-d894-4c32-af73-7797230e53a9","html_url":"https://github.com/ThePat02/DiceEngine","commit_stats":null,"previous_names":["thepat02/diceengine"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThePat02%2FDiceEngine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThePat02%2FDiceEngine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThePat02%2FDiceEngine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThePat02%2FDiceEngine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ThePat02","download_url":"https://codeload.github.com/ThePat02/DiceEngine/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238035385,"owners_count":19405682,"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":["dice","godot","godot-engine"],"created_at":"2024-09-24T13:25:04.250Z","updated_at":"2025-10-24T20:31:34.411Z","avatar_url":"https://github.com/ThePat02.png","language":"GDScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DiceEngine\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"addons\\dice_engine\\dice_engine.svg\" alt=\"DiceEngine Icon\" width=\"128\" height=\"128\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cb\u003eDiceEngine\u003c/b\u003e is a simple Dice Roller for the Godot Engine 4.x written in `GDScript`!\n\u003c/p\u003e\n\n\n## Features\n- Roll any number of dice with any number of sides\n- Perform and check the results of `DiceCheck` resources that can represent skill checks in your game\n\n\n## Installation\n**Method 1:** Copy the `addons/dice_engine` folder into your `addons` folder in your Godot project.\u003cbr\u003e\n**Method 2:** Install it directly from the AssetLib in the Godot Editor.\n\n\n## Usage\nAll functionalities are documented in the in-game documentation. You can access it by pressing `F1` in the Godot Editor and searching for `DiceEngine` or `DiceCheck`.\n\n### ![Singleton](addons/dice_engine/dice.svg) Dice Singleton\nThis plugin automatically adds a new `Dice` singleton to your project. You can access it from any script using something like this:\n```gdscript\n# Rolls 2 six-sided dice and returns the sum\nvar result_sum: int = Dice.roll(2, 6) # 2d6\n\n# Rolls 3x 4 six-sided dice and returns the sum results in an array\nvar result_multiple: Array[int] = Dice.roll_multiple(3, 4, 6) # 3x 4d6\n```\n\n### ![Singleton](addons/dice_engine/dice.svg) DiceEngine\nThe core of this plugin is the `DiceEngine` class. It provides all the functionality to roll dice and gather the results. It has the following enums, methods and signals:\n\n```gdscript\nclass_name DiceEngine extends Node\n## A simple dice engine that can roll dice with a certain number of sides and amount,\n## and return the result in different ways.\n\n## Emitted when a dice roll is performed.\nsignal rolled_dice(result: int, dice_results: Array[int], dice_amount: int, dice_sides: int, roll_type: RollType)\n\n## Predefined dice types using the DX notation, with X being the number of sides.\nenum DiceType {\n    D4 = 4,\n    D6 = 6,\n    D8 = 8,\n    D10 = 10,\n    D12 = 12,\n    D20 = 20,\n    D100 = 100,\n}\n\n## The type of roll to perform.\nenum RollType {\n    SUM, ## Default. The sum of all dice results.\n    HIGHEST, ## The highest result.\n    LOWEST, ## The lowest result.\n    AVERAGE, ## The average result.\n}\n\n## Rolls a number of dice with a certain number of sides.\nfunc roll(amount: int, sides: int, roll_type: RollType = RollType.SUM) -\u003e int\n\n## Rolls a number of dice with a certain number of sides multiple times.\nfunc roll_multiple(times: int, amount: int, sides: int, roll_type: RollType = RollType.SUM) -\u003e Array[int]\n```\n\n### ![DiceCheck](/addons/dice_engine/roll.svg) DiceCheck Resource\nUsing the `DiceCheck` resource, you can save perform dice roll checks (or more specifically, skill checks) and gather the results. I suggest, using this to store custom rolls inside your own skill check resource! It has the following properties and methods:\n\n```gdscript\nclass_name DiceCheck extends Resource\n## A simple dice check that can be used to compare the result of a dice roll with a certain value.\n\n## The results of the dice check.\nenum DiceCheckResult {\n    SUCCESS,\n    FAILURE\n}\n\n## The type of check to perform.\nvar type: CheckType = CheckType.GREATER_THAN\n## The value to compare the dice roll with.\nvar value: int = 10\n## The amount of dice to roll.\nvar dice_amount: int = 1\n## The number of sides on the dice to roll.\nvar dice_sides: int = 20\n## The type of roll to perform.\nvar roll_type: DiceEngine.RollType = DiceEngine.RollType.SUM\n\n## Performs a dice check and returns the result.\nfunc check() -\u003e DiceCheckResult\n```\n\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthepat02%2Fdiceengine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthepat02%2Fdiceengine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthepat02%2Fdiceengine/lists"}