fantasycalendar / FoundryVTT-ItemPiles

Other
33 stars 52 forks source link

[REQUEST] - Descriptive request description #551

Open sito92 opened 4 months ago

sito92 commented 4 months ago

I'm looking for functionality that would allow me to hide items based on their property. For example in Fallout 2d20 there is a concept of items rarity. Merchants shouldn't have items with rarity above rolled value by player. So i would like to have option to hide such items with one click.

Maybe it would be possible with macro already? Is there a way to check item property and set hidden property accordingly?

p4535992 commented 3 months ago

A solution i can suggest is Item Piles + BRT

On the macro level you can update the merchant every time using the result from the roll

Set up a roll table with some DC value

const dcValue = <ROLLED NUMBER ?>;
const skillDenom = <A STRING TO CHECK ON THE ROLLTABLE>;
const targetMerchant = <Actor or token>;
const rollTableToUse = <Roltable>;
const items = await game.modules.get("better-rolltables").api.retrieveItemsDataFromRollTableResult({
    table:  rollTableToUse ,
    options: {
        rollMode: "gmroll",
        dc: dcValue,
        skill: skillDenom,
        rollAsTableType: "harvest"
    }
});
const options = {
    removeExistingActorItems: true // BEWARE THIS WILL DESTROY THE CURRENT INVENTORY IF THE TARGET IS A ACTOR
}
game.itempiles.API.addItems(targetMerchant, items, options);