From 88a8f0dcc28bcc460ec24b21a5655a8108196e65 Mon Sep 17 00:00:00 2001 From: Taito <81960499+taito2019@users.noreply.github.com> Date: Mon, 18 Apr 2022 20:21:08 +0200 Subject: [PATCH 1/7] New kit & balance changes! New Kit: Shabby Changed: Revive animation, perfect reward, spider probability, squid probability, viking damage, sponge amount --- .../plugins/kitapi/implementation/Perfect.kt | 2 +- .../plugins/kitapi/implementation/Revive.kt | 6 +- .../plugins/kitapi/implementation/Shabby.kt | 85 +++++++++++++++++++ .../plugins/kitapi/implementation/Spider.kt | 2 +- .../plugins/kitapi/implementation/Sponge.kt | 2 +- .../plugins/kitapi/implementation/Squid.kt | 2 +- .../plugins/kitapi/implementation/Viking.kt | 2 +- 7 files changed, 93 insertions(+), 8 deletions(-) create mode 100644 src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Shabby.kt 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 de102f3..b18d29d 100644 --- a/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Spider.kt +++ b/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Spider.kt @@ -34,7 +34,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 872c88e..551b755 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 b249180..59734c0 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 c8954a5..035a1f2 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 } } } \ No newline at end of file From c4cd6a6de90dc4884a7fce9d9bcf664f9ac748a9 Mon Sep 17 00:00:00 2001 From: Taito <81960499+taito2019@users.noreply.github.com> Date: Fri, 22 Apr 2022 19:20:46 +0200 Subject: [PATCH 2/7] Farmer Kit 2-facher drop B) --- .../plugins/kitapi/implementation/Farmer.kt | 21 +++++++++++++++++++ .../hglabor/plugins/kitapi/kit/KitManager.kt | 2 ++ 2 files changed, 23 insertions(+) create mode 100644 src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Farmer.kt 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..b1a5443 --- /dev/null +++ b/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Farmer.kt @@ -0,0 +1,21 @@ +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) { + it.block.drops.add(i) + i.amount *= 2 + } + } +} + 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..3117e76 100644 --- a/src/main/kotlin/de/hglabor/plugins/kitapi/kit/KitManager.kt +++ b/src/main/kotlin/de/hglabor/plugins/kitapi/kit/KitManager.kt @@ -11,6 +11,7 @@ object KitManager { Digger, Domino, Endermage, + Farmer, Gladiator, Lumberjack, Magma, @@ -23,6 +24,7 @@ object KitManager { Redstoner, //Relaxo, Revive, + Shabby, Smoothyy, Snail, Spider, From 372133a2f37c6ecdd0bd9c7299fcf583ec35b68f Mon Sep 17 00:00:00 2001 From: Taito <81960499+taito2019@users.noreply.github.com> Date: Fri, 22 Apr 2022 19:28:03 +0200 Subject: [PATCH 3/7] bug fix.. fix (cringe) --- .../kotlin/de/hglabor/plugins/kitapi/implementation/Farmer.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Farmer.kt b/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Farmer.kt index b1a5443..311aca5 100644 --- a/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Farmer.kt +++ b/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Farmer.kt @@ -12,9 +12,8 @@ val Farmer = Kit("Farmer", ::FarmerProperties) { displayMaterial = Material.WHEAT kitPlayerEvent({ it.player }) { it, _ -> - for (i in it.block.drops) { + for (i in it.block.drops.toList()) { it.block.drops.add(i) - i.amount *= 2 } } } From e619844c660e37523a18f6db8a7db530838c82de Mon Sep 17 00:00:00 2001 From: Taito <81960499+taito2019@users.noreply.github.com> Date: Sat, 23 Apr 2022 17:14:35 +0200 Subject: [PATCH 4/7] 2 neue Kits xp dieb, kanga --- .../plugins/kitapi/implementation/Claw.kt | 27 ++++++++++++ .../plugins/kitapi/implementation/Dieb.kt | 22 ++++++++++ .../kitapi/implementation/K\303\244nguru.kt" | 43 +++++++++++++++++++ .../hglabor/plugins/kitapi/kit/KitManager.kt | 3 ++ 4 files changed, 95 insertions(+) create mode 100644 src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Claw.kt create mode 100644 src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Dieb.kt create mode 100644 "src/main/kotlin/de/hglabor/plugins/kitapi/implementation/K\303\244nguru.kt" diff --git a/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Claw.kt b/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Claw.kt new file mode 100644 index 0000000..3ff8bcb --- /dev/null +++ b/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Claw.kt @@ -0,0 +1,27 @@ +package de.hglabor.plugins.kitapi.implementation + +import de.hglabor.plugins.kitapi.cooldown.CooldownProperties +import de.hglabor.plugins.kitapi.cooldown.applyCooldown +import de.hglabor.plugins.kitapi.kit.Kit +import org.bukkit.Material +import org.bukkit.entity.Arrow +import org.bukkit.entity.Player +import org.bukkit.inventory.ItemStack +import java.util.* + + +class ClawProperties : CooldownProperties(16000) + +val Claw = Kit("Claw", ::ClawProperties) { + displayMaterial = Material.SHEARS + + clickOnEntityItem(ItemStack(Material.ARROW)) { + val rightClicked = it.rightClicked as? Player ?: return@clickOnEntityItem + applyCooldown(it) { + val arrow = Material.ARROW + val playerDirection: Vector = it.player.location.direction + it.launchProjectile(arrow, playerDirection()) + } + } +} + 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/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/kit/KitManager.kt b/src/main/kotlin/de/hglabor/plugins/kitapi/kit/KitManager.kt index 3117e76..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,12 +7,15 @@ object KitManager { Anchor, Automatic, Blink, + //Claw, //Counter, + Dieb, Digger, Domino, Endermage, Farmer, Gladiator, + Känguru, Lumberjack, Magma, Nightshade, From 930eea5dd09176eb08672c4102a15d3ae50ec024 Mon Sep 17 00:00:00 2001 From: Taito <81960499+taito2019@users.noreply.github.com> Date: Sat, 23 Apr 2022 17:39:46 +0200 Subject: [PATCH 5/7] Revert "2 neue Kits xp" This reverts commit e619844c660e37523a18f6db8a7db530838c82de. --- .../plugins/kitapi/implementation/Claw.kt | 27 ------------ .../plugins/kitapi/implementation/Dieb.kt | 22 ---------- .../kitapi/implementation/K\303\244nguru.kt" | 43 ------------------- .../hglabor/plugins/kitapi/kit/KitManager.kt | 3 -- 4 files changed, 95 deletions(-) delete mode 100644 src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Claw.kt delete mode 100644 src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Dieb.kt delete mode 100644 "src/main/kotlin/de/hglabor/plugins/kitapi/implementation/K\303\244nguru.kt" diff --git a/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Claw.kt b/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Claw.kt deleted file mode 100644 index 3ff8bcb..0000000 --- a/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Claw.kt +++ /dev/null @@ -1,27 +0,0 @@ -package de.hglabor.plugins.kitapi.implementation - -import de.hglabor.plugins.kitapi.cooldown.CooldownProperties -import de.hglabor.plugins.kitapi.cooldown.applyCooldown -import de.hglabor.plugins.kitapi.kit.Kit -import org.bukkit.Material -import org.bukkit.entity.Arrow -import org.bukkit.entity.Player -import org.bukkit.inventory.ItemStack -import java.util.* - - -class ClawProperties : CooldownProperties(16000) - -val Claw = Kit("Claw", ::ClawProperties) { - displayMaterial = Material.SHEARS - - clickOnEntityItem(ItemStack(Material.ARROW)) { - val rightClicked = it.rightClicked as? Player ?: return@clickOnEntityItem - applyCooldown(it) { - val arrow = Material.ARROW - val playerDirection: Vector = it.player.location.direction - it.launchProjectile(arrow, playerDirection()) - } - } -} - diff --git a/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Dieb.kt b/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Dieb.kt deleted file mode 100644 index a964c4f..0000000 --- a/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Dieb.kt +++ /dev/null @@ -1,22 +0,0 @@ -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/K\303\244nguru.kt" "b/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/K\303\244nguru.kt" deleted file mode 100644 index 7305d3e..0000000 --- "a/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/K\303\244nguru.kt" +++ /dev/null @@ -1,43 +0,0 @@ -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/kit/KitManager.kt b/src/main/kotlin/de/hglabor/plugins/kitapi/kit/KitManager.kt index a68d223..3117e76 100644 --- a/src/main/kotlin/de/hglabor/plugins/kitapi/kit/KitManager.kt +++ b/src/main/kotlin/de/hglabor/plugins/kitapi/kit/KitManager.kt @@ -7,15 +7,12 @@ object KitManager { Anchor, Automatic, Blink, - //Claw, //Counter, - Dieb, Digger, Domino, Endermage, Farmer, Gladiator, - Känguru, Lumberjack, Magma, Nightshade, From 5d9a4dcf40e8901429dfb1fffe1611321ca1f0b0 Mon Sep 17 00:00:00 2001 From: Taito <81960499+taito2019@users.noreply.github.com> Date: Sat, 23 Apr 2022 17:40:47 +0200 Subject: [PATCH 6/7] Revert "Revert "2 neue Kits xp"" This reverts commit 930eea5dd09176eb08672c4102a15d3ae50ec024. --- .../plugins/kitapi/implementation/Claw.kt | 27 ++++++++++++ .../plugins/kitapi/implementation/Dieb.kt | 22 ++++++++++ .../kitapi/implementation/K\303\244nguru.kt" | 43 +++++++++++++++++++ .../hglabor/plugins/kitapi/kit/KitManager.kt | 3 ++ 4 files changed, 95 insertions(+) create mode 100644 src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Claw.kt create mode 100644 src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Dieb.kt create mode 100644 "src/main/kotlin/de/hglabor/plugins/kitapi/implementation/K\303\244nguru.kt" diff --git a/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Claw.kt b/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Claw.kt new file mode 100644 index 0000000..3ff8bcb --- /dev/null +++ b/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Claw.kt @@ -0,0 +1,27 @@ +package de.hglabor.plugins.kitapi.implementation + +import de.hglabor.plugins.kitapi.cooldown.CooldownProperties +import de.hglabor.plugins.kitapi.cooldown.applyCooldown +import de.hglabor.plugins.kitapi.kit.Kit +import org.bukkit.Material +import org.bukkit.entity.Arrow +import org.bukkit.entity.Player +import org.bukkit.inventory.ItemStack +import java.util.* + + +class ClawProperties : CooldownProperties(16000) + +val Claw = Kit("Claw", ::ClawProperties) { + displayMaterial = Material.SHEARS + + clickOnEntityItem(ItemStack(Material.ARROW)) { + val rightClicked = it.rightClicked as? Player ?: return@clickOnEntityItem + applyCooldown(it) { + val arrow = Material.ARROW + val playerDirection: Vector = it.player.location.direction + it.launchProjectile(arrow, playerDirection()) + } + } +} + 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/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/kit/KitManager.kt b/src/main/kotlin/de/hglabor/plugins/kitapi/kit/KitManager.kt index 3117e76..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,12 +7,15 @@ object KitManager { Anchor, Automatic, Blink, + //Claw, //Counter, + Dieb, Digger, Domino, Endermage, Farmer, Gladiator, + Känguru, Lumberjack, Magma, Nightshade, From 429a9a2e082b25e3b1f412cb24e41aff9e70d768 Mon Sep 17 00:00:00 2001 From: Taito <81960499+taito2019@users.noreply.github.com> Date: Sat, 23 Apr 2022 17:41:56 +0200 Subject: [PATCH 7/7] delete claw xp xpxpxpxp --- .../plugins/kitapi/implementation/Claw.kt | 27 ------------------- 1 file changed, 27 deletions(-) delete mode 100644 src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Claw.kt diff --git a/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Claw.kt b/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Claw.kt deleted file mode 100644 index 3ff8bcb..0000000 --- a/src/main/kotlin/de/hglabor/plugins/kitapi/implementation/Claw.kt +++ /dev/null @@ -1,27 +0,0 @@ -package de.hglabor.plugins.kitapi.implementation - -import de.hglabor.plugins.kitapi.cooldown.CooldownProperties -import de.hglabor.plugins.kitapi.cooldown.applyCooldown -import de.hglabor.plugins.kitapi.kit.Kit -import org.bukkit.Material -import org.bukkit.entity.Arrow -import org.bukkit.entity.Player -import org.bukkit.inventory.ItemStack -import java.util.* - - -class ClawProperties : CooldownProperties(16000) - -val Claw = Kit("Claw", ::ClawProperties) { - displayMaterial = Material.SHEARS - - clickOnEntityItem(ItemStack(Material.ARROW)) { - val rightClicked = it.rightClicked as? Player ?: return@clickOnEntityItem - applyCooldown(it) { - val arrow = Material.ARROW - val playerDirection: Vector = it.player.location.direction - it.launchProjectile(arrow, playerDirection()) - } - } -} -