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 support for custom properties (homebrew) #349

Open
Stackclash opened this issue Feb 24, 2024 · 5 comments
Open

✨ Add support for custom properties (homebrew) #349

Stackclash opened this issue Feb 24, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@Stackclash
Copy link

I have a homebrew that has a couple of custom properties for items. I would like to include these in the template.

"itemProperty": [
    {
		"name": "Herb",
		"source": "HHbH",
		"page": 5,
		"abbreviation": "Hrb",
		"template": "{@b Location:} {{item.customProperties.lcn}} {@b Requires Preparation:} {{item.customProperties.prep}}",
		"entries": []
	}
]

Hamund's Herbalism Handbook

Here is an example of an item with these properties:

{
	"name": "Sentry Bush",
	"source": "HHbH",
	"page": 30,
	"type": "Herb",
	"rarity": "common",
	"value": 100,
	"property": [
		"Hrb"
	],
	"entries": [
		{
			"type": "entries",
			"name": "Description:",
			"entries": [
				"A scraggly brush found only on high altitudes, its bitter twigs produce an incredibly potent stimulant that when brewed into a tea, can completely replace one's need to sleep. Due to its inaccessible location, but widely sought-after use, mountain clans are often found carrying them in their caravan to trade to people that need to stay awake for long periods of time."
			]
		},
		{
			"type": "entries",
			"name": "Effect:",
			"entries": [
				"After preparing this herb, you gain all the benefits of 8 hours of sleep (or the equivalent form of dormancy for your race). You still need to rest for at least 8 hours in order to benefit from a long rest."
			]
		}
	],
	"customProperties": {
		"lcn": "Mountain",
		"prep": "Yes"
	},
	"foundryType": "consumable"
}

Hamund's Herbalism Handbook

@Stackclash Stackclash added the enhancement New feature or request label Feb 24, 2024
@ebullient
Copy link
Owner

ebullient commented Feb 25, 2024

Item properties are absolutely already taken into account provided they are in the right format in _meta. The Herbalism Handbook works properly, IIRC.

The meta for that handbook does not include a description. This shows in rules/item-properties.md:

### Herb
_Source: Hamund's Herbalism Handbook p. 5_

And items are linked to it:

# Aboleth Stalk
*Herb, rare, Herb*  

- **Properties**: [Herb](rules/item-properties.md#Herb)
- **Cost**: 500 gp

What is missing?

@Stackclash
Copy link
Author

Stackclash commented Feb 26, 2024

@ebullient the properties for "Location" and "Requires Preparation".
image

"customProperties": {
	"lcn": "Mountain",
	"prep": "Yes"
}

The lcn and prep keys.

@ebullient
Copy link
Owner

ebullient commented Feb 26, 2024

ok. A different kind of custom properties. ;)

Herb is, in and of itself, a custom Item property (at a macro level), so I didn't see the detail that you meant.

Always item template usage?

@Stackclash
Copy link
Author

Stackclash commented Feb 26, 2024

I'm imagining something along the lines of the following in the item template:

Location: {resource.custom.lcn}
Requires Preparation: {resource.custom.prep}

@revilowaldow
Copy link

Always item template usage?

Not necessarily, if you wanted a stress test try https://github.com/TheGiddyLimit/homebrew/blob/master/magicvariant/aeyana%3B%20Gemstones.json
Which includes customProperties mixed with itemEntry and variant generation.
Clock the hasRefs flag.

image

image

Basically this one '''item''' explodes to 46 items on the site

image
See video:
https://github.com/ebullient/ttrpg-convert-cli/assets/52298102/9a0a3e25-8329-413e-aeee-f88c3a14693b

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

No branches or pull requests

3 participants