Finish Twitch-combat tutorial

This commit is contained in:
Griatch 2023-05-06 22:42:33 +02:00
parent 7bb2f55434
commit bfd261ee23
17 changed files with 1273 additions and 49 deletions

View file

@ -122,12 +122,25 @@ class Ability(Enum):
ALLEGIANCE_HOSTILE = "hostile"
ALLEGIANCE_NEUTRAL = "neutral"
ALLEGIANCE_FRIENDLY = "friendly"
ABILITY_REVERSE_MAP = {
"str": Ability.STR,
"dex": Ability.DEX,
"con": Ability.CON,
"int": Ability.INT,
"wis": Ability.WIS,
"cha": Ability.CHA
}
```
Here the `Ability` class holds basic properties of a character sheet.
The `ABILITY_REVERSE_MAP` is a convenient map to go the other way - if you in some command were to enter the string 'cha', we could use this mapping to directly convert your input to the correct `Ability`:
ability = ABILITY_REVERSE_MAP.get(your_input)
## Utility module