Closed julienp closed 13 years ago
Trinkets and other procs in the ProcsList will have the same the same issue if you ever end up modifying them. I'm not sure if there's a case where that will happen, but we might as well change them the same way to make the code more robust.
I just realized that my current code assumes all weapon procs are PPMProcs and all trinkets Procs. I'd solve this by adding a is_ppm flag to the data tuples in allowed_procs and allowed_enchants. Either you create a Proc or PPMProc instance based on that flag or simply roll the PPMProc methods into Proc, with init augmented by an is_ppm argument. I'll wait for someone to review this before I go ahead with the changes.
Sigh, just noticed that get_all_procs_for_stat and get_all_damage_procs don't work properly at all. I'll look into it.
Fixed. I'll make sure to test better before sending a pull-request, sorry.
Weapon enchants need to be a new instance of PPMProc for each weapon since their proc_chance is modified in Weapon.init, otherwise you end up changing the same class level PPMProc.