Added Introversion

This commit is contained in:
Auxilor 2021-02-05 16:48:25 +00:00
parent bcd429419f
commit 9e0842dee6
6 changed files with 67 additions and 0 deletions

View File

@ -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.

View File

@ -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));
}
}

View File

@ -25,6 +25,7 @@ general-config:
- butchering
- razor
- ender_slayer
- introversion
maximum-level: 5
config:

View File

@ -25,6 +25,7 @@ general-config:
- defusion
- razor
- butchering
- introversion
maximum-level: 5
config:

View File

@ -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

View File

@ -24,6 +24,7 @@ general-config:
- defusion
- butchering
- ender_slayer
- introversion
maximum-level: 8
config: