Add some combat processing logic for Tridents/Xbows

This commit is contained in:
nossr50
2023-04-11 04:17:29 -07:00
parent 63e7c09ed4
commit aaa47d3b67
10 changed files with 169 additions and 36 deletions

View File

@@ -52,7 +52,7 @@ public class ArcheryManager extends SkillManager {
* @param target The {@link LivingEntity} damaged by the arrow
* @param arrow The {@link Entity} who shot the arrow
*/
public double distanceXpBonusMultiplier(LivingEntity target, Entity arrow) {
public static double distanceXpBonusMultiplier(LivingEntity target, Entity arrow) {
//Hacky Fix - some plugins spawn arrows and assign them to players after the ProjectileLaunchEvent fires
if(!arrow.hasMetadata(MetadataConstants.METADATA_KEY_ARROW_DISTANCE))
return 1;

View File

@@ -2,10 +2,20 @@ package com.gmail.nossr50.skills.tridents;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.ToolType;
import com.gmail.nossr50.skills.SkillManager;
import com.gmail.nossr50.util.Permissions;
public class TridentsManager extends SkillManager {
public TridentsManager(McMMOPlayer mmoPlayer) {
super(mmoPlayer, PrimarySkillType.TRIDENTS);
}
/**
* Checks if the player can activate the Super Ability for Tridents
* @return true if the player can activate the Super Ability, false otherwise
*/
public boolean canActivateAbility() {
return mmoPlayer.getToolPreparationMode(ToolType.TRIDENTS) && Permissions.tridentsSuper(getPlayer());
}
}