Add Explosive Shot definition

This commit is contained in:
nossr50 2023-12-20 19:11:08 -08:00
parent 23b8e0a28c
commit 3e11b7da2c
7 changed files with 34 additions and 21 deletions

View File

@ -22,6 +22,7 @@ public enum SubSkillType {
ARCHERY_DAZE,
ARCHERY_SKILL_SHOT(20),
ARCHERY_ARCHERY_LIMIT_BREAK(10),
ARCHERY_EXPLOSIVE_SHOT(1),
/* Axes */
AXES_ARMOR_IMPACT(20),

View File

@ -10,6 +10,12 @@ import org.bukkit.block.BlockState;
import org.bukkit.entity.Player;
public enum SuperAbilityType {
EXPLOSIVE_SHOT("Archery.Skills.ExplosiveShot.On",
"Archery.Skills.ExplosiveShot.Off",
"Archery.Skills.ExplosiveShot.Other.On",
"Archery.Skills.ExplosiveShot.Refresh",
"Archery.Skills.ExplosiveShot.Other.Off",
"Archery.SubSkill.ExplosiveShot.Name"),
BERSERK(
"Unarmed.Skills.Berserk.On",
"Unarmed.Skills.Berserk.Off",
@ -190,6 +196,7 @@ public enum SuperAbilityType {
public boolean getPermissions(Player player) {
return switch (this) {
case BERSERK -> Permissions.berserk(player);
case EXPLOSIVE_SHOT -> Permissions.explosiveShot(player);
case BLAST_MINING -> Permissions.remoteDetonation(player);
case GIGA_DRILL_BREAKER -> Permissions.gigaDrillBreaker(player);
case GREEN_TERRA -> Permissions.greenTerra(player);
@ -211,25 +218,15 @@ public enum SuperAbilityType {
* @return true if the block is affected by this ability, false otherwise
*/
public boolean blockCheck(BlockState blockState) {
switch (this) {
case BERSERK:
return (BlockUtils.affectedByGigaDrillBreaker(blockState) || blockState.getType() == Material.SNOW || mcMMO.getMaterialMapStore().isGlass(blockState.getType()));
case GIGA_DRILL_BREAKER:
return BlockUtils.affectedByGigaDrillBreaker(blockState);
case GREEN_TERRA:
return BlockUtils.canMakeMossy(blockState);
case SUPER_BREAKER:
return BlockUtils.affectedBySuperBreaker(blockState);
case TREE_FELLER:
return BlockUtils.hasWoodcuttingXP(blockState);
default:
return false;
}
return switch (this) {
case BERSERK ->
(BlockUtils.affectedByGigaDrillBreaker(blockState) || blockState.getType() == Material.SNOW || mcMMO.getMaterialMapStore().isGlass(blockState.getType()));
case GIGA_DRILL_BREAKER -> BlockUtils.affectedByGigaDrillBreaker(blockState);
case GREEN_TERRA -> BlockUtils.canMakeMossy(blockState);
case SUPER_BREAKER -> BlockUtils.affectedBySuperBreaker(blockState);
case TREE_FELLER -> BlockUtils.hasWoodcuttingXP(blockState);
default -> false;
};
}
/**

View File

@ -11,7 +11,8 @@ public enum ToolType {
PICKAXE("Mining.Ability.Lower", "Mining.Ability.Ready"),
SHOVEL("Excavation.Ability.Lower", "Excavation.Ability.Ready"),
SWORD("Swords.Ability.Lower", "Swords.Ability.Ready"),
CROSSBOWS("Crossbows.Ability.Lower", "Crossbows.Ability.Ready"),
CROSSBOW("Crossbows.Ability.Lower", "Crossbows.Ability.Ready"),
BOW("Archery.Ability.Lower", "Archery.Ability.Ready"),
TRIDENTS("Tridents.Ability.Lower", "Tridents.Ability.Ready");
private final String lowerTool;
@ -40,7 +41,7 @@ public enum ToolType {
switch (this) {
case AXE:
return ItemUtils.isAxe(itemStack);
case CROSSBOWS:
case CROSSBOW:
return ItemUtils.isCrossbow(itemStack);
case TRIDENTS:
return ItemUtils.isTrident(itemStack);

View File

@ -180,6 +180,7 @@ public final class Permissions {
public static boolean concoctions(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.alchemy.concoctions"); }
/* ARCHERY */
public static boolean explosiveShot(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.archery.explosiveshot"); }
public static boolean arrowRetrieval(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.archery.trackarrows"); }
public static boolean daze(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.archery.daze"); }

View File

@ -182,6 +182,11 @@ Archery.SubSkill.ArcheryLimitBreak.Description=Breaking your limits. Increased d
Archery.SubSkill.ArcheryLimitBreak.Stat=Limit Break Max DMG
Archery.Listener=Archery:
Archery.SkillName=ARCHERY
Archery.Skills.ExplosiveShot.Off=
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.On=&a{0}&2 has used &cExplosive Shot!
Archery.Skills.ExplosiveShot.Refresh=&aYour &Explosive Shot &ability is refreshed!
#AXES
Axes.Ability.Bonus.0=Axe Mastery
Axes.Ability.Bonus.1=Bonus {0} damage

View File

@ -290,10 +290,13 @@ permissions:
mcmmo.ability.archery.all:
description: Allows access to all Archery abilities
children:
mcmmo.ability.archery.explosiveshot: true
mcmmo.ability.archery.skillshot: true
mcmmo.ability.archery.daze: true
mcmmo.ability.archery.arrowretrieval: true
mcmmo.ability.archery.archerylimitbreak: true
mcmmo.ability.archery.explosiveshot:
description: Allows access to the Explosive Shot super ability for Archery
mcmmo.ability.archery.archerylimitbreak:
description: Adds damage to bows
mcmmo.ability.archery.skillshot:

View File

@ -31,6 +31,11 @@ Alchemy:
Rank_7: 900
Rank_8: 1000
Archery:
ExplosiveShot:
Standard:
Rank_1: 5
RetroMode:
Rank_1: 50
ArcheryLimitBreak:
Standard:
Rank_1: 10