Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions Collections/Croebh's Class Info/sr.alias
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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()}>" '''
</drac2>
</drac2>
4 changes: 3 additions & 1 deletion Collections/Croebh's Class Info/sr.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
**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.

**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.