reyzor1991 / foundry-vtt-pf2e-notification Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
Hey Reyzor,
It's not a big deal, but if you have the time maybe you could look into implementing this somehow? The buckler is shown as occupying a hand, however, you can hold anything you want in that hand together with the buckler. It only matters if you try to Raise the buckler. https://2e.aonprd.com/Shields.aspx?ID=1 So the warning should not pop up unless you are trying to raise it while holding other 2 items.
Thanks for great modules :)
Foundry lists this module as incompatible with v12 when asking it to preview compatibility.
I've added the following to my module on my end but it would be amazing to have this engrained in the main module as a togglable feature
This prevents the situation where a player has equipped more items than they can carry and enters combat. In the current module, the hook is based on an item update, so if the user tries to equip something, it flags it. However, if the user enters combat but never changes their items equipped status (i.e.: it was already being wielded) the player can have many items equipped without notice
The below code will check on each turn change in combat for each user - filtering shields, weapons, and torches (more can be added pretty easily)
Hooks.on("updateCombat",` async (combat, data) => {
const combatentID = combat.current.tokenId;
let token = canvas.scene.tokens.get(combatentID);
let actor = token.actor;
const shield = actor.itemTypes.equipment.filter(i => i.system.armor?.type === "shield" && i.system.equipped.carryType === "held");
const weapons = actor.itemTypes.weapon.filter(i => i.name.toLowerCase() !== "unarmed attack" && i.system.equipped.carryType === "held");
const torches = actor.itemTypes.consumable.filter(i => i.name.toLowerCase() === "torch");
const items = [];
if (shield) items.push(...shield);
if (weapons) items.push(...weapons);
if (torches) items.push(...torches);
let handsequipped = items.reduce(function (s, a) {
return s + a.system.equipped.handsHeld;
}, 0);
if (handsequipped > 2)
{
ui.notifications.warn(`${actor.name} is currently wielding ${handsequipped} 'hands' worth of items`);
}
});
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.