Added storm ring
This commit is contained in:
@@ -31,6 +31,7 @@ import com.willfp.talismans.talismans.talismans.SkeletonTalisman;
|
||||
import com.willfp.talismans.talismans.talismans.SpeedTalisman;
|
||||
import com.willfp.talismans.talismans.talismans.SpiderResistanceTalisman;
|
||||
import com.willfp.talismans.talismans.talismans.SpiderTalisman;
|
||||
import com.willfp.talismans.talismans.talismans.StormRing;
|
||||
import com.willfp.talismans.talismans.talismans.StrengthTalisman;
|
||||
import com.willfp.talismans.talismans.talismans.ZombieResistanceTalisman;
|
||||
import com.willfp.talismans.talismans.talismans.ZombieTalisman;
|
||||
@@ -82,6 +83,7 @@ public class Talismans {
|
||||
public static final Talisman NIGHT_CRYSTAL = new NightCrystal();
|
||||
public static final Talisman NECROMANCE_RING = new NecromanceRing();
|
||||
public static final Talisman GROUNDING_CHARM = new GroundingCharm();
|
||||
public static final Talisman STORM_RING = new StormRing();
|
||||
|
||||
/**
|
||||
* Get all registered {@link Talisman}s.
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.willfp.talismans.talismans.talismans;
|
||||
|
||||
import com.willfp.talismans.talismans.Talisman;
|
||||
import com.willfp.talismans.talismans.TalismanLevel;
|
||||
import com.willfp.talismans.talismans.Talismans;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class StormRing extends Talisman {
|
||||
public StormRing() {
|
||||
super("storm");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnyAttack(@NotNull final TalismanLevel level,
|
||||
@NotNull final Player attacker,
|
||||
@NotNull final LivingEntity victim,
|
||||
@NotNull final EntityDamageEvent event) {
|
||||
if (!attacker.getWorld().hasStorm()) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.setDamage(event.getDamage() * (1 + (level.getConfig().getDouble(Talismans.CONFIG_LOCATION + "percent-more-damage")) / 100));
|
||||
}
|
||||
}
|
||||
55
eco-core/core-plugin/src/main/resources/talismans/storm.yml
Normal file
55
eco-core/core-plugin/src/main/resources/talismans/storm.yml
Normal file
@@ -0,0 +1,55 @@
|
||||
enabled: true
|
||||
disabled-in-worlds: [ ]
|
||||
|
||||
levels:
|
||||
1:
|
||||
name: "&aStorm Ring I"
|
||||
description: Deal more damage during a storm.
|
||||
|
||||
obtaining:
|
||||
craftable: true
|
||||
recipe:
|
||||
- redstone
|
||||
- glowstone_dust
|
||||
- redstone
|
||||
|
||||
- glowstone_dust
|
||||
- ender_eye
|
||||
- glowstone_dust
|
||||
|
||||
- redstone
|
||||
- glowstone_dust
|
||||
- redstone
|
||||
|
||||
general-config:
|
||||
material: player_head
|
||||
texture: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMWY5MjgzZGY0OTI1YmYzNmJmNmZjZjVjMzU1Y2VkMjczYmIxN2Y5NDcyYWI3NjU3YmYxNTllMWI2YmI5NTI3In19fQ==
|
||||
|
||||
config:
|
||||
percent-more-damage: 5
|
||||
|
||||
2:
|
||||
name: "&eStorm Ring II"
|
||||
description: Deal more damage during a storm.
|
||||
|
||||
obtaining:
|
||||
craftable: true
|
||||
recipe:
|
||||
- talismans:storm_1
|
||||
- talismans:storm_1
|
||||
- talismans:storm_1
|
||||
|
||||
- talismans:storm_1
|
||||
- heart_of_the_sea
|
||||
- talismans:storm_1
|
||||
|
||||
- talismans:storm_1
|
||||
- talismans:storm_1
|
||||
- talismans:storm_1
|
||||
|
||||
general-config:
|
||||
material: player_head
|
||||
texture: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNjVjNDE2ZWYyYmU4NWU5MTI2ZDE4YTMzZTRiYjhmYzRkODYxNGMxZDNkN2E3MzJiN2ZmYTAyMzRlYmVjNDJkMSJ9fX0=
|
||||
|
||||
config:
|
||||
percent-more-damage: 10
|
||||
Reference in New Issue
Block a user