Skip to content

Commit cf9ea04

Browse files
committed
Spelling/wrapping
1 parent 8725db6 commit cf9ea04

File tree

14 files changed

+144
-64
lines changed

14 files changed

+144
-64
lines changed

.cspell.json

Lines changed: 46 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
// language - current active spelling language
66
"language": "en",
77
"enabledLanguageIds": [
8-
"markdown", "yaml", "python"
8+
"markdown",
9+
"yaml",
10+
"python"
911
],
1012
"dictionaries": [
1113
"en",
@@ -16,50 +18,86 @@
1618
"python-common",
1719
"latex",
1820
"public-licenses",
19-
"softwareTerm",
20-
"custom-dictionary"
21+
"softwareTerm"
2122
],
2223
// words - list of words to be always considered correct
2324
"words": [
25+
"addoption",
26+
"addopts",
2427
"Attribs",
2528
"Battlecharged",
2629
"codemirror",
30+
"compatiblelicenses",
31+
"creativecommons",
32+
"datadir",
2733
"delim",
2834
"Descrip",
35+
"docstrings",
36+
"dofa",
37+
"dotenv",
38+
"Edtech",
2939
"Erdania",
3040
"excepthook",
41+
"fontawesome",
42+
"Gameplay",
43+
"ipykernel",
44+
"ipynb",
3145
"isort",
46+
"jupyterlab",
47+
"jupytext",
3248
"kernelspec",
3349
"levelname",
3450
"manip",
3551
"markdownlint",
52+
"minversion",
53+
"mkdocs",
54+
"mkdocstrings",
55+
"mult",
3656
"nbconvert",
3757
"nbformat",
58+
"noopener",
59+
"posthog",
3860
"premade",
3961
"Premade",
4062
"premades",
4163
"Prereq",
4264
"Prereqs",
65+
"purp",
4366
"pydot",
67+
"pytests",
4468
"reflavoring",
4569
"remixable",
70+
"respec",
4671
"roleplay",
4772
"Roleplay",
4873
"ruleset",
4974
"Scrying",
5075
"Shortbow",
5176
"Shortsword",
77+
"sidenav",
78+
"sublicensable",
79+
"testpaths",
80+
"Thadius",
81+
"THEGAME",
82+
"townsperson",
5283
"TTRPG",
5384
"TTRPGs",
5485
"Vuln",
5586
"Vulny",
5687
"Vulnys",
57-
"workshopped"
88+
"waivable",
89+
"workshopped",
90+
"Xena",
91+
"yamls"
5892
],
5993
// flagWords - list of words to be always considered incorrect
6094
// This is useful for offensive words and common spelling errors.
61-
// For example "hte" should be "the"
62-
"flagWords": [
63-
"hte"
64-
]
95+
"flagWords": [],
96+
"ignorePaths": [
97+
"**/docs/site",
98+
".git",
99+
"automation.egg-info",
100+
"__pycache__"
101+
],
102+
"enabled": true
65103
}

LICENSE

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ Licensor grants You such rights in consideration of benefits the
7070
Licensor receives from making the Licensed Material available under
7171
these terms and conditions.
7272

73-
7473
Section 1 -- Definitions.
7574

7675
a. Adapted Material means material subject to Copyright and Similar
@@ -150,7 +149,6 @@ Section 1 -- Definitions.
150149
n. You means the individual or entity exercising the Licensed Rights
151150
under this Public License. Your has a corresponding meaning.
152151

153-
154152
Section 2 -- Scope.
155153

156154
a. License grant.
@@ -236,7 +234,6 @@ Section 2 -- Scope.
236234
the Licensed Material is used other than for NonCommercial
237235
purposes.
238236

239-
240237
Section 3 -- License Conditions.
241238

242239
Your exercise of the Licensed Rights is expressly made subject to the
@@ -302,7 +299,6 @@ following conditions.
302299
Measures to, Adapted Material that restrict exercise of the
303300
rights granted under the Adapter's License You apply.
304301

305-
306302
Section 4 -- Sui Generis Database Rights.
307303

308304
Where the Licensed Rights include Sui Generis Database Rights that
@@ -326,7 +322,6 @@ For the avoidance of doubt, this Section 4 supplements and does not
326322
replace Your obligations under this Public License where the Licensed
327323
Rights include other Copyright and Similar Rights.
328324

329-
330325
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
331326

332327
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
@@ -355,7 +350,6 @@ Section 5 -- Disclaimer of Warranties and Limitation of Liability.
355350
possible, most closely approximates an absolute disclaimer and
356351
waiver of all liability.
357352

358-
359353
Section 6 -- Term and Termination.
360354

361355
a. This Public License applies for the term of the Copyright and
@@ -384,7 +378,6 @@ Section 6 -- Term and Termination.
384378
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
385379
License.
386380

387-
388381
Section 7 -- Other Terms and Conditions.
389382

