Skip to content

Commit

Permalink
Merge pull request #575 from open5e/574-api-v2-some-magic-items-marke…
Browse files Browse the repository at this point in the history
…d-as-non-magical-in-items-data

574 api v2 some magic items marked as non magical in items data
  • Loading branch information
augustjohnson authored Oct 18, 2024
2 parents a7d9c91 + 3fd0ee0 commit c6588fd
Show file tree
Hide file tree
Showing 12 changed files with 9,819 additions and 2,904 deletions.
10 changes: 10 additions & 0 deletions api_v2/models/armor.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@ class Armor(HasName, FromDocument):
null=True,
help_text='Integer representing the dexterity modifier cap.')

@property
def category(self):
category = 'heavy'
if self.ac_add_dexmod:
category= 'light'
if self.ac_cap_dexmod:
category= 'medium'
return category


@property
def ac_display(self):
"""Display text for armor class."""
Expand Down
1 change: 1 addition & 0 deletions api_v2/serializers/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
class ArmorSerializer(GameContentSerializer):
key = serializers.ReadOnlyField()
ac_display = serializers.ReadOnlyField()
category = serializers.ReadOnlyField()

class Meta:
model = models.Armor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"ac_base": 17,
"ac_cap_dexmod": null,
"ac_display": "17",
"category": "heavy",
"document": "http://localhost:8000/v2/documents/srd/",
"grants_stealth_disadvantage": true,
"key": "srd_splint",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"ac_base": 17,
"ac_cap_dexmod": null,
"ac_display": "17",
"category": "heavy",
"document": "http://localhost:8000/v2/documents/srd/",
"grants_stealth_disadvantage": true,
"key": "srd_splint",
Expand All @@ -14,7 +15,10 @@
"armor_class": 0,
"category": "http://localhost:8000/v2/itemcategories/armor/",
"cost": "200.00",
"damage_immunities": [],
"damage_immunities": [
"http://localhost:8000/v2/damagetypes/poison/",
"http://localhost:8000/v2/damagetypes/psychic/"
],
"damage_resistances": [],
"damage_vulnerabilities": [],
"desc": "This armor is made of narrow vertical strips of metal riveted to a backing of leather that is worn over cloth padding. Flexible chain mail protects the joints.",
Expand Down
2,961 changes: 2,192 additions & 769 deletions api_v2/tests/responses/TestObjects.test_item_category_example.approved.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
"armor_class": 0,
"category": "http://localhost:8000/v2/itemcategories/wondrous-item/",
"cost": "0.00",
"damage_immunities": [],
"damage_immunities": [
"http://localhost:8000/v2/damagetypes/poison/",
"http://localhost:8000/v2/damagetypes/psychic/"
],
"damage_resistances": [],
"damage_vulnerabilities": [],
"desc": "This item first appears to be a Large sealed iron barrel weighing 500 pounds. The barrel has a hidden catch, which can be found with a successful DC 20 Intelligence (Investigation) check. Releasing the catch unlocks a hatch at one end of the barrel, allowing two Medium or smaller creatures to crawl inside. Ten levers are set in a row at the far end, each in a neutral position, able to move either up or down. When certain levers are used, the apparatus transforms to resemble a giant lobster.\r\n\r\nThe apparatus of the Crab is a Large object with the following statistics:\r\n\r\n**Armor Class:** 20\r\n\r\n**Hit Points:** 200\r\n\r\n**Speed:** 30 ft., swim 30 ft. (or 0 ft. for both if the legs and tail aren't extended)\r\n\r\n**Damage Immunities:** poison, psychic\r\n\r\nTo be used as a vehicle, the apparatus requires one pilot. While the apparatus's hatch is closed, the compartment is airtight and watertight. The compartment holds enough air for 10 hours of breathing, divided by the number of breathing creatures inside.\r\n\r\nThe apparatus floats on water. It can also go underwater to a depth of 900 feet. Below that, the vehicle takes 2d6 bludgeoning damage per minute from pressure.\r\n\r\nA creature in the compartment can use an action to move as many as two of the apparatus's levers up or down. After each use, a lever goes back to its neutral position. Each lever, from left to right, functions as shown in the Apparatus of the Crab Levers table.\r\n\r\n**Apparatus of the Crab Levers (table)**\r\n\r\n| Lever | Up | Down |\r\n|-------|----------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------|\r\n| 1 | Legs and tail extend, allowing the apparatus to walk and swim. | Legs and tail retract, reducing the apparatus's speed to 0 and making it unable to benefit from bonuses to speed. |\r\n| 2 | Forward window shutter opens. | Forward window shutter closes. |\r\n| 3 | Side window shutters open (two per side). | Side window shutters close (two per side). |\r\n| 4 | Two claws extend from the front sides of the apparatus. | The claws retract. |\r\n| 5 | Each extended claw makes the following melee weapon attack: +8 to hit, reach 5 ft., one target. Hit: 7 (2d6) bludgeoning damage. | Each extended claw makes the following melee weapon attack: +8 to hit, reach 5 ft., one target. Hit: The target is grappled (escape DC 15). |\r\n| 6 | The apparatus walks or swims forward. | The apparatus walks or swims backward. |\r\n| 7 | The apparatus turns 90 degrees left. | The apparatus turns 90 degrees right. |\r\n| 8 | Eyelike fixtures emit bright light in a 30-foot radius and dim light for an additional 30 feet. | The light turns off. |\r\n| 9 | The apparatus sinks as much as 20 feet in liquid. | The apparatus rises up to 20 feet in liquid. |\r\n| 10 | The rear hatch unseals and opens. | The rear hatch closes and seals. |",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
"armor_class": 0,
"category": "http://localhost:8000/v2/itemcategories/weapon/",
"cost": "10.00",
"damage_immunities": [],
"damage_immunities": [
"http://localhost:8000/v2/damagetypes/poison/",
"http://localhost:8000/v2/damagetypes/psychic/"
],
"damage_resistances": [],
"damage_vulnerabilities": [],
"desc": "A short sword.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
"armor_class": 0,
"category": "http://localhost:8000/v2/itemcategories/weapon/",
"cost": "50.00",
"damage_immunities": [],
"damage_immunities": [
"http://localhost:8000/v2/damagetypes/poison/",
"http://localhost:8000/v2/damagetypes/psychic/"
],
"damage_resistances": [],
"damage_vulnerabilities": [],
"desc": "A longbow.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
"armor_class": 0,
"category": "http://localhost:8000/v2/itemcategories/adventuring-gear/",
"cost": "10.00",
"damage_immunities": [],
"damage_immunities": [
"http://localhost:8000/v2/damagetypes/poison/",
"http://localhost:8000/v2/damagetypes/psychic/"
],
"damage_resistances": [],
"damage_vulnerabilities": [],
"desc": "Can be used as an arcane focus.",
Expand All @@ -31,7 +34,10 @@
"armor_class": 0,
"category": "http://localhost:8000/v2/itemcategories/adventuring-gear/",
"cost": "20.00",
"damage_immunities": [],
"damage_immunities": [
"http://localhost:8000/v2/damagetypes/poison/",
"http://localhost:8000/v2/damagetypes/psychic/"
],
"damage_resistances": [],
"damage_vulnerabilities": [],
"desc": "Can be used as an Arcane Focus.",
Expand All @@ -55,7 +61,10 @@
"armor_class": 0,
"category": "http://localhost:8000/v2/itemcategories/rod/",
"cost": "10.00",
"damage_immunities": [],
"damage_immunities": [
"http://localhost:8000/v2/damagetypes/poison/",
"http://localhost:8000/v2/damagetypes/psychic/"
],
"damage_resistances": [],
"damage_vulnerabilities": [],
"desc": "Can be used as an arcane focus.",
Expand All @@ -79,7 +88,10 @@
"armor_class": 0,
"category": "http://localhost:8000/v2/itemcategories/staff/",
"cost": "5.00",
"damage_immunities": [],
"damage_immunities": [
"http://localhost:8000/v2/damagetypes/poison/",
"http://localhost:8000/v2/damagetypes/psychic/"
],
"damage_resistances": [],
"damage_vulnerabilities": [],
"desc": "Can be used as an arcane focus.",
Expand Down Expand Up @@ -135,7 +147,10 @@
"armor_class": 0,
"category": "http://localhost:8000/v2/itemcategories/wand/",
"cost": "10.00",
"damage_immunities": [],
"damage_immunities": [
"http://localhost:8000/v2/damagetypes/poison/",
"http://localhost:8000/v2/damagetypes/psychic/"
],
"damage_resistances": [],
"damage_vulnerabilities": [],
"desc": "Can be used as an arcane focus.",
Expand Down
Loading

0 comments on commit c6588fd

Please sign in to comment.