From 86174b7a2018dc7c1220eeb3df51e10054e5f881 Mon Sep 17 00:00:00 2001 From: feyrkh Date: Sun, 29 Sep 2024 05:18:10 -0500 Subject: [PATCH 1/2] Typo fix in evadventure/utils.py Incorrectly uses attack_type for both attack and defense in get_obj_stats --- evennia/contrib/tutorials/evadventure/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evennia/contrib/tutorials/evadventure/utils.py b/evennia/contrib/tutorials/evadventure/utils.py index 25152c236f..34db91b11b 100644 --- a/evennia/contrib/tutorials/evadventure/utils.py +++ b/evennia/contrib/tutorials/evadventure/utils.py @@ -37,7 +37,7 @@ def get_obj_stats(obj, owner=None): carried = f", Worn: [{carried.value}]" if carried else "" attack_type = getattr(obj, "attack_type", None) - defense_type = getattr(obj, "attack_type", None) + defense_type = getattr(obj, "defense_type", None) return _OBJ_STATS.format( key=obj.key, From 321da9b69403f55001f9351bc123cc48cbb43f04 Mon Sep 17 00:00:00 2001 From: feyrkh Date: Sun, 29 Sep 2024 05:23:12 -0500 Subject: [PATCH 2/2] Fix 'defend_type' vs 'defense_type' typos in beginner tutorial --- .../Beginner-Tutorial/Part3/Beginner-Tutorial-Objects.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-Objects.md b/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-Objects.md index 449367eb0f..98330c17f1 100644 --- a/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-Objects.md +++ b/docs/source/Howtos/Beginner-Tutorial/Part3/Beginner-Tutorial-Objects.md @@ -248,7 +248,7 @@ class EvAdventureWeapon(EvAdventureObject): quality = AttributeProperty(3, autocreate=False) attack_type = AttributeProperty(Ability.STR, autocreate=False) - defend_type = AttributeProperty(Ability.ARMOR, autocreate=False) + defense_type = AttributeProperty(Ability.ARMOR, autocreate=False) damage_roll = AttributeProperty("1d6", autocreate=False) @@ -387,7 +387,7 @@ class EvAdventureRuneStone(EvAdventureWeapon, EvAdventureConsumable): quality = AttributeProperty(3, autocreate=False) attack_type = AttributeProperty(Ability.INT, autocreate=False) - defend_type = AttributeProperty(Ability.DEX, autocreate=False) + defense_type = AttributeProperty(Ability.DEX, autocreate=False) damage_roll = AttributeProperty("1d8", autocreate=False) @@ -488,4 +488,4 @@ Well, we just figured out all we need! You can go back and update `get_obj_stats When you change this function you must also update the related unit test - so your existing test becomes a nice way to test your new Objects as well! Add more tests showing the output of feeding different object-types to `get_obj_stats`. -Try it out yourself. If you need help, a finished utility example is found in [evennia/contrib/tutorials/evadventure/utils.py](get_obj_stats). \ No newline at end of file +Try it out yourself. If you need help, a finished utility example is found in [evennia/contrib/tutorials/evadventure/utils.py](get_obj_stats).