Fix punching of oerkkis
authorPerttu Ahola <celeron55@gmail.com>
Sun, 16 Oct 2011 22:58:38 +0000 (01:58 +0300)
committerPerttu Ahola <celeron55@gmail.com>
Sun, 16 Oct 2011 22:58:38 +0000 (01:58 +0300)
src/content_sao.cpp
src/content_sao.h

index 9569b6586cc4c9f8e04732d8fe2c6d01d9f471e9..61a2df25502f6e8ecd7ffd3484be18bd820b9847 100644 (file)
@@ -684,11 +684,25 @@ std::string Oerkki1SAO::getStaticData()
        return os.str();
 }
 
-u16 Oerkki1SAO::punch(const std::string &toolname, v3f dir)
+u16 Oerkki1SAO::punch(const std::string &toolname, v3f dir,
+               const std::string &playername)
 {
        m_speed_f += dir*12*BS;
 
-       u16 amount = 20;
+       u16 amount = 5;
+       /* See tool names in inventory.h */
+       if(toolname == "WSword")
+               amount = 10;
+       if(toolname == "STSword")
+               amount = 12;
+       if(toolname == "SteelSword")
+               amount = 16;
+       if(toolname == "STAxe")
+               amount = 7;
+       if(toolname == "SteelAxe")
+               amount = 9;
+       if(toolname == "SteelPick")
+               amount = 7;
        doDamage(amount);
        return 65536/100;
 }
index a335c12b8b638f58311165cfe0fc96e588a63880..f0ebf4f6fbe3b02822ba35d3e74f08b785835b84 100644 (file)
@@ -96,7 +96,8 @@ public:
        std::string getClientInitializationData();
        std::string getStaticData();
        InventoryItem* createPickedUpItem(){return NULL;}
-       u16 punch(const std::string &toolname, v3f dir);
+       u16 punch(const std::string &toolname, v3f dir,
+                       const std::string &playername);
        bool isPeaceful(){return false;}
 private:
        void doDamage(u16 d);