Skip to content
Open
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
14 changes: 12 additions & 2 deletions api_v2/serializers/background.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,26 @@
from .document import DocumentSummarySerializer

class BackgroundBenefitSerializer(GameContentSerializer):
# crossreferences are serialized in GameContentSerializer. This delegates to parent implementation
crossreferences = serializers.SerializerMethodField(method_name='get_crossreferences_data')
def get_crossreferences_data(self, obj):
return self.get_crossreferences(obj)

class Meta:
model = models.BackgroundBenefit
fields = ['name','desc','type']
fields = [
'name',
'desc',
'type',
'crossreferences'
]


class BackgroundSerializer(GameContentSerializer):
key = serializers.ReadOnlyField()
benefits = BackgroundBenefitSerializer(many=True)
document = DocumentSummarySerializer()

class Meta:
model = models.Background
fields = '__all__'
6 changes: 6 additions & 0 deletions api_v2/serializers/characterclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ class Meta:
class ClassFeatureSerializer(GameContentSerializer):
key = serializers.ReadOnlyField()
feature_items = ClassFeaturePrefetchSerializer(many=True, read_only=True)

# crossreferences are serialized on GameContentSerializer. This delegates to parent implementation
crossreferences = serializers.SerializerMethodField(method_name='get_crossreferences_data')
def get_crossreferences_data(self, obj):
return self.get_crossreferences(obj)

