Skip to content

Commit

Permalink
Distinguish between racial and class darkvision
Browse files Browse the repository at this point in the history
Characters can have darkvision from both class and racial sources. This
patch distinguishes between these two, so that darkvision gained from a
certain class is classified as having that class as source, and not a
race.
  • Loading branch information
PJBrs committed Jan 20, 2023
1 parent 709d5ab commit 66e38c8
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 24 deletions.
4 changes: 2 additions & 2 deletions dungeonsheets/classes/ranger.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from dungeonsheets.classes.classes import CharClass, SubClass
from dungeonsheets.stats import (
attack_text_locator,
att_dmg_modifier,
att_dmg_modifier,
skill_modifier,
)

Expand Down Expand Up @@ -71,7 +71,7 @@ class GloomStalker(SubClass):
features_by_level[3] = [
features.DreadAmbusher,
features.UmbralSight,
features.Darkvision,
features.DarkvisionClass,
]
features_by_level[7] = [features.IronMind]
features_by_level[11] = [features.StalkersFlurry]
Expand Down
2 changes: 1 addition & 1 deletion dungeonsheets/classes/sorceror.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class ShadowMagic(SubClass):
features_by_level = defaultdict(list)
features_by_level[1] = [
features.EyesOfTheDark,
features.SuperiorDarkvision,
features.SuperiorDarkvisionClass,
features.StrengthOfTheGrave,
]
features_by_level[6] = [features.HoundOfIllOmen]
Expand Down
4 changes: 2 additions & 2 deletions dungeonsheets/features/races.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


# Many Classes
class Darkvision(Feature):
class DarkvisionRace(Feature):
"""Accustomed to life underground, you have superior vision in dark and dim
conditions. You can see in dim light within 60 feet of you as if it were
bright light, and in darkness as if it were dim light. You can't discern
Expand All @@ -15,7 +15,7 @@ class Darkvision(Feature):
source = "Race"


class SuperiorDarkvision(Feature):
class SuperiorDarkvisionRace(Feature):
"""Accustomed to life underground, you have superior vision in dark and dim
conditions. You can see in dim light within 120 feet of you as if it were
bright light, and in darkness as if it were dim light. You can't discern
Expand Down
12 changes: 12 additions & 0 deletions dungeonsheets/features/ranger.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,18 @@ class UmbralSight(Feature):
source = "Ranger (Gloom Stalker)"


class DarkvisionClass(Feature):
"""Accustomed to life underground, you have superior vision in dark and dim
conditions. You can see in dim light within 60 feet of you as if it were
bright light, and in darkness as if it were dim light. You can't discern
color in darkness, only shades of gray.
"""

name = "Darkvision (60')"
source = "Class (Gloom Stalker"


class IronMind(Feature):
"""By 7th level, you have honed your ability to resist the mind-altering
powers of your prey. You gain proficiency in Wisdom saving throws. Ifyou
Expand Down
10 changes: 10 additions & 0 deletions dungeonsheets/features/sorceror.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,16 @@ class EyesOfTheDark(Feature):
spells_known = (spells.Darkness,)
spells_prepared = (spells.Darkness,)

class SuperiorDarkvisionClass(Feature):
"""Accustomed to life underground, you have superior vision in dark and dim
conditions. You can see in dim light within 120 feet of you as if it were
bright light, and in darkness as if it were dim light. You can't discern
color in darkness, only shades of gray.
"""

name = "Darkvision (120')"
source = "Sorcerer (Shadow Magic)"

class StrengthOfTheGrave(Feature):
"""Starting at 1st level, your existence in a twilight state between life
Expand Down
4 changes: 2 additions & 2 deletions dungeonsheets/features/wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,13 @@ class ExpertDivination(Feature):


class TheThirdEye(Feature):
"""Starting at 10th level, you can use your action to increase your powers o f
"""Starting at 10th level, you can use your action to increase your powers of
perception. When you do so, choose one of the following benefits, which
lasts until you are incapacitated or you take a short or long rest. You
can't use the feature again until you finish a rest.
**Darkvision**: You gain darkvision out to a range of 60 feet, as described
in chapter 8.
in Chapter 8.
**Ethereal Sight**: You can see into the Ethereal Plane within 60
feet of you.
Expand Down
34 changes: 17 additions & 17 deletions dungeonsheets/race.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class _Dwarf(Race):
weapons.ThrowingHammer,
weapons.Warhammer,
)
features = (feats.Darkvision, feats.DwarvenResilience, feats.Stonecunning)
features = (feats.DarkvisionRace, feats.DwarvenResilience, feats.Stonecunning)


class HillDwarf(_Dwarf):
Expand All @@ -91,7 +91,7 @@ class _Elf(Race):
dexterity_bonus = 2
skill_proficiencies = ("perception",)
languages = ("Common", "Elvish")
features = (feats.Darkvision, feats.FeyAncestry, feats.Trance)
features = (feats.DarkvisionRace, feats.FeyAncestry, feats.Trance)


