rpgsheet

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 0f28fe8efc37577f4efbb34ceaa3100adbd7d290
parent 32e312d2f9f7482c87df2551f3cc44a295e37784
Author: Skylar Hill <stellarskylark@posteo.net>
Date:   Sat,  4 Jun 2022 21:19:34 -0500

Switch separator character for identifiers to underscore

Diffstat:
Msrc/utils.nim | 4++--
Msrc/verb.nim | 2+-
Mtemplates/dnd5e.yaml | 162++++++++++++++++++++++++++++++++++++++++----------------------------------------
3 files changed, 84 insertions(+), 84 deletions(-)

diff --git a/src/utils.nim b/src/utils.nim @@ -28,13 +28,13 @@ proc fancyDisplay*(exp: string, maxLen: int): string = exp else: exp[0..min(maxLen-1, exp.len-1)] - result = result.replace("-", " ") + result = result.replace("_", " ") for word in result.split(" "): if word notin noCap: result = result.replace(word, word.capitalizeAscii) proc deFancy*(display: string): string = - result = display.replace(" ", "-").toLowerAscii() + result = display.replace(" ", "_").toLowerAscii() proc contains*(node: YamlNode, search: string): bool = for key in keys(node.fields): diff --git a/src/verb.nim b/src/verb.nim @@ -8,7 +8,7 @@ import import utils -let reRawExp = re"[a-zA-Z\-']?[a-zA-Z']+" +let reRawExp = re"[\w_']+" let reProcessedExp = re"^[\d*+\-/()]*$" let reDice = re"(\d+x)?(\d*d[\d%]+)(\*\d+)?([+-]\d+)?(s\d+)?" diff --git a/templates/dnd5e.yaml b/templates/dnd5e.yaml @@ -5,16 +5,16 @@ level: 1 tabs: - main: - stats - - ability-modifiers + - ability_modifiers - skills - features - - inventory-and-attacks: + - inventory_and_attacks: - attacks - equipment - wallet - spells: # You can remove this section if you're not a caster - - spell-slots - - spellcasting-stats + - spell_slots + - spellcasting_stats - spells expressions: # Change "race" to your character's race @@ -23,24 +23,24 @@ expressions: window: features # Add as many more of these as you want. Make the key # like this; if you have Unarmored Defense, add an - # unarmored-defense field. - your-feature: + # unarmored_defense field. + your_feature: desc: Your character's awesome feature window: features # Set these equal to your stats - max-health: + max_health: modifier: 10 window: stats - current-health: + current_health: modifier: 10 window: stats - temporary-health: + temporary_health: modifier: 0 window: stats speed: modifier: 30 window: stats - armor-class: + armor_class: modifier: 10 window: stats proficiency: @@ -65,54 +65,54 @@ expressions: modifier: 10 window: stats # Add your tool and language proficiencies here - other-proficiencies: + other_proficiencies: window: stats desc: Common, Simple weapons # You probably don't want to change these STR: modifier: "(strength-10)/2" - window: ability-modifiers + window: ability_modifiers DEX: modifier: "(dexterity-10)/2" - window: ability-modifiers + window: ability_modifiers CON: modifier: "(constitution-10)/2" - window: ability-modifiers + window: ability_modifiers INT: modifier: "(intelligence-10)/2" - window: ability-modifiers + window: ability_modifiers WIS: modifier: "(wisdom-10)/2" - window: ability-modifiers + window: ability_modifiers CHA: modifier: "(charisma-10)/2" - window: ability-modifiers + window: ability_modifiers # Add "+proficiency" to the skills you are proficient in, # and "+(proficiency*2)" if you hvae expertise - passive-perception: + passive_perception: modifier: 10+WIS window: skills - strength-saving-throw: + strength_saving_throw: dice: d20 modifier: STR window: skills - dexterity-saving-throw: + dexterity_saving_throw: dice: d20 modifier: DEX window: skills - constitution-saving-throw: + constitution_saving_throw: dice: d20 modifier: CON window: skills - intelligence-saving-throw: + intelligence_saving_throw: dice: d20 modifier: INT window: skills - wisdom-saving-throw: + wisdom_saving_throw: dice: d20 modifier: WIS window: skills - charisma-saving-throw: + charisma_saving_throw: dice: d20 modifier: CHA window: skills @@ -120,7 +120,7 @@ expressions: dice: d20 modifier: DEX window: skills - animal-handling: + animal_handling: dice: d20 modifier: WIS window: skills @@ -176,7 +176,7 @@ expressions: dice: d20 modifier: INT window: skills - sleight-of-hand: + sleight_of_hand: dice: d20 modifier: DEX window: skills @@ -189,102 +189,102 @@ expressions: modifier: WIS window: skills # Attacks; add two items for every way you have to attack, - # one for the attack roll, and the second for damage - unarmed-strike: + # one for the attack roll, and the 2nd for damage + unarmed_strike: dice: d20 modifier: STR+proficiency window: attacks desc: A simple attack with the body - unarmed-strike-damage: + unarmed_strike_damage: modifier: 1+STR window: attacks # Inventory; add an item for whatever you happen to have - common-clothes: + common_clothes: desc: Simple, common clothes for a simple, common person. Nothing wrong with that. window: equipment - copper-pieces: + copper_pieces: modifier: 0 window: wallet - silver-pieces: + silver_pieces: modifier: 0 window: wallet - gold-pieces: + gold_pieces: modifier: 0 window: wallet - electrum-pieces: + electrum_pieces: modifier: 0 window: wallet - platinum-pieces: + platinum_pieces: modifier: 0 window: wallet # You can remove these if you're not a caster - first-level-spell-slots: + 1st_level_spell_slots: modifier: 1 - window: spell-slots - second-level-spell-slots: + window: spell_slots + 2nd_level_spell_slots: modifier: 0 - window: spell-slots - third-level-spell-slots: + window: spell_slots + 3rd_level_spell_slots: modifier: 0 - window: spell-slots - fourth-level-spell-slots: + window: spell_slots + 4th_level_spell_slots: modifier: 0 - window: spell-slots - fifth-level-spell-slots: + window: spell_slots + 5th_level_spell_slots: modifier: 0 - window: spell-slots - sixth-level-spell-slots: + window: spell_slots + 6th_level_spell_slots: modifier: 0 - window: spell-slots - seventh-level-spell-slots: + window: spell_slots + 7th_level_spell_slots: modifier: 0 - window: spell-slots - eighth-level-spell-slots: + window: spell_slots + 8th_level_spell_slots: modifier: 0 - window: spell-slots - ninth-level-spell-slots: + window: spell_slots + 9th_level_spell_slots: modifier: 0 - window: spell-slots - first-level-slots-expended: + window: spell_slots + 1st_level_slots_expended: modifier: 1 - window: spell-slots - second-level-slots-expended: + window: spell_slots + 2nd_level_slots_expended: modifier: 0 - window: spell-slots - third-level-slots-expended: + window: spell_slots + 3rd_level_slots_expended: modifier: 0 - window: spell-slots - fourth-level-slots-expended: + window: spell_slots + 4th_level_slots_expended: modifier: 0 - window: spell-slots - fifth-level-slots-expended: + window: spell_slots + 5th_level_slots_expended: modifier: 0 - window: spell-slots - sixth-level-slots-expended: + window: spell_slots + 6th_level_slots_expended: modifier: 0 - window: spell-slots - seventh-level-slots-expended: + window: spell_slots + 7th_level_slots_expended: modifier: 0 - window: spell-slots - eighth-level-slots-expended: + window: spell_slots + 8th_level_slots_expended: modifier: 0 - window: spell-slots - ninth-level-slots-expended: + window: spell_slots + 9th_level_slots_expended: modifier: 0 - window: spell-slots - spellcasting-ability: + window: spell_slots + spellcasting_ability: modifier: CHA # set this appropriately - window: spellcasting-stats - spell-save-dc: - modifier: 8+spellcasting-ability+proficiency - window: spellcasting-stats - spell-attack-bonus: + window: spellcasting_stats + spell_save_dc: + modifier: 8+spellcasting_ability+proficiency + window: spellcasting_stats + spell_attack_bonus: dice: 1d20 - modifier: spellcasting-ability+proficiency - window: spellcasting-stats + modifier: spellcasting_ability+proficiency + window: spellcasting_stats prestidigitation: - desc: "Cantrip. This spell is a minor magical trick that novice spellcasters use for practice. You create one of the following magical effects within range: 1) You create an instantaneous, harmless sensory effect, such as a shower of sparks, a puff of wind, faint musical notes, or an odd odor. 2) You instantaneously light or snuff out a candle, a torch, or a small campfire. 3) You instantaneously clean or soil an object no larger than 1 cubic foot. 4) You chill, warm, or flavor up to 1 cubic foot of nonliving material for 1 hour. 5) You make a color, a small mark, or a symbol appear on an object or a surface for 1 hour. 6) You create a nonmagical trinket or an illusory image that can fit in your hand and that lasts until the end of your next turn. If you cast this spell multiple times, you can have up to three of its non-instantaneous effects active at a time, and you can dismiss such an effect as an action." + desc: "Cantrip. This spell is a minor magical trick that novice spellcasters use for practice. You create one of the following magical effects within range: 1) You create an instantaneous, harmless sensory effect, such as a shower of sparks, a puff of wind, faint musical notes, or an odd odor. 2) You instantaneously light or snuff out a candle, a torch, or a small campfire. 3) You instantaneously clean or soil an object no larger than 1 cubic foot. 4) You chill, warm, or flavor up to 1 cubic foot of nonliving material for 1 hour. 5) You make a color, a small mark, or a symbol appear on an object or a surface for 1 hour. 6) You create a nonmagical trinket or an illusory image that can fit in your hand and that lasts until the end of your next turn. If you cast this spell multiple times, you can have up to three of its non_instantaneous effects active at a time, and you can dismiss such an effect as an action." window: spells - carl's-hideous-face: + carl's_hideous_face: desc: 9th level. Oh god, oh no, look away if you want to live. window: spells