diff --git a/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Dieb.kt b/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Dieb.kt new file mode 100644 index 0000000..a964c4f --- /dev/null +++ b/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Dieb.kt @@ -0,0 +1,22 @@ +package de.hglabor.plugins.kitapi.implementation + +import de.hglabor.plugins.kitapi.cooldown.MultipleUsesCooldownProperties +import de.hglabor.plugins.kitapi.cooldown.applyCooldown +import de.hglabor.plugins.kitapi.kit.Kit +import org.bukkit.Material +import org.bukkit.entity.Player +import org.bukkit.inventory.ItemStack + +class DiebProperties : MultipleUsesCooldownProperties(3, 45000) + +val Dieb = Kit("Dieb", ::DiebProperties) { + displayMaterial = Material.COAL + + clickOnEntityItem(ItemStack(Material.COAL)) { + val rightClicked = it.rightClicked as? Player ?: return@clickOnEntityItem + applyCooldown(it) { + } + rightClicked.inventory.removeItem(ItemStack(Material.MUSHROOM_SOUP)) + it.player.inventory.addItem(ItemStack(Material.MUSHROOM_SOUP)) + } +} \ No newline at end of file diff --git a/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Farmer.kt b/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Farmer.kt new file mode 100644 index 0000000..311aca5 --- /dev/null +++ b/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Farmer.kt @@ -0,0 +1,20 @@ +package de.hglabor.plugins.kitapi.implementation + +import de.hglabor.plugins.kitapi.kit.Kit +import de.hglabor.plugins.kitapi.kit.KitProperties +import org.bukkit.Material +import org.bukkit.event.block.BlockBreakEvent + + +class FarmerProperties : KitProperties() + +val Farmer = Kit("Farmer", ::FarmerProperties) { + displayMaterial = Material.WHEAT + + kitPlayerEvent({ it.player }) { it, _ -> + for (i in it.block.drops.toList()) { + it.block.drops.add(i) + } + } +} + diff --git "a/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/K\303\244nguru.kt" "b/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/K\303\244nguru.kt" new file mode 100644 index 0000000..7305d3e --- /dev/null +++ "b/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/K\303\244nguru.kt" @@ -0,0 +1,43 @@ +package de.hglabor.plugins.kitapi.implementation + +import de.hglabor.plugins.hungergames.SecondaryColor +import de.hglabor.plugins.hungergames.game.GameManager +import de.hglabor.plugins.hungergames.game.phase.phases.LobbyPhase +import de.hglabor.plugins.kitapi.cooldown.CooldownProperties +import de.hglabor.plugins.kitapi.cooldown.applyCooldown +import de.hglabor.plugins.kitapi.kit.ClickOnEntityKitItem +import de.hglabor.plugins.kitapi.kit.Kit +import de.hglabor.plugins.kitapi.kit.KitProperties +import net.axay.kspigot.extensions.events.isRightClick +import net.axay.kspigot.extensions.geometry.times +import net.axay.kspigot.items.itemStack +import net.axay.kspigot.items.meta +import net.axay.kspigot.items.name +import org.bukkit.Material +import org.bukkit.event.player.PlayerInteractEvent +import org.bukkit.event.player.PlayerToggleSneakEvent +import org.bukkit.inventory.ItemStack +import org.bukkit.util.Vector + +class KänguruProperties : KitProperties() { + val Vector = 3 +} + +val Känguru = Kit("Kangaroo", ::KänguruProperties) { + displayMaterial = Material.FIREWORK + + clickableItem(ItemStack(Material.FIREWORK)) { + if (!it.action.isRightClick) return@clickableItem + val player = it.player + val velocity = player.velocity + if (!player.isOnGround) return@clickableItem + + if (player.isSneaking) { +velocity.x *= 5 + velocity.y *= 2 + } + else { + velocity.y *= 5 + } + } +} \ No newline at end of file diff --git a/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Perfect.kt b/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Perfect.kt index eabee09..17840a5 100644 --- a/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Perfect.kt +++ b/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Perfect.kt @@ -10,7 +10,7 @@ import java.util.* class PerfectProperties : KitProperties() { val soupsForReward by int(8); - val soupsAsReward by int(5); + val soupsAsReward by int(3); } val Perfect = Kit("Perfect", ::PerfectProperties) { diff --git a/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Revive.kt b/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Revive.kt index 5b42582..faf766a 100644 --- a/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Revive.kt +++ b/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Revive.kt @@ -30,7 +30,7 @@ val Revive = Kit("Revive", ::ReviveProperties) { player.addPotionEffects( listOf( PotionEffect(PotionEffectType.REGENERATION, 10, 9), - PotionEffect(PotionEffectType.ABSORPTION, 200, 2), + PotionEffect(PotionEffectType.ABSORPTION, 200, 4), PotionEffect(PotionEffectType.FIRE_RESISTANCE, 800, 0) ) ) @@ -42,11 +42,11 @@ val Revive = Kit("Revive", ::ReviveProperties) { val scaleY = 1 val density = 1.0 var i = 0.0 - player.world.playSound(player.location, Sound.ANVIL_BREAK, 3f, 1f) + player.world.playSound(player.location, Sound.FIREWORK_BLAST, 3f, 1f) while (i < 2 * Math.PI) { val x = cos(i) * scaleX val y = sin(i) * scaleY - player.world.playEffect(player.location.clone().add(x, 0, y), Effect.HAPPY_VILLAGER, 15) + player.world.playEffect(player.location.clone().add(x, 0, y), Effect.FIREWORKS_SPARK, 15) i += density } } diff --git a/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Shabby.kt b/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Shabby.kt new file mode 100644 index 0000000..2433cf9 --- /dev/null +++ b/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Shabby.kt @@ -0,0 +1,85 @@ +package de.hglabor.plugins.kitapi.implementation + +import de.hglabor.plugins.hungergames.event.KitDisableEvent +import de.hglabor.plugins.hungergames.event.KitEnableEvent +import de.hglabor.plugins.hungergames.utils.ChanceUtils +import de.hglabor.plugins.kitapi.kit.Kit +import de.hglabor.plugins.kitapi.kit.KitProperties +import net.axay.kspigot.runnables.taskRunLater +import org.bukkit.Material +import org.bukkit.entity.LivingEntity +import org.bukkit.entity.Player +import org.bukkit.event.entity.EntityDamageByEntityEvent +import org.bukkit.event.player.PlayerItemConsumeEvent +import org.bukkit.potion.PotionEffect +import org.bukkit.potion.PotionEffectType + + +class ShabbyProperties : KitProperties() { + val effectDuration by int(3) + val effectMultiplier by int(0) + val probability by int(8) +} + +val Shabby = Kit("Shabby", ::ShabbyProperties) { + displayMaterial = Material.FERMENTED_SPIDER_EYE + + kitPlayerEvent({ it.damager as? Player }) { it, damager -> + val target = (it.entity as? LivingEntity) ?: return@kitPlayerEvent + if (!ChanceUtils.roll(kit.properties.probability)) return@kitPlayerEvent + target.addPotionEffect( + PotionEffect( + PotionEffectType.BLINDNESS, + this.kit.properties.effectDuration * 20, + this.kit.properties.effectMultiplier + ) + ) + } + kitPlayerEvent({ it.damager as? Player }) { it, damager -> + val target = (it.entity as? LivingEntity) ?: return@kitPlayerEvent + if (!ChanceUtils.roll(kit.properties.probability)) return@kitPlayerEvent + target.addPotionEffect( + PotionEffect( + PotionEffectType.SLOW, + this.kit.properties.effectDuration * 20, + this.kit.properties.effectMultiplier + ) + ) + } + kitPlayerEvent({ it.damager as? Player }) { it, damager -> + val target = (it.entity as? LivingEntity) ?: return@kitPlayerEvent + if (!ChanceUtils.roll(kit.properties.probability)) return@kitPlayerEvent + target.addPotionEffect( + PotionEffect( + PotionEffectType.POISON, + this.kit.properties.effectDuration * 20, + this.kit.properties.effectMultiplier + ) + ) + } + kitPlayerEvent({ it.damager as? Player }) { it, damager -> + val target = (it.entity as? LivingEntity) ?: return@kitPlayerEvent + if (!ChanceUtils.roll(kit.properties.probability)) return@kitPlayerEvent + target.addPotionEffect( + PotionEffect( + PotionEffectType.WEAKNESS, + this.kit.properties.effectDuration * 20, + this.kit.properties.effectMultiplier + ) + ) + } + kitPlayerEvent({ it.damager as? Player }) { it, damager -> + val target = (it.entity as? LivingEntity) ?: return@kitPlayerEvent + if (!ChanceUtils.roll(kit.properties.probability)) return@kitPlayerEvent + target.addPotionEffect( + PotionEffect( + PotionEffectType.WITHER, + this.kit.properties.effectDuration * 20, + this.kit.properties.effectMultiplier + ) + ) + } +} + + + diff --git a/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Spider.kt b/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Spider.kt index 2578fa8..f98d6d8 100644 --- a/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Spider.kt +++ b/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Spider.kt @@ -31,7 +31,7 @@ import org.bukkit.util.Vector class SpiderProperties : CooldownProperties(20000) { val effectDuration by int(3) val effectMultiplier by int(1) - val probability by int(30) + val probability by int(20) val spidernetRadius by int(5) val spidernetHeight by int(5) diff --git a/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Sponge.kt b/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Sponge.kt index 6a5256c..357799c 100644 --- a/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Sponge.kt +++ b/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Sponge.kt @@ -32,7 +32,7 @@ class SpongeProperties : MultipleUsesCooldownProperties(15, 30000) { val poisonDuration by int(60) val poisonAmplifier by int(60) val spongesOnKill by int(2) - val spongesOnStart by int(12) + val spongesOnStart by int(13) val spongeBoost by double(1.0) } diff --git a/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Squid.kt b/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Squid.kt index 3362ffa..08fe8f7 100644 --- a/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Squid.kt +++ b/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Squid.kt @@ -18,7 +18,7 @@ import org.bukkit.potion.PotionEffectType class SquidProperties : KitProperties() { val effectDuration by int(3) val effectMultiplier by int(0) - val probability by int(30) + val probability by int(15) } val Squid = Kit("Squid", ::SquidProperties) { diff --git a/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Viking.kt b/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Viking.kt index 4123bbe..4df4365 100644 --- a/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Viking.kt +++ b/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Viking.kt @@ -14,7 +14,7 @@ val Viking = Kit("Viking", ::VikingProperties) { kitPlayerEvent({ it.damager as? Player }) { it, player -> when (player.itemInHand.type) { Material.DIAMOND_AXE, Material.WOOD_AXE, Material.IRON_AXE, Material.STONE_AXE -> - it.damage += 1.5 + it.damage += 2.0 else -> {} } } diff --git a/src/main/kotlin/de/hglabor/plugins/kitapi/kit/KitManager.kt b/src/main/kotlin/de/hglabor/plugins/kitapi/kit/KitManager.kt index f11022c..a68d223 100644 --- a/src/main/kotlin/de/hglabor/plugins/kitapi/kit/KitManager.kt +++ b/src/main/kotlin/de/hglabor/plugins/kitapi/kit/KitManager.kt @@ -7,11 +7,15 @@ object KitManager { Anchor, Automatic, Blink, + //Claw, //Counter, + Dieb, Digger, Domino, Endermage, + Farmer, Gladiator, + Känguru, Lumberjack, Magma, Nightshade, @@ -23,6 +27,7 @@ object KitManager { Redstoner, //Relaxo, Revive, + Shabby, Smoothyy, Snail, Spider,