From c0caedc3730085b3261f09e1df23cc1bdd2fce79 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Sun, 11 Sep 2011 17:50:44 +0200 Subject: Added Apple Trees --- src/content_inventory.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/content_inventory.cpp') diff --git a/src/content_inventory.cpp b/src/content_inventory.cpp index de8f8e397..2b0dfcb3a 100644 --- a/src/content_inventory.cpp +++ b/src/content_inventory.cpp @@ -1,4 +1,4 @@ -/* + /* Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola @@ -71,6 +71,8 @@ std::string item_craft_get_image_name(const std::string &subname) return "scorched_stuff.png"; else if(subname == "firefly") return "firefly.png"; + else if(subname == "apple") + return "apple.png"; else return "cloud.png"; // just something } @@ -94,7 +96,7 @@ ServerActiveObject* item_craft_create_object(const std::string &subname, s16 item_craft_get_drop_count(const std::string &subname) { - if(subname == "rat" || subname == "firefly") + if(subname == "rat" || subname == "firefly" || subname == "apple") return 1; return -1; @@ -126,6 +128,8 @@ bool item_craft_is_eatable(const std::string &subname) { if(subname == "cooked_rat") return true; + else if(subname == "apple") + return true; return false; } @@ -133,6 +137,8 @@ s16 item_craft_eat_hp_change(const std::string &subname) { if(subname == "cooked_rat") return 6; // 3 hearts + else if(subname == "apple") + return 12; // 6 hearts return 0; } -- cgit v1.2.3 From 6496b1cf1fe3b172ad2611c51a7a1b9f0f168b13 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Sun, 11 Sep 2011 18:16:07 +0200 Subject: Removed Spaces --- src/content_inventory.cpp | 2 +- src/content_mapblock.cpp | 2 +- src/content_mapnode.cpp | 2 +- src/content_mapnode.h | 2 +- src/mapgen.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/content_inventory.cpp') diff --git a/src/content_inventory.cpp b/src/content_inventory.cpp index 2b0dfcb3a..5fbb02d9b 100644 --- a/src/content_inventory.cpp +++ b/src/content_inventory.cpp @@ -1,4 +1,4 @@ - /* +/* Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola diff --git a/src/content_mapblock.cpp b/src/content_mapblock.cpp index 1ae6886a5..1cc37b969 100644 --- a/src/content_mapblock.cpp +++ b/src/content_mapblock.cpp @@ -1,4 +1,4 @@ - /* +/* Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola diff --git a/src/content_mapnode.cpp b/src/content_mapnode.cpp index 37e79829f..09a84156a 100644 --- a/src/content_mapnode.cpp +++ b/src/content_mapnode.cpp @@ -1,4 +1,4 @@ - /* +/* Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola diff --git a/src/content_mapnode.h b/src/content_mapnode.h index 639f572eb..35dcc20ec 100644 --- a/src/content_mapnode.h +++ b/src/content_mapnode.h @@ -1,4 +1,4 @@ - /* +/* Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola diff --git a/src/mapgen.cpp b/src/mapgen.cpp index 6ac99aabd..026248ad4 100644 --- a/src/mapgen.cpp +++ b/src/mapgen.cpp @@ -1,4 +1,4 @@ - /* +/* Minetest-c55 Copyright (C) 2010-2011 celeron55, Perttu Ahola -- cgit v1.2.3 From 4328a6442b0b35e1acdb15c9ab0ac51c2049ae83 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Sun, 11 Sep 2011 19:17:14 +0200 Subject: Fixed duplication bug --- src/content_inventory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/content_inventory.cpp') diff --git a/src/content_inventory.cpp b/src/content_inventory.cpp index 5fbb02d9b..55ddbf8dc 100644 --- a/src/content_inventory.cpp +++ b/src/content_inventory.cpp @@ -96,7 +96,7 @@ ServerActiveObject* item_craft_create_object(const std::string &subname, s16 item_craft_get_drop_count(const std::string &subname) { - if(subname == "rat" || subname == "firefly" || subname == "apple") + if(subname == "rat" || subname == "firefly") return 1; return -1; -- cgit v1.2.3 From 785a2fd23a47af3629db824adc5e4e1376880d4d Mon Sep 17 00:00:00 2001 From: sfan5 Date: Mon, 12 Sep 2011 19:44:26 +0200 Subject: Changed the Heal Amount of Apples from 6 to 2 --- src/content_inventory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/content_inventory.cpp') diff --git a/src/content_inventory.cpp b/src/content_inventory.cpp index 55ddbf8dc..e0c9d8b86 100644 --- a/src/content_inventory.cpp +++ b/src/content_inventory.cpp @@ -138,7 +138,7 @@ s16 item_craft_eat_hp_change(const std::string &subname) if(subname == "cooked_rat") return 6; // 3 hearts else if(subname == "apple") - return 12; // 6 hearts + return 4; // 2 hearts return 0; } -- cgit v1.2.3 From 88dc8c694ed0e182b4d5ace4fcd94a0a82946c31 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Mon, 12 Sep 2011 20:10:17 +0200 Subject: Added Iron Apple which heals 4 Hearts --- data/apple_iron.png | Bin 0 -> 207 bytes src/content_craft.cpp | 14 ++++++++++++++ src/content_inventory.cpp | 6 ++++++ 3 files changed, 20 insertions(+) create mode 100644 data/apple_iron.png (limited to 'src/content_inventory.cpp') diff --git a/data/apple_iron.png b/data/apple_iron.png new file mode 100644 index 000000000..2dffdf014 Binary files /dev/null and b/data/apple_iron.png 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; } -- cgit v1.2.3