Skip to content

Commit 66f5997

Browse files
committed
added 'desc' to WeaponPropertySummarySerializer, updated test cases to reflect new shape of API response
1 parent 6709221 commit 66f5997

5 files changed

+9
-1
lines changed

api_v2/serializers/item.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class Meta:
5151
class WeaponPropertySummarySerializer(GameContentSerializer):
5252
class Meta:
5353
model = models.WeaponProperty
54-
fields = ['name', 'type', 'url']
54+
fields = ['name', 'type', 'url', 'desc']
5555

5656
class WeaponPropertyAssignmentSerializer(GameContentSerializer):
5757
property = WeaponPropertySummarySerializer()

api_v2/tests/responses/TestObjects.test_item_melee_weapon_example.approved.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
{
5252
"detail": null,
5353
"property": {
54+
"desc": "When making an attack with a finesse weapon, you use your choice of your Strength or Dexterity modifier for the attack and damage rolls. You must use the same modifier for both rolls.",
5455
"name": "Finesse",
5556
"type": null,
5657
"url": "http://localhost:8000/v2/weaponproperties/srd-2014_finesse-wp/"
@@ -59,6 +60,7 @@
5960
{
6061
"detail": null,
6162
"property": {
63+
"desc": "A light weapon is small and easy to handle, making it ideal for use when fighting with two weapons.",
6264
"name": "Light",
6365
"type": null,
6466
"url": "http://localhost:8000/v2/weaponproperties/srd-2014_light-wp/"

api_v2/tests/responses/TestObjects.test_item_ranged_weapon_example.approved.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
{
5252
"detail": "range 150/600",
5353
"property": {
54+
"desc": "You can use a weapon that has the ammunition property to make a ranged attack only if you have ammunition to fire from the weapon. Each time you attack with the weapon, you expend one piece of ammunition. Drawing the ammunition from a quiver, case, or other container is part of the attack (you need a free hand to load a one-\u00ad\u2010\u2011handed weapon). At the end of the battle, you can recover half your expended ammunition by taking a minute to search the battlefield.\n\nIf you use a weapon that has the ammunition property to make a melee attack, you treat the weapon as an improvised weapon (see \u201cImprovised Weapons\u201d later in the section). A sling must be loaded to deal any damage when used in this way.",
5455
"name": "Ammunition",
5556
"type": null,
5657
"url": "http://localhost:8000/v2/weaponproperties/srd-2014_ammunition-wp/"
@@ -59,6 +60,7 @@
5960
{
6061
"detail": null,
6162
"property": {
63+
"desc": "This weapon requires two hands when you attack with it.",
6264
"name": "Two-Handed",
6365
"type": null,
6466
"url": "http://localhost:8000/v2/weaponproperties/srd-2014_two-handed-wp/"

api_v2/tests/responses/TestObjects.test_weapon_example.approved.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
{
3232
"detail": null,
3333
"property": {
34+
"desc": "When making an attack with a finesse weapon, you use your choice of your Strength or Dexterity modifier for the attack and damage rolls. You must use the same modifier for both rolls.",
3435
"name": "Finesse",
3536
"type": null,
3637
"url": "/v2/weaponproperties/srd-2014_finesse-wp/"
@@ -39,6 +40,7 @@
3940
{
4041
"detail": null,
4142
"property": {
43+
"desc": "A light weapon is small and easy to handle, making it ideal for use when fighting with two weapons.",
4244
"name": "Light",
4345
"type": null,
4446
"url": "/v2/weaponproperties/srd-2014_light-wp/"

api_v2/tests/responses/TestObjects.test_weapon_with_mastery_example.approved.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
{
3232
"detail": null,
3333
"property": {
34+
"desc": "If you hit a creature with this weapon, that creature has Disadvantage on its next attack roll before the start of your next turn.",
3435
"name": "Sap",
3536
"type": "Mastery",
3637
"url": "/v2/weaponproperties/srd-2024_sap-mastery/"
@@ -39,6 +40,7 @@
3940
{
4041
"detail": "1d10",
4142
"property": {
43+
"desc": "A Versatile weapon can be used with one or two hands. A damage value in parentheses appears with the property. The weapon deals that damage when used with two hands to make a melee attack.",
4244
"name": "Versatile",
4345
"type": null,
4446
"url": "/v2/weaponproperties/srd-2024_versatile-wp/"

0 commit comments

Comments
 (0)