Implement hasty cooking skillcape perk (1 tick faster but 5 cooking levels lower for burn rate)

Add Nardah's "Clay Oven" to the list of cooking spots
Fix small burn inaccuracy with cooking gauntlets
This commit is contained in:
Avi Weinstock
2022-03-27 05:22:29 +00:00
committed by Ryan
parent 7709c3bb04
commit 34aa842494
3 changed files with 17 additions and 8 deletions
@@ -55,7 +55,7 @@ class CookingRewrite : InteractionListener() {
}
companion object {
val COOKING_OBJs = intArrayOf(24313,21302, 13528, 13529, 13533, 13531, 13536, 13539, 13542, 2728, 2729, 2730, 2731, 2732, 2859, 3038, 3039, 3769, 3775, 4265, 4266, 5249, 5499, 5631, 5632, 5981, 9682, 10433, 11404, 11405, 11406, 12102, 12796, 13337, 13881, 14169, 14919, 15156, 20000, 20001, 21620, 21792, 22713, 22714, 23046, 24283, 24284, 25155, 25156, 25465, 25730, 27297, 29139, 30017, 32099, 33500, 34495, 34546, 36973, 37597, 37629, 37726, 114, 4172, 5275, 8750, 16893, 22154, 34410, 34565, 114, 9085, 9086, 9087, 12269, 15398, 25440, 25441, 2724, 2725, 2726, 4618, 4650, 5165, 6093, 6094, 6095, 6096, 8712, 9374, 9439, 9440, 9441, 10824, 17640, 17641, 17642, 17643, 18039, 21795, 24285, 24329, 27251, 33498, 35449, 36815, 36816, 37426, 40110)
val COOKING_OBJs = intArrayOf(24313,21302, 13528, 13529, 13533, 13531, 13536, 13539, 13542, 2728, 2729, 2730, 2731, 2732, 2859, 3038, 3039, 3769, 3775, 4265, 4266, 5249, 5499, 5631, 5632, 5981, 9682, 10433, 11404, 11405, 11406, 12102, 12796, 13337, 13881, 14169, 14919, 15156, 20000, 20001, 21620, 21792, 22713, 22714, 23046, 24283, 24284, 25155, 25156, 25465, 25730, 27297, 29139, 30017, 32099, 33500, 34495, 34546, 36973, 37597, 37629, 37726, 114, 4172, 5275, 8750, 16893, 22154, 34410, 34565, 114, 9085, 9086, 9087, 12269, 15398, 25440, 25441, 2724, 2725, 2726, 4618, 4650, 5165, 6093, 6094, 6095, 6096, 8712, 9374, 9439, 9440, 9441, 10824, 17640, 17641, 17642, 17643, 18039, 21795, 24285, 24329, 27251, 33498, 35449, 36815, 36816, 37426, 40110, 10377)
@JvmStatic
fun cook(player: Player, `object`: Scenery?, initial: Int, product: Int, amount: Int) {
@@ -71,4 +71,4 @@ class CookingRewrite : InteractionListener() {
}
}
}
}
}
@@ -15,6 +15,7 @@ import core.game.world.map.Location;
import core.game.world.update.flag.context.Animation;
import core.tools.RandomFunction;
import org.rs09.consts.Items;
import rs09.game.node.entity.skill.skillcapeperks.SkillcapePerks;
public class StandardCookingPulse extends Pulse {
//range animation
@@ -95,7 +96,11 @@ public class StandardCookingPulse extends Pulse {
public boolean reward() {
if (getDelay() == 1) {
setDelay(object.getName().toLowerCase().equals("range") ? 5 : 4);
int delay = object.getName().toLowerCase().equals("range") ? 5 : 4;
if(SkillcapePerks.isActive(SkillcapePerks.HASTY_COOKING, player)) {
delay -= 1;
}
setDelay(delay);
return false;
}
@@ -110,16 +115,20 @@ public class StandardCookingPulse extends Pulse {
public boolean isBurned(final Player player, final Scenery object, int food) {
boolean hasGauntlets = player.getEquipment().containsItem(new Item(Items.COOKING_GAUNTLETS_775));
double burn_stop = (double) CookableItems.getBurnLevel(food);
int effectiveCookingLevel = player.getSkills().getLevel(Skills.COOKING);
if(SkillcapePerks.isActive(SkillcapePerks.HASTY_COOKING, player)) {
effectiveCookingLevel -= 5;
}
int gauntlets_boost = 0;
CookableItems item = CookableItems.forId(food);
if (hasGauntlets && (food == Items.RAW_SWORDFISH_371 || food == Items.RAW_LOBSTER_377 || food == Items.RAW_MONKFISH_7944 || food == Items.RAW_SHARK_383)) {
burn_stop -= 6;
gauntlets_boost += 6;
}
if (player.getSkills().getLevel(Skills.COOKING) > burn_stop) {
if (effectiveCookingLevel >= burn_stop) {
return false;
}
int cook_level = player.getSkills().getLevel(Skills.COOKING) + gauntlets_boost;
int cook_level = effectiveCookingLevel + gauntlets_boost;
double host_ratio = RandomFunction.randomDouble(100.0);
double low = item.low + (object.getName().contains("fire") ? 0 : (0.1 * item.low));
double high = item.high + (object.getName().contains("fire") ? 0 : (0.1 * item.high));
@@ -185,7 +194,6 @@ public class StandardCookingPulse extends Pulse {
}
// Cook some rat meat on a campfire in Lumbridge Swamp
System.out.println(object.getName());
if (initialItem.getId() == Items.RAW_RAT_MEAT_2134 && object.getName().toLowerCase().contains("fire") && (playerRegion == 12593 || playerRegion == 12849)) {
player.getAchievementDiaryManager().finishTask(player, DiaryType.LUMBRIDGE, 1, 10);
}
@@ -71,6 +71,7 @@ enum class SkillcapePerks(val attribute: String, val effect: ((Player) -> Unit)?
api.sendDialogue(player, "Your cape is lined with empty pockets shaped like various utilities needed for slayer.")
}
}),
HASTY_COOKING("cape_perks:hasty-cooking"),
NONE("cape_perks:none")
;
@@ -100,7 +101,7 @@ enum class SkillcapePerks(val attribute: String, val effect: ((Player) -> Unit)?
Skillcape.MINING -> PRECISION_MINER
Skillcape.SMITHING -> BAREFISTED_SMITHING
Skillcape.FISHING -> GREAT_AIM
Skillcape.COOKING -> NONE
Skillcape.COOKING -> HASTY_COOKING
Skillcape.FIREMAKING -> CONSTANT_GLOW
Skillcape.WOODCUTTING -> NONE
Skillcape.FARMING -> SEED_ATTRACTION
@@ -250,4 +251,4 @@ enum class SkillcapePerks(val attribute: String, val effect: ((Player) -> Unit)?
}
}
}
}