maces wip

This commit is contained in:
nossr50 2024-06-29 16:49:10 -07:00
parent 02c732bdf2
commit e1dee2778d
16 changed files with 304 additions and 178 deletions

View File

@ -1,3 +1,14 @@
# TODO: Add Maces to repair
# TODO: Add subskills
# TODO: Add Maces to combat utils
# TODO: Skill ideas... Base DMG buff, Base Smash Buff, Momentum
# TODO: Maces guide command
# TODO: Maces Locale entries
# TODO: Audit CombatUtils and make sure attack strength is being used
Version 2.2.015
Added Maces skill
Fixed a bug where a player's attack cooldown was not being taken into account when adding bonus DMG
Version 2.2.014 Version 2.2.014
Fixed a bug where Luck Of The Sea was being applied for Super Breaker (and other abilities) Fixed a bug where Luck Of The Sea was being applied for Super Breaker (and other abilities)

View File

@ -376,7 +376,7 @@
<dependency> <dependency>
<groupId>org.spigotmc</groupId> <groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId> <artifactId>spigot-api</artifactId>
<version>1.20.6-R0.1-SNAPSHOT</version> <version>1.21-R0.1-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>

View File

@ -1,52 +1,80 @@
//package com.gmail.nossr50.commands.skills; package com.gmail.nossr50.commands.skills;
//
//import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
//import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.SubSkillType;
//import com.gmail.nossr50.util.player.UserManager; import com.gmail.nossr50.locale.LocaleLoader;
//import com.gmail.nossr50.util.skills.CombatUtils; import com.gmail.nossr50.mcMMO;
//import com.gmail.nossr50.util.skills.SkillUtils; import com.gmail.nossr50.util.skills.CombatUtils;
//import com.gmail.nossr50.util.text.TextComponentFactory; import com.gmail.nossr50.util.skills.RankUtils;
//import net.kyori.adventure.text.Component; import com.gmail.nossr50.util.skills.SkillUtils;
//import org.bukkit.ChatColor; import com.gmail.nossr50.util.text.TextComponentFactory;
//import org.bukkit.entity.Player; import net.kyori.adventure.text.Component;
// import org.bukkit.ChatColor;
//import java.util.ArrayList; import org.bukkit.entity.Player;
//import java.util.List;
// import java.util.ArrayList;
//import static com.gmail.nossr50.datatypes.skills.SubSkillType.MACES_MACES_LIMIT_BREAK; import java.util.List;
//
//public class MacesCommand extends SkillCommand { import static com.gmail.nossr50.datatypes.skills.SubSkillType.MACES_CRIPPLE;
// import static com.gmail.nossr50.datatypes.skills.SubSkillType.MACES_MACES_LIMIT_BREAK;
// public MacesCommand() {
// super(PrimarySkillType.MACES); public class MacesCommand extends SkillCommand {
// }
// public MacesCommand() {
// @Override super(PrimarySkillType.MACES);
// protected void dataCalculations(Player player, float skillValue) {} }
//
// @Override String crippleChanceToApply, crippleChanceToApplyLucky, crippleLengthAgainstPlayers, crippleLengthAgainstMobs;
// protected void permissionsCheck(Player player) {}
// @Override
// @Override protected void dataCalculations(Player player, float skillValue) {
// protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) { if (SkillUtils.canUseSubskill(player, MACES_CRIPPLE)) {
// List<String> messages = new ArrayList<>(); int crippleRank = RankUtils.getRank(player, MACES_CRIPPLE);
// crippleLengthAgainstPlayers = String.valueOf("INSERT VALUE HERE");
// if (SkillUtils.canUseSubskill(player, MACES_MACES_LIMIT_BREAK)) { crippleLengthAgainstMobs = String.valueOf("INSERT VALUE HERE");
// messages.add(getStatMessage(MACES_MACES_LIMIT_BREAK,
// String.valueOf(CombatUtils.getLimitBreakDamageAgainstQuality(player, MACES_MACES_LIMIT_BREAK, 1000)))); crippleChanceToApply = String.valueOf(mcMMO.p.getAdvancedConfig().getCrippleChanceToApplyOnHit(crippleRank) + "%");
// } crippleChanceToApplyLucky = String.valueOf(mcMMO.p.getAdvancedConfig().getCrippleChanceToApplyOnHit(crippleRank) * 1.33);
// }
// messages.add(ChatColor.GRAY + "The Maces skill is a work in progress and is still being developed," + }
// " feedback would be appreciated in the mcMMO discord server.");
// return messages; @Override
// } protected void permissionsCheck(Player player) {}
//
// @Override @Override
// protected List<Component> getTextComponents(Player player) { protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {
// List<Component> textComponents = new ArrayList<>(); final List<String> messages = new ArrayList<>();
//
// TextComponentFactory.getSubSkillTextComponents(player, textComponents, PrimarySkillType.MACES); if (SkillUtils.canUseSubskill(player, MACES_MACES_LIMIT_BREAK)) {
// messages.add(getStatMessage(MACES_MACES_LIMIT_BREAK,
// return textComponents; String.valueOf(CombatUtils.getLimitBreakDamageAgainstQuality(player,
// } MACES_MACES_LIMIT_BREAK, 1000))));
//} }
if (SkillUtils.canUseSubskill(player, MACES_CRIPPLE)) {
messages.add(getStatMessage(MACES_CRIPPLE, crippleChanceToApply)
+ (isLucky ? LocaleLoader.getString("Perks.Lucky.Bonus", crippleChanceToApplyLucky) : ""));
messages.add(getStatMessage(true, true, MACES_CRIPPLE,
crippleLengthAgainstPlayers,
crippleLengthAgainstMobs));
}
if (SkillUtils.canUseSubskill(player, SubSkillType.MACES_CRUSH)) {
messages.add(getStatMessage(SubSkillType.MACES_CRUSH,
String.valueOf(mmoPlayer.getMacesManager().getCrushDamage())));
}
messages.add(ChatColor.GRAY + "The Maces skill is a work in progress and is still being developed," +
" feedback would be appreciated in the mcMMO discord server.");
return messages;
}
@Override
protected List<Component> getTextComponents(Player player) {
List<Component> textComponents = new ArrayList<>();
TextComponentFactory.getSubSkillTextComponents(player, textComponents, PrimarySkillType.MACES);
return textComponents;
}
}

View File

@ -11,6 +11,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
public class AdvancedConfig extends BukkitConfig { public class AdvancedConfig extends BukkitConfig {
int[] defaultCrippleValues = new int[]{10, 15, 20, 25};
public AdvancedConfig(File dataFolder) { public AdvancedConfig(File dataFolder) {
super("advanced.yml", dataFolder); super("advanced.yml", dataFolder);
@ -937,4 +938,10 @@ public class AdvancedConfig extends BukkitConfig {
public boolean isKnockOnWoodXPOrbEnabled() { public boolean isKnockOnWoodXPOrbEnabled() {
return config.getBoolean("Skills.Woodcutting.TreeFeller.Knock_On_Wood.Add_XP_Orbs_To_Drops", true); return config.getBoolean("Skills.Woodcutting.TreeFeller.Knock_On_Wood.Add_XP_Orbs_To_Drops", true);
} }
/* MACES */
public double getCrippleChanceToApplyOnHit(int rank) {
String root = "Skills.Maces.Cripple.Chance_To_Apply_On_Hit.Rank_";
return config.getDouble(root + rank, defaultCrippleValues[rank-1]);
}
} }

View File

@ -112,7 +112,6 @@ public class McMMOPlayer implements Identified {
private int respawnATS; private int respawnATS;
private int teleportATS; private int teleportATS;
private long databaseATS; private long databaseATS;
private double attackStrength; //captured during arm swing events
//private int chimeraWingLastUse; //private int chimeraWingLastUse;
private Location teleportCommence; private Location teleportCommence;
@ -151,7 +150,6 @@ public class McMMOPlayer implements Identified {
experienceBarManager = new ExperienceBarManager(this); experienceBarManager = new ExperienceBarManager(this);
debugMode = false; //Debug mode helps solve support issues, players can toggle it on or off debugMode = false; //Debug mode helps solve support issues, players can toggle it on or off
attackStrength = 1.0D;
this.playerAuthor = new PlayerAuthor(player); this.playerAuthor = new PlayerAuthor(player);
@ -239,7 +237,7 @@ public class McMMOPlayer implements Identified {
} }
public double getAttackStrength() { public double getAttackStrength() {
return attackStrength; return player.getAttackCooldown();
} }
public @NotNull PrimarySkillType getLastSkillShownScoreboard() { public @NotNull PrimarySkillType getLastSkillShownScoreboard() {

View File

@ -59,6 +59,8 @@ public enum SubSkillType {
/* Maces */ /* Maces */
MACES_MACES_LIMIT_BREAK(10), MACES_MACES_LIMIT_BREAK(10),
MACES_CRUSH(4),
MACES_CRIPPLE(4),
/* Mining */ /* Mining */
MINING_BIGGER_BOMBS(1), MINING_BIGGER_BOMBS(1),

View File

@ -2,10 +2,73 @@ package com.gmail.nossr50.skills.maces;
import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.skills.SkillManager; import com.gmail.nossr50.skills.SkillManager;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.player.NotificationManager;
import com.gmail.nossr50.util.random.ProbabilityUtil;
import com.gmail.nossr50.util.skills.RankUtils;
import com.gmail.nossr50.util.sounds.SoundManager;
import com.gmail.nossr50.util.sounds.SoundType;
import org.bukkit.SoundCategory;
import org.bukkit.entity.LivingEntity;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.jetbrains.annotations.NotNull;
public class MacesManager extends SkillManager { public class MacesManager extends SkillManager {
public MacesManager(McMMOPlayer mmoPlayer) { public MacesManager(McMMOPlayer mmoPlayer) {
super(mmoPlayer, PrimarySkillType.MACES); super(mmoPlayer, PrimarySkillType.MACES);
} }
/**
* Get the Crush damage bonus.
*
* @return the Crush damage bonus.
*/
public double getCrushDamage() {
if (!Permissions.canUseSubSkill(mmoPlayer.getPlayer(), SubSkillType.MACES_CRUSH))
return 0;
int rank = RankUtils.getRank(getPlayer(), SubSkillType.MACES_CRUSH);
if (rank > 0) {
return (1.0D + (rank * 0.5D));
}
return 0;
}
/**
* Process Cripple attack.
*
* @param target The defending entity
*/
public void processCripple(@NotNull LivingEntity target) {
// Don't apply Cripple if the target is already Slowed
if (target.getPotionEffect(PotionEffectType.SLOWNESS) != null) {
return;
}
if (!Permissions.canUseSubSkill(mmoPlayer.getPlayer(), SubSkillType.MACES_CRIPPLE)) {
return;
}
int crippleRank = RankUtils.getRank(getPlayer(), SubSkillType.MACES_CRIPPLE);
double crippleOdds = (mcMMO.p.getAdvancedConfig().getCrippleChanceToApplyOnHit(crippleRank)
* mmoPlayer.getAttackStrength());
if (ProbabilityUtil.isStaticSkillRNGSuccessful(PrimarySkillType.MACES, mmoPlayer, crippleOdds)) {
// Cripple is success, Cripple the target
target.addPotionEffect(PotionEffectType.SLOWNESS.createEffect(getCrippleTickDuration(), 1));
// TODO: Play some kind of Smash effect / sound
SoundManager.sendCategorizedSound(getPlayer(), target.getLocation(), SoundType.CRIPPLE, SoundCategory.PLAYERS);
}
}
public int getCrippleTickDuration() {
// TODO: Make configurable
return 20 * 5;
}
} }

View File

@ -32,95 +32,47 @@ public final class CommandRegistrationManager {
private static final String permissionsMessage = LocaleLoader.getString("mcMMO.NoPermission"); private static final String permissionsMessage = LocaleLoader.getString("mcMMO.NoPermission");
private static void registerSkillCommands() { private static void registerSkillCommands() {
for (PrimarySkillType skill : PrimarySkillType.values()) { for (PrimarySkillType primarySkillType : PrimarySkillType.values()) {
if (skill == PrimarySkillType.MACES) if (primarySkillType == PrimarySkillType.MACES
&& !mcMMO.getCompatibilityManager().getMinecraftGameVersion().isAtLeast(1, 21, 0)) {
continue; continue;
}
String commandName = skill.toString().toLowerCase(Locale.ENGLISH); final String commandName = primarySkillType.toString().toLowerCase(Locale.ENGLISH);
String localizedName = mcMMO.p.getSkillTools().getLocalizedSkillName(skill).toLowerCase(Locale.ENGLISH); final String localizedName = mcMMO.p.getSkillTools().getLocalizedSkillName(primarySkillType).toLowerCase(Locale.ENGLISH);
PluginCommand command; final PluginCommand command = mcMMO.p.getCommand(commandName);
if (command == null) {
mcMMO.p.getLogger().severe("Command not found: " + commandName);
continue;
}
command = mcMMO.p.getCommand(commandName);
command.setDescription(LocaleLoader.getString("Commands.Description.Skill", StringUtils.getCapitalized(localizedName))); command.setDescription(LocaleLoader.getString("Commands.Description.Skill", StringUtils.getCapitalized(localizedName)));
command.setPermission("mcmmo.commands." + commandName); command.setPermission("mcmmo.commands." + commandName);
command.setPermissionMessage(permissionsMessage); command.setPermissionMessage(permissionsMessage);
command.setUsage(LocaleLoader.getString("Commands.Usage.0", commandName)); command.setUsage(LocaleLoader.getString("Commands.Usage.0", commandName));
command.setUsage(command.getUsage() + "\n" + LocaleLoader.getString("Commands.Usage.2", commandName, "?", "[" + LocaleLoader.getString("Commands.Usage.Page") + "]")); command.setUsage(command.getUsage() + "\n" + LocaleLoader.getString("Commands.Usage.2", commandName, "?", "[" + LocaleLoader.getString("Commands.Usage.Page") + "]"));
switch (skill) { switch (primarySkillType) {
case ACROBATICS: case ACROBATICS -> command.setExecutor(new AcrobaticsCommand());
command.setExecutor(new AcrobaticsCommand()); case ALCHEMY -> command.setExecutor(new AlchemyCommand());
break; case ARCHERY -> command.setExecutor(new ArcheryCommand());
case AXES -> command.setExecutor(new AxesCommand());
case ALCHEMY: case CROSSBOWS -> command.setExecutor(new CrossbowsCommand());
command.setExecutor(new AlchemyCommand()); case EXCAVATION -> command.setExecutor(new ExcavationCommand());
break; case FISHING -> command.setExecutor(new FishingCommand());
case HERBALISM -> command.setExecutor(new HerbalismCommand());
case ARCHERY: case MACES -> command.setExecutor(new MacesCommand());
command.setExecutor(new ArcheryCommand()); case MINING -> command.setExecutor(new MiningCommand());
break; case REPAIR -> command.setExecutor(new RepairCommand());
case SALVAGE -> command.setExecutor(new SalvageCommand());
case AXES: case SMELTING -> command.setExecutor(new SmeltingCommand());
command.setExecutor(new AxesCommand()); case SWORDS -> command.setExecutor(new SwordsCommand());
break; case TAMING -> command.setExecutor(new TamingCommand());
case CROSSBOWS: case TRIDENTS -> command.setExecutor(new TridentsCommand());
command.setExecutor(new CrossbowsCommand()); case UNARMED -> command.setExecutor(new UnarmedCommand());
break; case WOODCUTTING -> command.setExecutor(new WoodcuttingCommand());
default -> throw new IllegalStateException("Unexpected value: " + primarySkillType);
case EXCAVATION:
command.setExecutor(new ExcavationCommand());
break;
case FISHING:
command.setExecutor(new FishingCommand());
break;
case HERBALISM:
command.setExecutor(new HerbalismCommand());
break;
case MACES:
// command.setExecutor(new MacesCommand());
break;
case MINING:
command.setExecutor(new MiningCommand());
break;
case REPAIR:
command.setExecutor(new RepairCommand());
break;
case SALVAGE:
command.setExecutor(new SalvageCommand());
break;
case SMELTING:
command.setExecutor(new SmeltingCommand());
break;
case SWORDS:
command.setExecutor(new SwordsCommand());
break;
case TAMING:
command.setExecutor(new TamingCommand());
break;
case TRIDENTS:
command.setExecutor(new TridentsCommand());
break;
case UNARMED:
command.setExecutor(new UnarmedCommand());
break;
case WOODCUTTING:
command.setExecutor(new WoodcuttingCommand());
break;
default:
throw new IllegalStateException("Unexpected value: " + skill);
} }
} }
} }

View File

@ -85,14 +85,11 @@ public class PlatformManager {
} }
public String getServerSoftwareStr() { public String getServerSoftwareStr() {
switch(getServerSoftware()) { return switch (getServerSoftware()) {
case PAPER: case PAPER -> "Paper";
return "Paper"; case SPIGOT -> "Spigot";
case SPIGOT: default -> "CraftBukkit";
return "Spigot"; };
default:
return "CraftBukkit";
}
} }
public @Nullable CompatibilityManager getCompatibilityManager() { public @Nullable CompatibilityManager getCompatibilityManager() {

View File

@ -13,6 +13,7 @@ import com.gmail.nossr50.runnables.skills.AwardCombatXpTask;
import com.gmail.nossr50.skills.acrobatics.AcrobaticsManager; import com.gmail.nossr50.skills.acrobatics.AcrobaticsManager;
import com.gmail.nossr50.skills.archery.ArcheryManager; import com.gmail.nossr50.skills.archery.ArcheryManager;
import com.gmail.nossr50.skills.axes.AxesManager; import com.gmail.nossr50.skills.axes.AxesManager;
import com.gmail.nossr50.skills.maces.MacesManager;
import com.gmail.nossr50.skills.swords.SwordsManager; import com.gmail.nossr50.skills.swords.SwordsManager;
import com.gmail.nossr50.skills.taming.TamingManager; import com.gmail.nossr50.skills.taming.TamingManager;
import com.gmail.nossr50.skills.tridents.TridentsManager; import com.gmail.nossr50.skills.tridents.TridentsManager;
@ -20,6 +21,7 @@ import com.gmail.nossr50.skills.unarmed.UnarmedManager;
import com.gmail.nossr50.util.*; import com.gmail.nossr50.util.*;
import com.gmail.nossr50.util.player.NotificationManager; import com.gmail.nossr50.util.player.NotificationManager;
import com.gmail.nossr50.util.player.UserManager; import com.gmail.nossr50.util.player.UserManager;
import org.bukkit.Bukkit;
import org.bukkit.GameMode; import org.bukkit.GameMode;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.attribute.Attribute; import org.bukkit.attribute.Attribute;
@ -72,10 +74,6 @@ public final class CombatUtils {
mcMMOPlayer.checkAbilityActivation(PrimarySkillType.SWORDS); mcMMOPlayer.checkAbilityActivation(PrimarySkillType.SWORDS);
} }
if (target.getHealth() - event.getFinalDamage() > 0) {
swordsManager.processRupture(target);
}
//Add Stab Damage //Add Stab Damage
if (swordsManager.canUseStab()) { if (swordsManager.canUseStab()) {
boostedDamage += (swordsManager.getStabDamage() * mcMMOPlayer.getAttackStrength()); boostedDamage += (swordsManager.getStabDamage() * mcMMOPlayer.getAttackStrength());
@ -90,6 +88,11 @@ public final class CombatUtils {
} }
event.setDamage(boostedDamage); event.setDamage(boostedDamage);
if (target.getHealth() - event.getFinalDamage() > 0) {
swordsManager.processRupture(target);
}
processCombatXP(mcMMOPlayer, target, PrimarySkillType.SWORDS); processCombatXP(mcMMOPlayer, target, PrimarySkillType.SWORDS);
printFinalDamageDebug(player, event, mcMMOPlayer); printFinalDamageDebug(player, event, mcMMOPlayer);
@ -210,29 +213,40 @@ public final class CombatUtils {
delayArrowMetaCleanup(arrow); delayArrowMetaCleanup(arrow);
} }
private static void processMacesCombat(@NotNull LivingEntity target, @NotNull Player player, @NotNull EntityDamageByEntityEvent event) { private static void processMacesCombat(@NotNull LivingEntity target,
@NotNull Player player,
@NotNull EntityDamageByEntityEvent event) {
if (event.getCause() == DamageCause.THORNS) { if (event.getCause() == DamageCause.THORNS) {
return; return;
} }
double boostedDamage = event.getDamage(); double boostedDamage = event.getDamage();
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player); final McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
//Make sure the profiles been loaded //Make sure the profiles been loaded
if (mcMMOPlayer == null) { if (mcMMOPlayer == null) {
return; return;
} }
// MacesManager macesManager = mcMMOPlayer.getMacesManager(); final MacesManager macesManager = mcMMOPlayer.getMacesManager();
// Apply Limit Break DMG
if (canUseLimitBreak(player, target, SubSkillType.MACES_MACES_LIMIT_BREAK)) { if (canUseLimitBreak(player, target, SubSkillType.MACES_MACES_LIMIT_BREAK)) {
boostedDamage += (getLimitBreakDamage(player, target, SubSkillType.MACES_MACES_LIMIT_BREAK) * mcMMOPlayer.getAttackStrength()); boostedDamage += (getLimitBreakDamage(player, target, SubSkillType.MACES_MACES_LIMIT_BREAK) * mcMMOPlayer.getAttackStrength());
} }
event.setDamage(boostedDamage); // Apply Crush
processCombatXP(mcMMOPlayer, target, PrimarySkillType.MACES); boostedDamage += (macesManager.getCrushDamage() * mcMMOPlayer.getAttackStrength());
event.setDamage(boostedDamage);
// Apply Cripple
if (target.getHealth() - event.getFinalDamage() > 0) {
macesManager.processCripple(target);
}
processCombatXP(mcMMOPlayer, target, PrimarySkillType.MACES);
printFinalDamageDebug(player, event, mcMMOPlayer); printFinalDamageDebug(player, event, mcMMOPlayer);
} }
@ -416,7 +430,9 @@ public final class CombatUtils {
* *
* @param event The event to run the combat checks on. * @param event The event to run the combat checks on.
*/ */
public static void processCombatAttack(@NotNull EntityDamageByEntityEvent event, @NotNull Entity painSourceRoot, @NotNull LivingEntity target) { public static void processCombatAttack(@NotNull EntityDamageByEntityEvent event,
@NotNull Entity painSourceRoot,
@NotNull LivingEntity target) {
Entity painSource = event.getDamager(); Entity painSource = event.getDamager();
EntityType entityType = painSource.getType(); EntityType entityType = painSource.getType();
@ -456,6 +472,11 @@ public final class CombatUtils {
} }
if (painSourceRoot instanceof Player player && entityType == EntityType.PLAYER) { if (painSourceRoot instanceof Player player && entityType == EntityType.PLAYER) {
// final McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
// if (mcMMOPlayer != null) {
// Bukkit.broadcastMessage("DEBUG: AttackStrength of painSource: " + mcMMOPlayer.getAttackStrength());
// System.out.println("DEBUG: AttackStrength of painSource: " + mcMMOPlayer.getAttackStrength());
// }
if (!UserManager.hasPlayerDataKey(player)) { if (!UserManager.hasPlayerDataKey(player)) {
return; return;

View File

@ -9,6 +9,15 @@ import org.bukkit.World;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
public class SoundManager { public class SoundManager {
public static Sound CRIPPLE_SOUND;
static {
try {
CRIPPLE_SOUND = Sound.valueOf("ITEM_MACE_SMASH_GROUND");
} catch (IllegalArgumentException e) {
CRIPPLE_SOUND = Sound.BLOCK_ANVIL_PLACE;
}
}
/** /**
* Sends a sound to the player * Sends a sound to the player
* @param soundType the type of sound * @param soundType the type of sound
@ -74,6 +83,7 @@ public class SoundManager {
case DEFLECT_ARROWS, BLEED -> Sound.ENTITY_ENDER_EYE_DEATH; case DEFLECT_ARROWS, BLEED -> Sound.ENTITY_ENDER_EYE_DEATH;
case GLASS -> Sound.BLOCK_GLASS_BREAK; case GLASS -> Sound.BLOCK_GLASS_BREAK;
case ITEM_CONSUMED -> Sound.ITEM_BOTTLE_EMPTY; case ITEM_CONSUMED -> Sound.ITEM_BOTTLE_EMPTY;
case CRIPPLE -> CRIPPLE_SOUND;
}; };
} }

View File

@ -16,6 +16,7 @@ public enum SoundType {
BLEED, BLEED,
GLASS, GLASS,
ITEM_CONSUMED, ITEM_CONSUMED,
CRIPPLE,
TIRED; TIRED;
public boolean usesCustomPitch() { public boolean usesCustomPitch() {

View File

@ -634,3 +634,10 @@ Skills:
MaxBonusLevel: MaxBonusLevel:
Standard: 100 Standard: 100
RetroMode: 1000 RetroMode: 1000
Maces:
Cripple:
Chance_To_Apply_On_Hit:
Rank_1: 10
Rank_2: 15
Rank_3: 20
Rank_4: 33

View File

@ -464,6 +464,13 @@ Maces.Ability.Ready=&3You &6ready&3 your Mace.
Maces.SubSkill.MacesLimitBreak.Name=Maces Limit Break Maces.SubSkill.MacesLimitBreak.Name=Maces Limit Break
Maces.SubSkill.MacesLimitBreak.Description=Breaking your limits. Increased damage against tough opponents. Intended for PVP, up to server settings for whether it will boost damage in PVE. Maces.SubSkill.MacesLimitBreak.Description=Breaking your limits. Increased damage against tough opponents. Intended for PVP, up to server settings for whether it will boost damage in PVE.
Maces.SubSkill.MacesLimitBreak.Stat=Limit Break Max DMG Maces.SubSkill.MacesLimitBreak.Stat=Limit Break Max DMG
Maces.SubSkill.Crush.Name=Crush
Maces.SubSkill.Crush.Description=Adds bonus damage to your attacks.
Maces.SubSkill.Crush.Stat=Crush Damage
Maces.SubSkill.Cripple.Name=Cripple
Maces.SubSkill.Cripple.Description=Adds a chance to cripple your target.
Maces.SubSkill.Cripple.Stat=Cripple Chance
Maces.SubSkill.Cripple.Stat.Extra=[[DARK_AQUA]]Cripple Duration: &e{0}s&a vs Players, &e{1}s&a vs Mobs.
Maces.Listener=Maces: Maces.Listener=Maces:
#SWORDS #SWORDS
@ -899,6 +906,7 @@ Commands.XPGain.Crossbows=Attacking Monsters
Commands.XPGain.Excavation=Digging and finding treasures Commands.XPGain.Excavation=Digging and finding treasures
Commands.XPGain.Fishing=Fishing (Go figure!) Commands.XPGain.Fishing=Fishing (Go figure!)
Commands.XPGain.Herbalism=Harvesting Herbs Commands.XPGain.Herbalism=Harvesting Herbs
Commands.XPGain.Maces=Attacking Monsters
Commands.XPGain.Mining=Mining Stone & Ore Commands.XPGain.Mining=Mining Stone & Ore
Commands.XPGain.Repair=Repairing Commands.XPGain.Repair=Repairing
Commands.XPGain.Swords=Attacking Monsters Commands.XPGain.Swords=Attacking Monsters

View File

@ -444,6 +444,7 @@ Salvage:
Rank_7: 850 Rank_7: 850
Rank_8: 1000 Rank_8: 1000
Maces: Maces:
MacesLimitBreak:
Standard: Standard:
Rank_1: 10 Rank_1: 10
Rank_2: 20 Rank_2: 20
@ -466,6 +467,28 @@ Maces:
Rank_8: 800 Rank_8: 800
Rank_9: 900 Rank_9: 900
Rank_10: 1000 Rank_10: 1000
Cripple:
Standard:
Rank_1: 5
Rank_2: 20
Rank_3: 40
Rank_4: 80
RetroMode:
Rank_1: 50
Rank_2: 200
Rank_3: 400
Rank_4: 800
Crush:
Standard:
Rank_1: 10
Rank_2: 25
Rank_3: 75
Rank_4: 90
RetroMode:
Rank_1: 100
Rank_2: 250
Rank_3: 750
Rank_4: 900
Mining: Mining:
MotherLode: MotherLode:
Standard: Standard:

View File

@ -17,9 +17,7 @@ import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.mockito.Mockito; import org.mockito.Mockito;
import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.List;
import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq; import static org.mockito.ArgumentMatchers.eq;