diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/EcoEnchants.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/EcoEnchants.java index 5326ee48..488fdff1 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/EcoEnchants.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/EcoEnchants.java @@ -122,6 +122,7 @@ import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Inferno; import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Infuriate; import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Insecticide; import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Instantaneous; +import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Introversion; import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Invigoration; import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Kinetic; import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Launch; @@ -474,6 +475,7 @@ public class EcoEnchants { public static final EcoEnchant ARBORIST = new Arborist(); public static final EcoEnchant LUCKY_CATCH = new LuckyCatch(); public static final EcoEnchant AVERSION = new Aversion(); + public static final EcoEnchant INTROVERSION = new Introversion(); /** * Get all registered {@link EcoEnchant}s. diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Introversion.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Introversion.java new file mode 100644 index 00000000..c2e80382 --- /dev/null +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Introversion.java @@ -0,0 +1,30 @@ +package com.willfp.ecoenchants.enchantments.ecoenchants.normal; + +import com.willfp.ecoenchants.enchantments.EcoEnchant; +import com.willfp.ecoenchants.enchantments.EcoEnchants; +import com.willfp.ecoenchants.enchantments.meta.EnchantmentType; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Player; +import org.bukkit.event.entity.EntityDamageByEntityEvent; +import org.jetbrains.annotations.NotNull; + +public class Introversion extends EcoEnchant { + public Introversion() { + super( + "introversion", EnchantmentType.NORMAL + ); + } + + @Override + public void onMeleeAttack(@NotNull final LivingEntity attacker, + @NotNull final LivingEntity victim, + final int level, + @NotNull final EntityDamageByEntityEvent event) { + if (victim instanceof Player) { + return; + } + + double multiplier = this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "bonus-per-level"); + event.setDamage(event.getDamage() + (level * multiplier)); + } +} diff --git a/eco-core/core-plugin/src/main/resources/enchants/normal/defusion.yml b/eco-core/core-plugin/src/main/resources/enchants/normal/defusion.yml index adaa08fa..8656bb7b 100644 --- a/eco-core/core-plugin/src/main/resources/enchants/normal/defusion.yml +++ b/eco-core/core-plugin/src/main/resources/enchants/normal/defusion.yml @@ -25,6 +25,7 @@ general-config: - butchering - razor - ender_slayer + - introversion maximum-level: 5 config: diff --git a/eco-core/core-plugin/src/main/resources/enchants/normal/enderslayer.yml b/eco-core/core-plugin/src/main/resources/enchants/normal/enderslayer.yml index 972d4ee2..57a14953 100644 --- a/eco-core/core-plugin/src/main/resources/enchants/normal/enderslayer.yml +++ b/eco-core/core-plugin/src/main/resources/enchants/normal/enderslayer.yml @@ -25,6 +25,7 @@ general-config: - defusion - razor - butchering + - introversion maximum-level: 5 config: diff --git a/eco-core/core-plugin/src/main/resources/enchants/normal/introversion.yml b/eco-core/core-plugin/src/main/resources/enchants/normal/introversion.yml new file mode 100644 index 00000000..ae2cfc01 --- /dev/null +++ b/eco-core/core-plugin/src/main/resources/enchants/normal/introversion.yml @@ -0,0 +1,32 @@ +# +# Introversion EcoEnchant +# + +name: "Introversion" +description: Increases damage against players. +enabled: true + +obtaining: + table: true + villager: true + loot: true + rarity: uncommon + +general-config: + targets: + - sword + - axe + grindstoneable: true + disabled-in-worlds: [] + conflicts: + - sharpness + - bane_of_arthropods + - smite + - defusion + - razor + - ender_slayer + - butchering + maximum-level: 5 + +config: + bonus-per-level: 2.5 # Damage to players = base damage + (level * bonus), eg Introversion 5 will do 12.5 more damage to players \ No newline at end of file diff --git a/eco-core/core-plugin/src/main/resources/enchants/special/razor.yml b/eco-core/core-plugin/src/main/resources/enchants/special/razor.yml index 205862c3..65e537ee 100644 --- a/eco-core/core-plugin/src/main/resources/enchants/special/razor.yml +++ b/eco-core/core-plugin/src/main/resources/enchants/special/razor.yml @@ -24,6 +24,7 @@ general-config: - defusion - butchering - ender_slayer + - introversion maximum-level: 8 config: