summaryrefslogtreecommitdiff
path: root/src/main/java/net/uomc/mineshaft/blacksmith/Armour.java
blob: 592a4c351002e415448669e7c63c49b1a4853a6d (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
package net.uomc.mineshaft.blacksmith;

import net.dv8tion.jda.api.entities.Member;
import net.uomc.mineshaft.Mineshaft;

public class Armour extends Tool {
    public static final int MAX_ARMOUR_LEVEL = 5;

    public Armour(Mineshaft mineshaft, Member member) {
        super(mineshaft, member, "armour");
    }

    public String getName() {
        return armourLevelToName(getLevel());
    }

    public static String armourLevelToName(long 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_ARMOUR_LEVEL;
    }

    public long getDamageReduction() {
        switch ((int) getLevel()) {
            case 0: // "None";
                return 0;
            case 1: // "Copper";
                return 3;
            case 2: // "Iron";
                return 6;
            case 3: // "Gold";
                return 9;
            case 4: // "Diamond";
                return 12;
            default: // "Netherite";
                return 15;
        }
    }

}