vagabond-rpg-foundryvtt/packs/_source/equipment/backpack.json
Cal Corum 1a36139387 Add slotsWhenEquipped system and equipment Active Effect sync
- Add getTotalSlots() method to base-item.mjs as unified interface
- Add slotsWhenEquipped field to weapon, armor, and equipment schemas
- Implement getTotalSlots() in each item type respecting equipped state
- Update actor slot calculation to use getTotalSlots() uniformly
- Add _onUpdate hook to sync equipment effects with equipped state
- Update backpack with slotsWhenEquipped: 0 and +2 slot bonus effect

Backpack now correctly:
- Costs 1 slot when unequipped, 0 when equipped
- Grants +2 max item slots via Active Effect when equipped

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-17 00:34:16 -06:00

56 lines
1.2 KiB
JSON

{
"_id": "vagabondEquipBackpack",
"name": "Backpack",
"type": "equipment",
"img": "icons/svg/item-bag.svg",
"system": {
"description": "<p>Grants +2 Slots, occupies 1 Slot (0 while worn). Can only benefit from one at a time.</p>",
"quantity": 1,
"slots": 1,
"slotsWhenEquipped": 0,
"slotsPerItem": false,
"value": 500,
"consumable": false,
"uses": {
"value": 0,
"max": 0,
"autoDestroy": true
},
"category": "container",
"equipped": false,
"containerCapacity": 2,
"tags": ["container", "camping"],
"isTrinket": false,
"canCastThrough": false,
"relic": {
"isRelic": false,
"tier": 1,
"abilityName": "",
"abilityDescription": "",
"activationCost": "",
"usesPerDay": 0,
"usesRemaining": 0,
"requiresAttunement": false,
"attuned": false,
"lore": ""
}
},
"effects": [
{
"name": "Backpack Slot Bonus",
"icon": "icons/svg/item-bag.svg",
"changes": [
{
"key": "system.itemSlots.bonus",
"mode": 2,
"value": "2"
}
],
"disabled": true,
"transfer": true
}
],
"_key": "!items!vagabondEquipBackpack",
"reviewed": true
}