fantasycalendar / FoundryVTT-ItemPiles

Other
33 stars 54 forks source link

[REQUEST] - Add Split Proceeds ability when selling to merchant #255

Open TheGreatRedDuke opened 1 year ago

TheGreatRedDuke commented 1 year ago

Is your feature request related to a problem? Please describe. One very common thing in many game systems is party members picking up tons of loot with the intent to later sell most of it and split the proceeds with the party. Currently there's not a easy way to do this without manually splitting the total proceeds by doing the math and having party members each add to their currencies manually. This can be made a little more complicated if multiple party members are all doing the same process at once.

Describe the solution you'd like Add the ability to split proceeds when selling to a merchant.

Describe alternatives you've considered Make no changes.

Additional context I think this would be a great feature to add that would benefit many game systems. A merchant can be created that allows for selling only and then easily added to a scene to allow players to quickly and easily sell extra gear for the benefit of the party.

ghost commented 1 year ago

As a further enhancement to this, may I suggest that the characters to receive the proceeds be assignable from actors by dropping actors from the list. This would allow proceeds to include only those who should get shares, possibly including NPCs with whom the party has agreed to split shares.

gridstop commented 1 year ago

Another hypothetical angle to address this would be: 1) GM creates a shared loot actor (and set it to an Item Pile) for the players, and make them all owners. 2) If this module could make it easy for a player to open item piles like corpses or merchants as the shared actor, maybe by holding a hotkey while double clicking. Then 'Take All' could move items from the corpse into the shared party loot, and when shopping they could open the merchant as the shared actor to buy/sell with party resources. Then they could distribute currency from the shared actor as normal afterwards.

If this is possible right now I can't see how. If a player tries to change the 'You're inspecting this pile as (playername)' on an item pile, there's a permission error if they don't own the item pile itself, even if they own the shared actor they want to inspect as. Likewise there is no option to change the interacting actor when shopping. Ideally the mod would check the player's token is near the item pile like normal, but do all the interactions via a chosen party loot actor even if it didn't have a token.

EDIT: Actually this is really close to working using a macro like this: game.itempiles.API.renderItemPileInterface(canvas.tokens.hover?.actor, { "inspectingTarget": "Actor.3a18aOCP9mDPNLNQ" }) But the 'Take All' is broken with a TypeError on source.type being undefined when opening this way. Shopping seems to work OK as does picking up individual items.