Skip to content

Commit

Permalink
Added base hit dice field to sizes.
Browse files Browse the repository at this point in the history
  • Loading branch information
augustjohnson committed Oct 24, 2024
1 parent 007b847 commit ea81d37
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 8 deletions.
18 changes: 18 additions & 0 deletions api_v2/migrations/0013_size_suggested_hit_dice.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 5.1.2 on 2024-10-24 14:22

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('api_v2', '0012_alter_creature_subcategory'),
]

operations = [
migrations.AddField(
model_name='size',
name='suggested_hit_dice',
field=models.CharField(blank=True, choices=[('D4', 'd4'), ('D6', 'd6'), ('D8', 'd8'), ('D10', 'd10'), ('D12', 'd12'), ('D20', 'd20')], help_text='What kind of die to roll for damage.', max_length=20, null=True),
),
]
4 changes: 3 additions & 1 deletion api_v2/models/size.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.db import models

from .abstracts import HasName
from .abstracts import distance_field, distance_unit_field
from .abstracts import distance_field, distance_unit_field, damage_die_type_field
from .document import FromDocument

class Size(HasName, FromDocument):
Expand All @@ -19,6 +19,8 @@ class Size(HasName, FromDocument):
space_diameter = distance_field()
distance_unit = distance_unit_field()

suggested_hit_dice = damage_die_type_field()

@property
def get_distance_unit(self):
if self.distance_unit is None:
Expand Down
3 changes: 2 additions & 1 deletion data/v2/en-publishing/mmenag/Size.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"document": "mmenag",
"rank": 7,
"space_diameter": 25.0,
"distance_unit": null
"distance_unit": null,
"suggested_hit_dice": "d20"
}
}
]
18 changes: 12 additions & 6 deletions data/v2/wizards-of-the-coast/srd/Size.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"document": "srd",
"rank": 6,
"space_diameter": 20.0,
"distance_unit": null
"distance_unit": null,
"suggested_hit_dice": "d20"
}
},
{
Expand All @@ -18,7 +19,8 @@
"document": "srd",
"rank": 5,
"space_diameter": 15.0,
"distance_unit": null
"distance_unit": null,
"suggested_hit_dice": "d12"
}
},
{
Expand All @@ -29,7 +31,8 @@
"document": "srd",
"rank": 4,
"space_diameter": 10.0,
"distance_unit": null
"distance_unit": null,
"suggested_hit_dice": "d10"
}
},
{
Expand All @@ -40,7 +43,8 @@
"document": "srd",
"rank": 3,
"space_diameter": 5.0,
"distance_unit": null
"distance_unit": null,
"suggested_hit_dice": "d8"
}
},
{
Expand All @@ -51,7 +55,8 @@
"document": "srd",
"rank": 2,
"space_diameter": 5.0,
"distance_unit": null
"distance_unit": null,
"suggested_hit_dice": "d6"
}
},
{
Expand All @@ -62,7 +67,8 @@
"document": "srd",
"rank": 1,
"space_diameter": 2.5,
"distance_unit": null
"distance_unit": null,
"suggested_hit_dice": "d4"
}
}
]

0 comments on commit ea81d37

Please sign in to comment.