RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
FoodData.java
1package com.osroyale.content.consume;
2
3import com.osroyale.game.world.entity.mob.player.Player;
4import com.osroyale.game.world.entity.skill.Skill;
5
6import java.util.Arrays;
7import java.util.Optional;
8
56
57public enum FoodData {
58 SLICED_BANANA(3162, 2, "Sliced banana"),
59 EASTER_EGG1(1961, 12, "Easter Egg"),
60 PUMPKIN(1959, 14, "Pumpkin"),
61 HALF_JUG_OF_WINE(1989, 7, "Half Full Wine Jug"),
62 WINE(1993, 11, "Wine"),
63 MANTA(391, 22, "Manta Ray"),
64 SHARK(385, 20, "Shark"),
65 LOBSTER(379, 12, "Lobster"),
66 BEER(1917, 1, "Beer"),
67 GREENMANS_ALE(1909, 1, "Greenman's Ale"),
68 TROUT(333, 7, "Trout"),
69 SALMON(329, 9, "Salmon"),
70 SWORDFISH(373, 14, "Swordfish"),
71 TUNA(361, 10, "Tuna"),
72 MONKFISH(7946, 16, "Monkfish"),
73 SEA_TURTLE(397, 21, "Sea Turtle"),
74 CABBAGE(1965, 1, "Cabbage"),
75 CAKE(1891, 4, "Cake"),
76 BASS(365, 13, "Bass"),
77 COD(339, 7, "Cod"),
78 POTATO(1942, 1, "Potato"),
79 BAKED_POTATO(6701, 4, "Baked Potato"),
80 POTATO_WITH_CHEESE(6705, 16, "Potato with Cheese"),
81 EGG_POTATO(7056, 16, "Egg Potato"),
82 CHILLI_POTATO(7054, 14, "Chilli Potato"),
83 MUSHROOM_POTATO(7058, 20, "Mushroom Potato"),
84 TUNA_POTATO(7060, 22, "Tuna Potato"),
85 SHRIMPS(315, 3, "Shrimps"),
86 HERRING(347, 5, "Herring"),
87 SARDINE(325, 4, "Sardine"),
88 CHOCOLATE_CAKE(1897, 5, "Chocolate Cake"),
89 HALF_CHOCOLATE_CAKE(1899, 5, "2/3 Chocolate Cake"),
90 CHOCOLATE_SLICE(1901, 5, "Chocolate Slice"),
91 ANCHOVIES(319, 1, "Anchovies"),
92 PLAIN_PIZZA(2289, 2289, 2291, 7, "Plain Pizza"),
93 HALF_PLAIN_PIZZA(2291, 2289, -1, 7, "1/2 Plain pizza"),
94 MEAT_PIZZA(2293, 2293, 2295, 8, "Meat Pizza"),
95 HALF_MEAT_PIZZA(2295, 2293, -1, 8, "1/2 Meat Pizza"),
96 ANCHOVY_PIZZA(2297, 2297, 2299, 9, "Anchovy Pizza"),
97 HALF_ANCHOVY_PIZZA(2299, 2297, -1, 9, "1/2 Anchovy Pizza"),
98 PINEAPPLE_PIZZA(2301, 2301, 2303, 11, "Pineapple Pizza"),
99 HALF_PINEAPPLE_PIZZA(2303, 2301, -1, 11, "1/2 Pineapple Pizza"),
100 BREAD(2309, 5, "Bread"),
101 APPLE_PIE(2323, 2323, 2335, 7, "Apple Pie"),
102 HALF_APPLE_PIE(2335, 2323, -1, 7, "Half Apple Pie"),
103 REDBERRY_PIE(2325, 2325, 2333, 5, "Redberry Pie"),
104 HALF_REDBERRY_PIE(2333, 2325, -1, 5, "Half Redberry Pie"),
105 UGTHANKI_KEBAB(1883, 2, "Ugthanki kebab"),
106 MEAT_PIE(2327, 2327, 2331, 6, "Meat Pie"),
107 HALF_MEAT_PIE(2331, 2327, -1, 6, "Half Meat Pie"),
108 SUMMER_PIE(7218, 7218, 7220, 11, "Summer Pie"),
109 HALF_SUMMER_PIE(7220, 7218, -1, 11, "Half Summer Pie"),
110 PIKE(351, 8, "Pike"),
111 POTATO_WITH_BUTTER(6703, 14, "Potato with Butter"),
112 BANANA(1963, 2, "Banana"),
113 PEACH(6883, 8, "Peach"),
114 ORANGE(2108, 2, "Orange"),
115 PINEAPPLE_RINGS(2118, 2, "Pineapple Rings"),
116 PINEAPPLE_CHUNKS(2116, 2, "Pineapple Chunks"),
117 EASTER_EGG(7928, 1, "Easter Egg"),
118 EASTER_EGG2(7929, 1, "Easter Egg"),
119 EASTER_EGG3(7930, 1, "Easter Egg"),
120 EASTER_EGG4(7931, 1, "Easter Egg"),
121 EASTER_EGG5(7932, 1, "Easter Egg"),
122 EASTER_EGG6(7933, 1, "Easter Egg"),
123 PURPLE_SWEETS(10476, 9, "Purple Sweets"),
124 POT_OF_CREAM(2130, 1, "Pot of cream"),
125 BANDAGES(4049, 3, "Bandages"),
126 COOKED_KARAMBWAN(3144, -1, -1, 18, "Cooked Karambwan"),
127 DARK_CRAB(11936, 22, "Dark Crab"),
128 ANGLERFISH(13441, 22, "Anglerfish");
129
131 private final int id;
132
134 private final int parent;
135
137 private final int replacement;
138
140 private final int heal;
141
143 private final String name;
144
152 FoodData(int id, int parent, int replacement, int heal, String name) {
153 this.id = id;
154 this.parent = parent;
155 this.replacement = replacement;
156 this.heal = heal;
157 this.name = name;
158 }
159
167 FoodData(int id, int heal, String name) {
168 this(id, id, -1, heal, name);
169 }
170
177 public static Optional<FoodData> forId(int id) {
178 return Arrays.stream(values()).filter(a -> a.id == id).findFirst();
179 }
180
181 //TODO Cleaner
182 public static int anglerfishHeal(Player player) {
183 int hitpoints = player.skills.getMaxLevel(Skill.HITPOINTS);
184 if (hitpoints >= 10 && hitpoints <= 19)
185 return 3;
186 if (hitpoints >= 20 && hitpoints <= 24)
187 return 4;
188 if (hitpoints >= 25 && hitpoints <= 29)
189 return 6;
190 if (hitpoints >= 30 && hitpoints <= 39)
191 return 7;
192 if (hitpoints >= 40 && hitpoints <= 49)
193 return 8;
194 if (hitpoints >= 50 && hitpoints <= 59)
195 return 11;
196 if (hitpoints >= 60 && hitpoints <= 69)
197 return 12;
198 if (hitpoints >= 70 && hitpoints <= 74)
199 return 13;
200 if (hitpoints >= 75 && hitpoints <= 79)
201 return 15;
202 if (hitpoints >= 80 && hitpoints <= 89)
203 return 16;
204 if (hitpoints >= 90 && hitpoints <= 92)
205 return 17;
206 if (hitpoints >= 93)
207 return 22;
208 return 0;
209 }
210
212 public int getId() {
213 return id;
214 }
215
217 public int getReplacement() {
218 return replacement;
219 }
220
222 public boolean isFast() {
223 return replacement != -1 || parent != id;
224 }
225
227 public int getHeal() {
228 return heal;
229 }
230
232 public String getName() {
233 return name;
234 }
235}
FoodData(int id, int heal, String name)
FoodData(int id, int parent, int replacement, int heal, String name)
static Optional< FoodData > forId(int id)