Ugly-as-Sin icon indicating copy to clipboard operation
Ugly-as-Sin copied to clipboard

Scarcity: Refactor out hardcoded item behaviors

Open caligari87 opened this issue 3 years ago • 0 comments

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 avatar Mar 19 '21 05:03 caligari87