How it works under the hood (in some kind of pseudo-pseudo-code)
Updated 10 months agoIt patches the "Start" method of GrabbableItem class. Basically, whenever there is spawned a grabbable item in the game, be it stun grenade or yield sign, my mod will check if this item is in the "PatchableItems" list. (it's the list of item names, you can find it in PatchableItemsList class)
If it's in the list - then we check if the item has a scanNode already or not (this was the case with RadarBooster which has scanNode existing by default).
If it doesnt - then we add a scanNode for it, so you can scan this item. (Here we also set distance at which you can and can't scan this item)
In the end of this all - we call setScrapValue() method on this item to set it's value (for which it is later sold at company building).
The value of the item is calculated as: originalPrice * salesPercentage (default is 100) / 200 (this formula helps avoiding some float parsing stuff)