class HighElf(_Elf):
Expand Down Expand Up @@ -128,7 +128,7 @@ class DarkElf(_Elf):
proficiencies_text = ("rapiers", "shortswords", "hand crossbows")
charisma_bonus = 1
features = (
feats.SuperiorDarkvision,
feats.SuperiorDarkvisionRace,
feats.FeyAncestry,
feats.Trance,
feats.SunlightSensitivity,
Expand Down Expand Up @@ -198,7 +198,7 @@ class _Gnome(Race):
speed = 25
intelligence_bonus = 2
languages = ("Common", "Gnomish")
features = (feats.Darkvision, feats.GnomeCunning)
features = (feats.DarkvisionRace, feats.GnomeCunning)


class ForestGnome(_Gnome):
Expand All @@ -218,7 +218,7 @@ class DeepGnome(_Gnome):
name = "Deep Gnome"
dexterity_bonus = 1
languages = ("Common", "Gnomish", "Undercommon")
features = (feats.SuperiorDarkvision, feats.GnomeCunning, feats.StoneCamouflage)
features = (feats.SuperiorDarkvisionRace, feats.GnomeCunning, feats.StoneCamouflage)


# Half-elves
Expand Down Expand Up @@ -249,7 +249,7 @@ class HalfElf(Race):
)
num_skill_choices = 2
languages = ("Common", "Elvish", "[choose one]")
features = (feats.Darkvision, feats.FeyAncestry)
features = (feats.DarkvisionRace, feats.FeyAncestry)


# Half-Orcs
Expand All @@ -261,7 +261,7 @@ class HalfOrc(Race):
constitution_bonus = 1
skill_proficiencies = ("intimidation",)
languages = ("Common", "Orc")
features = (feats.Darkvision, feats.RelentlessEndurance, feats.SavageAttacks)
features = (feats.DarkvisionRace, feats.RelentlessEndurance, feats.SavageAttacks)


# Tieflings
Expand All @@ -272,7 +272,7 @@ class Tiefling(Race):
intelligence_bonus = 1
charisma_bonus = 2
languages = ("Common", "Infernal")
features = (feats.Darkvision, feats.HellishResistance, feats.InfernalLegacy)
features = (feats.DarkvisionRace, feats.HellishResistance, feats.InfernalLegacy)


# Aasimar
Expand All @@ -283,7 +283,7 @@ class _Aasimar(Race):
charisma_bonus = 2
languages = ("Common", "Celestial")
features = (
feats.Darkvision,
feats.DarkvisionRace,
feats.CelestialResistance,
feats.HealingHands,
feats.LightBearer,
Expand Down Expand Up @@ -392,7 +392,7 @@ class Tabaxi(Race):
proficiencies_text = ("Claws",)
skill_proficiencies = ("perception", "stealth")
features = (
feats.Darkvision,
feats.DarkvisionRace,
feats.FelineAgility,
)

Expand Down Expand Up @@ -459,7 +459,7 @@ class EarthGenasi(_Genasi):
class FireGenasi(_Genasi):
name = "Fire Genasi"
intelligence_bonus = 1
features = (feats.Darkvision, feats.FireResistance, feats.ReachToTheBlaze)
features = (feats.DarkvisionRace, feats.FireResistance, feats.ReachToTheBlaze)


class WaterGenasi(_Genasi):
Expand Down Expand Up @@ -495,7 +495,7 @@ class BugBear(Race):
size = "medium"
speed = 30
features = (
feats.Darkvision,
feats.DarkvisionRace,
feats.LongLimbed,
feats.PowerfulBuild,
feats.SupriseAttack,
Expand All @@ -510,7 +510,7 @@ class Goblin(Race):
constitution_bonus = 1
size = "small"
speed = 30
features = (feats.Darkvision, feats.FuryOfTheSmall, feats.NimbleEscape)
features = (feats.DarkvisionRace, feats.FuryOfTheSmall, feats.NimbleEscape)
languages = ("Common", "Goblin")


Expand All @@ -520,7 +520,7 @@ class HobGoblin(Race):
intelligence_bonus = 1
size = "medium"
speed = 30
features = (feats.Darkvision, feats.SavingFace)
features = (feats.DarkvisionRace, feats.SavingFace)
proficiencies_text = ("light armor", "[Chose two martial melee weapons]")
languages = ("Common", "Goblin")

Expand All @@ -532,7 +532,7 @@ class Kobold(Race):
size = "small"
speed = 30
features = (
feats.Darkvision,
feats.DarkvisionRace,
feats.PackTactics,
feats.GrovelCowerAndBeg,
feats.SunlightSensitivity,
Expand All @@ -548,7 +548,7 @@ class Orc(Race):
size = "medium"
speed = 30
skill_proficiencies = ("intimidation",)
features = (feats.Darkvision, feats.Aggressive, feats.PowerfulBuild)
features = (feats.DarkvisionRace, feats.Aggressive, feats.PowerfulBuild)
languages = ("Common", "Orc")


Expand All @@ -559,7 +559,7 @@ class PureBlood(Race):
size = "medium"
speed = 30
features = (
feats.Darkvision,
feats.DarkvisionRace,
feats.InnateSpellcasting,
feats.MagicResistance,
feats.PoisonImmunity,
Expand Down

0 comments on commit 66e38c8

Please sign in to comment.