standardized buffs
A lot of discussion has happened over the last week or so on how to deal with overlapping buffs.
At present, there aren’t very many objects that give stat buffs - and there aren’t any that give skill buffs. Aside from my strong desire to avoid unbalanced +con buffs floating all over the place, the biggest reason for this sort of thing is probably just how horribly difficult it is to implement reliably.
The current method for giving someone a temporary stat buff is by giving an object a query_str_bonus() method (or con, dex, spd, int, etc…) and dropping it in the player’s inventory. You then wait until recalc() is called on the living - it is called very frequently. The result of all query_str_bonus() calls on the player’s entire inventory is added together in a stat_bonus[] hash that’s stored on all living objects and the contents of stat_bonus[] are then added to all stat queries…
there is a better way
In stead of requiring individual objects to track every buff and in stead of requiring frequent iteration over a player’s inventory and calling 10 methods on every object they’re holding… I think a single buff manager is in order.
Read more…