Giter Club home page Giter Club logo

foundry-vtt-pf2e-notification's People

Contributors

reyzor1991 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

foundry-vtt-pf2e-notification's Issues

Buckler should count as a free hand

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 :)

v12 Compatibility

Foundry lists this module as incompatible with v12 when asking it to preview compatibility.

Feature Request: Add notification in combat

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`);    
     }
});

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.