API Reference
sdark - Shadowdark tools.
- class sdark.Ancestry(name: str, languages: list[sdark.characters.language.Language], talent: sdark.characters.talents.talent.Talent)
-
- name: str
- class sdark.Armor(name: 'Word', unit_cost: 'Money', unit_slots: 'Slots', unit: 'Unit', free_to_carry: 'int', qty: 'int', base_ac: int, has_dex_mod: bool, properties: list[str])
- base_ac: int
- has_dex_mod: bool
- properties: list[str]
- class sdark.Attack(weapon: sdark.gear.weapon.Weapon, mode: sdark.gear.weapon_mode.WeaponMode, attack_roll: list[ndice.dice.Dice], damage_roll: sdark.characters.damage_roll.DamageRoll, range: sdark.mechanics.range.Range)
- attack_roll: list[Dice]
- damage_roll: DamageRoll
- mode: WeaponMode
- class sdark.Character(name: 'str', ancestry: 'Ancestry', gender: 'Gender', alignment: 'Alignment', background: 'Background', deity: 'Deity', profession: 'Profession | None', level: 'int', stren: 'Stren', dex: 'Dex', con: 'Con', intel: 'Intel', wis: 'Wis', cha: 'Cha', hp: 'int', xp: 'int', languages: 'list[Language]', talents: 'list[Talent]', spells: 'list[Spell]', inventory: 'Inventory')
-
- property ac: int
- background: Background
- cha: Cha
- con: Con
- dex: Dex
- hp: int
- intel: Intel
- level: int
- name: str
- profession: Profession | None
- stren: Stren
- property title: str | None
- wis: Wis
- xp: int
- property xp_to_level_up: int
- class sdark.Deity(name: str, alignment: sdark.characters.alignment.Alignment, description: str)
-
- description: str
- name: str
- class sdark.Gear(name: 'Word', unit_cost: 'Money', unit_slots: 'Slots', unit: 'Unit', free_to_carry: 'int', qty: 'int')
-
- free_to_carry: int
- property kind: str
- name: Word
- qty: int
- unit: Unit
- class sdark.Language(name: str, who_speaks_it: str, frequency: sdark.characters.language.LanguageFrequency = <LanguageFrequency.COMMON: 'common'>)
- frequency: LanguageFrequency
- name: str
- who_speaks_it: str
- class sdark.Money(gp: 'Fraction | int' = Fraction(0, 1), sp: 'Fraction | int' = Fraction(0, 1), cp: 'Fraction | int' = Fraction(0, 1))
- property coins: tuple[int, int, int]
- cp: Fraction
- class sdark.Profession(name: str, weapons: list[sdark.gear.weapon.Weapon], armor: list[sdark.gear.armor.Armor], hp_per_level: ndice.dice.Dice, talents: list[sdark.characters.talents.talent.Talent])
-
- hp_per_level: Dice
- name: str
- class sdark.Stat(value: int)
- abstract property abbreviation: str
- property mod: Dice
Stats table, SD v4.8, p15
- abstract property name: str
- class sdark.Table(rows: 'list[Row[T]]', dice: 'Dice | None' = None)
-
- pick(rng: RNG, count: int, *, skip: Sequence[T] = ()) list[T]
- roll(rng: RNG) T
- dice: Dice | None = None
- property total_weight: int
- class sdark.TalentChoice(name: str, description: str, choices: list[sdark.characters.talents.talent.Talent])
- class sdark.Weapon(name: 'Word', unit_cost: 'Money', unit_slots: 'Slots', unit: 'Unit', free_to_carry: 'int', qty: 'int', mode: sdark.gear.weapon_mode.WeaponMode, range: sdark.mechanics.range.Range, damage: ndice.dice.Dice | tuple[ndice.dice.Dice, ndice.dice.Dice], grip: sdark.gear.grip.Grip = <Grip.ONE_HANDED: 1>, finesse: bool = False, loading: bool = False, thrown: bool = False)
- damage: Dice | tuple[Dice, Dice]
- finesse: bool
- property is_two_handed: bool
- property is_versatile: bool
- loading: bool
- mode: WeaponMode
- thrown: bool
- class sdark.WeaponMastery(name: str, description: str, weapon: sdark.gear.weapon.Weapon)
- sdark.clamp(low: int, value: int, high: int) int
- sdark.make_mod(value: int) Dice
- sdark.mod_value(*mods: Dice) int
- sdark.random_character(rng: Callable[[int], int], roll_stats: RollStats, roll_hp: RollHP, level: int) Character
- sdark.roll_with_advantage(rng: Callable[[int], int], *dice_expression: Dice) int
- sdark.roll_with_disadvantage(rng: Callable[[int], int], *dice_expression: Dice) int
- sdark.simplify_mods(*expression: Dice) list[Dice]