Purpose:
This tool simulates fatigue and HP loss for a communion over time, considering main spellcasting, one-off spells, and an optional recurring Battlefield Rigor Mortis effect.
How to Use (Inputs):
Spell Settings (Main Communion Spell):
- Base Fatigue: Fatigue cost of the spell before modifications.
- Path Req: Required magic path level to cast the spell.
- Encumbrance (Master): Master's encumbrance, adding to fatigue.
- Magic Scale: Province magic scale (-3 to +3), affects fatigue costs.
Caster/Slave Settings (Main Communion Path):
- Caster Level: Master's magic level in the spell's path (for main communion spell).
- Slave Level: Slave's magic level in the path (for main communion spell, and for one-off spells if "Off-Path" is not checked for them).
- Number of Slaves: Total communion slaves.
- Number of Masters: Total communion masters casting the main spell.
- Communion MR: Magic Resistance for masters and slaves against Rigor Mortis.
Fatigue/HP Settings:
- Initial Slave Fat: Starting fatigue of the slave pool.
- Initial Master Fat: Starting fatigue of each master.
- Slave HP: Starting HP of the slave pool.
- Extra Slave Reinvig/Turn: Additional fatigue recovery per turn for slaves.
- Extra Master Reinvig/Turn: Additional fatigue recovery per turn for masters.
- Healing (HP)/Turn: HP regeneration per turn for slaves.
Simulation & Battlefield Settings:
- Turns: Number of turns to simulate (1–10000).
- Relief spell active: If checked, applies fatigue recovery each turn.
- Enable Battlefield Rigor Mortis?: Check to activate the Rigor Mortis effect.
- Rigor Extra Pen: Additional penetration bonus for Rigor Mortis.
One-Off Spells:
- Turn: Turn the spell is cast.
- Base Fat: Base fatigue cost of the spell.
- Path Req: Required path level for this specific spell.
- Caster Lvl: Caster’s level in the path for this specific spell.
- Off-Path: If checked, slaves are considered path level 0 for calculating their fatigue multiplier for this specific spell. If unchecked, the global "Slave Level" is used.
Mechanics Modeled (Attempting to match spreadsheet and game definitions):
Single Exploding Die (openD6_dom): A d6 roll. If '6', counts as 5 and re-rolls, adding new result. Repeats for more '6's.
Dominions Random Number (DRN): As per game definition: openD6_dom() + openD6_dom(). Calculated by calculate_game_DRN().
Communion Master Level (CM Level): FLOOR(LOG2(Number_of_Slaves)) + Caster_Level.
Master Fatigue Component (MFC_base): (Base_Spell_Fatigue / (1 + MAX(0, CM_Level - Spell_Path_Req))) * (1 - 0.1 * Magic_Scale).
Master Fatigue Cost (per main spell): Master_Final_Cost = (MFC_base + Master_Encumbrance) / (1 + Number_of_Slaves).
Slave Fatigue Multiplier: Based on Caster Level (CL) vs Slave Level (SL):
- If
SL == 0: If CL == 1, then 2x; Else, 4x.
- Else (
SL > 0): If FLOOR(CL / 2) > SL, then 4x; Else if CL > SL, then 2x; Else if CL == SL, then 1x; Else (CL < SL), then 0.5x.
Slave Fatigue Cost (per main spell): Master_Final_Cost * Slave_Fatigue_Multiplier.
One-Off Spell Slave Fatigue: (MFC_base_one_off / (1 + Number_of_Slaves)) * Slave_Fatigue_Multiplier_one_off. (No master encumbrance).
Fatigue Damage (when fatigue reaches or exceeds 200):
For main/one-off spells: 1 + FLOOR(Fatigue_Cost_that_Pushed_to_200 / 50). Applied for each event causing fatigue >= 200.
For Rigor Mortis: 1 HP damage if its fatigue addition causes slave fatigue >= 200.
The simulation proceeds turn by turn (order of operations):
- Battlefield Rigor Mortis (if enabled): Pulses occur. For each hit on slaves, fatigue applied. If slave fatigue reaches/exceeds 200 due to this pulse, 1 HP damage taken. Masters also take fatigue if hit.
- One-Off Spells: For each, fatigue applied to slaves. If slave fatigue reaches/exceeds 200 due to this spell, calculated HP damage taken.
- Main Communion Spell Casting: Each active master casts. Master takes fatigue. For each master's cast, slave fatigue is added. If slave fatigue reaches/exceeds 200 due to *this specific master's contribution*, calculated HP damage taken.
- Relief Spell (if active): Recovers
max(0, 1 + calculate_game_DRN() - calculate_game_DRN()) fatigue.
- Natural Fatigue Recovery: Standard recovery + Extra Reinvig.
- HP Regeneration: Slaves heal HP.