HDest-Community / Ugly-as-Sin

Enhancement modules for Hideous Destructor
zlib License
21 stars 17 forks source link

Scarcity: Refactor out hardcoded item behaviors #146

Closed caligari87 closed 1 year ago

caligari87 commented 3 years ago

Noticed when troubleshooting a strange issue; stims were getting duplicated. Zerk and lite-amps too. Turns out its because of the HDMagAmmo handler and the fact that so many subclasses rely on it.

What I think I need to do is better generalize the scarcity system, instead of relying on hardcoded behaviors for so many subclasses. HDMagAmmo in particular is too useful for too many things, and treating everything that inherits from it is doomed to failure.

In the end (unfortunately?) this will probably end up in a more robust, if somewhat less "interesting" scarcity system. Where hardcoded behaviors are required, handle those first and skip the generalized cases instead of double-dipping the way it's currently set up.

Alternate solution: Ask Ace to refactor the HDMagAmmo base class into something more like the backpack's StorageItem system and adjust the inheritance chain to be less flat.

caligari87 commented 1 year ago

This was added.