Skip to content

Commit

Permalink
removed individual attribute files in place of a single json - update…
Browse files Browse the repository at this point in the history
…d readme
  • Loading branch information
Ludicro committed Dec 10, 2024
1 parent 61d9f1b commit a1eb2d7
Show file tree
Hide file tree
Showing 11 changed files with 185 additions and 192 deletions.
45 changes: 0 additions & 45 deletions Attributes/area_types.txt

This file was deleted.

17 changes: 0 additions & 17 deletions Attributes/conditions.txt

This file was deleted.

15 changes: 0 additions & 15 deletions Attributes/damage_types.txt

This file was deleted.

20 changes: 0 additions & 20 deletions Attributes/duration.txt

This file was deleted.

11 changes: 0 additions & 11 deletions Attributes/levels.txt

This file was deleted.

18 changes: 0 additions & 18 deletions Attributes/range.txt

This file was deleted.

9 changes: 0 additions & 9 deletions Attributes/school.txt

This file was deleted.

158 changes: 158 additions & 0 deletions GlyphEngine/attributes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
{
"levels":
[
"None",
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9"
],
"schools":
[
"None",
"Abjuration",
"Conjuration",
"Divination",
"Enchantment",
"Evocation",
"Illusion",
"Necromancy",
"Transmutation"
],
"durations":
[
"Instantaneous",
"1 hour",
"1 minute",
"1 round",
"10 days",
"10 minutes",
"24 hours",
"30 days",
"7 days",
"6 hours",
"8 hours",
"Special",
"Until dispelled",
"Up to 1 hour",
"Up to 1 minute",
"Up to 1 round",
"Up to 10 minutes",
"Up to 2 hours",
"Up to 24 hours",
"Up to 8 hours"
],
"ranges":
[
"None",
"1 mile",
"10 feet",
"100 feet",
"120 feet",
"150 feet",
"30 feet",
"300 feet",
"5 feet",
"500 feet",
"500 miles",
"60 feet",
"90 feet",
"Self",
"Sight",
"Special",
"Touch",
"Unlimited"
],
"area_types":
[
"None",
"cone (15)",
"cone (30)",
"cone (40)",
"cone (60)",
"cube (1)",
"cube (10)",
"cube (100)",
"cube (15)",
"cube (150)",
"cube (20)",
"cube (200)",
"cube (2500)",
"cube (30)",
"cube (40)",
"cube (40000)",
"cube (5)",
"cube (5280)",
"cylinder (10)",
"cylinder (20)",
"cylinder (40)",
"cylinder (5)",
"cylinder (50)",
"cylinder (60)",
"line (15)",
"line (100)",
"line (50)",
"line (60)",
"line (30)",
"line (90)",
"sphere (10)",
"sphere (100)",
"sphere (15)",
"sphere (20)",
"sphere (30)",
"sphere (360)",
"sphere (40)",
"sphere (5)",
"sphere (60)",
"sphere (26400)",
"square (10)",
"square (20)",
"square (5)",
"square (2500)",
"square (5280)"
],
"damage_types":
[
"None",
"Acid",
"Bludgeoning",
"Cold",
"Fire",
"Force",
"Lightning",
"Necrotic",
"Piercing",
"Poison",
"Psychic",
"Radiant",
"Slashing",
"Thunder",
"Multiple"
],
"conditions":
[
"None",
"Blinded",
"Charmed",
"Deafened",
"Exhaustion",
"Frightened",
"Grappled",
"Incapacitated",
"Invisible",
"Paralyzed",
"Petrified",
"Poisoned",
"Prone",
"Restrained",
"Stunned",
"Unconscious",
"Multiple"
]
}
18 changes: 10 additions & 8 deletions GlyphEngine/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import matplotlib.pyplot as plt
import os
from tqdm.auto import tqdm
import json

cmap = plt.get_cmap('turbo')

Expand Down Expand Up @@ -148,13 +149,15 @@ def draw_spell(level, rang, area, dtype, school, duration, condition,
plt.clf() # Clear the figure before drawing new glyph

# Load attributes
ranges = load_attribute("Attributes/range.txt")
levels = load_attribute("Attributes/levels.txt")
area_types = load_attribute("Attributes/area_types.txt")
dtypes = load_attribute("Attributes/damage_types.txt")
schools = load_attribute("Attributes/school.txt")
durations = load_attribute("Attributes/duration.txt")
conditions = load_attribute("Attributes/conditions.txt")
with open("GlyphEngine/attributes.json", "r") as f:
attributes = json.load(f)
ranges = attributes["ranges"]
levels = attributes["levels"]
area_types = attributes["area_types"]
dtypes = attributes["damage_types"]
schools = attributes["schools"]
durations = attributes["durations"]
conditions = attributes["conditions"]

# Find indices for the attributes and uses lowercases values
i_range = [r.lower() for r in ranges].index(rang.lower())
Expand Down Expand Up @@ -224,4 +227,3 @@ def draw_spell(level, rang, area, dtype, school, duration, condition,

plt.savefig(savename, transparent=False, bbox_inches='tight')
plt.clf()

Loading

0 comments on commit a1eb2d7

Please sign in to comment.