Added Iron Apple which heals 4 Hearts
authorsfan5 <sfan5@live.de>
Mon, 12 Sep 2011 18:10:17 +0000 (20:10 +0200)
committersfan5 <sfan5@live.de>
Mon, 12 Sep 2011 18:10:17 +0000 (20:10 +0200)
data/apple_iron.png [new file with mode: 0644]
src/content_craft.cpp
src/content_inventory.cpp

diff --git a/data/apple_iron.png b/data/apple_iron.png
new file mode 100644 (file)
index 0000000..2dffdf0
Binary files /dev/null and b/data/apple_iron.png differ
index 20ab5f06937b5aa2223d4df0c3d05961ca114209..8e8b17a9b08acda44ef5a949f2590bb6926be1fa 100644 (file)
@@ -428,6 +428,20 @@ InventoryItem *craft_get_result(InventoryItem **items)
                        return new MaterialItem(CONTENT_LADDER, 1);
                }
        }
+       
+       // Iron Apple
+       {
+               ItemSpec specs[9];
+               specs[1] = ItemSpec(ITEM_CRAFT, "steel_ingot");
+               specs[3] = ItemSpec(ITEM_CRAFT, "steel_ingot");
+               specs[4] = ItemSpec(ITEM_CRAFT, "apple");
+               specs[5] = ItemSpec(ITEM_CRAFT, "steel_ingot");
+               specs[7] = ItemSpec(ITEM_CRAFT, "steel_ingot");
+               if(checkItemCombination(items, specs))
+               {
+                       return new CraftItem("apple_iron", 1);
+               }
+       }
 
        return NULL;
 }
index e0c9d8b86d836c9035e3242b9ee761266296af00..59997ee4b69a6902896c566c172dfefe51bafc4d 100644 (file)
@@ -73,6 +73,8 @@ std::string item_craft_get_image_name(const std::string &subname)
                return "firefly.png";
        else if(subname == "apple")
                return "apple.png";
+               else if(subname == "apple_iron")
+               return "apple_iron.png";
        else
                return "cloud.png"; // just something
 }
@@ -130,6 +132,8 @@ bool item_craft_is_eatable(const std::string &subname)
                return true;
        else if(subname == "apple")
                return true;
+       else if(subname == "apple_iron")
+               return true;
        return false;
 }
 
@@ -139,6 +143,8 @@ s16 item_craft_eat_hp_change(const std::string &subname)
                return 6; // 3 hearts
        else if(subname == "apple")
                return 4; // 2 hearts
+       else if(subname == "apple_iron")
+               return 8; // 4 hearts
        return 0;
 }