mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-08-01 20:15:28 +02:00
More work on Crossbows & Tridents
This commit is contained in:
@@ -229,6 +229,7 @@ public final class Permissions {
|
||||
/* CROSSBOWS */
|
||||
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 poweredShot(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.crossbows.poweredshot"); }
|
||||
|
||||
/* TRIDENTS */
|
||||
public static boolean tridentsSuper(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.tridents.superability"); }
|
||||
|
@@ -144,8 +144,12 @@ public final class CombatUtils {
|
||||
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)) {
|
||||
boostedDamage+=(getLimitBreakDamage(player, target, SubSkillType.TRIDENTS_TRIDENTS_LIMIT_BREAK) * mcMMOPlayer.getAttackStrength());
|
||||
boostedDamage += (getLimitBreakDamage(player, target, SubSkillType.TRIDENTS_TRIDENTS_LIMIT_BREAK) * mcMMOPlayer.getAttackStrength());
|
||||
}
|
||||
|
||||
event.setDamage(boostedDamage);
|
||||
@@ -154,7 +158,8 @@ public final class CombatUtils {
|
||||
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();
|
||||
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||
@@ -167,6 +172,11 @@ public final class CombatUtils {
|
||||
|
||||
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)) {
|
||||
boostedDamage+=getLimitBreakDamage(player, target, SubSkillType.CROSSBOWS_CROSSBOWS_LIMIT_BREAK);
|
||||
}
|
||||
|
@@ -13,6 +13,7 @@ import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.metadata.ItemMetadataService;
|
||||
import com.gmail.nossr50.util.ItemUtils;
|
||||
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.UserManager;
|
||||
import com.gmail.nossr50.util.text.StringUtils;
|
||||
@@ -352,4 +353,15 @@ public final class SkillUtils {
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user