From c2699499861f95b1c7c9c7df972789b5f2c51397 Mon Sep 17 00:00:00 2001 From: Trident101 Date: Sun, 10 Sep 2023 15:41:43 +0000 Subject: [PATCH] Implemented cooking curry and pita bread --- Server/data/configs/item_configs.json | 16 ++++++++++++++ .../global/skill/cooking/CookableItems.java | 4 +++- .../skill/cooking/StandardCookingPulse.java | 21 +++++++++++++------ 3 files changed, 34 insertions(+), 7 deletions(-) diff --git a/Server/data/configs/item_configs.json b/Server/data/configs/item_configs.json index 79297703a..68b41bf4b 100644 --- a/Server/data/configs/item_configs.json +++ b/Server/data/configs/item_configs.json @@ -19310,6 +19310,14 @@ "archery_ticket_price": "0", "id": "1866" }, + { + "examine": "It's all burnt.", + "durability": null, + "name": "Burnt pitta bread", + "tradeable": "true", + "archery_ticket_price": "0", + "id": "1867" + }, { "durability": null, "name": "Burnt pitta bread", @@ -20724,6 +20732,14 @@ "archery_ticket_price": "0", "id": "2012" }, + { + "examine": "Eew, it's horribly burnt.", + "durability": null, + "name": "Burnt curry", + "tradeable": "true", + "archery_ticket_price":"0", + "id":"2013" + }, { "durability": null, "name": "Burnt curry", diff --git a/Server/src/main/content/global/skill/cooking/CookableItems.java b/Server/src/main/content/global/skill/cooking/CookableItems.java index 5cabc2f52..cea0f356d 100644 --- a/Server/src/main/content/global/skill/cooking/CookableItems.java +++ b/Server/src/main/content/global/skill/cooking/CookableItems.java @@ -46,7 +46,8 @@ public enum CookableItems { FAT_SNAIL(3373, 3367, 3375, 22, 95, 73, 402, 73, 402), // bread - BREAD(2309, 2307, 2311, 1, 40, 0, 0, 118, 492), + BREAD(2309, 2307, 2311, 1, 40, 118, 492, 118, 492), + PITTA_BREAD(1865, 1863, 1867, 58, 40,118, 492, 118, 492), // cake CAKE(1891, 1889, 1903, 40, 180, 0, 0, 38, 332), @@ -79,6 +80,7 @@ public enum CookableItems { // bowl foods BOWL_STEW(2003, 2001, 2005, 25, 117, 68, 392, 68, 392), + BOWL_CURRY(2011, 2009, 2013, 60, 280, 38, 332, 38, 332), BOWL_NETTLE(4239, 4237, 4239, 20, 52, 78, 412, 78, 412), BOWL_EGG(7078, 7076, 7090, 13, 50, 0, 0, 90, 438), BOWL_ONION(7084, 1871, 7092, 43, 60, 36, 322, 36, 322), diff --git a/Server/src/main/content/global/skill/cooking/StandardCookingPulse.java b/Server/src/main/content/global/skill/cooking/StandardCookingPulse.java index 66654e428..9541e0c5f 100644 --- a/Server/src/main/content/global/skill/cooking/StandardCookingPulse.java +++ b/Server/src/main/content/global/skill/cooking/StandardCookingPulse.java @@ -26,7 +26,7 @@ public class StandardCookingPulse extends Pulse { //Cooking sound public static final Audio SOUND = new Audio(2577, 1, 1); - + private static final int LUMBRIDGE_RANGE = 114; private final int initial; @@ -96,7 +96,7 @@ public class StandardCookingPulse extends Pulse { public boolean reward() { if (getDelay() == 1) { int delay = object.getName().toLowerCase().contains("range") ? 5 : 4; - if(SkillcapePerks.isActive(SkillcapePerks.HASTY_COOKING, player)) { + if (SkillcapePerks.isActive(SkillcapePerks.HASTY_COOKING, player)) { delay -= 1; } setDelay(delay); @@ -110,7 +110,7 @@ public class StandardCookingPulse extends Pulse { } return amount < 1; } - + public boolean isBurned(final Player player, final Scenery object, int food) { boolean hasGauntlets = player.getEquipment().containsItem(new Item(Items.COOKING_GAUNTLETS_775)); int effectiveCookingLevel = player.getSkills().getLevel(Skills.COOKING); @@ -118,7 +118,8 @@ public class StandardCookingPulse extends Pulse { effectiveCookingLevel -= 5; } CookableItems item = CookableItems.forId(food); - int low, high; + int low; + int high; if (hasGauntlets && CookableItems.gauntletValues.containsKey(food)) { int[] successValues = CookableItems.gauntletValues.get(food); low = successValues[0]; @@ -189,11 +190,19 @@ public class StandardCookingPulse extends Pulse { if (CookableItems.intentionalBurn(food.getId())) { return "You deliberately burn the perfectly good piece of meat."; } - if (!burned) { + + if (!burned && food.getName().startsWith("Raw")) { return "You manage to cook some " + food.getName().replace("Raw ", ""); - } else { + } else if (burned && food.getName().startsWith("Raw")) { return "You accidentally burn some " + food.getName().replace("Raw ", ""); } + + if (!burned && food.getName().startsWith(("Uncooked"))) { + return "You manage to cook some " + food.getName().replace("Uncooked ", ""); + } else if (burned && food.getName().startsWith(("Uncooked"))) { + return "You accidentally burn some " + food.getName().replace("Uncooked ", ""); + } + return null; } private Animation getAnimation(final Scenery object) {