mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-08-01 03:55:28 +02:00

committed by
GitHub

parent
02c732bdf2
commit
971e5da0ad
@@ -1,52 +1,81 @@
|
||||
//package com.gmail.nossr50.commands.skills;
|
||||
//
|
||||
//import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
//import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
//import com.gmail.nossr50.util.player.UserManager;
|
||||
//import com.gmail.nossr50.util.skills.CombatUtils;
|
||||
//import com.gmail.nossr50.util.skills.SkillUtils;
|
||||
//import com.gmail.nossr50.util.text.TextComponentFactory;
|
||||
//import net.kyori.adventure.text.Component;
|
||||
//import org.bukkit.ChatColor;
|
||||
//import org.bukkit.entity.Player;
|
||||
//
|
||||
//import java.util.ArrayList;
|
||||
//import java.util.List;
|
||||
//
|
||||
//import static com.gmail.nossr50.datatypes.skills.SubSkillType.MACES_MACES_LIMIT_BREAK;
|
||||
//
|
||||
//public class MacesCommand extends SkillCommand {
|
||||
//
|
||||
// public MacesCommand() {
|
||||
// super(PrimarySkillType.MACES);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// protected void dataCalculations(Player player, float skillValue) {}
|
||||
//
|
||||
// @Override
|
||||
// protected void permissionsCheck(Player player) {}
|
||||
//
|
||||
// @Override
|
||||
// protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {
|
||||
// List<String> messages = new ArrayList<>();
|
||||
//
|
||||
// if (SkillUtils.canUseSubskill(player, MACES_MACES_LIMIT_BREAK)) {
|
||||
// messages.add(getStatMessage(MACES_MACES_LIMIT_BREAK,
|
||||
// String.valueOf(CombatUtils.getLimitBreakDamageAgainstQuality(player, MACES_MACES_LIMIT_BREAK, 1000))));
|
||||
// }
|
||||
//
|
||||
// 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;
|
||||
// }
|
||||
//}
|
||||
package com.gmail.nossr50.commands.skills;
|
||||
|
||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.datatypes.skills.SubSkillType;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.skills.maces.MacesManager;
|
||||
import com.gmail.nossr50.util.skills.CombatUtils;
|
||||
import com.gmail.nossr50.util.skills.RankUtils;
|
||||
import com.gmail.nossr50.util.skills.SkillUtils;
|
||||
import com.gmail.nossr50.util.text.TextComponentFactory;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static com.gmail.nossr50.datatypes.skills.SubSkillType.MACES_CRIPPLE;
|
||||
import static com.gmail.nossr50.datatypes.skills.SubSkillType.MACES_MACES_LIMIT_BREAK;
|
||||
|
||||
public class MacesCommand extends SkillCommand {
|
||||
|
||||
public MacesCommand() {
|
||||
super(PrimarySkillType.MACES);
|
||||
}
|
||||
|
||||
String crippleChanceToApply, crippleChanceToApplyLucky, crippleLengthAgainstPlayers, crippleLengthAgainstMobs;
|
||||
|
||||
@Override
|
||||
protected void dataCalculations(Player player, float skillValue) {
|
||||
if (SkillUtils.canUseSubskill(player, MACES_CRIPPLE)) {
|
||||
int crippleRank = RankUtils.getRank(player, MACES_CRIPPLE);
|
||||
crippleLengthAgainstPlayers = String.valueOf(MacesManager.getCrippleTickDuration(true) / 20.0D);
|
||||
crippleLengthAgainstMobs = String.valueOf(MacesManager.getCrippleTickDuration(false) / 20.0D);
|
||||
|
||||
crippleChanceToApply = String.valueOf(mcMMO.p.getAdvancedConfig().getCrippleChanceToApplyOnHit(crippleRank) + "%");
|
||||
crippleChanceToApplyLucky = String.valueOf(mcMMO.p.getAdvancedConfig().getCrippleChanceToApplyOnHit(crippleRank) * 1.33);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void permissionsCheck(Player player) {}
|
||||
|
||||
@Override
|
||||
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {
|
||||
final List<String> messages = new ArrayList<>();
|
||||
|
||||
if (SkillUtils.canUseSubskill(player, MACES_MACES_LIMIT_BREAK)) {
|
||||
messages.add(getStatMessage(MACES_MACES_LIMIT_BREAK,
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user