The immunity issue may actually not be as complicated as I thought. Such factors are generally a product of affixes, which means we need to check stat procs. So process can be:
Get all categories that contain the flag you're looking for (eg: harmed by cold, harmed by fire, etc).
Get all items that have any of the selected categories.
Process items.
During process, have to check secondary aspects due to affixes.
A jacket with resist fire would throw up an immunity flag during processing, preventing damage.
An artifact with a unique category would throw up an immunity flag during processing, preventing damage.
An item with special properties (wooden shoes that aren't harmed by electricity, or something) can include that flag at the top level, which would be found during processing, preventing damage.
Essentially, immunities all get tossed over to the processing stage to be worked out. The initial item query only cares about collecting all items which -might- be subject to the damage being inflicted. A cold attack while you're holding 2 potions would only have to fully process those two, rather than all items in inventory.
This also deals with having conflicting categories (eg: having Harmed by Fire in one category, and Resists Fire in another category). Processing doesn't care about "harmed by", it only cares about immunities, or resists, takes extra damage, or whatever.
Get all categories that contain the flag you're looking for (eg: harmed by cold, harmed by fire, etc).
Get all items that have any of the selected categories.
Process items.
During process, have to check secondary aspects due to affixes.
A jacket with resist fire would throw up an immunity flag during processing, preventing damage.
An artifact with a unique category would throw up an immunity flag during processing, preventing damage.
An item with special properties (wooden shoes that aren't harmed by electricity, or something) can include that flag at the top level, which would be found during processing, preventing damage.
Essentially, immunities all get tossed over to the processing stage to be worked out. The initial item query only cares about collecting all items which -might- be subject to the damage being inflicted. A cold attack while you're holding 2 potions would only have to fully process those two, rather than all items in inventory.
This also deals with having conflicting categories (eg: having Harmed by Fire in one category, and Resists Fire in another category). Processing doesn't care about "harmed by", it only cares about immunities, or resists, takes extra damage, or whatever.
Comment