RuneHive-Game
Loading...
Searching...
No Matches
SkillCape.java
Go to the documentation of this file.
1package com.runehive.content.skillcape;
2
3import com.runehive.game.world.entity.mob.player.Player;
4import com.runehive.game.world.items.Item;
5
6public enum SkillCape {
7 ATTACK(9747, "Free access to Cyclops area found upstairs within the Warriors' Guild."),
8 DEFENCE(9753, "Act as a permanent Ring of Life."),
9 RANGED(9756, "Act as an Ava's accumulator."),
10 PRAYER(9759, "Provides double experience when training Prayer."),
11 MAGIC(9762, "Can cast spellbook swap 5 times per day."),
12 HITPOINTS(9768, "2x HP restore rate."),
13 AGILITY(9771, "Increased run energy restore rate."),
14 HERBLORE(9774, "Provides a chance to save ingredients."),
15 THIEVING(9777, "Better chance of succeeding when stealing from stalls."),
16 CRAFTING(9780, "Provides a chance to save materials."),
17 FLETCHING(9783, "Provides a chance to save materials."),
18 SLAYER(9786, "Can cancel up to 2 tasks per day."),
19 MINING(9792, "Provides a chance to receive double materials."),
20 SMITHING(9795, "Increases speed at which you smelt bars/forge items."),
21 COOKING(9801, "Impossible to burn any food."),
22 FIREMAKING(9804, "Provides a chance to save a log."),
23 WOODCUTTING(9807, "Provides a chance to receive double materials."),
24 FARMING(9810, "5% increased yield from herb patches.");
25
26 private final int itemId;
27 private final String description;
28
30 this.itemId = itemId;
31 this.description = description;
32 }
33
34 public static boolean isEquipped(Player player, SkillCape cape) {
35 final Item currentCape = player.equipment.getCape();
36 if (currentCape == null) {
37 return false;
38 }
39
40 // Max cape gives all perks.
41 if (currentCape.getId() == 13280) {
42 return true;
43 }
44
45 return currentCape.getId() == cape.getItemId() || currentCape.getId() == cape.getItemId() + 1;
46 }
47
48 private int getItemId() {
49 return itemId;
50 }
51
52 public String getDescription() {
53 return description;
54 }
55}
This class represents a character controlled by a player.
Definition Player.java:125
The container class that represents an item that can be interacted with.
Definition Item.java:21
final int getId()
Gets the identification of this item.
Definition Item.java:324
SkillCape(int itemId, String description)
static boolean isEquipped(Player player, SkillCape cape)