Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add raw size field to all races #299

Merged
merged 2 commits into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions api/management/commands/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,8 @@ def import_race(self, race_json, import_spec) -> ImportResult:
i.alignment = race_json["alignment"]
if "size" in race_json:
i.size = race_json["size"]
if "size-raw" in race_json:
i.size_raw = race_json["size-raw"]
if "speed" in race_json:
i.speed_json = json.dumps(
race_json["speed"]
Expand Down
18 changes: 18 additions & 0 deletions api/migrations/0032_race_size_raw.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.2.19 on 2023-07-13 12:50

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('api', '0031_rename_environments_monster_environments_json'),
]

operations = [
migrations.AddField(
model_name='race',
name='size_raw',
field=models.TextField(default='Medium', help_text='Size Category.'),
),
]
2 changes: 2 additions & 0 deletions api/models/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ def asi(self):
help_text='Markdown description of the alignment tendencies of the race.')
size = models.TextField(
help_text='Markdown description of the size category of the race.')
size_raw = models.TextField(
help_text='Size Category.', default="Medium")
speed_json = models.TextField()

def speed(self):
Expand Down
1 change: 1 addition & 0 deletions api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ class Meta:
'age',
'alignment',
'size',
'size_raw',
'speed',
'speed_desc',
'languages',
Expand Down
23 changes: 23 additions & 0 deletions api_v2/migrations/0003_auto_20230713_1250.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 3.2.19 on 2023-07-13 12:50

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('api_v2', '0002_auto_20230618_1534'),
]

operations = [
migrations.AlterField(
model_name='armor',
name='ac_cap_dexmod',
field=models.IntegerField(blank=True, help_text='Integer representing the dexterity modifier cap.', null=True),
),
migrations.AlterField(
model_name='armor',
name='strength_score_required',
field=models.IntegerField(blank=True, help_text='Strength score required to wear the armor without penalty.', null=True),
),
]
9 changes: 9 additions & 0 deletions data/WOTC_5e_SRD_v5.1/races.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"age": "**_Age._** Dwarves mature at the same rate as humans, but they're considered young until they reach the age of 50. On average, they live about 350 years.",
"alignment": "**_Alignment._** Most dwarves are lawful, believing firmly in the benefits of a well-ordered society. They tend toward good as well, with a strong sense of fair play and a belief that everyone deserves to share in the benefits of a just order.",
"size": "**_Size._** Dwarves stand between 4 and 5 feet tall and average about 150 pounds. Your size is Medium.",
"size-raw": "Medium",
"speed": {
"walk": 25
},
Expand Down Expand Up @@ -53,6 +54,7 @@
"age": "**_Age._** Although elves reach physical maturity at about the same age as humans, the elven understanding of adulthood goes beyond physical growth to encompass worldly experience. An elf typically claims adulthood and an adult name around the age of 100 and can live to be 750 years old.",
"alignment": "**_Alignment._** Elves love freedom, variety, and self- expression, so they lean strongly toward the gentler aspects of chaos. They value and protect others' freedom as well as their own, and they are more often good than not. The drow are an exception; their exile has made them vicious and dangerous. Drow are more often evil than not.",
"size": "**_Size._** Elves range from under 5 to over 6 feet tall and have slender builds. Your size is Medium.",
"size-raw": "Medium",
"speed": {
"walk": 30
},
Expand Down Expand Up @@ -92,6 +94,7 @@
"age": "**_Age._** A halfling reaches adulthood at the age of 20 and generally lives into the middle of his or her second century.",
"alignment": "**_Alignment._** Most halflings are lawful good. As a rule, they are good-hearted and kind, hate to see others in pain, and have no tolerance for oppression. They are also very orderly and traditional, leaning heavily on the support of their community and the comfort of their old ways.",
"size": "**_Size._** Halflings average about 3 feet tall and weigh about 40 pounds. Your size is Small.",
"size-raw": "Small",
"speed": {
"walk": 25
},
Expand Down Expand Up @@ -160,6 +163,7 @@
"age": "**_Age._** Humans reach adulthood in their late teens and live less than a century.",
"alignment": "**_Alignment._** Humans tend toward no particular alignment. The best and the worst are found among them.",
"size": "**_Size._** Humans vary widely in height and build, from barely 5 feet to well over 6 feet tall. Regardless of your position in that range, your size is Medium.",
"size-raw": "Medium",
"speed": {
"walk": 30
},
Expand Down Expand Up @@ -187,6 +191,7 @@
"age": "**_Age._** Young dragonborn grow quickly. They walk hours after hatching, attain the size and development of a 10-year-old human child by the age of 3, and reach adulthood by 15. They live to be around 80.",
"alignment": "**_Alignment._** Dragonborn tend to extremes, making a conscious choice for one side or the other in the cosmic war between good and evil. Most dragonborn are good, but those who side with evil can be terrible villains.",
"size": "**_Size._** Dragonborn are taller and heavier than humans, standing well over 6 feet tall and averaging almost 250 pounds. Your size is Medium.",
"size-raw": "Medium",
"speed": {
"walk": 30
},
Expand All @@ -209,6 +214,7 @@
"age": "**_Age._** Gnomes mature at the same rate humans do, and most are expected to settle down into an adult life by around age 40. They can live 350 to almost 500 years.",
"alignment": "**_Alignment._** Gnomes are most often good. Those who tend toward law are sages, engineers, researchers, scholars, investigators, or inventors. Those who tend toward chaos are minstrels, tricksters, wanderers, or fanciful jewelers. Gnomes are good-hearted, and even the tricksters among them are more playful than vicious.",
"size": "**_Size._** Gnomes are between 3 and 4 feet tall and average about 40 pounds. Your size is Small.",
"size-raw": "Small",
"speed": {
"walk": 25
},
Expand Down Expand Up @@ -260,6 +266,7 @@
"age": "**_Age._** Half-elves mature at the same rate humans do and reach adulthood around the age of 20. They live much longer than humans, however, often exceeding 180 years.",
"alignment": "**_Alignment._** Half-elves share the chaotic bent of their elven heritage. They value both personal freedom and creative expression, demonstrating neither love of leaders nor desire for followers. They chafe at rules, resent others' demands, and sometimes prove unreliable, or at least unpredictable.",
"size": "**_Size._** Half-elves are about the same size as humans, ranging from 5 to 6 feet tall. Your size is Medium.",
"size-raw": "Medium",
"speed": {
"walk": 30
},
Expand Down Expand Up @@ -289,6 +296,7 @@
"age": "**_Age._** Half-orcs mature a little faster than humans, reaching adulthood around age 14. They age noticeably faster and rarely live longer than 75 years.",
"alignment": "**_Alignment._** Half-orcs inherit a tendency toward chaos from their orc parents and are not strongly inclined toward good. Half-orcs raised among orcs and willing to live out their lives among them are usually evil.",
"size": "**_Size._** Half-orcs are somewhat larger and bulkier than humans, and they range from 5 to well over 6 feet tall. Your size is Medium.",
"size-raw": "Medium",
"speed": {
"walk": 30
},
Expand Down Expand Up @@ -318,6 +326,7 @@
"age": "**_Age._** Tieflings mature at the same rate as humans but live a few years longer.",
"alignment": "**_Alignment._** Tieflings might not have an innate tendency toward evil, but many of them end up there. Evil or not, an independent nature inclines many tieflings toward a chaotic alignment.",
"size": "**_Size._** Tieflings are about the same size and build as humans. Your size is Medium.",
"size-raw": "Medium",
"speed": {
"walk": 30
},
Expand Down