Skip to content

Commit

Permalink
Remove spc exclusions from discipline/gifts/perks, add whitelist vali…
Browse files Browse the repository at this point in the history
…dation for actor subtypes
  • Loading branch information
Veilza committed Mar 3, 2025
1 parent 3efb3a4 commit a721594
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
13 changes: 12 additions & 1 deletion system/actor/wod-actor-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,18 @@ export class WoDActor extends HandlebarsApplicationMixin(foundry.applications.sh
const blacklist = itemsList[itemType].excludedActorTypes

// If the whitelist contains any entries, we can check to make sure this actor type is allowed for the item
if (!foundry.utils.isEmpty(whitelist) && whitelist.indexOf(actorType) === -1) {
// We go through the base actor type, then subtypes - if we match to any of them, we allow the item to be
// added to the actor.
//
// We don't need to add this logic to the blacklist because the blacklist only needs to check against the base types.
if (!foundry.utils.isEmpty(whitelist) &&
// This is just a general check against the base actorType
!whitelist.includes(actorType) &&
// If the actor is an SPC, check against the spcType
!(actorType === 'spc' && whitelist.includes(this.actor.system.spcType)) &&
// If the actor is a Group sheet, check against the groupType
!(actorType === 'group' && whitelist.includes(this.actor.system.groupType))
) {
ui.notifications.warn(game.i18n.format('WOD5E.ItemsList.ItemCannotBeDroppedOnActor', {
string1: itemType,
string2: actorType
Expand Down
9 changes: 3 additions & 6 deletions system/api/def/itemtypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,7 @@ export class ItemTypes extends BaseDefinitionClass {
img: 'systems/vtm5e/assets/icons/items/discipline.png',
types: ['power'],
sheetClass: DisciplineItemSheet,
restrictedActorTypes: ['vampire', 'ghoul'],
excludedActorTypes: ['spc']
restrictedActorTypes: ['vampire', 'ghoul']
}

static boon = {
Expand Down Expand Up @@ -182,8 +181,7 @@ export class ItemTypes extends BaseDefinitionClass {
img: 'systems/vtm5e/assets/icons/items/edge.png',
types: ['perk'],
sheetClass: PerkItemSheet,
restrictedActorTypes: ['hunter'],
excludedActorTypes: ['spc']
restrictedActorTypes: ['hunter']
}

static edgepool = {
Expand Down Expand Up @@ -230,8 +228,7 @@ export class ItemTypes extends BaseDefinitionClass {
img: 'systems/vtm5e/assets/icons/items/gift.png',
types: ['gift'],
sheetClass: GiftItemSheet,
restrictedActorTypes: ['werewolf'],
excludedActorTypes: ['spc']
restrictedActorTypes: ['werewolf']
}
}

Expand Down

0 comments on commit a721594

Please sign in to comment.