390383
a. The Licensor shall not be bound by any additional or different
@@ -394,7 +387,6 @@ Section 7 -- Other Terms and Conditions.
394387
Licensed Material not stated herein are separate from and
395388
independent of the terms and conditions of this Public License.
396389

397-
398390
Section 8 -- Interpretation.
399391

400392
a. For the avoidance of doubt, this Public License does not, and

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ about how to play.
2626
3. **Running Code**. The `environment.yaml` file specifies a
2727
[Conda](https://docs.conda.io/en/latest/) environment that will allow you to run all
2828
code and generate documentation. `mkdocs` will allow you to see what the docs site
29-
looks like before commiting by visiting `localhost:8000`
29+
looks like before committing by visiting `localhost:8000`
3030

3131
```console
3232
conda env create -f environment.yaml # Generate conda environment
@@ -49,7 +49,7 @@ The following VS Code extensions have been used to support development...
4949
- [GitHub](https://github.com/stkb/Rewrap/)
5050
3. CSpell: Allows custom dictionaries on spell-check.
5151
- [Extension](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker)
52-
- [GithHub](https://github.com/streetsidesoftware/vscode-spell-checker)
52+
- [GitHub](https://github.com/streetsidesoftware/vscode-spell-checker)
5353
- Config: `.cspell.json`
5454
4. Black Formatter: Supports code uniformity.
5555
- [Extension](https://marketplace.visualstudio.com/items?itemName=ms-python.black-formatter)

automation/_input/04_Powers_SAMPLE.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
Inorganic:
2+
Category:
3+
- Roleplay
4+
- Society
5+
Description: You were not born, but instead created. You are not a slave to the bodily needs of the rest, but may instead be called to a prescribed purpose.
6+
Mechanic:
7+
- You do not need to breathe, eat or sleep (but still rest to recover Health/Power Points). Choose one of the following when you take this Vulnerability
8+
- Your creator or society at large consider you to have a function that you do not wish to pursue, such as a dangerous and laborious profession.
9+
- You require a rare form of fuel that is difficult to obtain and are rendered catatonic without regular access. Work with your GM to see what makes sense for your character in the setting.
10+
Type: Vulny
11+
XP: -2
12+
113
Destructive Beam:
214
Type: Major
315
Category: Magic

automation/simulator/deck.py

Lines changed: 52 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
# Intial draft adapted from https://github.com/wynand1004/Projects by @TokyoEdtech
1+
# Initial draft adapted from https://github.com/wynand1004/Projects by @TokyoEdtech
22

33
import random
4-
from typing import Union
54

65
from ..utils import logger
76

@@ -19,6 +18,8 @@ class Card(object):
1918
Attributes:
2019
suit (str): one of [D,C,H,S,R,B] for Diamond, Club, Heart, Spade, Red, Black
2120
val (str): one of [A, K, Q, J, T] for Ace to Ten. Or 2 to 9.
21+
val_number (int): integer corresponding to above value
22+
color (str): either R or B for red or black
2223
"""
2324

2425
def __init__(self, suit, val=" "):
@@ -159,11 +160,15 @@ def __repr__(self):
159160
output += f"Discards: {len(self.discards):02d}\n"
160161
return output
161162

162-
def shuffle(self, limit=None):
163+
def shuffle(self, limit: int = None):
163164
"""Shuffle N from discard to deck
164165
165-
If limit provided, only shuffle those from discard.
166-
If no limit, reshuffle all discarded. Add jokers back to hand.
166+
If limit provided, only shuffle those from discard. If no limit, reshuffle all
167+
discarded. Add jokers back to hand.
168+
169+
Args:
170+
limit (int, optional): Number of cards to shuffle back into deck. Defaults
171+
to None.
167172
"""
168173
random.shuffle(self.discards)
169174
if not limit:
@@ -176,15 +181,26 @@ def shuffle(self, limit=None):
176181
self.draw_TC()
177182

178183
@property
179-
def TC(self):
184+
def TC(self) -> Card:
185+
"""Target card
186+
187+
Returns:
188+
Card: Current Target Card from deck. Not applicable to GM decks.
189+
"""
180190
if not self._TC and self._use_TC:
181191
self.draw_TC
182192
return self._TC
183193

184194
def draw_TC(self):
195+
"""Draw a new target card"""
185196
self._TC = self.draw()
186197

187-
def draw(self) -> Card:
198+
def draw(self) -> Card | None:
199+
"""Draw a card, if available. Otherwise returns None.
200+
201+
Returns:
202+
Card: _description_
203+
"""
188204
"""Draw a card. If any available, return card"""
189205
if len(self.cards) == 0 and self._use_TC:
190206
logger.warning("No cards available in deck.")
@@ -200,12 +216,21 @@ def draw(self) -> Card:
200216

201217
def check_by_skill(self, **kwargs):
202218
if self._use_TC:
203-
raise TypeError("check_by_skill method envoked on a non-GM deck")
219+
raise TypeError("check_by_skill method invoked on a non-GM deck")
204220
kwargs.pop("skill", None)
205221
return self.check(**kwargs)
206222

207-
def discard(self, n, return_string=False, **_):
208-
"""Draw n cards, return none. Discard/hand as normal"""
223+
def discard(self, n: int, return_string=False, **_) -> str | None:
224+
"""Draw n cards, return none. Discard/hand as normal
225+
226+
Args:
227+
n (int): Number of cards to discard. If "all", uses discards all remaining.
228+
return_string (bool, optional): Return a string reflecting result. Defaults
229+
to False.
230+
231+
Returns:
232+
str | None: If return_string, report "Drew X"
233+
""" """"""
209234
if n == "all":
210235
n = len(self.cards)
211236

@@ -216,8 +241,11 @@ def discard(self, n, return_string=False, **_):
216241
if return_string:
217242
return f"Drew {draws}"
218243

219-
def exchange_fate(self, return_string=False):
220-
"""Move fate card from hand. If Ace, add to discard"""
244+
def exchange_fate(self, return_string=False) -> str | None:
245+
"""Move fate card from hand. If Ace, add to discard
246+
247+
Args:
248+
return_string (bool, optional): Default to False"""
221249
if len(self.hand) == 0:
222250
result = "No cards available to exchange"
223251
else:
@@ -231,7 +259,7 @@ def exchange_fate(self, return_string=False):
231259

232260
logger.info(result)
233261

234-
def _basic_check(self, TC: Card, DR: int) -> Union[None, int]:
262+
def _basic_check(self, TC: Card, DR: int) -> None | int:
235263
"""Return string corresponding to check 'Hit/Miss/Color/Suit' etc
236264
237265
Args:
@@ -268,21 +296,29 @@ def check(
268296
return_val: bool = False,
269297
return_string: bool = False,
270298
verbose=True,
271-
) -> Union[None, int]:
299+
) -> tuple[int, str] | str:
272300
"""Log string corresponding to check 'Hit/Miss/Color/Suit' etc
273301
274302
Args:
275303
TC (Card): Target card
276-
TR: (int): Target Range
304+
DR: (int): Target Range
277305
mod (int): TR modifier
278306
upper_lower (str): 'upper' or 'lower' Hand ('u' or 'l'). Default neither.
279307
draw_n (int): How many to draw. If upper/lower, default 2. Otherwise 1.
280308
upper_lower_int (int): Instead of passing upper_lower and draw_n, use
281309
positive/negative for upper/lower with int of draw_n -1.
282310
for example, -1 for draw 2 lower
283311
draw_all (bool): If upper hand, draw all before stopping. Default false.
284-
return_val (bool): Return the string. Default False.
312+
return_val (bool): Return the integer of the result. Default False.
313+
return_string (bool): Return the string describing what happened. Default
314+
False.
315+
verbose (bool): Log the result string as a debug item
316+
317+
Returns:
318+
tuple | str: If return_string, returns a tuple containing the result as a
319+
string, followed by the result value. If return_val, only integer result.
285320
"""
321+
286322
DR = max(0, abs(DR) + mod) # Apply mod to non-negative TR
287323
if upper_lower_int:
288324
upper_lower = (

automation/simulator/encounter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def sim_epic_event(
156156
Args:
157157
TC: target card. Default draw from gm_deck
158158
participants: list of those involved on a TC. Default all PCs
159-
skill: Type of check for each participant in particpant order. Default 0 mod
159+
skill: Type of check for each participant in participant order. Default 0 mod
160160
e.g., participants=[PC1, PC2], skill=['STR','Finesse'].
161161
If same for all, provide as string
162162
successes_needed: N suited hits before end. Default 1

automation/simulator/player.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def save(self, DR: int = 3, attrib="None", **kwargs):
182182
TC=self.TC, DR=DR, mod=getattr(self.Attribs, attrib, 0), **new_kwargs
183183
)
184184

185-
# NOTE: drawlog doesn't know if had options
185+
# NOTE: draw_log doesn't know if had options
186186
draw_log.info(
187187
[
188188
self.id,

automation/templates/powers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def __init__(self, input_files="04_Powers_SAMPLE.yaml", limit_types: list = None
5656
input_files = [
5757
file
5858
for file in ensure_list(ambiguous_item=input_files)
59-
if "ower" in file.lower() or "vuln" in file.lower()
59+
if "power" in file.lower() or "vuln" in file.lower()
6060
]
6161
super().__init__(input_files=input_files)
6262
self._limit_types = limit_types or list_power_types

automation/templates/yaml_spec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def as_dict(self):
117117

118118
@abstractmethod
119119
def categories(self) -> dict:
120-
"""{(heirarchy tuple): [List of names]} dict"""
120+
"""{(hierarchy tuple): [List of names]} dict"""
121121
pass
122122

123123
@property

0 commit comments

Comments
 (0)