Skip to content

Comments

Feature: Add "Available (No Cantrips)" option to Item Choice Advancement#6609

Open
CATFOOL wants to merge 1 commit intofoundryvtt:5.3.xfrom
CATFOOL:5.2.x
Open

Feature: Add "Available (No Cantrips)" option to Item Choice Advancement#6609
CATFOOL wants to merge 1 commit intofoundryvtt:5.3.xfrom
CATFOOL:5.2.x

Conversation

@CATFOOL
Copy link

@CATFOOL CATFOOL commented Jan 7, 2026

This PR adds a new option Available (No Cantrips) (availableNoCantrips) to the Spell Level restriction in the Item Choice Advancement configuration.

Currently, the Available option allows players to choose spells of any level for which they have spell slots, but this includes Cantrips (0-level spells). There are cases (e.g., specific feats or class features) where a player should be allowed to choose from any leveled spell they can cast, but not Cantrips. This new option fills that gap.

@Fyorl Fyorl added feature request system: advancement priority: medium strategic Requires sign-off from a core Foundry VTT developer before merge. labels Jan 7, 2026
@arbron arbron changed the base branch from 5.2.x to 5.3.x February 10, 2026 17:29
this.advancement.actor, { added, removed, level: this.featureLevel }
) === true);
const validSpell = !validateSpellLevel || (i.system.level <= maxSlot);
const validSpell = !validateSpellLevel || (i.system.level <= maxSlot && i.system.level >= minSpellLevel);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
const validSpell = !validateSpellLevel || (i.system.level <= maxSlot && i.system.level >= minSpellLevel);
const validSpell = !validateSpellLevel || ((i.system.level >= minSlot) && (i.system.level <= maxSlot));

const spellLevel = this.advancement.configuration.restriction.level;
const maxSlot = this._maxSpellSlotLevel();
const validateSpellLevel = (this.advancement.configuration.type === "spell") && (spellLevel === "available");
const minSpellLevel = spellLevel === "availableNoCantrips" ? 1 : 0;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd probably just name this minSlot to match with the existing maxSlot. Alternatively you could rename the existing maxSlot to maxLevel if you think that would make more sense.

Suggested change
const minSpellLevel = spellLevel === "availableNoCantrips" ? 1 : 0;
const minSlot = spellLevel === "availableNoCantrips" ? 1 : 0;

Comment on lines +222 to +223
: config.restriction.level === "available" ? 0
: Number(config.restriction.level),
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should probably leave the min level as undefined in cases where we don't care about it so that players are still free to set the filter to a higher level if they want to only look at higher levels spells.

Suggested change
: config.restriction.level === "available" ? 0
: Number(config.restriction.level),
: config.restriction.level === "available" ? undefined : Number(config.restriction.level),

Comment on lines +318 to +319
const minLevel = spellLevel === "availableNoCantrips" ? 1 : 0;
if ( item.system.level > maxSlot || item.system.level < minLevel ) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same naming comment as above.

Suggested change
const minLevel = spellLevel === "availableNoCantrips" ? 1 : 0;
if ( item.system.level > maxSlot || item.system.level < minLevel ) {
const minSlot = spellLevel === "availableNoCantrips" ? 1 : 0;
if ( (item.system.level < minSlot) || (item.system.level > maxSlot) ) {

@arbron
Copy link
Collaborator

arbron commented Feb 10, 2026

There is also going to be a re-writing of ItemChoiceFlow very shortly, so be prepared to re-apply these changes to ItemChoiceFlowV2 once #6249 is merged.

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

Labels

priority: medium strategic Requires sign-off from a core Foundry VTT developer before merge. system: advancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants