3 Copyright (C) 2011 celeron55, Perttu Ahola <celeron55@gmail.com>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 std::string tool_get_imagename(const std::string &toolname)
24 if(toolname == "WPick")
25 return "tool_woodpick.png";
26 else if(toolname == "STPick")
27 return "tool_stonepick.png";
28 else if(toolname == "SteelPick")
29 return "tool_steelpick.png";
30 else if(toolname == "MesePick")
31 return "tool_mesepick.png";
32 else if(toolname == "WShovel")
33 return "tool_woodshovel.png";
34 else if(toolname == "STShovel")
35 return "tool_stoneshovel.png";
36 else if(toolname == "SteelShovel")
37 return "tool_steelshovel.png";
38 else if(toolname == "WAxe")
39 return "tool_woodaxe.png";
40 else if(toolname == "STAxe")
41 return "tool_stoneaxe.png";
42 else if(toolname == "SteelAxe")
43 return "tool_steelaxe.png";
44 else if(toolname == "WSword")
45 return "tool_woodsword.png";
46 else if(toolname == "STSword")
47 return "tool_stonesword.png";
48 else if(toolname == "SteelSword")
49 return "tool_steelsword.png";
54 ToolDiggingProperties tool_get_digging_properties(const std::string &toolname)
56 // weight, crackiness, crumbleness, cuttability
57 if(toolname == "WPick")
58 return ToolDiggingProperties(2.0, 0,-1,2,0, 50, 0,0,0,0);
59 else if(toolname == "STPick")
60 return ToolDiggingProperties(1.5, 0,-1,2,0, 100, 0,0,0,0);
61 else if(toolname == "SteelPick")
62 return ToolDiggingProperties(1.0, 0,-1,2,0, 300, 0,0,0,0);
64 else if(toolname == "MesePick")
65 return ToolDiggingProperties(0, 0,0,0,0, 1337, 0,0,0,0);
67 else if(toolname == "WShovel")
68 return ToolDiggingProperties(2.0, 0.5,2,-1.5,0.3, 50, 0,0,0,0);
69 else if(toolname == "STShovel")
70 return ToolDiggingProperties(1.5, 0.5,2,-1.5,0.1, 100, 0,0,0,0);
71 else if(toolname == "SteelShovel")
72 return ToolDiggingProperties(1.0, 0.5,2,-1.5,0.0, 300, 0,0,0,0);
74 // weight, crackiness, crumbleness, cuttability
75 else if(toolname == "WAxe")
76 return ToolDiggingProperties(2.0, 0.5,-0.2,1,-0.5, 50, 0,0,0,0);
77 else if(toolname == "STAxe")
78 return ToolDiggingProperties(1.5, 0.5,-0.2,1,-0.5, 100, 0,0,0,0);
79 else if(toolname == "SteelAxe")
80 return ToolDiggingProperties(1.0, 0.5,-0.2,1,-0.5, 300, 0,0,0,0);
82 else if(toolname == "WSword")
83 return ToolDiggingProperties(3.0, 3,0,1,-1, 50, 0,0,0,0);
84 else if(toolname == "STSword")
85 return ToolDiggingProperties(2.5, 3,0,1,-1, 100, 0,0,0,0);
86 else if(toolname == "SteelSword")
87 return ToolDiggingProperties(2.0, 3,0,1,-1, 300, 0,0,0,0);
90 return ToolDiggingProperties(0.5, 1,0,-1,0, 50, 0,0,0,0);