def to_representation(self, instance):
"""
Expand Down Expand Up @@ -65,6 +70,7 @@ class Meta:
'key',
'name',
'desc',
'crossreferences',
'feature_type',
'feature_items'
]
Expand Down
6 changes: 6 additions & 0 deletions api_v2/serializers/creature.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,17 @@ class CreatureActionSerializer(GameContentSerializer):
attacks = CreatureActionAttackSerializer(many=True, read_only=True)
usage_limits = serializers.SerializerMethodField()

# crossreferences are serialized on GameContentSerializer. This delegates to parent implementation
crossreferences = serializers.SerializerMethodField(method_name='get_crossreferences_data')
def get_crossreferences_data(self, obj):
return self.get_crossreferences(obj)

class Meta:
model = models.CreatureAction
fields = [
'name',
'desc',
'crossreferences',
'attacks',
'action_type',
'order_in_statblock',
Expand Down
8 changes: 6 additions & 2 deletions api_v2/serializers/species.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@
from .document import DocumentSummarySerializer

class SpeciesTraitSerializer(GameContentSerializer):

# crossreferences are serialized on GameContentSerializer. This delegates to parent implementation
crossreferences = serializers.SerializerMethodField(method_name='get_crossreferences_data')
def get_crossreferences_data(self, obj):
return self.get_crossreferences(obj)

class Meta:
model = models.SpeciesTrait
fields = ['name', 'desc', 'type', 'order']
fields = ['name', 'desc', 'type', 'order', 'crossreferences']


class SpeciesSerializer(GameContentSerializer):
Expand Down
2 changes: 1 addition & 1 deletion api_v2/serializers/spell.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class SpellSerializer(GameContentSerializer):

range_unit = serializers.SerializerMethodField()
shape_size_unit = serializers.SerializerMethodField()

# todo: model typed as any
@extend_schema_field(OpenApiTypes.STR)
def get_range_unit(self, spell):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,41 @@
{
"benefits": [
{
"crossreferences": {
"to": []
},
"desc": "A holy symbol (a gift to you when you entered the priesthood), a prayer book or prayer wheel, 5 sticks of incense, vestments, a set of common clothes, and a pouch containing 15 gp",
"name": "Equipment",
"type": "equipment"
},
{
"crossreferences": {
"to": []
},
"desc": "Two of your choice",
"name": "Languages",
"type": "language"
},
{
"crossreferences": {
"to": []
},
"desc": "As an acolyte, you command the respect of those who share your faith, and you can perform the religious ceremonies of your deity. You and your adventuring companions can expect to receive free healing and care at a temple, shrine, or other established presence of your faith, though you must provide any material components needed for spells. Those who share your religion will support you (but only you) at a modest lifestyle.\r\n\r\nYou might also have ties to a specific temple dedicated to your chosen deity or pantheon, and you have a residence there. This could be the temple where you used to serve, if you remain on good terms with it, or a temple where you have found a new home. While near your temple, you can call upon the priests for assistance, provided the assistance you ask for is not hazardous and you remain in good standing with your temple.",
"name": "Shelter of the Faithful",
"type": "feature"
},
{
"crossreferences": {
"to": []
},
"desc": "Insight, Religion",
"name": "Skill Proficiencies",
"type": "skill_proficiency"
},
{
"crossreferences": {
"to": []
},
"desc": "Acolytes are shaped by their experience in temples or other religious communities. Their study of the history and tenets of their faith and their relationships to temples, shrines, or hierarchies affect their mannerisms and ideals. Their flaws might be some hidden hypocrisy or heretical idea, or an ideal or bond taken to an extreme.\r\n\r\n| d8 | Personality Trait |\r\n|---|---|\r\n| 1 | I idolize a particular hero of my faith, and constantly refer to that person's deeds and example. |\r\n| 2 | I can find common ground between the fiercest enemies, empathizing with them and always working toward peace. |\r\n| 3 | I see omens in every event and action. The gods try to speak to us, we just need to listen |\r\n| 4 | Nothing can shake my optimistic attitude. |\r\n| 5 | I quote (or misquote) sacred texts and proverbs in almost every situation. |\r\n| 6 | I am tolerant (or intolerant) of other faiths and respect (or condemn) the worship of other gods. |\r\n| 7 | I've enjoyed fine food, drink, and high society among my temple's elite. Rough living grates on me. |\r\n| 8 | I've spent so long in the temple that I have little practical experience dealing with people in the outside world. |\r\n\r\n| d6 | Ideal |\r\n|---|---|\r\n| 1 | Tradition. The ancient traditions of worship and sacrifice must be preserved and upheld. (Lawful) |\r\n| 2 | Charity. I always try to help those in need, no matter what the personal cost. (Good) |\r\n| 3 | Change. We must help bring about the changes the gods are constantly working in the world. (Chaotic) |\r\n| 4 | Power. I hope to one day rise to the top of my faith's religious hierarchy. (Lawful) |\r\n| 5 | Faith. I trust that my deity will guide my actions. I have faith that if I work hard, things will go well. (Lawful) |\r\n| 6 | Aspiration. I seek to prove myself worthy of my god's favor by matching my actions against his or her teachings. (Any) |\r\n\r\n| d6 | Bond |\r\n|---|---|\r\n| 1 | I would die to recover an ancient relic of my faith that was lost long ago. |\r\n| 2 | I will someday get revenge on the corrupt temple hierarchy who branded me a heretic. |\r\n| 3 | I owe my life to the priest who took me in when my parents died. |\r\n| 4 | Everything I do is for the common people. |\r\n| 5 | I will do anything to protect the temple where I served. |\r\n| 6 | I seek to preserve a sacred text that my enemies consider heretical and seek to destroy. |\r\n\r\n| d6 | Flaw |\r\n|---|---|\r\n| 1 | I judge others harshly, and myself even more severely. |\r\n| 2 | I put too much trust in those who wield power within my temple's hierarchy. |\r\n| 3 | My piety sometimes leads me to blindly trust those that profess faith in my god. |\r\n| 4 | I am inflexible in my thinking. |\r\n| 5 | I am suspicious of strangers and expect the worst of them. |\r\n| 6 | Once I pick a goal, I become obsessed with it to the detriment of everything else in my life. |",
"name": "Suggested Characteristics",
"type": "suggested_characteristics"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
},
"features": [
{
"crossreferences": {
"to": []
},
"data_for_class_table": [],
"desc": "When you reach 4th level, and again at 8th, 12th, 16th, and 19th level, you can increase one ability score of your choice by 2, or you can increase two ability scores of your choice by 1. As normal, you can\u2019t increase an ability score above 20 using this feature.",
"feature_type": "CLASS_LEVEL_FEATURE",
Expand Down Expand Up @@ -50,6 +53,9 @@
"name": "Ability Score Improvement"
},
{
"crossreferences": {
"to": []
},
"data_for_class_table": [],
"desc": "Beginning at 9th level, you can roll one additional weapon damage die when determining the extra damage for a critical hit with a melee attack.\r\n\r\nThis increases to two additional dice at 13th level and three additional dice at 17th level.",
"feature_type": "CLASS_LEVEL_FEATURE",
Expand All @@ -71,6 +77,9 @@
"name": "Brutal Critical"
},
{
"crossreferences": {
"to": []
},
"data_for_class_table": [],
"desc": "At 2nd level, you gain an uncanny sense of when things nearby aren\u2019t as they should be, giving you an edge when you dodge away from danger.\r\n\r\nYou have advantage on Dexterity saving throws against effects that you can see, such as traps and spells. To gain this benefit, you can\u2019t be blinded, deafened, or incapacitated.",
"feature_type": "CLASS_LEVEL_FEATURE",
Expand All @@ -84,6 +93,9 @@
"name": "Danger Sense"
},
{
"crossreferences": {
"to": []
},
"data_for_class_table": [],
"desc": "You start with the following equipment, in addition to the equipment granted by your background:\r\n* (*a*) a greataxe or (*b*) any martial melee weapon\r\n* (*a*) two handaxes or (*b*) any simple weapon\r\n* An explorer\u2019s pack and four javelins",
"feature_type": "STARTING_EQUIPMENT",
Expand All @@ -92,6 +104,9 @@
"name": "Equipment"
},
{
"crossreferences": {
"to": []
},
"data_for_class_table": [],
"desc": "Beginning at 5th level, you can attack twice, instead of once, whenever you take the Attack action on your turn.",
"feature_type": "CLASS_LEVEL_FEATURE",
Expand All @@ -105,6 +120,9 @@
"name": "Extra Attack"
},
{
"crossreferences": {
"to": []
},
"data_for_class_table": [],
"desc": "Starting at 5th level, your speed increases by 10 feet while you aren\u2019t wearing heavy armor.",
"feature_type": "CLASS_LEVEL_FEATURE",
Expand All @@ -118,6 +136,9 @@
"name": "Fast Movement"
},
{
"crossreferences": {
"to": []
},
"data_for_class_table": [],
"desc": "By 7th level, your instincts are so honed that you have advantage on initiative rolls.\r\n\r\nAdditionally, if you are surprised at the beginning of combat and aren\u2019t incapacitated, you can act normally on your first turn, but only if you enter your rage before doing anything else on that turn.",
"feature_type": "CLASS_LEVEL_FEATURE",
Expand All @@ -131,6 +152,9 @@
"name": "Feral Instinct"
},
{
"crossreferences": {
"to": []
},
"data_for_class_table": [],
"desc": "Beginning at 18th level, if your total for a Strength check is less than your Strength score, you can use that score in place of the total.",
"feature_type": "CLASS_LEVEL_FEATURE",
Expand All @@ -144,6 +168,9 @@
"name": "Indomitable Might"
},
{
"crossreferences": {
"to": []
},
"data_for_class_table": [],
"desc": "Beginning at 15th level, your rage is so fierce that it ends early only if you fall unconscious or if you choose to end it.",
"feature_type": "CLASS_LEVEL_FEATURE",
Expand All @@ -157,6 +184,9 @@
"name": "Persistent Rage"
},
{
"crossreferences": {
"to": []
},
"data_for_class_table": [],
"desc": "At 20th level, you embody the power of the wilds. Your Strength and Constitution scores increase by 4. Your maximum for those scores is now 24.",
"feature_type": "CLASS_LEVEL_FEATURE",
Expand All @@ -170,6 +200,9 @@
"name": "Primal Champion"
},
{
"crossreferences": {
"to": []
},
"data_for_class_table": [],
"desc": "At 3rd level, you choose a path that shapes the nature of your rage. Choose the Path of the Berserker or the Path of the Totem Warrior, both detailed at the end of the class description. Your choice grants you features at 3rd level and again at 6th, 10th, and 14th levels.",
"feature_type": "CLASS_LEVEL_FEATURE",
Expand All @@ -183,6 +216,9 @@
"name": "Primal Path"
},
{
"crossreferences": {
"to": []
},
"data_for_class_table": [],
"desc": "**Armor:** Light armor, medium armor, shields\r\n**Weapons:** Simple weapons, martial weapons\r\n**Tools:** None\r\n**Saving Throws:** Strength, Constitution\r\n**Skills:** Choose two from Animal Handling, Athletics, Intimidation, Nature, Perception, and Survival",
"feature_type": "PROFICIENCIES",
Expand All @@ -191,6 +227,9 @@
"name": "Proficiencies"
},
{
"crossreferences": {
"to": []
},
"data_for_class_table": [
{
"column_value": "+2",
Expand Down Expand Up @@ -280,6 +319,9 @@
"name": "Proficiency Bonus"
},
{
"crossreferences": {
"to": []
},
"data_for_class_table": [],
"desc": "In battle, you fight with primal ferocity. On your turn, you can enter a rage as a bonus action.\r\n\r\nWhile raging, you gain the following benefits if you aren't wearing heavy armor:\r\n\r\n* You have advantage on Strength checks and Strength saving throws.\r\n* When you make a melee weapon attack using Strength, you gain a bonus to the damage roll that increases as you gain levels as a barbarian, as shown in the Rage Damage column of the Barbarian table.\r\n* You have resistance to bludgeoning, piercing, and slashing damage. \r\n\r\nIf you are able to cast spells, you can't cast them or concentrate on them while raging.\r\n\r\nYour rage lasts for 1 minute. It ends early if you are knocked unconscious or if your turn ends and you haven't attacked a hostile creature since your last turn or taken damage since then. You can also end your rage on your turn as a bonus action.\r\n\r\nOnce you have raged the number of times shown for your barbarian level in the Rages column of the Barbarian table, you must finish a long rest before you can rage again.",
"feature_type": "CLASS_LEVEL_FEATURE",
Expand All @@ -293,6 +335,9 @@
"name": "Rage"
},
{
"crossreferences": {
"to": []
},
"data_for_class_table": [
{
"column_value": "+2",
Expand Down Expand Up @@ -382,6 +427,9 @@
"name": "Rage Damage"
},
{
"crossreferences": {
"to": []
},
"data_for_class_table": [
{
"column_value": "2",
Expand Down Expand Up @@ -471,6 +519,9 @@
"name": "Rages"
},
{
"crossreferences": {
"to": []
},
"data_for_class_table": [],
"desc": "Starting at 2nd level, you can throw aside all concern for defense to attack with fierce desperation. When you make your first attack on your turn, you can decide to attack recklessly. Doing so gives you advantage on melee weapon attack rolls using Strength during this turn, but attack rolls against you have advantage until your next turn.",
"feature_type": "CLASS_LEVEL_FEATURE",
Expand All @@ -484,6 +535,9 @@
"name": "Reckless Attack"
},
{
"crossreferences": {
"to": []
},
"data_for_class_table": [],
"desc": "Starting at 11th level, your rage can keep you fighting despite grievous wounds. If you drop to 0 hit points while you\u2019re raging and don\u2019t die outright, you can make a DC 10 Constitution saving throw. If you succeed, you drop to 1 hit point instead.\r\n\r\nEach time you use this feature after the first, the DC increases by 5. When you finish a short or long rest, the DC resets to 10.",
"feature_type": "CLASS_LEVEL_FEATURE",
Expand All @@ -497,6 +551,9 @@
"name": "Relentless Rage"
},
{
"crossreferences": {
"to": []
},
"data_for_class_table": [],
"desc": "While you are not wearing any armor, your Armor Class equals 10 + your Dexterity modifier + your Constitution modifier. You can use a shield and still gain this benefit.",
"feature_type": "CLASS_LEVEL_FEATURE",
Expand Down
Loading
Loading