diff options
| author | davidovski <david@davidovski.xyz> | 2025-10-31 17:49:48 +0000 |
|---|---|---|
| committer | davidovski <david@davidovski.xyz> | 2025-10-31 17:49:48 +0000 |
| commit | 5a008748459e230de0e875afff59e3b92c7aca0c (patch) | |
| tree | 0d09aebd1bb5628237959a6d1b49d1a7772d86a6 /src/main/java/net/uomc/mineshaft/blacksmith/Sword.java | |
| parent | fff63aaea786a5f1c59bbf99c999a2aa7bb810e5 (diff) | |
Work on v0.6
Diffstat (limited to 'src/main/java/net/uomc/mineshaft/blacksmith/Sword.java')
| -rw-r--r-- | src/main/java/net/uomc/mineshaft/blacksmith/Sword.java | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/src/main/java/net/uomc/mineshaft/blacksmith/Sword.java b/src/main/java/net/uomc/mineshaft/blacksmith/Sword.java new file mode 100644 index 0000000..aa3fcea --- /dev/null +++ b/src/main/java/net/uomc/mineshaft/blacksmith/Sword.java @@ -0,0 +1,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; + } + } + +} |
