RuneHive-Game
Loading...
Searching...
No Matches
FinishedPotion.java
Go to the documentation of this file.
1package com.runehive.content.skill.impl.herblore;
2
3import com.runehive.game.world.items.Item;
4
5import java.util.Arrays;
6
7/**
8 * Holds all the finished potion data.
9 *
10 * @author Daniel
11 */
12public enum FinishedPotion implements Potion {
13 ATTACK_POTION(121, 91, 221, 1, 25),
14 ANTIPOISON(175, 93, 235, 5, 37.5),
15 STRENGTH_POTION(115, 95, 225, 12, 50),
16 RESTORE_POTION(127, 97, 223, 22, 62.5),
17 ENERGY_POTION(3010, 97, 1975, 26, 67.5),
18 DEFENCE_POTION(133, 99, 239, 30, 75),
19 AGILITY_POTION(3034, 3002, 2152, 34, 80),
20 COMBAT_POTION(9741, 97, 9736, 36, 84),
21 RAYER_POTION(139, 99, 231, 38, 87.5),
22 SUPER_ATTACK(145, 101, 221, 45, 100),
23 VIAL_OF_STENCH(18661, 101, 1871, 46, 0),
24 FISHING_POTION(181, 101, 235, 48, 112.5),
25 SUPER_ENERGY(3018, 103, 2970, 52, 117.5),
26 SUPER_STRENGTH(157, 105, 225, 55, 137.5),
27 WEAPON_POISON(187, 105, 241, 60, 138),
28 SUPER_RESTORE(3026, 3004, 223, 63, 142.5),
29 SUPER_DEFENCE(163, 107, 239, 66, 150),
30 ANTIFIRE(2454, 2483, 241, 69, 157.5),
31 RANGING_POTION(169, 109, 245, 72, 162.5),
32 MAGIC_POTION(3042, 2483, 3138, 76, 172.5),
33 ZAMORAK_BREW(189, 111, 247, 78, 175),
34 SARADOMIN_BREW(6687, 3002, 6693, 81, 180);
35
36 /**
37 * The finished potion product.
38 */
39 private final int product;
40
41 /**
42 * The finished potion ingredients.
43 */
44 private final Item[] ingredients;
45
46 /**
47 * The level required to make the potion.
48 */
49 private final int level;
50
51 /**
52 * The experience rewarded for the potion.
53 */
54 private final double experience;
55
56 /**
57 * Constructs a new <code>FinishedPotion</code>.
58 *
59 * @param product The product item.
60 * @param unfinishedPotion The unfinished potion item.
61 * @param ingredient The ingredients needed for the potion.
62 * @param level The level required.
63 * @param experience The experience rewarded.
64 */
65 FinishedPotion(int product, int unfinishedPotion, int ingredient, int level, double experience) {
66 this.product = product;
67 this.ingredients = new Item[]{new Item(unfinishedPotion), new Item(ingredient)};
68 this.level = level;
69 this.experience = experience;
70 }
71
72 /**
73 * Gets the finished potion data.
74 *
75 * @param use The item being used.
76 * @param with The item being used with.
77 * @return The finished potion data.
78 */
79 public static FinishedPotion get(Item use, Item with) {
80 for (final FinishedPotion potion : values()) {
81 if (potion.ingredients[0].equals(use) && potion.ingredients[1].equals(with) || potion.ingredients[1].equals(use) && potion.ingredients[0].equals(with)) {
82 return potion;
83 }
84 }
85 return null;
86 }
87
88 @Override
89 public int getAnimation() {
90 return 363;
91 }
92
93 @Override
94 public double getExperience() {
95 return experience;
96 }
97
98 @Override
99 public Item[] getIngredients() {
100 return ingredients;
101 }
102
103 @Override
104 public int getLevel() {
105 return level;
106 }
107
108 @Override
109 public Item getProduct() {
110 return new Item(product);
111 }
112
113 @Override
114 public String toString() {
115 return "FinishedPotion[product: " + getProduct() + ", level: " + level + ", experience: " + experience + ", ingredients: " + Arrays.toString(ingredients) + "]";
116 }
117}
The container class that represents an item that can be interacted with.
Definition Item.java:21
FinishedPotion(int product, int unfinishedPotion, int ingredient, int level, double experience)
Constructs a new FinishedPotion.
Item[] getIngredients()
Gets the ingredients required for the potion.
final double experience
The experience rewarded for the potion.
double getExperience()
Gets the experience rewarded.
int getLevel()
Gets the level required for making the potion.
final Item[] ingredients
The finished potion ingredients.
final int level
The level required to make the potion.
The potion making itemcontainer.
Definition Potion.java:10