Hey I know that "event" may not be the right word for this but I am making a RPG rouge type game and the basic premise I am working with right now is leveling up... The idea is when the player levels up they can select to raise thier HP, Power(attack), or Toughness(defense) by 1 point or take a "perk" instead. One of the perks I have in mind is a Lifelink ability... If you deal damage greater than 0 you gain a portion of that in HP.
In my mind I think of it as an "event".... Player dealt damage, any effect that activates when the player deals damage is activated and the code is run. I know events are used for GUI and input. Should I use delagates? I know I could just hard-code switches or if statements but that seems like a poor way of doing it... I have thought of an entity component system but that would requre a massive rewrite of my code and I am not looking to do that right now.
How can I implement something like that in a generic modular way where I can have diferent conditions that the perks could react to...(if that makes sense).
Thanks,
Nick
EDIT: I think I found what I was looking for... creating a system that allows the objects to send messages to eachother when they do things, using a finite state machine. Any other idas are still appreciated!
Edited by BambooCatfish, 24 January 2013 - 01:41 PM.






