feat: enhance blink ability with new particle effects, revamped sounds, and improved feedback messages.

This commit is contained in:
Kariya 2025-12-14 07:00:40 +00:00
parent 9cc0e03c10
commit e72167c2ce

View File

@ -71,12 +71,15 @@ class BlinkComponent(private val plugin: App) : AbstractComponent(plugin, "blink
} }
// Landing feedback // Landing feedback
player.playSound(player.location, Sound.ENTITY_BREEZE_LAND, 0.5f, 1.2f)
player.spawnParticle(Particle.DUST, player.location, 5, 0.3, 0.1, 0.3, 0.0, Particle.DustOptions(org.bukkit.Color.PURPLE, 1.0f))
} }
// Check for cooldown finish // Check for cooldown finish
if (cooldown.checkFinished(player)) { if (cooldown.checkFinished(player)) {
showReadyMessage(player) showReadyMessage(player)
player.playSound(player.location, Sound.BLOCK_NOTE_BLOCK_BELL, 0.5f, 1.5f) player.playSound(player.location, Sound.BLOCK_NOTE_BLOCK_BELL, 0.5f, 2.0f)
player.playSound(player.location, Sound.BLOCK_BEACON_ACTIVATE, 0.5f, 2.0f)
// Allow re-use immediately // Allow re-use immediately
usedBlink.remove(player.uniqueId) usedBlink.remove(player.uniqueId)
} }
@ -124,7 +127,6 @@ class BlinkComponent(private val plugin: App) : AbstractComponent(plugin, "blink
private fun handleBlink(player: Player, item: ItemStack) { private fun handleBlink(player: Player, item: ItemStack) {
val tier = getTier(item) ?: Tier.ONE val tier = getTier(item) ?: Tier.ONE
val currentVelocity = player.velocity
// Get movement direction from player's keyboard input // Get movement direction from player's keyboard input
val inputDirection = getMovementDirectionFromInput(player) val inputDirection = getMovementDirectionFromInput(player)
@ -155,10 +157,19 @@ class BlinkComponent(private val plugin: App) : AbstractComponent(plugin, "blink
// Visual Effects // Visual Effects
spawnBlinkParticles(player, boostDirection, usingLookDirection) spawnBlinkParticles(player, boostDirection, usingLookDirection)
// Sound Effects // Sound Effects (Play at start location for others)
player.playSound(player.location, Sound.ENTITY_ENDERMAN_TELEPORT, 0.6f, 1.8f) player.world.playSound(player.location, Sound.ENTITY_GENERIC_EXPLODE, 1.0f, 2.0f) // Pop! high pitch
player.playSound(player.location, Sound.ENTITY_BREEZE_SHOOT, 0.4f, 1.5f) player.world.playSound(player.location, Sound.ENTITY_ENDERMAN_TELEPORT, 1.0f, 1.2f)
player.playSound(player.location, Sound.BLOCK_AMETHYST_BLOCK_CHIME, 0.8f, 1.2f)
// Personal feedback sounds (High volume to ensure player hears it even after moving)
// Launch sound / Wind burst
player.playSound(player.location, Sound.ENTITY_BREEZE_WIND_BURST, 10.0f, 1.5f)
// Sharp launch sound
player.playSound(player.location, Sound.ENTITY_FIREWORK_ROCKET_LAUNCH, 10.0f, 1.2f)
// Rushing wind/magic
player.playSound(player.location, Sound.ITEM_TRIDENT_RIPTIDE_1, 10.0f, 2.0f)
// Magic chime
player.playSound(player.location, Sound.BLOCK_AMETHYST_BLOCK_CHIME, 10.0f, 1.5f)
// Action Bar message // Action Bar message
showBlinkMessage(player, usingLookDirection) showBlinkMessage(player, usingLookDirection)
@ -228,30 +239,44 @@ class BlinkComponent(private val plugin: App) : AbstractComponent(plugin, "blink
val loc = player.location val loc = player.location
val world = player.world val world = player.world
// Origin burst - purple spiral // 1. Afterimage (残像) - Smoke cloud in player's place
for (i in 0 until 16) { world.spawnParticle(Particle.CLOUD, loc.clone().add(0.0, 1.0, 0.0), 10, 0.4, 0.8, 0.4, 0.1)
val angle = (i * 22.5) * Math.PI / 180
// 2. Shockwave / Ignition (Ring at feet)
for (i in 0 until 36) {
val angle = Math.toRadians(i * 10.0)
val radius = 0.8
val x = Math.cos(angle) * radius
val z = Math.sin(angle) * radius
// Soul flame ring
world.spawnParticle(Particle.SOUL_FIRE_FLAME, loc.clone().add(x, 0.1, z), 1, 0.0, 0.0, 0.0, 0.02)
}
// 3. Origin burst - purple spiral
for (i in 0 until 20) {
val angle = (i * 18.0) * Math.PI / 180
val radius = 0.5 + (i * 0.05) val radius = 0.5 + (i * 0.05)
val x = kotlin.math.cos(angle) * radius val x = kotlin.math.cos(angle) * radius
val z = kotlin.math.sin(angle) * radius val z = kotlin.math.sin(angle) * radius
val y = i * 0.08 val y = i * 0.05
world.spawnParticle(Particle.REVERSE_PORTAL, loc.clone().add(x, y, z), 2, 0.0, 0.0, 0.0, 0.01) world.spawnParticle(Particle.REVERSE_PORTAL, loc.clone().add(x, y, z), 2, 0.0, 0.0, 0.0, 0.01)
world.spawnParticle(Particle.DRAGON_BREATH, loc.clone().add(x, y, z), 1, 0.0, 0.0, 0.0, 0.01)
} }
// Directional trail particles // 4. Directional trail particles (The "Dash" line)
val trailDirection = direction.clone().normalize() val trailDirection = direction.clone().normalize()
for (i in 1..8) { for (i in 1..8) {
val trailPos = loc.clone().add(trailDirection.clone().multiply(i * 0.5)) val trailPos = loc.clone().add(trailDirection.clone().multiply(i * 0.5))
world.spawnParticle(Particle.DUST, trailPos.add(0.0, 1.0, 0.0), 3, 0.2, 0.2, 0.2, 0.0, Particle.DustOptions(org.bukkit.Color.PURPLE, 1.0f))
world.spawnParticle(Particle.ENCHANT, trailPos.add(0.0, 1.0, 0.0), 5, 0.1, 0.3, 0.1, 0.5) world.spawnParticle(Particle.ENCHANT, trailPos.add(0.0, 1.0, 0.0), 5, 0.1, 0.3, 0.1, 0.5)
world.spawnParticle(Particle.PORTAL, trailPos, 3, 0.1, 0.2, 0.1, 0.3)
} }
// Central effect // 5. Flash at origin
world.spawnParticle(Particle.DRAGON_BREATH, loc.clone().add(0.0, 1.0, 0.0), 10, 0.2, 0.3, 0.2, 0.02) world.spawnParticle(Particle.FLASH, loc.clone().add(0.0, 1.0, 0.0), 1, 0.0, 0.0, 0.0, 0.0)
// Look direction indicator if applicable // Look direction indicator if applicable
if (usingLook) { if (usingLook) {
world.spawnParticle(Particle.END_ROD, loc.clone().add(direction.clone().multiply(1.5)).add(0.0, 1.0, 0.0), 5, 0.1, 0.1, 0.1, 0.02) world.spawnParticle(Particle.END_ROD, loc.clone().add(direction.clone().multiply(1.5)).add(0.0, 1.0, 0.0), 10, 0.1, 0.1, 0.1, 0.05)
} }
} }
@ -262,6 +287,7 @@ class BlinkComponent(private val plugin: App) : AbstractComponent(plugin, "blink
.append(Component.text("ブリンク!", SECONDARY_COLOR)) .append(Component.text("ブリンク!", SECONDARY_COLOR))
.append(Component.text(" [$modeText]", NamedTextColor.GRAY)) .append(Component.text(" [$modeText]", NamedTextColor.GRAY))
.append(Component.text("", PRIMARY_COLOR)) .append(Component.text("", PRIMARY_COLOR))
.append(Component.text("加速!", PRIMARY_COLOR))
) )
} }