Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add functionality to cast a spell #13

Merged
merged 14 commits into from
Nov 6, 2023
Merged

Add functionality to cast a spell #13

merged 14 commits into from
Nov 6, 2023

Conversation

Carifio24
Copy link
Owner

@Carifio24 Carifio24 commented Nov 6, 2023

This PR adds functionality, exposed via a button in the spell window controller, to cast a spell. The effect of this is to use a slot of the appropriate level for the current character. The basic logic breakdown is as follows:

If the spell has rules for higher level casting, and the character has available slot(s) of the spell's level or higher, a popup controller allows selecting which spell level to cast
If the spell doesn't have higher level rules and the character's only available slots are of a higher level, a popup controller is presented asking if the user wants to upcast (for no benefit)
If the spell doesn't have higher level rules and the character has a slot of the appropriate level, a slot of that level is expended
Otherwise, a Toast message informs the user of the issue with casting (the character either doesn't have any slots, or any available slots, of an appropriate level)

This PR also fixes an issue where component flags weren't being used when filtering spells.

@Carifio24 Carifio24 merged commit 22e8484 into master Nov 6, 2023
5 checks passed
@Carifio24 Carifio24 added the enhancement New feature or request label Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant