Last active
August 14, 2019 18:38
-
-
Save ndugger/ef0275cc823a1327b4ef4b48e94d81b7 to your computer and use it in GitHub Desktop.
Dungeon Master Language
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use game. | |
| use math. | |
| define dice as blueprint (use number as sides) of game'item, set to: | |
| define roll as action (use number as times, share number), set to: | |
| define value as number, set to 0. | |
| repeat times: | |
| set value to value + do math'round (do math'random (0, sides)). | |
| share value. | |
| share roll. | |
| share dice. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use battle. | |
| use dice. | |
| use game. | |
| define d12 as dice, set to new (12). | |
| do battle'begin. | |
| define attack as number, set to do d12'roll (2). | |
| define critical as number, set to 0. | |
| define damage as number, set to 0. | |
| if attack > 12: | |
| set critical to do d12'roll (1). | |
| set damage to attack + critical. | |
| set battle'target'hp to battle'target'hp - damage. | |
| if battle'target'hp = 0, or battle'target'hp < 0: | |
| do battle'end. | |
| do game'save. | |
| if battle'target'hp > 0: | |
| do battle'continue. |
Author
Author
keywords:
- use
- define
- as
- set _ to
- if
- do
- repeat for
- share
- or
- and
Author
meaningful tokens:
- <
- >
- =
- ( )
- '
- "
- ,
- .
- -
- +
- ->
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
built-in types: