-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathItems.java
More file actions
53 lines (50 loc) · 1.06 KB
/
Items.java
File metadata and controls
53 lines (50 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
class Items {
public static boolean doesPlayerHaveItem(Player player, Item item){
for(int i = 0; i<player.getInventory().size();i++){
Item tmpItem = player.getInventory().get(i);
if(tmpItem.getName().equals(item.getName().toLowerCase())){
return true;
}
}
return false;
}
public static boolean doesPlayerHaveItem(Player player, String item){
for(int i = 0; i<player.getInventory().size();i++){
Item tmpItem = player.getInventory().get(i);
if(tmpItem.getName().toLowerCase().equals(item.toLowerCase())){
return true;
}
}
return false;
}
public static String getDamageTypeName(int dmgType){
String type = "";
switch (dmgType){ // PLEASE ADD ANY NEW TYPE AT THE END
case 0:
type = "Physical";
break;
case 1:
type = "Magic";
break;
case 2:
type = "Fire";
break;
case 3:
type = "Water";
break;
case 4:
type = "Poison";
break;
case 5:
type = "Bleed";
break;
case 6:
type = "Explosion";
break;
case 7:
type = "Ranged";
break;
}
return type;
}
}