foundryvtt / dnd5e

An implementation of the 5th Edition game system for Foundry Virtual Tabletop (http://foundryvtt.com).
MIT License
300 stars 206 forks source link

Sense Upgrade change Effects not stacking if sense has existing value greater than upgrade #3838

Open MrPrimate opened 1 month ago

MrPrimate commented 1 month ago

Foundry: 12.327 D&D: 3.2.1

I suspect this applies to things that are not senses as well, however I have not tested that broadly.

If the following effect is applied to an actor with no senses, or a sense (darkvision in this case) less that 30 it creates the effect correctly, setting it to 60.

const effectData = {
  changes: [
    {
      key: "system.attributes.senses.darkvision",
      mode: CONST.ACTIVE_EFFECT_MODES.UPGRADE,
      value: "30",
      priority: 20,
    },
    {
      key: "system.attributes.senses.darkvision",
      mode: CONST.ACTIVE_EFFECT_MODES.ADD,
      value: "30",
      priority: 40,
    },
  ],
  disabled: false,
  name: "Darkvision example",
};
await actor.createEmbeddedDocuments("ActiveEffect", [effectData]);

If the sense is set to the value of the upgrade change or greater then it does not apply correctly, setting the value to 30.

Fyorl commented 1 month ago

I think priority is simply an unimplemented field currently. This may belong in the core repo with a more system-agnostic description.