From 426ce73a64c5c57017d1279df4ac6b900b6232ac Mon Sep 17 00:00:00 2001 From: Benubu <74571551+benubu@users.noreply.github.com> Date: Wed, 28 Aug 2024 16:45:37 -0400 Subject: [PATCH 1/3] Update sr.alias 1) add a check for ignorePactSlots cvar/uvar and don't try to account for pactSlots if set 2) Recover all spell slots if character setting srslots is True. --- Collections/Croebh's Class Info/sr.alias | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/Collections/Croebh's Class Info/sr.alias b/Collections/Croebh's Class Info/sr.alias index a49a6a5..ad6636e 100644 --- a/Collections/Croebh's Class Info/sr.alias +++ b/Collections/Croebh's Class Info/sr.alias @@ -53,6 +53,8 @@ hitDice = [f"d{x}" for x in range(20,0,-1)] Bardness = int(get('BardLevel',1))-1 Warlockness = int(get('WarlockLevel',0)) +ignorePactSlots = int(get('ignorePactSlots',0)) +srslots = 'srslots' in character().csettings and character().csettings['srslots'] yourRace = get("race",ch.race) Verdan = "ro<3" if yourRace.lower()=='verdan' else "" spentDice = [] @@ -125,7 +127,17 @@ if countersToResetO: counterFields[counterField] += counterText counterFields = [field.strip(', ') for field in counterFields if field] outText += ' -f "Reset Counters|'+'" -f "Continued|'.join(counterFields)+'"' -if Warlockness: +if srslots: + if sum([sb.get_max_slots(slotLevel) for slotLevel in range(1,10)]): + spellSlotText = '' + for slotLevel in range(1,10): + if sb.get_max_slots(slotLevel): + if delta := sb.get_max_slots(slotLevel)-sb.get_slots(slotLevel): + delta = f' ({delta:+})' + sb.set_slots(slotLevel,sb.get_max_slots(slotLevel)) + spellSlotText += character().spellbook.slots_str(slotLevel)+(delta if delta else '')+n + outText += ', Spell Slots' if compact else f' -f "Spell Slots|{spellSlotText}|inline"' +elif not ignorePactSlots and Warlockness: W = int(WarlockLevel) slotLevel = min(ceil(W/2),5) totalSlots = sb.get_max_slots(slotLevel) @@ -136,6 +148,7 @@ if Warlockness: delta = min(sb.get_max_slots(slotLevel)-sb.get_slots(slotLevel)-int(get('ssSpent',0)),pactSlots) sb.set_slots(slotLevel,min(delta+sb.get_slots(slotLevel),sb.get_max_slots(slotLevel))) outText += f' -f "Spell Slots|{sb.slots_str(slotLevel)}{f" ({delta:+})" if delta else ""}"' + hitDieText = '' for hitdie in ownedHitDice: delta = 0 @@ -146,4 +159,4 @@ for hitdie in ownedHitDice: outText += f' -f "Hit Dice|{hitDieText}"' if ownedHitDice else '' outText += f' -f "{yourRace} Regeneration|{ch.cc_str("Regeneration")}|inline"' if get('regenValid') else '' return outText+ f''' -thumb {image} -color {color} -footer "{name}: <{character().hp_str()}>" ''' - \ No newline at end of file + From 66452e6a9689a100329ad78645dabbceaea26e0d Mon Sep 17 00:00:00 2001 From: Benubu <74571551+benubu@users.noreply.github.com> Date: Wed, 28 Aug 2024 16:48:38 -0400 Subject: [PATCH 2/3] Update sr.md Add instructions for `!cvar ignorePactSlots 1` and `!csettings` --- Collections/Croebh's Class Info/sr.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Collections/Croebh's Class Info/sr.md b/Collections/Croebh's Class Info/sr.md index 57c8917..496f241 100644 --- a/Collections/Croebh's Class Info/sr.md +++ b/Collections/Croebh's Class Info/sr.md @@ -13,4 +13,6 @@ You can also just do `!sr X` to use X Hit Dice, starting with the largest availa **Periapt of Wound Closure:** If you have a Periapt of Wound Closure, create a cvar named `attunedItems` and put `Periapt of Wound Closure` in it. You can also use the `periapt` or `closure` argument with the alias to apply the effect. -**Verdan: Black Blood Healing:** If your race is set as Verdan, `!sr` will automatically reroll any 1s or 2s you roll on a Hit Die. \ No newline at end of file +**Verdan: Black Blood Healing:** If your race is set as Verdan, `!sr` will automatically reroll any 1s or 2s you roll on a Hit Die. + +`!sr` will try to automatically detect if you're a Warlock and recover pact slots appropriately. You can override this with `!cvar ignorePactSlots 1` to always disable recovering spell slots on short rest, or use `!csettings` -> Gameplay Settings -> Toggle Short Rest Slots to always recover *all* slots on short rest. From 2983e0382a3c9650c755b6f7f6be25f4eea67252 Mon Sep 17 00:00:00 2001 From: Benubu <74571551+benubu@users.noreply.github.com> Date: Wed, 28 Aug 2024 16:48:57 -0400 Subject: [PATCH 3/3] Update sr.md --- Collections/Croebh's Class Info/sr.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Collections/Croebh's Class Info/sr.md b/Collections/Croebh's Class Info/sr.md index 496f241..29bf5ed 100644 --- a/Collections/Croebh's Class Info/sr.md +++ b/Collections/Croebh's Class Info/sr.md @@ -15,4 +15,4 @@ You can also just do `!sr X` to use X Hit Dice, starting with the largest availa **Verdan: Black Blood Healing:** If your race is set as Verdan, `!sr` will automatically reroll any 1s or 2s you roll on a Hit Die. -`!sr` will try to automatically detect if you're a Warlock and recover pact slots appropriately. You can override this with `!cvar ignorePactSlots 1` to always disable recovering spell slots on short rest, or use `!csettings` -> Gameplay Settings -> Toggle Short Rest Slots to always recover *all* slots on short rest. +**Warlock: Pact Slots:** `!sr` will try to automatically detect if you're a Warlock and recover pact slots appropriately. You can override this with `!cvar ignorePactSlots 1` to always disable recovering spell slots on short rest, or use `!csettings` -> Gameplay Settings -> Toggle Short Rest Slots to always recover *all* slots on short rest.