]> jfr.im git - irc/gameservirc.git/blobdiff - gameserv-2.0/libgameservgldl/src/GameLayer/GameObjects/WeaponGO.cpp
Changed all references of HP to Health
[irc/gameservirc.git] / gameserv-2.0 / libgameservgldl / src / GameLayer / GameObjects / WeaponGO.cpp
index 40edef53e69a5612b91858ecee68ee72d9bb31af..1f6c1691504fabe49ff044092e56f887a295d56b 100644 (file)
@@ -3,10 +3,13 @@ using GameServ::GameLayer::GameObjects::ItemGO;
 #include <GameServ/GameLayer/GameObjects/WeaponGO.h>\r
 using GameServ::GameLayer::GameObjects::WeaponGO;\r
 \r
+#include <GameServ/Types.h>\r
+using GameServ::Types::Modifiers;\r
+\r
 #include <string>\r
 using std::string;\r
-#include <vector>\r
-using std::vector;\r
+#include <map>\r
+using std::map;\r
 \r
 #include <boost/format.hpp>\r
 #include <boost/algorithm/string.hpp>\r
@@ -15,18 +18,20 @@ using boost::str;
 \r
 WeaponGO::WeaponGO() : ItemGO()\r
 {\r
+       mType = ItemTypes::Weapon;\r
 }\r
 \r
-WeaponGO::WeaponGO(const string &name, const int &price, const int &uses, const int &strength, const int &defense, const int &maxhp) :\r
+WeaponGO::WeaponGO(const string &name, const int &price, const int &uses, const int &strength, const int &defense, const int &maxhealth) :\r
 ItemGO()\r
 {\r
        mName = name;\r
        mPrice = price;\r
        mUses = uses;\r
        mModifiers.clear();\r
-       mModifiers.push_back(str(format("STRENGTH + %d") % strength));\r
-       mModifiers.push_back(str(format("DEFENSE + %d") % defense));\r
-       mModifiers.push_back(str(format("MAXHP + %d") % maxhp));\r
+       mModifiers[Modifiers::strength] = strength;\r
+       mModifiers[Modifiers::defense] = defense;\r
+       mModifiers[Modifiers::maxhealth] = maxhealth;\r
+       mType = ItemTypes::Weapon;\r
 }\r
 \r
 WeaponGO::~WeaponGO()\r