More work on Crossbows & Tridents

This commit is contained in:
nossr50 2024-01-04 12:39:26 -08:00
parent 4ba0f76eb9
commit 826d16d916
14 changed files with 193 additions and 27 deletions

View File

@ -1,8 +1,14 @@
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.datatypes.skills.SubSkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.archery.Archery;
import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.player.UserManager;
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,6 +19,9 @@ import java.util.List;
public class CrossbowsCommand extends SkillCommand { public class CrossbowsCommand extends SkillCommand {
private boolean canSSG; private boolean canSSG;
private boolean canTrickShot;
private boolean canPoweredShot;
private int bounceCount;
public CrossbowsCommand() { public CrossbowsCommand() {
super(PrimarySkillType.CROSSBOWS); super(PrimarySkillType.CROSSBOWS);
@ -27,17 +36,42 @@ public class CrossbowsCommand extends SkillCommand {
protected void permissionsCheck(Player player) { protected void permissionsCheck(Player player) {
canSSG = RankUtils.hasUnlockedSubskill(player, SubSkillType.CROSSBOWS_SUPER_SHOTGUN) canSSG = RankUtils.hasUnlockedSubskill(player, SubSkillType.CROSSBOWS_SUPER_SHOTGUN)
&& Permissions.superShotgun(player); && Permissions.superShotgun(player);
canTrickShot = RankUtils.hasUnlockedSubskill(player, SubSkillType.CROSSBOWS_TRICK_SHOT)
&& Permissions.trickShot(player);
canPoweredShot = RankUtils.hasUnlockedSubskill(player, SubSkillType.CROSSBOWS_POWERED_SHOT)
&& Permissions.poweredShot(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<>();
McMMOPlayer mmoPlayer = UserManager.getPlayer(player);
if (mmoPlayer == null) {
return messages;
}
if (canPoweredShot) {
messages.add(getStatMessage(SubSkillType.ARCHERY_SKILL_SHOT, percent.format(mmoPlayer.getCrossbowsManager().getDamageBonusPercent(player))));
}
if (canSSG) { if (canSSG) {
messages.add("Super Shotgun"); messages.add("Super Shotgun");
//TODO: Implement SSG //TODO: Implement SSG
} }
if (canTrickShot) {
messages.add(getStatMessage(SubSkillType.CROSSBOWS_TRICK_SHOT,
String.valueOf(mmoPlayer.getCrossbowsManager().getTrickShotMaxBounceCount())));
}
if(Permissions.canUseSubSkill(player, SubSkillType.CROSSBOWS_CROSSBOWS_LIMIT_BREAK)) {
messages.add(getStatMessage(SubSkillType.CROSSBOWS_CROSSBOWS_LIMIT_BREAK,
String.valueOf(CombatUtils.getLimitBreakDamageAgainstQuality(player, SubSkillType.CROSSBOWS_CROSSBOWS_LIMIT_BREAK, 1000))));
}
return messages; return messages;
} }

View File

@ -11,7 +11,6 @@ import com.gmail.nossr50.util.player.NotificationManager;
import com.gmail.nossr50.util.player.UserManager; import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.scoreboards.ScoreboardManager; import com.gmail.nossr50.util.scoreboards.ScoreboardManager;
import com.gmail.nossr50.util.skills.PerksUtils; import com.gmail.nossr50.util.skills.PerksUtils;
import com.gmail.nossr50.util.skills.RankUtils;
import com.gmail.nossr50.util.skills.SkillTools; import com.gmail.nossr50.util.skills.SkillTools;
import com.gmail.nossr50.util.text.StringUtils; import com.gmail.nossr50.util.text.StringUtils;
import com.gmail.nossr50.util.text.TextComponentFactory; import com.gmail.nossr50.util.text.TextComponentFactory;
@ -29,7 +28,6 @@ import java.text.DecimalFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.Set;
public abstract class SkillCommand implements TabExecutor { public abstract class SkillCommand implements TabExecutor {
protected PrimarySkillType skill; protected PrimarySkillType skill;
@ -294,14 +292,4 @@ public abstract class SkillCommand implements TabExecutor {
protected abstract List<Component> getTextComponents(Player player); protected abstract List<Component> getTextComponents(Player player);
/**
* Checks if a player can use a skill
* @param player target player
* @param subSkillType target subskill
* @return true if the player has permission and has the skill unlocked
*/
protected boolean canUseSubskill(Player player, SubSkillType subSkillType)
{
return Permissions.isSubSkillEnabled(player, subSkillType) && RankUtils.hasUnlockedSubskill(player, subSkillType);
}
} }

View File

@ -9,6 +9,7 @@ import com.gmail.nossr50.util.player.UserManager;
import com.gmail.nossr50.util.random.ProbabilityUtil; import com.gmail.nossr50.util.random.ProbabilityUtil;
import com.gmail.nossr50.util.skills.CombatUtils; 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.skills.SkillUtils;
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;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -69,8 +70,8 @@ public class SwordsCommand extends SkillCommand {
@Override @Override
protected void permissionsCheck(Player player) { protected void permissionsCheck(Player player) {
canRupture = canUseSubskill(player, SubSkillType.SWORDS_RUPTURE); canRupture = SkillUtils.canUseSubskill(player, SubSkillType.SWORDS_RUPTURE);
canCounter = canUseSubskill(player, SubSkillType.SWORDS_COUNTER_ATTACK); canCounter = SkillUtils.canUseSubskill(player, SubSkillType.SWORDS_COUNTER_ATTACK);
canSerratedStrike = RankUtils.hasUnlockedSubskill(player, SubSkillType.SWORDS_SERRATED_STRIKES) && Permissions.serratedStrikes(player); canSerratedStrike = RankUtils.hasUnlockedSubskill(player, SubSkillType.SWORDS_SERRATED_STRIKES) && Permissions.serratedStrikes(player);
} }
@ -101,13 +102,13 @@ public class SwordsCommand extends SkillCommand {
+ (hasEndurance ? LocaleLoader.getString("Perks.ActivationTime.Bonus", serratedStrikesLengthEndurance) : "")); + (hasEndurance ? LocaleLoader.getString("Perks.ActivationTime.Bonus", serratedStrikesLengthEndurance) : ""));
} }
if(canUseSubskill(player, SubSkillType.SWORDS_STAB)) if(SkillUtils.canUseSubskill(player, SubSkillType.SWORDS_STAB))
{ {
messages.add(getStatMessage(SubSkillType.SWORDS_STAB, messages.add(getStatMessage(SubSkillType.SWORDS_STAB,
String.valueOf(UserManager.getPlayer(player).getSwordsManager().getStabDamage()))); String.valueOf(UserManager.getPlayer(player).getSwordsManager().getStabDamage())));
} }
if(canUseSubskill(player, SubSkillType.SWORDS_SWORDS_LIMIT_BREAK)) { if(SkillUtils.canUseSubskill(player, SubSkillType.SWORDS_SWORDS_LIMIT_BREAK)) {
messages.add(getStatMessage(SubSkillType.SWORDS_SWORDS_LIMIT_BREAK, messages.add(getStatMessage(SubSkillType.SWORDS_SWORDS_LIMIT_BREAK,
String.valueOf(CombatUtils.getLimitBreakDamageAgainstQuality(player, SubSkillType.SWORDS_SWORDS_LIMIT_BREAK, 1000)))); String.valueOf(CombatUtils.getLimitBreakDamageAgainstQuality(player, SubSkillType.SWORDS_SWORDS_LIMIT_BREAK, 1000))));
} }

View File

@ -3,6 +3,7 @@ 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.util.skills.CombatUtils; import com.gmail.nossr50.util.skills.CombatUtils;
import com.gmail.nossr50.util.skills.SkillUtils;
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;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -27,12 +28,12 @@ public class TridentsCommand extends SkillCommand {
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 (canUseSubskill(player, SubSkillType.TRIDENTS_SUPER)) { if (SkillUtils.canUseSubskill(player, SubSkillType.TRIDENTS_SUPER)) {
messages.add("Tridents Super Ability"); messages.add("Tridents Super Ability");
//TODO: Implement Tridents Super //TODO: Implement Tridents Super
} }
if(canUseSubskill(player, SubSkillType.TRIDENTS_TRIDENTS_LIMIT_BREAK)) { if(SkillUtils.canUseSubskill(player, SubSkillType.TRIDENTS_TRIDENTS_LIMIT_BREAK)) {
messages.add(getStatMessage(SubSkillType.TRIDENTS_TRIDENTS_LIMIT_BREAK, messages.add(getStatMessage(SubSkillType.TRIDENTS_TRIDENTS_LIMIT_BREAK,
String.valueOf(CombatUtils.getLimitBreakDamageAgainstQuality(player, SubSkillType.TRIDENTS_TRIDENTS_LIMIT_BREAK, 1000)))); String.valueOf(CombatUtils.getLimitBreakDamageAgainstQuality(player, SubSkillType.TRIDENTS_TRIDENTS_LIMIT_BREAK, 1000))));
} }

View File

@ -693,6 +693,15 @@ public class AdvancedConfig extends BukkitConfig {
return config.getDouble("Skills.Axes.SkullSplitter.DamageModifier", 2.0D); return config.getDouble("Skills.Axes.SkullSplitter.DamageModifier", 2.0D);
} }
/* CROSSBOWS */
public double getPoweredShotRankDamageMultiplier() {
return config.getDouble("Skills.Crossbows.PoweredShot.RankDamageMultiplier", 10.0D);
}
public double getPoweredShotDamageMax() {
return config.getDouble("Skills.Archery.SkillShot.MaxDamage", 9.0D);
}
/* EXCAVATION */ /* EXCAVATION */
//Nothing to configure, everything is already configurable in config.yml //Nothing to configure, everything is already configurable in config.yml

View File

@ -36,6 +36,7 @@ public enum SubSkillType {
CROSSBOWS_SUPER_SHOTGUN(1), CROSSBOWS_SUPER_SHOTGUN(1),
CROSSBOWS_CROSSBOWS_LIMIT_BREAK(10), CROSSBOWS_CROSSBOWS_LIMIT_BREAK(10),
CROSSBOWS_TRICK_SHOT(3), CROSSBOWS_TRICK_SHOT(3),
CROSSBOWS_POWERED_SHOT(20),
/* Excavation */ /* Excavation */
EXCAVATION_ARCHAEOLOGY(8), EXCAVATION_ARCHAEOLOGY(8),
@ -101,6 +102,7 @@ public enum SubSkillType {
/* Tridents */ /* Tridents */
TRIDENTS_SUPER(1), TRIDENTS_SUPER(1),
TRIDENTS_IMPALE(10),
TRIDENTS_TRIDENTS_LIMIT_BREAK(10), TRIDENTS_TRIDENTS_LIMIT_BREAK(10),
/* Unarmed */ /* Unarmed */

View File

@ -3,7 +3,9 @@ package com.gmail.nossr50.skills.crossbows;
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.datatypes.skills.SubSkillType;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.skills.SkillManager; import com.gmail.nossr50.skills.SkillManager;
import com.gmail.nossr50.skills.archery.Archery;
import com.gmail.nossr50.util.BowType; import com.gmail.nossr50.util.BowType;
import com.gmail.nossr50.util.MetadataConstants; import com.gmail.nossr50.util.MetadataConstants;
import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.Permissions;
@ -12,6 +14,7 @@ import com.gmail.nossr50.util.skills.RankUtils;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.entity.Arrow; import org.bukkit.entity.Arrow;
import org.bukkit.entity.Player;
import org.bukkit.metadata.FixedMetadataValue; import org.bukkit.metadata.FixedMetadataValue;
import org.bukkit.plugin.Plugin; import org.bukkit.plugin.Plugin;
import org.bukkit.projectiles.ProjectileSource; import org.bukkit.projectiles.ProjectileSource;
@ -41,13 +44,9 @@ public class CrossbowsManager extends SkillManager {
if (originalArrow.hasMetadata(MetadataConstants.METADATA_KEY_BOUNCE_COUNT)) { if (originalArrow.hasMetadata(MetadataConstants.METADATA_KEY_BOUNCE_COUNT)) {
bounceCount = originalArrow.getMetadata(MetadataConstants.METADATA_KEY_BOUNCE_COUNT).get(0).asInt(); bounceCount = originalArrow.getMetadata(MetadataConstants.METADATA_KEY_BOUNCE_COUNT).get(0).asInt();
Bukkit.broadcastMessage("Bounce count: " + bounceCount);
if (bounceCount >= getTrickShotMaxBounceCount()) { if (bounceCount >= getTrickShotMaxBounceCount()) {
Bukkit.broadcastMessage("No more bounces.");
return; return;
} }
} else {
Bukkit.broadcastMessage("No bounce count metadata");
} }
final ProjectileSource originalArrowShooter = originalArrow.getShooter(); final ProjectileSource originalArrowShooter = originalArrow.getShooter();
@ -59,10 +58,7 @@ public class CrossbowsManager extends SkillManager {
// check the angle of the arrow against the inverse normal to see if the angle was too shallow // check the angle of the arrow against the inverse normal to see if the angle was too shallow
// only checks angle on the first bounce // only checks angle on the first bounce
if (bounceCount == 0 && arrowInBlockVector.angle(inverseNormal) < Math.PI / 4) { if (bounceCount == 0 && arrowInBlockVector.angle(inverseNormal) < Math.PI / 4) {
Bukkit.broadcastMessage("No bouncing.");
return; return;
} else {
Bukkit.broadcastMessage("Bouncing.");
} }
// Spawn new arrow with the reflected direction // Spawn new arrow with the reflected direction
@ -82,4 +78,23 @@ public class CrossbowsManager extends SkillManager {
public int getTrickShotMaxBounceCount() { public int getTrickShotMaxBounceCount() {
return RankUtils.getRank(mmoPlayer, SubSkillType.CROSSBOWS_TRICK_SHOT); return RankUtils.getRank(mmoPlayer, SubSkillType.CROSSBOWS_TRICK_SHOT);
} }
public double getPoweredShotBonusDamage(Player player, double oldDamage)
{
double damageBonusPercent = getDamageBonusPercent(player);
double newDamage = oldDamage + (oldDamage * damageBonusPercent);
return Math.min(newDamage, (oldDamage + mcMMO.p.getAdvancedConfig().getPoweredShotDamageMax()));
}
public double getDamageBonusPercent(Player player) {
return ((RankUtils.getRank(player, SubSkillType.CROSSBOWS_POWERED_SHOT)) * (mcMMO.p.getAdvancedConfig().getPoweredShotRankDamageMultiplier()) / 100.0D);
}
public double poweredShot(double oldDamage) {
if (ProbabilityUtil.isNonRNGSkillActivationSuccessful(SubSkillType.CROSSBOWS_POWERED_SHOT, getPlayer())) {
return Archery.getSkillShotBonusDamage(getPlayer(), oldDamage);
} else {
return oldDamage;
}
}
} }

View File

@ -2,9 +2,11 @@ package com.gmail.nossr50.skills.tridents;
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.datatypes.skills.ToolType; import com.gmail.nossr50.datatypes.skills.ToolType;
import com.gmail.nossr50.skills.SkillManager; import com.gmail.nossr50.skills.SkillManager;
import com.gmail.nossr50.util.Permissions; import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.skills.RankUtils;
public class TridentsManager extends SkillManager { public class TridentsManager extends SkillManager {
public TridentsManager(McMMOPlayer mmoPlayer) { public TridentsManager(McMMOPlayer mmoPlayer) {
@ -18,4 +20,16 @@ public class TridentsManager extends SkillManager {
public boolean canActivateAbility() { public boolean canActivateAbility() {
return mmoPlayer.getToolPreparationMode(ToolType.TRIDENTS) && Permissions.tridentsSuper(getPlayer()); return mmoPlayer.getToolPreparationMode(ToolType.TRIDENTS) && Permissions.tridentsSuper(getPlayer());
} }
public double impaleDamageBonus() {
int rank = RankUtils.getRank(getPlayer(), SubSkillType.TRIDENTS_IMPALE);
if(rank > 1) {
return (1.0D + (rank * .5D));
} else if(rank == 1) {
return 1.0D;
}
return 0.0D;
}
} }

View File

@ -229,6 +229,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 trickShot(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.crossbows.trickshot"); } public static boolean trickShot(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.crossbows.trickshot"); }
public static boolean poweredShot(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.crossbows.poweredshot"); }
/* TRIDENTS */ /* TRIDENTS */
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"); }

View File

@ -144,6 +144,10 @@ public final class CombatUtils {
mcMMOPlayer.checkAbilityActivation(PrimarySkillType.TRIDENTS); mcMMOPlayer.checkAbilityActivation(PrimarySkillType.TRIDENTS);
} }
if (SkillUtils.canUseSubskill(player, SubSkillType.TRIDENTS_IMPALE)) {
boostedDamage += (tridentsManager.impaleDamageBonus() * mcMMOPlayer.getAttackStrength());
}
if(canUseLimitBreak(player, target, SubSkillType.TRIDENTS_TRIDENTS_LIMIT_BREAK)) { if(canUseLimitBreak(player, target, SubSkillType.TRIDENTS_TRIDENTS_LIMIT_BREAK)) {
boostedDamage += (getLimitBreakDamage(player, target, SubSkillType.TRIDENTS_TRIDENTS_LIMIT_BREAK) * mcMMOPlayer.getAttackStrength()); boostedDamage += (getLimitBreakDamage(player, target, SubSkillType.TRIDENTS_TRIDENTS_LIMIT_BREAK) * mcMMOPlayer.getAttackStrength());
} }
@ -154,7 +158,8 @@ public final class CombatUtils {
printFinalDamageDebug(player, event, mcMMOPlayer); printFinalDamageDebug(player, event, mcMMOPlayer);
} }
private static void processCrossbowsCombat(@NotNull LivingEntity target, @NotNull Player player, @NotNull EntityDamageByEntityEvent event, @NotNull Projectile arrow) { private static void processCrossbowsCombat(@NotNull LivingEntity target, @NotNull Player player,
@NotNull EntityDamageByEntityEvent event, @NotNull Projectile arrow) {
double initialDamage = event.getDamage(); double initialDamage = event.getDamage();
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player); McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
@ -167,6 +172,11 @@ public final class CombatUtils {
double boostedDamage = event.getDamage(); double boostedDamage = event.getDamage();
if (SkillUtils.canUseSubskill(player, SubSkillType.CROSSBOWS_POWERED_SHOT)) {
//Not Additive
boostedDamage = mcMMOPlayer.getCrossbowsManager().poweredShot(initialDamage);
}
if(canUseLimitBreak(player, target, SubSkillType.CROSSBOWS_CROSSBOWS_LIMIT_BREAK)) { if(canUseLimitBreak(player, target, SubSkillType.CROSSBOWS_CROSSBOWS_LIMIT_BREAK)) {
boostedDamage+=getLimitBreakDamage(player, target, SubSkillType.CROSSBOWS_CROSSBOWS_LIMIT_BREAK); boostedDamage+=getLimitBreakDamage(player, target, SubSkillType.CROSSBOWS_CROSSBOWS_LIMIT_BREAK);
} }

View File

@ -13,6 +13,7 @@ import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.metadata.ItemMetadataService; import com.gmail.nossr50.metadata.ItemMetadataService;
import com.gmail.nossr50.util.ItemUtils; import com.gmail.nossr50.util.ItemUtils;
import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.Permissions;
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 com.gmail.nossr50.util.text.StringUtils; import com.gmail.nossr50.util.text.StringUtils;
@ -352,4 +353,15 @@ public final class SkillUtils {
return quantity; return quantity;
} }
/**
* Checks if a player can use a skill
* @param player target player
* @param subSkillType target subskill
* @return true if the player has permission and has the skill unlocked
*/
public static boolean canUseSubskill(Player player, SubSkillType subSkillType)
{
return Permissions.isSubSkillEnabled(player, subSkillType) && RankUtils.hasUnlockedSubskill(player, subSkillType);
}
} }

View File

@ -183,6 +183,7 @@ Archery.SubSkill.ArcheryLimitBreak.Stat=Limit Break Max DMG
Archery.Listener=Archery: Archery.Listener=Archery:
Archery.SkillName=ARCHERY Archery.SkillName=ARCHERY
Archery.SubSkill.ExplosiveShot.Name=Explosive Shot Archery.SubSkill.ExplosiveShot.Name=Explosive Shot
Archery.SubSkill.ExplosiveShot.Description=Fire an explosive arrow
Archery.Skills.ExplosiveShot.Off= Archery.Skills.ExplosiveShot.Off=
Archery.Skills.ExplosiveShot.On=&a**EXPLOSIVE SHOT ACTIVATED** Archery.Skills.ExplosiveShot.On=&a**EXPLOSIVE SHOT ACTIVATED**
Archery.Skills.ExplosiveShot.Other.Off=Explosive Shot&a has worn off for &e{0} Archery.Skills.ExplosiveShot.Other.Off=Explosive Shot&a has worn off for &e{0}
@ -428,6 +429,9 @@ Crossbows.Ability.Lower=&7You lower your crossbow.
Crossbows.Ability.Ready=&3You &6ready&3 your Crossbow. Crossbows.Ability.Ready=&3You &6ready&3 your Crossbow.
Crossbows.Skills.SSG.Refresh=&aYour &eSuper Shotgun &aability is refreshed! Crossbows.Skills.SSG.Refresh=&aYour &eSuper Shotgun &aability is refreshed!
Crossbows.Skills.SSG.Other.On=&a{0}&2 used &Super Shotgun! Crossbows.Skills.SSG.Other.On=&a{0}&2 used &Super Shotgun!
Crossbows.SubSkill.PoweredShot.Name=Powered Shot
Crossbows.SubSkill.PoweredShot.Description=Increases damage done with crossbows
Crossbows.SubSkill.PoweredShot.Stat=Powered Shot Bonus Damage
Crossbows.SubSkill.SuperShotgun.Name=Super Shotgun Crossbows.SubSkill.SuperShotgun.Name=Super Shotgun
Crossbows.SubSkill.SuperShotgun.Description=Shoot dozens of arrows at once Crossbows.SubSkill.SuperShotgun.Description=Shoot dozens of arrows at once
Crossbows.SubSkill.SuperShotgun.Stat=Per Projectile damage &a{0} Crossbows.SubSkill.SuperShotgun.Stat=Per Projectile damage &a{0}
@ -450,6 +454,9 @@ Tridents.Skills.TA.Other.On=&a{0}&2 used Trident &Super!
Tridents.SubSkill.SuperAbility.Name=Tridents Super Ability Tridents.SubSkill.SuperAbility.Name=Tridents Super Ability
Tridents.SubSkill.SuperAbility.Description=N/A Tridents.SubSkill.SuperAbility.Description=N/A
Tridents.SubSkill.SuperAbility.Stat=N/A Tridents.SubSkill.SuperAbility.Stat=N/A
Trients.SubSkill.Impale.Name=Impale
Tridents.SubSkill.Impale.Description=Increases damage done with tridents
Tridents.SubSkill.Impale.Stat=Impale Bonus Damage
Tridents.SubSkill.TridentsLimitBreak.Name=Tridents Limit Break Tridents.SubSkill.TridentsLimitBreak.Name=Tridents Limit Break
Tridents.SubSkill.TridentsLimitBreak.Description=Breaking your limits. Increased damage against tough opponents. Intended for PVP, up to server settings for whether it will boost damage in PVE. Tridents.SubSkill.TridentsLimitBreak.Description=Breaking your limits. Increased damage against tough opponents. Intended for PVP, up to server settings for whether it will boost damage in PVE.
Tridents.SubSkill.TridentsLimitBreak.Stat=Limit Break Max DMG Tridents.SubSkill.TridentsLimitBreak.Stat=Limit Break Max DMG

View File

@ -340,6 +340,7 @@ permissions:
children: children:
mcmmo.ability.crossbows.supershotgun: true mcmmo.ability.crossbows.supershotgun: true
mcmmo.ability.crossbows.trickshot: true mcmmo.ability.crossbows.trickshot: true
mcmmo.ability.crossbows.poweredshot: true
mcmmo.ability.crossbows.crossbowslimitbreak: true mcmmo.ability.crossbows.crossbowslimitbreak: true
mcmmo.ability.crossbows.supershotgun: mcmmo.ability.crossbows.supershotgun:
description: Allows access to the Super Shotgun super ability description: Allows access to the Super Shotgun super ability
@ -347,6 +348,8 @@ permissions:
description: Adds damage to crossbows description: Adds damage to crossbows
mcmmo.ability.crossbows.trickshot: mcmmo.ability.crossbows.trickshot:
description: Allows access to the Trick Shot ability description: Allows access to the Trick Shot ability
mcmmo.ability.crossbows.poweredshot:
description: Allows access to the Powered Shot ability
mcmmo.ability.excavation.*: mcmmo.ability.excavation.*:
default: false default: false
description: Allows access to all Excavation abilities description: Allows access to all Excavation abilities
@ -720,9 +723,12 @@ permissions:
description: Allows access to all Trident abilities description: Allows access to all Trident abilities
children: children:
mcmmo.ability.tridents.superability: true mcmmo.ability.tridents.superability: true
mcmmo.ability.tridents.impale: true
mcmmo.ability.tridents.tridentslimitbreak: true mcmmo.ability.tridents.tridentslimitbreak: true
mcmmo.ability.tridents.superability: mcmmo.ability.tridents.superability:
description: Allows access to tridents super ability description: Allows access to tridents super ability
mcmmo.ability.tridents.impale:
description: Allows access to tridents Impale ability
mcmmo.ability.tridents.tridentslimitbreak: mcmmo.ability.tridents.tridentslimitbreak:
description: Adds damage to tridents description: Adds damage to tridents
mcmmo.ability.unarmed.*: mcmmo.ability.unarmed.*:

View File

@ -216,6 +216,49 @@ Crossbows:
Rank_1: 50 Rank_1: 50
Rank_2: 200 Rank_2: 200
Rank_3: 400 Rank_3: 400
PoweredShot:
Standard:
Rank_1: 1
Rank_2: 10
Rank_3: 15
Rank_4: 20
Rank_5: 25
Rank_6: 30
Rank_7: 35
Rank_8: 40
Rank_9: 45
Rank_10: 50
Rank_11: 55
Rank_12: 60
Rank_13: 65
Rank_14: 70
Rank_15: 75
Rank_16: 80
Rank_17: 85
Rank_18: 90
Rank_19: 95
Rank_20: 100
RetroMode:
Rank_1: 1
Rank_2: 100
Rank_3: 150
Rank_4: 200
Rank_5: 250
Rank_6: 300
Rank_7: 350
Rank_8: 400
Rank_9: 450
Rank_10: 500
Rank_11: 550
Rank_12: 600
Rank_13: 650
Rank_14: 700
Rank_15: 750
Rank_16: 800
Rank_17: 850
Rank_18: 900
Rank_19: 950
Rank_20: 1000
CrossbowsLimitBreak: CrossbowsLimitBreak:
Standard: Standard:
Rank_1: 10 Rank_1: 10
@ -273,6 +316,29 @@ Tridents:
Rank_1: 5 Rank_1: 5
RetroMode: RetroMode:
Rank_1: 50 Rank_1: 50
Impale:
Standard:
Rank_1: 5
Rank_2: 15
Rank_3: 25
Rank_4: 35
Rank_5: 45
Rank_6: 55
Rank_7: 65
Rank_8: 75
Rank_9: 85
Rank_10: 100
RetroMode:
Rank_1: 50
Rank_2: 150
Rank_3: 250
Rank_4: 350
Rank_5: 450
Rank_6: 550
Rank_7: 650
Rank_8: 750
Rank_9: 850
Rank_10: 1000
Taming: Taming:
BeastLore: BeastLore:
Standard: Standard: