What if items them selves held the strings. Better yet since I want to keep items as pure data as much as possible. What if the itemFactory could generate the messages and report them. I've been wanting to do this with actions as well. For example;
itemSystem.reportUseAction(isPlayersAction, item, console); itemSystem.reportEatAction(item, console); itemSystem.reportFoundItem(item, console); combatSystem.reportHitAction(isPlayersAction, damageDealth, defender); //.....etcThe isPlayersAction would be for discerning how the message is worded, of course this will get a lot more use when updating the combat messages as well.This is gonna help the item systems code a bit as well. Right now it currently is the one that owns the information about what item type have been identified or not. right now there's a lot of copy past code for discerning whether and item has been identified or not, do to the hacked way of doing checks on it.
This is also going to be applied to how actions are are processed. Right now the highest level game namespace processes all item actions such as eating, using and even discarding. All of which I want to put into their respective systems.
This would be my first idea of how the functions would be modelled.
itemSystem.useItem(item, creatureToUseOn);But that wont handle everything, scrolls may interact with more than creatures. I could double the functions split into different item types. Though I want to lower the code. I don't know how many items will eventually be in the game that I'll want to able to be used.
itemSystem.usePotion(isPlayer, item, creature, console); itemSystem.useScroll(isPlayer, item, creature, scroll, console);I might just limit the use to just potions and scrolls and make it more general in the next attempt at this project. The last bit to note, in each action command is the console, cause they will also call the respective report function as well.
Now that I got my idea, its time to get coding.