diff --git a/Ars_Magica_5th/Ars_Magica_5th.html b/Ars_Magica_5th/Ars_Magica_5th.html
index abf524917f..218f6a4c29 100644
--- a/Ars_Magica_5th/Ars_Magica_5th.html
+++ b/Ars_Magica_5th/Ars_Magica_5th.html
@@ -24,14 +24,14 @@ This file is automatically generated from a template. Any change will be overwri
Info - February 2021 v1.6 Update
-Fixed tabs not displaying properly in firefox (tabs are again attached to an attribute)
-Fixed ability rolltemplate being too wide in some cases
-Added sheet documentation direclty into the sheet: check out the "Help" tab to find it
-Added inline labels to all rolls: hover over the result to see the details (may require re-selecting arts/characteristics to work properly)
-Added simple/stress die handling: check out the "Help" tab for configuration options. Criticals are supported too (but see caveat in the "Help" tab, 3D dice are lying to you)
-Added support for additional fatigue levels: magical creatures and enduring characters are easier now
-Added support for focus in magic totals & rolls
-
+
Fixed tabs not displaying properly in firefox (tabs are again attached to an attribute)
+
Fixed ability rolltemplate being too wide in some cases
+
Added sheet documentation direclty into the sheet: check out the "Help" tab to find it
+
Added inline labels to all rolls: hover over the result to see the details (may require re-selecting arts/characteristics to work properly)
+
Added simple/stress die handling: check out the "Help" tab for configuration options. Criticals are supported too (but see caveat in the "Help" tab, 3D dice are lying to you)
+
Added support for additional fatigue levels: magical creatures and enduring characters are easier now
+
Added support for focus in magic totals & rolls
+
×
@@ -42,18 +42,18 @@ This file is automatically generated from a template. Any change will be overwri
Info - February 2021 v1.6.1 Update - Rounding edges
-Fixed botch die botching on 1s instead of 10s
-Fixed critical dice displaying 10s as exploding, instead of 1s
-Fixed spell's arts value not being updated when the character's arts are modified
-Completely changed how arts are handled inside spells
-A script will be run to convert your data to the new format, but may fail for some spells
-Check the arts of your spells !
-
-
-Added a critical roll for initiative that sets the turn tracker initiative (not visible in the sheet, use the chat button)
-Added option to always ask which characteristic to use when rolling abilities
-Centered the sheet in its tab
-
+
Fixed botch die botching on 1s instead of 10s
+
Fixed critical dice displaying 10s as exploding, instead of 1s
+
Fixed spell's arts value not being updated when the character's arts are modified
+ Completely changed how arts are handled inside spells
+ A script will be run to convert your data to the new format, but may fail for some spells
+ Check the arts of your spells !
+
+
+
Added a critical roll for initiative that sets the turn tracker initiative (not visible in the sheet, use the chat button)
+
Added option to always ask which characteristic to use when rolling abilities
+
Centered the sheet in its tab
+
×
@@ -64,8 +64,8 @@ This file is automatically generated from a template. Any change will be overwri
Warning - February 2021 v1.6.1 update - ERROR: Spell's arts conversion
The conversion script that updates your spell's arts to the new format failed to run. This means you need to setup the arts of your spells again.
-
- Note: The script is run each time you open your character sheet, as long as this banner is visible. If it completes normally, it will hide this banner before you can see it.
+
+ Note: The script is run each time you open your character sheet, as long as this banner is visible. If it completes normally, it will hide this banner before you can see it.
×
@@ -432,7 +432,7 @@ This file is automatically generated from a template. Any change will be overwri
-
+
@@ -441,7 +441,7 @@ This file is automatically generated from a template. Any change will be overwri
-
+
@@ -450,7 +450,7 @@ This file is automatically generated from a template. Any change will be overwri
-
+
@@ -459,7 +459,7 @@ This file is automatically generated from a template. Any change will be overwri
-
+
@@ -468,7 +468,7 @@ This file is automatically generated from a template. Any change will be overwri
-
+
@@ -477,7 +477,7 @@ This file is automatically generated from a template. Any change will be overwri
-
+
@@ -534,7 +534,7 @@ This file is automatically generated from a template. Any change will be overwri
-
+
@@ -544,7 +544,7 @@ This file is automatically generated from a template. Any change will be overwri
-
+
@@ -554,7 +554,7 @@ This file is automatically generated from a template. Any change will be overwri
-
+
@@ -564,7 +564,7 @@ This file is automatically generated from a template. Any change will be overwri
-
+
@@ -574,7 +574,7 @@ This file is automatically generated from a template. Any change will be overwri
-
+
@@ -584,7 +584,7 @@ This file is automatically generated from a template. Any change will be overwri
-
+
@@ -594,7 +594,7 @@ This file is automatically generated from a template. Any change will be overwri
-
+
@@ -604,7 +604,7 @@ This file is automatically generated from a template. Any change will be overwri
-
+
@@ -1169,7 +1169,7 @@ This file is automatically generated from a template. Any change will be overwri
-
+
Focus
@@ -1179,6 +1179,7 @@ This file is automatically generated from a template. Any change will be overwri
+
diff --git a/Ars_Magica_5th/arm5_py_integration/__init__.py b/Ars_Magica_5th/arm5_py_integration/__init__.py
index 58d276afa6..26d94c7cfc 100644
--- a/Ars_Magica_5th/arm5_py_integration/__init__.py
+++ b/Ars_Magica_5th/arm5_py_integration/__init__.py
@@ -1,5 +1,6 @@
"""Module for providing the parts in the template.html file"""
import csv
+import textwrap
from pathlib import Path
import markdown
@@ -14,6 +15,9 @@ from .helpers import (
)
from .translations import translation_attrs, translation_attrs_setup
+# Note: Python automatically concatenates strings that are separated by newlines
+# This can be used to split long strings into multiple lines
+
# Xp helper
def xp(
@@ -22,7 +26,15 @@ def xp(
"""
Generate the HTML for the Xp parts of arts & abilities
"""
- return f"""[ / / ]"""
+ return (
+ "["
+ f""" """
+ "/"
+ f""" """
+ "/"
+ f""" """
+ "]"
+ )
def alert(title: str, text: str, *, level: str = "warning", ID: str = None):
@@ -47,16 +59,21 @@ def alert(title: str, text: str, *, level: str = "warning", ID: str = None):
alert_id = str(ID)
alert.strid.append(alert_id)
- return f"""
-
-
-
{level.title()} - {title}
- {text}
-
-
- ×
-
-
"""
+ indent = " " * 4 * 4
+ text = str(text).replace("\n", "\n" + indent)
+ return textwrap.dedent(
+ f"""\
+
+
+
+
{level.title()} - {title}
+ {text}
+
+
+ ×
+
+
"""
+ )
# python supports attributes on function
@@ -66,13 +83,17 @@ alert.strid = []
def disable_old_alerts(marker: str):
- lines = ",\n ".join(
+ indent = " " * 4 * 3
+ lines = f",\n{indent}".join(
f'"alert-{i}": 1' for i in list(range(alert.numid)) + alert.strid
)
- return f"""setAttrs({{
- "{marker}": 1,
- {lines}
-}}); """
+ return textwrap.dedent(
+ f"""\
+ setAttrs({{
+ "{marker}": 1,
+ {lines}
+ }}); """
+ )
# Add new parts to this dictionary
@@ -94,48 +115,135 @@ GLOBALS = {
# Personality traits
+personnality_roll = (
+ "[[@{Personality_Trait$$_Score}]] [@{Personality_Trait$$}] "
+ "+ (?{@{circumstantial_i18n}|0}) [@{circumstances_i18n}]"
+)
+personnality_roll_template = (
+ "&{template:generic} "
+ "{{Banner=^{personality} ^{roll}}} "
+ "{{Label=@{Personality_Trait$$}}} "
+ "{{Result=[[%(die)s + %(roll)s ]]}} "
+)
+personnality_roll_template_simple = personnality_roll_template % {
+ "roll": personnality_roll,
+ "die": "@{simple-die}",
+}
+personnality_roll_template_stress = (
+ (personnality_roll_template % {"roll": personnality_roll, "die": "@{stress-die}"})
+ # Additional roll template fields for stress rolls
+ + (
+ "{{stress=1}} "
+ "{{botch-button=[@{botch_i18n}!](~@{character_name}|botch)}} "
+ "{{crit-button=[@{critical_i18n}!](~@{character_name}|critical)}}"
+ )
+)
GLOBALS["personality_trait_rows"] = repeat_template(
- """
-
-
-
-
-
-
- """,
+ textwrap.dedent(
+ f"""\
+
+
+
+
+
+
+
+ """
+ ),
range(1, 7),
+ rep_key="$$",
)
# Reputations
+reputation_roll = (
+ "[[@{Reputations$$_Score}]] [@{Reputations$$}] "
+ "+ (?{@{circumstantial_i18n}|0}) [@{circumstances_i18n}]"
+)
+reputation_roll_template = (
+ "&{template:generic} "
+ "{{Banner=^{reputation} ^{roll}}} "
+ "{{Label=@{Reputations$$}}} "
+ "{{Result=[[%(die)s + %(roll)s ]] }}"
+)
+reputation_roll_template_simple = reputation_roll_template % {
+ "roll": reputation_roll,
+ "die": "@{simple-die}",
+}
+reputation_roll_template_stress = (
+ (reputation_roll_template % {"roll": reputation_roll, "die": "@{simple-die}"})
+ # Additiona roll template fields for stress rolls
+ + (
+ " {{stress=1}} "
+ "{{botch-button=[@{botch_i18n}!](~@{character_name}|botch)}} "
+ "{{crit-button=[@{critical_i18n}!](~@{character_name}|critical)}}"
+ )
+)
GLOBALS["reputation_rows"] = repeat_template(
- """
-
-
-
-
-
-
-
- """,
+ textwrap.dedent(
+ f"""\
+
+
+
+
+
+
+
+
+ """
+ ),
range(1, 7),
+ rep_key="$$",
)
# Characteristics definitions
-characteristic_roll = "(@{%(Char)s_Score}) [@{%(char)s_i18n}] + (@{wound_total}) [@{wounds_i18n}] + ([[floor(@{Fatigue})]]) [@{fatigue_i18n}] + (?{@{circumstantial_i18n}|0}) [@{circumstances_i18n}]"
+characteristic_roll = (
+ "(@{%(Char)s_Score}) [@{%(char)s_i18n}] "
+ "+ (@{wound_total}) [@{wounds_i18n}] "
+ "+ ([[floor(@{Fatigue})]]) [@{fatigue_i18n}] "
+ "+ (?{@{circumstantial_i18n}|0}) [@{circumstances_i18n}]"
+)
+characteristic_roll_template = (
+ "&{template:ability} "
+ "{{name= @{character_name}}} "
+ "{{label0=^{%%(char)s}}} "
+ "{{banner=@{%%(Char)s_Description}}} "
+ "{{label1=^{score}}} "
+ "{{result1=@{%%(Char)s_Score}}} "
+ "{{label2=^{characteristic-m}}} "
+ "{{label2=^{weakness-m}}} "
+ "{{result2=[[[[floor(@{Fatigue})]][@{fatigue_i18n}] + @{wound_total}[@{wounds_i18n}]]]}} "
+ "{{label3=^{circumstances-m}}} "
+ "{{result3=[[(?{@{circumstantial_i18n}|0})]]}} "
+ "{{result0=[[ %(die)s + %(roll)s ]]}} "
+ "{{stress=%(stress)s}} "
+ "{{botch-button=[@{botch_i18n}!](~@{character_name}|botch)}} "
+ "{{crit-button=[@{critical_i18n}!](~@{character_name}|critical)}}"
+)
+characteristic_roll_template_simple = characteristic_roll_template % {
+ "roll": characteristic_roll,
+ "die": "@{simple-die}",
+ "stress": "",
+}
+characteristic_roll_template_stress = characteristic_roll_template % {
+ "roll": characteristic_roll,
+ "die": "@{stress-die}",
+ "stress": "1",
+}
GLOBALS["characteristic_rows"] = repeat_template(
- """
- %(Char)s
-
-
-
-
-
-
-
- """.replace(
- "$characteristic_roll$", characteristic_roll
+ textwrap.dedent(
+ f"""\
+
+ %(Char)s
+
+
+
+
+
+
+
+ """
),
CHARACTERISTICS,
str_key="char",
@@ -171,13 +279,37 @@ GLOBALS["characteristic_name_ask_attr"] = (
)
# Abilities
-ability_roll_template = "&{template:ability} {{name=@{character_name}}} {{label0=@{Ability_name}}} {{banner=@{Ability_Speciality}}} {{label1=^{rank}}} {{result1= [[ @{Ability_Score} + @{Ability_Puissant} ]]}} {{label2=@{Ability_CharacName}}} {{result2=[[@{sys_at}@{character_name}@{sys_pipe}@{Ability_CharacName}_Score@{sys_rbk}]]}} {{label3=^{weakness-m}}} {{result3=[[ ([[floor(@{Fatigue})]]) [@{fatigue_i18n}] + (@{wound_total}) [@{wounds_i18n}] ]]}} {{label4=^{circumstances-m}}} {{result4=[[(?{@{circumstantial_i18n}|0})]]}} {{result0=%(roll)s}} {{botch-button=[@{botch_i18n}!](~@{character_name}|botch)}} {{crit-button=[@{critical_i18n}!](~@{character_name}|critical)}}"
-ability_roll = "[[ %(die)s + (@{Ability_Score} + @{Ability_Puissant}) [@{Ability_name}] + (@{sys_at}@{character_name}@{sys_pipe}@{Ability_CharacName}_Score@{sys_rbk}) [@{sys_at}@{character_name}@{sys_pipe}@{Ability_CharacName}_i18n@{sys_rbk}] + (@{wound_total}) [@{wounds_i18n}] + ([[floor(@{Fatigue})]]) [@{fatigue_i18n}] + (?{@{circumstantial_i18n}|0}) [@{circumstances_i18n}] ]]"
+ability_roll = (
+ "(@{Ability_Score} + @{Ability_Puissant}) [@{Ability_name}] "
+ "+ (@{sys_at}@{character_name}@{sys_pipe}@{Ability_CharacName}_Score@{sys_rbk}) [@{sys_at}@{character_name}@{sys_pipe}@{Ability_CharacName}_i18n@{sys_rbk}] "
+ "+ (@{wound_total}) [@{wounds_i18n}] "
+ "+ ([[floor(@{Fatigue})]]) [@{fatigue_i18n}] "
+ "+ (?{@{circumstantial_i18n}|0}) [@{circumstances_i18n}]"
+)
+ability_roll_template = (
+ "&{template:ability} "
+ "{{name=@{character_name}}} "
+ "{{label0=@{Ability_name}}} "
+ "{{banner=@{Ability_Speciality}}} "
+ "{{label1=^{rank}}} "
+ "{{result1= [[ @{Ability_Score} + @{Ability_Puissant} ]]}} "
+ "{{label2=@{Ability_CharacName}}} "
+ "{{result2=[[@{sys_at}@{character_name}@{sys_pipe}@{Ability_CharacName}_Score@{sys_rbk}]]}} "
+ "{{label3=^{weakness-m}}} "
+ "{{result3=[[ ([[floor(@{Fatigue})]]) [@{fatigue_i18n}] + (@{wound_total}) [@{wounds_i18n}] ]]}} "
+ "{{label4=^{circumstances-m}}} "
+ "{{result4=[[(?{@{circumstantial_i18n}|0})]]}} "
+ "{{result0=[[ %(die)s + %(roll)s ]]}} "
+ "{{botch-button=[@{botch_i18n}!](~@{character_name}|botch)}} "
+ "{{crit-button=[@{critical_i18n}!](~@{character_name}|critical)}}"
+)
+
GLOBALS["ability_roll_simple"] = ability_roll_template % {
- "roll": ability_roll % {"die": "@{simple-die}"}
+ "roll": ability_roll,
+ "die": "@{simple-die}",
}
GLOBALS["ability_roll_stress"] = (
- ability_roll_template % {"roll": ability_roll % {"die": "@{stress-die}"}}
+ ability_roll_template % {"roll": ability_roll, "die": "@{stress-die}"}
) + " {{stress=1}}"
@@ -262,8 +394,34 @@ GLOBALS["form_enumerated_options"] = repeat_template(
# Casting rolls
## Magic tab
-spontaneous_roll_template = "&{template:arcane} {{label0=^{spontaneous} ^{casting}}} {{result0=%(roll)s}} {{label1=^{aura}}} {{result1=@{aura}}} {{label2=^{weakness-m}}} {{result2=[[ @{wound_total}[@{wounds_i18n}] + [[floor(@{fatigue})]][@{fatigue_i18n}] ]]}} {{label3=^{circumstances-m}}} {{result3=?{@{modifiers_i18n}|0}}} {{botch-button=[@{botch_i18n}!](~@{character_name}|botch)}} {{crit-button=[@{critical_i18n}!](~@{character_name}|critical-spontaneous)}}"
-spontaneous_roll = "[[(%(die)s + @{Spontaneous1_Technique} + @{Spontaneous1_Form} + ([[@{Spontaneous1_Focus}]]) [@{focus_i18n}] + (@{gestures}) + (@{words}) + (@{Stamina_Score}) [@{stamina_i18n}] + (@{aura}) [@{aura_i18n}] + ([[floor(@{Fatigue})]]) [@{fatigue_i18n}] + (@{wound_total}) [@{wounds_i18n}] + (?{@{modifiers_i18n}|0}) [@{modifiers_i18n}] )/2 ]]"
+spontaneous_roll_template = (
+ "&{template:arcane} "
+ "{{label0=^{spontaneous} ^{casting}}} "
+ "{{result0=%(roll)s}} "
+ "{{label1=^{aura}}} "
+ "{{result1=@{aura}}} "
+ "{{label2=^{weakness-m}}} "
+ "{{result2=[[ @{wound_total}[@{wounds_i18n}] + [[floor(@{fatigue})]][@{fatigue_i18n}] ]]}} "
+ "{{label3=^{circumstances-m}}} "
+ "{{result3=?{@{modifiers_i18n}|0}}} "
+ "{{botch-button=[@{botch_i18n}!](~@{character_name}|botch)}} "
+ "{{crit-button=[@{critical_i18n}!](~@{character_name}|critical-spontaneous)}}"
+)
+spontaneous_roll = (
+ "[[("
+ "%(die)s "
+ "+ @{Spontaneous1_Technique} "
+ "+ @{Spontaneous1_Form} "
+ "+ ([[@{Spontaneous1_Focus}]]) [@{focus_i18n}] "
+ "+ (@{gestures}) "
+ "+ (@{words}) "
+ "+ (@{Stamina_Score}) [@{stamina_i18n}] "
+ "+ (@{aura}) [@{aura_i18n}] "
+ "+ ([[floor(@{Fatigue})]]) [@{fatigue_i18n}] "
+ "+ (@{wound_total}) [@{wounds_i18n}] "
+ "+ (?{@{modifiers_i18n}|0}) [@{modifiers_i18n}]"
+ " )/2 ]]"
+)
GLOBALS["spontaneous_roll_simple"] = spontaneous_roll_template % {
"roll": spontaneous_roll % {"die": "@{simple-die}"}
}
@@ -271,8 +429,36 @@ GLOBALS["spontaneous_roll_stress"] = (
spontaneous_roll_template % {"roll": spontaneous_roll % {"die": "@{stress-die}"}}
) + " {{stress=1}}"
-ceremonial_roll_template = "&{template:arcane} {{label0=^{ceremonial} ^{casting}}} {{result0= %(roll)s }} {{label1=^{aura}}} {{result1=@{aura}}} {{label2=^{weakness-m}}} {{result2=[[@{wound_total}[@{wounds_i18n}] + [[floor(@{fatigue})]][@{fatigue_i18n}] ]]}} {{label3=^{circumstances-m}}} {{result3=?{@{modifiers_i18n}|0}}} {{botch-button=[@{botch_i18n}!](~@{character_name}|botch)}} {{crit-button=[@{critical_i18n}!](~@{character_name}|critical-spontaneous)}}"
-ceremonial_roll = "[[(%(die)s+ @{Ceremonial_Technique} + @{Ceremonial_Form} + ([[@{Ceremonial_Focus}]]) [@{focus_i18n}] + (@{gestures}) + (@{words}) + (@{Stamina_Score}) [@{stamina_i18n}] + (@{aura}) [@{aura_i18n}] + ([[floor(@{Fatigue})]]) [@{fatigue_i18n}] + (@{wound_total}) [@{wounds_i18n}] + (@{Ceremonial_Artes_Lib}) [@{artes_i18n}] + (@{Ceremonial_Philos}) [@{philos_i18n}] + (?{@{modifiers_i18n}|0}) [@{modifiers_i18n}] )/2 ]]"
+ceremonial_roll_template = (
+ "&{template:arcane} "
+ "{{label0=^{ceremonial} ^{casting}}} "
+ "{{result0= %(roll)s }} "
+ "{{label1=^{aura}}} "
+ "{{result1=@{aura}}} "
+ "{{label2=^{weakness-m}}} "
+ "{{result2=[[@{wound_total}[@{wounds_i18n}] + [[floor(@{fatigue})]][@{fatigue_i18n}] ]]}} "
+ "{{label3=^{circumstances-m}}} "
+ "{{result3=?{@{modifiers_i18n}|0}}} "
+ "{{botch-button=[@{botch_i18n}!](~@{character_name}|botch)}} "
+ "{{crit-button=[@{critical_i18n}!](~@{character_name}|critical-spontaneous)}}"
+)
+ceremonial_roll = (
+ "[[("
+ "%(die)s"
+ "+ @{Ceremonial_Technique} "
+ "+ @{Ceremonial_Form} "
+ "+ ([[@{Ceremonial_Focus}]]) [@{focus_i18n}] "
+ "+ (@{gestures}) "
+ "+ (@{words}) "
+ "+ (@{Stamina_Score}) [@{stamina_i18n}] "
+ "+ (@{aura}) [@{aura_i18n}] "
+ "+ ([[floor(@{Fatigue})]]) [@{fatigue_i18n}] "
+ "+ (@{wound_total}) [@{wounds_i18n}] "
+ "+ (@{Ceremonial_Artes_Lib}) [@{artes_i18n}] "
+ "+ (@{Ceremonial_Philos}) [@{philos_i18n}] "
+ "+ (?{@{modifiers_i18n}|0}) [@{modifiers_i18n}] "
+ ")/2 ]]"
+)
GLOBALS["ceremonial_roll_simple"] = ceremonial_roll_template % {
"roll": ceremonial_roll % {"die": "@{simple-die}"}
}
@@ -280,8 +466,34 @@ GLOBALS["ceremonial_roll_stress"] = (
ceremonial_roll_template % {"roll": ceremonial_roll % {"die": "@{stress-die}"}}
) + " {{stress=1}}"
-formulaic_roll_template = "&{template:arcane} {{label0=^{formulaic} ^{casting}}} {{result0= %(roll)s }} {{label1=^{aura}}} {{result1=@{aura}}} {{label2=^{weakness-m}}} {{result2=[[@{wound_total}[@{wounds_i18n}] + [[floor(@{fatigue})]][@{fatigue_i18n}] ]]}} {{label3=^{circumstances-m}}} {{result3=?{@{modifiers_i18n}|0}}} {{botch-button=[@{botch_i18n}!](~@{character_name}|botch)}} {{crit-button=[@{critical_i18n}!](~@{character_name}|critical)}}"
-formulaic_roll = "[[%(die)s + @{Formulaic_Technique} + @{Formulaic_Form} + ([[@{Formulaic_Focus}]]) [@{focus_i18n}] + (@{gestures}) + (@{words}) + (@{Stamina_Score}) [@{stamina_i18n}] + (@{aura}) [@{aura_i18n}] + ([[floor(@{Fatigue})]]) [@{fatigue_i18n}] + (@{wound_total}) [@{wounds_i18n}] + (?{@{modifiers_i18n}|0}) [@{modifiers_i18n}] ]]"
+
+formulaic_roll_template = (
+ "&{template:arcane} "
+ "{{label0=^{formulaic} ^{casting}}} "
+ "{{result0= %(roll)s }} "
+ "{{label1=^{aura}}} "
+ "{{result1=@{aura}}} "
+ "{{label2=^{weakness-m}}} "
+ "{{result2=[[@{wound_total}[@{wounds_i18n}] + [[floor(@{fatigue})]][@{fatigue_i18n}] ]]}} "
+ "{{label3=^{circumstances-m}}} "
+ "{{result3=?{@{modifiers_i18n}|0}}} "
+ "{{botch-button=[@{botch_i18n}!](~@{character_name}|botch)}} "
+ "{{crit-button=[@{critical_i18n}!](~@{character_name}|critical)}}"
+)
+formulaic_roll = (
+ "[["
+ "%(die)s "
+ "+ @{Formulaic_Technique} "
+ "+ @{Formulaic_Form} "
+ "+ ([[@{Formulaic_Focus}]]) [@{focus_i18n}] "
+ "+ (@{gestures}) "
+ "+ (@{words}) "
+ "+ (@{Stamina_Score}) [@{stamina_i18n}] "
+ "+ (@{aura}) [@{aura_i18n}] "
+ "+ ([[floor(@{Fatigue})]]) [@{fatigue_i18n}] + (@{wound_total}) [@{wounds_i18n}] "
+ "+ (?{@{modifiers_i18n}|0}) [@{modifiers_i18n}] "
+ "]]"
+)
GLOBALS["formulaic_roll_simple"] = formulaic_roll_template % {
"roll": formulaic_roll % {"die": "@{simple-die}"}
}
@@ -289,8 +501,34 @@ GLOBALS["formulaic_roll_stress"] = (
formulaic_roll_template % {"roll": formulaic_roll % {"die": "@{stress-die}"}}
) + " {{stress=1}}"
-ritual_roll_template = "&{template:arcane} {{label0=^{ritual} ^{casting}}} {{result0= %(roll)s }} {{label1=^{aura}}} {{result1=@{aura}}} {{label2=^{weakness-m}}} {{result2=[[ @{wound_total}[@{wounds_i18n}] + [[floor(@{fatigue})]][@{fatigue_i18n}] ]]}} {{label3=^{circumstances-m}}} {{result3=?{@{modifiers_i18n}|0}}} {{botch-button=[@{botch_i18n}!](~@{character_name}|botch)}} {{crit-button=[@{critical_i18n}!](~@{character_name}|critical)}}"
-ritual_roll = "[[%(die)s + @{Ritual_Technique} + @{Ritual_Form} + ([[@{Ritual_Focus}]]) [@{focus_i18n}] + (@{Stamina_Score}) [@{stamina_i18n}] + (@{aura}) [@{aura_i18n}] + (@{Ritual_Artes_Lib}) [@{artes_i18n}] + (@{Ritual_Philos}) [@{philos_i18n}] + (@{wound_total}) [@{wounds_i18n}] + ([[floor(@{fatigue})]]) [@{fatigue_i18n}] + (?{@{modifiers_i18n}|0}) [@{modifiers_i18n}] ]]"
+ritual_roll_template = (
+ "&{template:arcane} "
+ "{{label0=^{ritual} ^{casting}}} "
+ "{{result0= %(roll)s }} "
+ "{{label1=^{aura}}} "
+ "{{result1=@{aura}}} "
+ "{{label2=^{weakness-m}}} "
+ "{{result2=[[ @{wound_total}[@{wounds_i18n}] + [[floor(@{fatigue})]][@{fatigue_i18n}] ]]}} "
+ "{{label3=^{circumstances-m}}} "
+ "{{result3=?{@{modifiers_i18n}|0}}} "
+ "{{botch-button=[@{botch_i18n}!](~@{character_name}|botch)}} "
+ "{{crit-button=[@{critical_i18n}!](~@{character_name}|critical)}}"
+)
+ritual_roll = (
+ "[["
+ "%(die)s "
+ "+ @{Ritual_Technique} "
+ "+ @{Ritual_Form} "
+ "+ ([[@{Ritual_Focus}]]) [@{focus_i18n}] "
+ "+ (@{Stamina_Score}) [@{stamina_i18n}] "
+ "+ (@{aura}) [@{aura_i18n}] "
+ "+ (@{Ritual_Artes_Lib}) [@{artes_i18n}] "
+ "+ (@{Ritual_Philos}) [@{philos_i18n}] "
+ "+ (@{wound_total}) [@{wounds_i18n}] "
+ "+ ([[floor(@{fatigue})]]) [@{fatigue_i18n}] "
+ "+ (?{@{modifiers_i18n}|0}) [@{modifiers_i18n}] "
+ "]]"
+)
GLOBALS["ritual_roll_simple"] = ritual_roll_template % {
"roll": ritual_roll % {"die": "@{simple-die}"}
}
@@ -300,18 +538,54 @@ GLOBALS["ritual_roll_stress"] = (
## Spells
# Deferred attribute access to get the spell's technique value
-spell_tech_value = "(@{sys_at}@{character_name}@{sys_pipe}@{spell_tech_name}_Score@{sys_rbk} + @{sys_at}@{character_name}@{sys_pipe}@{spell_tech_name}_Puissant@{sys_rbk}) [@{sys_at}@{character_name}@{sys_pipe}@{spell_tech_name}_i18n@{sys_rbk}]"
-spell_form_value = "(@{sys_at}@{character_name}@{sys_pipe}@{spell_form_name}_Score@{sys_rbk} + @{sys_at}@{character_name}@{sys_pipe}@{spell_form_name}_Puissant@{sys_rbk}) [@{sys_at}@{character_name}@{sys_pipe}@{spell_form_name}_i18n@{sys_rbk}]"
+spell_tech_value = (
+ "("
+ "@{sys_at}@{character_name}@{sys_pipe}@{spell_tech_name}_Score@{sys_rbk} "
+ "+ @{sys_at}@{character_name}@{sys_pipe}@{spell_tech_name}_Puissant@{sys_rbk}"
+ ") "
+ "[@{sys_at}@{character_name}@{sys_pipe}@{spell_tech_name}_i18n@{sys_rbk}]"
+)
+spell_form_value = (
+ "("
+ "@{sys_at}@{character_name}@{sys_pipe}@{spell_form_name}_Score@{sys_rbk} "
+ "+ @{sys_at}@{character_name}@{sys_pipe}@{spell_form_name}_Puissant@{sys_rbk}"
+ ") "
+ "[@{sys_at}@{character_name}@{sys_pipe}@{spell_form_name}_i18n@{sys_rbk}]"
+)
# Export the deferred attribute access for use in the HTML since the focus depends on them
GLOBALS["spell_tech_value"] = spell_tech_value
GLOBALS["spell_form_value"] = spell_form_value
-spell_roll_template = "&{template:spell} {{spell= @{spell_name}}} {{character= @{character_name} }} {{sigil=@{sigil}}} {{roll= %(roll)s }} {{range= @{spell_range} }} {{duration= @{spell_duration} }} {{target= @{spell_target} }} {{effect= @{spell_note} }} {{mastery= @{spell_note-2} }} {{Technique= @{sys_at}@{character_name}@{sys_pipe}@{spell_tech_name}_i18n@{sys_rbk} }} {{Form= @{sys_at}@{character_name}@{sys_pipe}@{spell_form_name}_i18n@{sys_rbk} }} {{Level= @{spell_level} }} {{botch-button=[@{botch_i18n}!](~@{character_name}|botch)}} {{crit-button=[@{critical_i18n}!](~@{character_name}|critical)}}"
+
+spell_roll_template = (
+ "&{template:spell} "
+ "{{spell= @{spell_name}}} "
+ "{{character= @{character_name} }} "
+ "{{sigil=@{sigil}}} {{roll= %(roll)s }} "
+ "{{range= @{spell_range} }} "
+ "{{duration= @{spell_duration} }} "
+ "{{target= @{spell_target} }} "
+ "{{effect= @{spell_note} }} "
+ "{{mastery= @{spell_note-2} }} "
+ "{{Technique= @{sys_at}@{character_name}@{sys_pipe}@{spell_tech_name}_i18n@{sys_rbk} }} "
+ "{{Form= @{sys_at}@{character_name}@{sys_pipe}@{spell_form_name}_i18n@{sys_rbk} }} "
+ "{{Level= @{spell_level} }} "
+ "{{botch-button=[@{botch_i18n}!](~@{character_name}|botch)}} "
+ "{{crit-button=[@{critical_i18n}!](~@{character_name}|critical)}}"
+)
spell_roll = (
- "[[%(die)s + (@{Stamina_Score}) [@{stamina_i18n}] + "
- + spell_tech_value
- + " + "
- + spell_form_value
- + "+ ([[@{spell_Focus}]]) [@{focus_i18n}] + (@{spell_bonus}) [@{bonus_i18n}] + (@{gestures}) + (@{words}) + (@{aura}) [@{aura_i18n}] + ([[floor(@{Fatigue})]]) [@{fatigue_i18n}] + (@{wound_total}) [@{wounds_i18n}] + (?{@{modifiers_i18n}|0}) [@{modifiers_i18n}] ]]"
+ "[["
+ "%(die)s "
+ "+ (@{Stamina_Score}) [@{stamina_i18n}] "
+ f"+ {spell_tech_value} "
+ f"+ {spell_form_value}"
+ "+ ([[@{spell_Focus}]]) [@{focus_i18n}] "
+ "+ (@{spell_bonus}) [@{bonus_i18n}] "
+ "+ (@{gestures}) "
+ "+ (@{words}) "
+ "+ (@{aura}) [@{aura_i18n}] "
+ "+ ([[floor(@{Fatigue})]]) [@{fatigue_i18n}] "
+ "+ (@{wound_total}) [@{wounds_i18n}] "
+ "+ (?{@{modifiers_i18n}|0}) [@{modifiers_i18n}] ]]"
)
GLOBALS["spell_roll_simple"] = spell_roll_template % {
"roll": spell_roll % {"die": "@{simple-die}"}
diff --git a/Ars_Magica_5th/fileval.py b/Ars_Magica_5th/fileval.py
index 3e918af4a9..341d80fdea 100755
--- a/Ars_Magica_5th/fileval.py
+++ b/Ars_Magica_5th/fileval.py
@@ -133,7 +133,11 @@ def main(
module = importlib.import_module(module_name)
ns.update(getattr(module, attr_name))
except Exception as err:
- print(f"error: Could not load {name}: {err}", end="")
+ print(
+ f"error: Could not load {name} due to "
+ f"{err.__class__.__name__}: {err}",
+ end="",
+ )
if verbose < 1:
print(" (use -v to display detailed traceback)")
else: