Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a third item to multiattack breaks CR calculation #32

Closed
shitwolfymakes opened this issue Aug 25, 2021 · 3 comments
Closed

Adding a third item to multiattack breaks CR calculation #32

shitwolfymakes opened this issue Aug 25, 2021 · 3 comments
Labels
enhancement New feature or request
Milestone

Comments

@shitwolfymakes
Copy link

I have no experience with JS, or I'd try to run this bug down myself.

When I add the third item to a multiattack group, the CR calculation suddenly stops including Resistances in the defensive CR calculation, resulting in an Estimated CR of 12 (17 Offensive, 8 Defensive) instead of 15/16. This doesn't seem to make any sense, given that an attack should have no effect on the monster's Resistances, let alone completely cancelling them out.

Below is the dump of the .5emm.json. Github isn't letting me upload even txt files for some reason

{"name":"Avatar of the Tempest (Category 3)","saveVersion":3,"size":"Huge","type":"elemental","alignment":"neutral","AC":17,"ACType":"natural armor","CR":18,"proficiency":5,"HP":{"HD":16,"type":12,"modifier":48},"speeds":[{"id":"b910e24f-3589-4dc7-bbc1-9ff364722bdf","type":"walk","speed":0,"note":""},{"type":"swim","speed":60,"note":"","id":"56b986b7-1b46-45c5-b5c1-6b309cab3daa"},{"type":"fly","speed":60,"note":"hover","id":"ef99b499-7b12-4663-a4ce-d6c42a44ca1b"}],"stats":{"STR":18,"DEX":21,"CON":17,"INT":6,"WIS":10,"CHA":13},"saves":{"STR":{"proficient":false,"override":false,"overrideValue":0},"DEX":{"proficient":true,"override":false,"overrideValue":0},"CON":{"proficient":true,"override":false,"overrideValue":0},"INT":{"proficient":false,"override":false,"overrideValue":0},"WIS":{"proficient":false,"override":false,"overrideValue":0},"CHA":{"proficient":false,"override":false,"overrideValue":0}},"skills":[],"resistances":["fire","acid","bludgeoning, piercing, and slashing from non-magical attacks that aren't adamantine"],"immunities":["cold","lightning","poison","thunder"],"vulnerabilities":[],"conditions":["exhaustion","grappled","paralyzed","petrified","poisoned","prone","restrained","unconscious"],"senses":{"blindsight":120,"darkvision":0,"tremorsense":0,"truesight":0},"passivePerception":{"override":false,"overrideValue":0},"languages":"Primordial","attacks":[{"name":"Shock","id":"afbb1acc-3c34-4c19-b26e-5a94363a79b6","distance":"Melee","kind":"Weapon","modifier":{"override":false,"overrideValue":0,"stat":"STR","proficient":true},"range":{"standard":0,"long":0,"reach":0},"targets":1,"damage":{"dice":8,"count":4,"modifier":{"override":false,"overrideValue":4,"stat":"STR"},"type":"lightning"},"alternateDamage":{"dice":10,"count":1,"modifier":{"override":false,"overrideValue":0,"stat":"STR"},"type":"slashing","condition":"","active":false},"additionalDamage":[],"save":0,"description":"This attack has advantage against a target wearing metal armor.","legendaryOnly":false},{"name":"Slam","id":"c19461a6-ae68-43b0-b5d5-c5852a48d963","distance":"Melee","kind":"Weapon","modifier":{"override":false,"overrideValue":0,"stat":"STR","proficient":true},"range":{"standard":0,"long":0,"reach":10},"targets":1,"damage":{"dice":8,"count":5,"modifier":{"override":false,"overrideValue":0,"stat":"STR"},"type":"slashing"},"alternateDamage":{"dice":10,"count":1,"modifier":{"override":false,"overrideValue":0,"stat":"STR"},"type":"slashing","condition":"","active":false},"additionalDamage":[{"id":"42e5a091-34db-4acd-a8d7-ebf0397329dc","dice":8,"count":1,"type":"lightning","note":""},{"id":"ae9374c9-e10b-470c-bde6-f818e0d959d8","dice":8,"count":1,"type":"thunder","note":""}],"save":0,"description":"","legendaryOnly":false}],"multiattacks":[{"id":"0d487fa3-e959-4f8e-acc7-a1eda99b91c2","attacks":["afbb1acc-3c34-4c19-b26e-5a94363a79b6","c19461a6-ae68-43b0-b5d5-c5852a48d963","c19461a6-ae68-43b0-b5d5-c5852a48d963"],"actions":[]}],"spellcasting":{"stat":"INT","save":{"override":false,"overrideValue":0},"modifier":{"override":false,"overrideValue":0},"attack":{"override":false,"overrideValue":0},"class":"","level":1,"slots":[0,0,0,0,0,0,0,0,0],"atWill":[],"standard":[],"notes":"","atWillNotes":""},"traits":[{"name":"Legendary Resistance","id":"3c5f6552-6cdd-4bb8-b940-8a9a53054ca4","description":"If the Avatar fails a saving throw, it can choose to succeed instead.","limitedUse":{"count":1,"rate":"day"},"crAnnotation":{"maxDamage":0,"maxSave":0,"maxModifier":0,"multitarget":false,"ehpMultiplier":1,"ehpModifier":0,"acModifier":0,"include":false}},{"name":"Thunderous Visage","id":"f45f3db5-fee1-4a31-8a7a-a7a63a47c8f9","description":"Any creature that touches the Avatar or hits it with a melee attack using a metallic weapon takes {1d8} lightning damage. In addition, the Avatar can enter any creature's space and stop there. The first time it enters a creature's space on a turn, that creature takes {1d8} lightning damage. A creature that ends its turn inside the Avatar's space also takes {1d8} lightning damage.","limitedUse":{"count":0,"rate":"day"},"crAnnotation":{"maxDamage":4,"maxSave":0,"maxModifier":0,"multitarget":true,"ehpMultiplier":1,"ehpModifier":0,"acModifier":0,"include":true}}],"actions":[{"name":"Thunderbolt","id":"38a75a16-0f63-47c4-9186-a649c3852e31","description":"The Avatar chooses one creature within 90 feet and one other creature within 30 feet of the first target. Each target must make a DC 16 Dexterity saving throw. The targets take {6d8} lightning damage on a failed save, or half as much damage on a successful one.","recharge":"","legendaryOnly":false,"limitedUse":{"count":0,"rate":"day"},"crAnnotation":{"maxDamage":27,"maxSave":16,"maxModifier":0,"multitarget":true,"ehpMultiplier":1,"ehpModifier":0,"acModifier":0,"include":true}},{"name":"Thunderclap","id":"cf365df5-93ce-4bfe-ba45-9530c3515751","description":"A wave of thunderous force blasts out 30 feet in every direction, centered on any point within 120 feet. All unsecured objects that are completely within the area of affect are carried outside the area of effect. All creatures within the area of effect must make a DC 16 Constitution saving throw. On a failed save, a creature takes {2d8+5} bludgeoning damage plus {3d8} thunder damage and is knocked prone.","recharge":"","legendaryOnly":false,"limitedUse":{"count":0,"rate":"day"},"crAnnotation":{"maxDamage":27,"maxSave":16,"maxModifier":0,"multitarget":true,"ehpMultiplier":1,"ehpModifier":0,"acModifier":0,"include":true}},{"name":"Debris Torrent","id":"f518db29-59cc-4ecb-af11-23f425a86234","description":"Debris pulled from buildings and the surrounding area blasts out in a 60-foot cone. Each creature in the area must make a DC 17 Dexterity saving throw. On a failed save, a creature takes {6d8} bludgeoning damage and {6d8} piercing damage, or half as much damage on a successful save.","recharge":"5-6","legendaryOnly":false,"limitedUse":{"count":0,"rate":"day"},"crAnnotation":{"maxDamage":54,"maxSave":20,"maxModifier":0,"multitarget":true,"ehpMultiplier":1,"ehpModifier":0,"acModifier":0,"include":true}},{"name":"Detect","id":"79e42d66-dbcd-46e5-bd33-fab50d239c3e","description":"The Avatar of the Tempest makes a Wisdom (Perception) check.","recharge":"","legendaryOnly":true,"limitedUse":{"count":0,"rate":"day"},"crAnnotation":{"maxDamage":0,"maxSave":0,"maxModifier":0,"multitarget":false,"ehpMultiplier":1,"ehpModifier":0,"acModifier":0,"include":false}},{"name":"Hailstorm","id":"0fdb46c7-8b4f-4d15-a7b1-63155fdbb524","description":"The Avatar of the Tempest unleashes a blast of hail in a 20-foot line. Each creature in that line must make a DC 20 Dexterity saving throw. A target takes {2d8+4} bludgeoning damage and {2d8+4} cold damage on a failed save, or half as much damage on a successful one.","recharge":"","legendaryOnly":true,"limitedUse":{"count":0,"rate":"day"},"crAnnotation":{"maxDamage":26,"maxSave":20,"maxModifier":0,"multitarget":true,"ehpMultiplier":1,"ehpModifier":0,"acModifier":0,"include":true}}],"legendaryActions":{"count":0,"actions":[{"id":"f66cf2d8-080f-4c22-9627-a222c4dd53a7","actionId":"79e42d66-dbcd-46e5-bd33-fab50d239c3e","cost":1},{"id":"7181272c-7fcd-41c9-bb7a-87484a945e33","actionId":"afbb1acc-3c34-4c19-b26e-5a94363a79b6","cost":1},{"id":"0326b6d4-54d7-4260-b11f-c84f953accd8","actionId":"0fdb46c7-8b4f-4d15-a7b1-63155fdbb524","cost":2}]},"reactions":[],"lairActions":[{"name":"Cyclone","id":"16196344-44fc-4b50-a804-dd5dc22a9bff","description":"Swirling winds pull all unsecured objects or prone creatures within 60 feet of the Avatar to the center of it's space. Each creature within 60 feet of the Avatar must make a DC 16 Strength saving throw. On a failed save, a creature takes {4d8+4} bludgeoning damage, and is knocked prone.","crAnnotation":{"maxDamage":22,"maxSave":16,"maxModifier":0,"multitarget":true,"ehpMultiplier":1,"ehpModifier":0,"acModifier":0,"include":false}},{"name":"Blinding Winds","id":"320f94b6-4f8b-41a2-83a7-dcf869c0d0d2","description":"Intense winds swirl in a 30-foot radius extending from the Avatar's form. All creatures inside must make a DC 15 Dexterity saving throw or suffer disadvantage on attack rolls until the effect ends. This lasts until initiative count 20 of the next round.","crAnnotation":{"maxDamage":0,"maxSave":10,"maxModifier":0,"multitarget":true,"ehpMultiplier":1,"ehpModifier":0,"acModifier":0,"include":false}},{"name":"Deafening Thunder","id":"f34e9eb3-fd7a-4188-b472-8cc738aa6907","description":"Thunder booms from a point within 120 feet of the Avatar. Each creature within a 20-foot radius of that point must make a DC 15 Constitution save or take {4d8} thunder damage and be deafened until the end of its next turn.","crAnnotation":{"maxDamage":18,"maxSave":16,"maxModifier":0,"multitarget":true,"ehpMultiplier":1,"ehpModifier":0,"acModifier":0,"include":false}}],"regionalEffects":[],"regionalEffectDescription":"The region containing the {NAME}'s lair is warped by the {NAME}'s magic. When the {NAME} dies, the effects fade after {1d10} days."}

P.S.: I think when it calculates Lair Actions in the CR, it is incorrectly replacing standard actions or multiattacks with the lair actions, rather than adding them on top of the normal calculation like (I think) it should. Lair actions should be totally independent of the action economy of the monster that gets them, unless I'm reading the manuals wrong.

@ebshimizu
Copy link
Owner

hey! thanks for giving the tool a try.

What's happening there is a bit of order of operations concerns:

  • Offensive CR is estimated first
  • Defensive CR is estimated second and uses the offensive CR in its calculations
  • The average of the two is then taken

This requires a bit of explanation. One of the weird things in CR calculation is that the defensive CR's effective HP multipliers change based on the expected CR of the monster. This is a bit of a problem for an automatic estimator, as I couldn't really assume that someone would pick an expected CR first, so I made the decision to base the defensive CR's calculations on the offensive CR (which does not require adjustments to compute).

A side effect of this decision is the edge case you've found here. At CR 17+, the effective HP multiplier for resistances is 1x and the EHP multiplier for immunities is 1.25x. Adding another attack to the multiattack list bumps the estimated offensive CR to 17, which then means that the defensive CR lowers the EHP multipliers, thus lowering the overall CR. This can have some rather dramatic effects.

So the tl;dr is that it's not really a bug but an edge case in the creation of an automatic CR calculator. I'd be interested to know what you'd like the behavior to be there (can add a toggle to use the manually-selected CR from the stat block for defensive?).

As for the second part, I'll take a look at the lair actions I might've put them in the actions stack by accident. They're supposed to be handled like traits (apply every round on top of a selected action).

@shitwolfymakes
Copy link
Author

I think adding a toggle might be best, with a suggestion to use it when creating creatures CR 15-17+

@ebshimizu ebshimizu added the enhancement New feature or request label Sep 11, 2021
@ebshimizu ebshimizu added this to the Version 2 milestone Jun 1, 2022
ebshimizu added a commit that referenced this issue Aug 6, 2022
ebshimizu added a commit that referenced this issue Aug 21, 2022
@ebshimizu
Copy link
Owner

This issue has been addressed in version 2, see #69 for a preview

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants