From 585a33e221a7ee392791f4fd5a5ec9214b8fe868 Mon Sep 17 00:00:00 2001 From: Erik Schilling Date: Sat, 30 Mar 2013 09:29:08 +0100 Subject: Moved fighting code into a component All damage dealing is now handeled via CombatComponent. Monsters use a derived MonsterCombatComponent since they can have a damage mutation and have a seperate script callback. The wirering with Being is still not optional since most of the stuff does not exist as components. Things done: - Seperated the fighting code from Being and only let Characters and Monsters add the Component (less overhead for npcs) - Added a getter for Attribute values to prevent searching it all the time in non Being members - Fixed the type if the damage mutation to double (no idea why it was int) I did not want to copy it over incorrectly - Removed the addAttack/removeAttack overrides in Character and made the knuckleAttack being added based on newly added signals Future TODOS: - Remove depedency on Being as soon all needed dependencies are available as components of Entity - Move the monster script callback into the general combatcomponent and make it usuable for characters too --- src/game-server/commandhandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/game-server/commandhandler.cpp') diff --git a/src/game-server/commandhandler.cpp b/src/game-server/commandhandler.cpp index 001f65f..353c3ef 100644 --- a/src/game-server/commandhandler.cpp +++ b/src/game-server/commandhandler.cpp @@ -670,7 +670,7 @@ static void handleMoney(Character *player, std::string &args) value = utils::stringToInt(valuestr); // change how much money the player has - other->setAttribute(ATTR_GP , other->getAttribute(ATTR_GP) + value); + other->setAttribute(ATTR_GP , other->getAttributeBase(ATTR_GP) + value); // log transaction std::string msg = "User created " + valuestr + " money"; -- cgit