2 ms·
What you describe is a very special and exceptional case to have it affect everything else. Personally what i would do in such a case is to have the Weapon obje
by badsectoracula 9y ago
What you describe is a very special and exceptional case to have it affect everything else. Personally what i would do in such a case is to have the Weapon object own a WeaponFlask object and when the weapon is added/removed to the player's inventory it automatically adds/removes the WeaponFlask object too and the WeaponFlask itself can veto being removed from the inventory. You'd need to add extra events for that, but assuming we're talking about an RPG style game, you most likely will have functionality for stuff like that anyway for other items (e.g. cursed items that cannot be removed, enchanted items that apply/remove an Effect when they are added/removed from the inventory or the player wears them, etc).
- a_t48 9y agoThat's one special case, but eventually you end up with a few dozen special cases.