I am building my own 2D engine and I try to handle the progression of my character.
For example, when the player has a special item an door opens or when he talks with someone and has an item, the person reacts in a different way.
I don't want to hardcode that. Is there an common way to handle such things? I thought about a FSM to handle that but it seemed too complex for it. (I want an easier way.)
At the moment I handle it with several if
statements that check if the characters items array has item X then say this and if he has item Y then say that.
PS: I am writing my engine in JavaScript so if you post code, I can live with Java and AS 3, but not with C/C++.