Hey! I'm trying to figure out an approach to storing and changing the state and values of my items placed on a grid inventory.
The items would have their own functionality and values, be affected by the type of tile they are on, the items next to them etc. I'd want the item to be capable of having as many states affecting it as possible, and for the states to interact synergistically ala. Binding of Isaac.
Just as an example, and item affected by two states, one that causes it to activate it's effect when moved a tile, and another that causes it to move in one direction in the inventory when used. So it creates an emergent synergy that makes it activate several times when used as long as it has slots to move to.
Is there some kind of programming pattern fit for storing these overlapping states, and have them effect the base item functionality? I know storing the states in the item script itself and having a nasty nested if statement probably isn't the way. And I feel a state machine wouldn't let me easily have the different states interact?
Thanks for the help for this kinda nebulous question!