blob: aa3fcea65a1805b4ea5d539ce26600ed1e0e44ef (
plain)
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
package net.uomc.mineshaft.blacksmith;
import net.dv8tion.jda.api.entities.Member;
import net.uomc.mineshaft.Mineshaft;
public class Sword extends Tool {
public static final int MAX_SWORD_LEVEL = 5;
public Sword(Mineshaft mineshaft, Member member) {
super(mineshaft, member, "sword");
}
public String getName() {
return swordLevelToName(getLevel());
}
public String getEmoji() {
// TODO add if enchanted
return swordToEmoji(getLevel());
}
public static String swordToEmoji(int level) {
switch ((int) level) {
case 0:
return "";
case 1:
return "<:copper_sword:1432879763193856060>";
case 2:
return "<:iron_sword:1432879761268412446>";
case 3:
return "<:gold_sword:1432879759385432155>";
case 4:
return "<:diamond_sword:1432879757065850941>";
default:
return "<:netherite_sword:1432879754712711278>";
}
}
public static String swordLevelToName(int level) {
switch ((int) level) {
case 0:
return "None";
case 1:
return "Copper";
case 2:
return "Iron";
case 3:
return "Gold";
case 4:
return "Diamond";
default:
return "Netherite";
}
}
public int getMaxLevel() {
return MAX_SWORD_LEVEL;
}
public long getDamageBonus() {
switch ((int) getLevel()) {
case 0: // "None";
return 0;
case 1: // "Copper";
return 2;
case 2: // "Iron";
return 4;
case 3: // "Gold";
return 6;
case 4: // "Diamond";
return 8;
default: // "Netherite";
return 10;
}
}
}
|