aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2011-09-12 20:10:17 +0200
committersfan5 <sfan5@live.de>2011-09-12 20:10:17 +0200
commit88dc8c694ed0e182b4d5ace4fcd94a0a82946c31 (patch)
tree5c10c020b77919076fa26ff0faf01c50e7895ac4
parent785a2fd23a47af3629db824adc5e4e1376880d4d (diff)
downloadminetest-88dc8c694ed0e182b4d5ace4fcd94a0a82946c31.tar.gz
minetest-88dc8c694ed0e182b4d5ace4fcd94a0a82946c31.tar.bz2
minetest-88dc8c694ed0e182b4d5ace4fcd94a0a82946c31.zip
Added Iron Apple which heals 4 Hearts
-rw-r--r--data/apple_iron.pngbin0 -> 207 bytes
-rw-r--r--src/content_craft.cpp14
-rw-r--r--src/content_inventory.cpp6
3 files changed, 20 insertions, 0 deletions
diff --git a/data/apple_iron.png b/data/apple_iron.png
new file mode 100644
index 000000000..2dffdf014
--- /dev/null
+++ b/data/apple_iron.png
Binary files differ
diff --git a/src/content_craft.cpp b/src/content_craft.cpp
index 20ab5f069..8e8b17a9b 100644
--- a/src/content_craft.cpp
+++ b/src/content_craft.cpp
@@ -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;
}
diff --git a/src/content_inventory.cpp b/src/content_inventory.cpp
index e0c9d8b86..59997ee4b 100644
--- a/src/content_inventory.cpp
+++ b/src/content_inventory.cpp
@@ -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;
}