Skip to content

Avr 1020 monk ability version filtering#2204

Open
lxgrf wants to merge 6 commits into
avrae:nightlyfrom
lxgrf:AVR-1020-monk-ability-version-filtering
Open

Avr 1020 monk ability version filtering#2204
lxgrf wants to merge 6 commits into
avrae:nightlyfrom
lxgrf:AVR-1020-monk-ability-version-filtering

Conversation

@lxgrf

@lxgrf lxgrf commented Aug 4, 2025

Copy link
Copy Markdown

Summary

Fixes monk abilities randomly requiring "Ki Points" (D&D 2014) vs "Focus Points" (D&D 2024) due to action discovery not filtering by D&D rules version. Uses the server settings to decide instead of guessing.

Changelog Entry

Fix monk abilities version filtering for D&D 2014/2024 compatibility (AVR-1020)

PR Type

  • Bug fix (non-breaking change which fixes an issue)

Breaking Change

  • No breaking changes

Testing

  • Unit tests pass (63/63)
  • Sheet manager tests pass (45/48, failures unrelated)
  • Syntax validation complete
  • Backward compatible

Changes Made

  • Enhanced core action discovery system to filter by D&D rules version
  • Updated all sheet processors (D&D Beyond, Dicecloud, DicecloudV2, Google Sheets)

Closes AVR-1020

Comment thread cogs5e/sheets/beyond.py Outdated
Comment on lines +444 to +446
version = "2024" # default
if hasattr(self, 'ctx') and self.ctx:
try:
if hasattr(self.ctx, 'get_server_settings'):
serv_settings = await self.ctx.get_server_settings() if self.ctx.guild else None
else:
from utils.settings.guild import ServerSettings
serv_settings = await ServerSettings.for_guild(mdb=self.ctx.bot.mdb, guild_id=self.ctx.guild.id)

if serv_settings:
version = serv_settings.version

if serv_settings and serv_settings.allow_character_override or not serv_settings:
try:
if hasattr(self.ctx, 'get_character'):
character = await self.ctx.get_character()
else:
from cogs5e.models.character import Character
character = await Character.from_ctx(self.ctx)

if character.options.version:
version = character.options.version
except:
pass
except:
pass

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this code block repeated 4 times - could we pull this out into a function?

self.ctx is guaranteed to exist since this is a function call from self.load_character

also - I dislike the imports inside the function - it will re-import it every time.

@1drturtle

Copy link
Copy Markdown
Contributor

also - it seems like your branch has merge conflicts at the moment. make sure your branch is synced with nightly.

@lxgrf lxgrf force-pushed the AVR-1020-monk-ability-version-filtering branch from 75d328d to 28b159a Compare August 4, 2025 19:09
@lxgrf

lxgrf commented Aug 4, 2025

Copy link
Copy Markdown
Author

@1drturtle Good feedback, thank you - new changes pushed. Does the logic look sound aside from that?

1drturtle

This comment was marked as resolved.

@1drturtle 1drturtle left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Don't have dicecloud on local copy but Gsheet/ddb import successfully in server and DM. All tests pass.


# don't bother parsing if a compendium action is found
if "avrae:parse_only" not in tags and (atk_actions := self.persist_actions_for_name(aname)):
if "avrae:parse_only" not in tags and (atk_actions := self.persist_actions_for_name(aname, "2024")):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be version here as well, correct? Instead of "2024".

Correct me if I'm wrong, I'm not fully familiar with this monk ability

@tonip-wizard

Copy link
Copy Markdown
Contributor

There is a problem when importing dicecloud characters
image

@tonip-wizard tonip-wizard self-requested a review March 5, 2026 19:45

@tonip-wizard tonip-wizard left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to fix issue with dicecloud import

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants