Add in trident command

This commit is contained in:
nossr50 2023-12-19 11:17:22 -08:00
parent c8dedfc980
commit 25952154e3
4 changed files with 14 additions and 12 deletions

View File

@ -1,5 +1,4 @@
Version 2.2.000 Version 2.2.000
TODO: Configs are not adding new keys and this needs to be fixed, this affects config.yml, experience.yml, etc
TODO: Add Xbows/Tridents to salvage/repair TODO: Add Xbows/Tridents to salvage/repair
TODO: Add unit test for combat XP values TODO: Add unit test for combat XP values
TODO: Add unit test to determine crossbow or bow skill TODO: Add unit test to determine crossbow or bow skill

View File

@ -2,7 +2,10 @@ package com.gmail.nossr50.commands.skills;
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.datatypes.skills.SubSkillType;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.random.ProbabilityUtil;
import com.gmail.nossr50.util.skills.CombatUtils;
import com.gmail.nossr50.util.skills.RankUtils; import com.gmail.nossr50.util.skills.RankUtils;
import com.gmail.nossr50.util.text.TextComponentFactory; import com.gmail.nossr50.util.text.TextComponentFactory;
import net.kyori.adventure.text.Component; import net.kyori.adventure.text.Component;
@ -13,30 +16,29 @@ import java.util.List;
public class TridentsCommand extends SkillCommand { public class TridentsCommand extends SkillCommand {
private boolean canTridentsSuper;
public TridentsCommand() { public TridentsCommand() {
super(PrimarySkillType.TRIDENTS); super(PrimarySkillType.TRIDENTS);
} }
@Override @Override
protected void dataCalculations(Player player, float skillValue) { protected void dataCalculations(Player player, float skillValue) {}
// TODO: Implement data calculations
}
@Override @Override
protected void permissionsCheck(Player player) { protected void permissionsCheck(Player player) {}
canTridentsSuper = RankUtils.hasUnlockedSubskill(player, SubSkillType.TRIDENTS_TRIDENTS_SUPER_ABILITY)
&& Permissions.superShotgun(player);
}
@Override @Override
protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) { protected List<String> statsDisplay(Player player, float skillValue, boolean hasEndurance, boolean isLucky) {
List<String> messages = new ArrayList<>(); List<String> messages = new ArrayList<>();
if (canTridentsSuper) { if (canUseSubskill(player, SubSkillType.TRIDENTS_TRIDENTS_SUPER_ABILITY)) {
messages.add("Tridents Super Ability"); messages.add("Tridents Super Ability");
//TODO: Implement SSG //TODO: Implement Tridents Super
}
if(canUseSubskill(player, SubSkillType.TRIDENTS_TRIDENTS_LIMIT_BREAK)) {
messages.add(getStatMessage(SubSkillType.TRIDENTS_TRIDENTS_LIMIT_BREAK,
String.valueOf(CombatUtils.getLimitBreakDamageAgainstQuality(player, SubSkillType.TRIDENTS_TRIDENTS_LIMIT_BREAK, 1000))));
} }
return messages; return messages;

View File

@ -228,6 +228,7 @@ public final class Permissions {
/* CROSSBOWS */ /* CROSSBOWS */
public static boolean superShotgun(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.crossbows.supershotgun"); } public static boolean superShotgun(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.crossbows.supershotgun"); }
public static boolean tridentsSuper(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.tridents.superability"); } public static boolean tridentsSuper(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.tridents.superability"); }
public static boolean tridentsLimitBreak(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.tridents.superability"); }
/* /*
* PARTY * PARTY

View File

@ -101,7 +101,7 @@ public final class CommandRegistrationManager {
command.setExecutor(new TamingCommand()); command.setExecutor(new TamingCommand());
break; break;
case TRIDENTS: case TRIDENTS:
// TODO: Implement command.setExecutor(new TridentsCommand());
break; break;
case UNARMED: case UNARMED: