Skip to content

Iron golem stub and iron hook ability#141

Merged
BetrixDev merged 3 commits intoreimaginedfrom
kit/ig
Sep 29, 2025
Merged

Iron golem stub and iron hook ability#141
BetrixDev merged 3 commits intoreimaginedfrom
kit/ig

Conversation

@BetrixDev
Copy link
Owner

@BetrixDev BetrixDev commented Sep 28, 2025

Summary by CodeRabbit

  • New Features

    • Added Iron Hook ability: launch a hook to latch onto enemies and pull them toward you, with sound/visual trail and cooldown.
    • Introduced Iron Golem kit: a durable bruiser with strong melee/knockback, equipped with iron armor and the Iron Hook ability.
  • Documentation

    • Updated in-game names and descriptions for Iron Hook and Iron Golem.
    • Added corresponding entries to abilities and kits configuration.

@coderabbitai
Copy link

coderabbitai bot commented Sep 28, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Introduces a new IronHookAbility, integrates it into kit assembly, extends BrawlProjectile with initial velocity and trail sound hooks, and adds corresponding data entries in abilities, kits, and localization files.

Changes

Cohort / File(s) Summary
New Ability: Iron Hook
plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/IronHookAbility.kt
Adds IronHookAbility with activate/teardown. Launches a Tripwire Hook projectile, configurable damage/size, custom initial velocity, trail effects, entity-hit handling (damage via velocity scaling, pull knockback), and cleanup lifecycle.
Projectile API extensions
plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/projectiles/BrawlProjectile.kt
Adds setInitialVelocity((Entity) -> Unit) to customize launch velocity and trailSoundEffect(Sound, volume, pitch). Prioritizes custom velocity during initialization and supports per-tick sound effect.
Kit ability wiring
plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/kits/BrawlKit.kt
Maps ability id "iron_hook" to IronHookAbility(player) during kit construction.
Game data: abilities and kits
plugin/src/main/resources/data/abilities.yml, plugin/src/main/resources/data/kits.yml
abilities.yml: Adds iron_hook entry (cooldown 8.0, itemSlot 1, type projectile, usage right_click, hotbarItem iron_pickaxe, displayItem tripwire_hook). kits.yml: Adds iron_golem kit referencing iron_hook with defined stats, passives, and armor items.
Localization
plugin/src/main/resources/data/lang/en.yml
Adds localized entries: kit iron_golem (name/description) and ability iron_hook (name/description).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant P as Player
  participant A as IronHookAbility
  participant PR as BrawlProjectile
  participant E as Target Entity
  participant D as BrawlDamageEvent

  P->>A: activate()
  A->>PR: build Tripwire Hook projectile<br/>set size, setInitialVelocity, trail effects
  PR-->>P: play throw sound
  loop each tick
    PR-->>PR: move, play trail sound
  end
  alt hit entity
    PR->>A: onHitEntity(entity, velocity)
    A->>D: fire damage event (Projectile, dmg = cfg * |v|)
    A->>E: apply pull knockback toward player
  else no hit
    PR-->>A: no entity hit
  end
  A->>PR: teardown() (on ability end)
  PR-->>A: destroy
Loading
sequenceDiagram
  autonumber
  participant PR as BrawlProjectile
  participant VF as customSetInitialVelocity
  participant DEF as DefaultVelocity

  PR->>PR: launch()
  alt custom velocity provided
    PR->>VF: invoke (projectile)
    VF-->>PR: velocity set
  else no custom function
    PR->>DEF: compute default launch velocity
    DEF-->>PR: velocity set
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • Iron golem stub and iron hook ability #141: Introduces the same IronHookAbility, projectile API hooks (setInitialVelocity/trailSoundEffect), and corresponding kit/resource entries, indicating a direct code match.

Poem

I cast a hook with clink and cheer,
A tripwire wink—now draw you near.
New kits awake, golems stomp by,
Projectiles sing as sounds fly by.
Thump, yank, thunk—what fun we weave,
A rabbit nods, then takes its leave. 🐇🎣

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly describes the two primary features introduced — the Iron Golem kit stub and the Iron Hook ability — clearly reflecting the pull request’s main objectives in a concise manner.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 570f10b and 9edd27a.

📒 Files selected for processing (2)
  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/IronHookAbility.kt (1 hunks)
  • plugin/src/main/resources/data/abilities.yml (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/projectiles/PotionProjectile.kt (1)

24-26: Drop the empty placeholder method

customMethod is public, carries no behavior, and its name doesn’t describe any intent. Let’s remove it (or implement the real logic) so we aren’t publishing dead API surface. Since PotionProjectile already works without it, simply deleting the method is cleanest.

-    fun customMethod() {
-
-    }
plugin/src/main/resources/data/abilities.yml (1)

314-320: Match the numeric style used elsewhere

Every other cooldown is written with a decimal (e.g., 3.0, 8.0). Using 8.0 here keeps the schema consistent and avoids any future parsing surprises if a strict double is expected.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 735495e and 570f10b.

📒 Files selected for processing (7)
  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/IronHookAbility.kt (1 hunks)
  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/kits/BrawlKit.kt (1 hunks)
  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/projectiles/BrawlProjectile.kt (3 hunks)
  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/projectiles/PotionProjectile.kt (1 hunks)
  • plugin/src/main/resources/data/abilities.yml (1 hunks)
  • plugin/src/main/resources/data/kits.yml (1 hunks)
  • plugin/src/main/resources/data/lang/en.yml (2 hunks)
🧰 Additional context used
📓 Path-based instructions (7)
**/*.kt

📄 CodeRabbit inference engine (.cursor/rules/kotlin-best-practices.mdc)

**/*.kt: Use data classes for immutable data structures like PlayerDocument
Leverage extension functions to enhance existing classes without modifying them
Implement sealed classes for representing different states or types (e.g., game states or player statuses)
Use coroutines for asynchronous operations to avoid blocking the main thread
Use Koin for dependency injection
Use LiteCommands for commands
Use Twilight for events
Use Ktor for HTTP requests
Use Kaml for configuration
Use Okio for file operations
Use Kotlinx Coroutines for asynchronous operations
Use Kotlinx Serialization for serialization
Use English for all code and documentation in source (identifiers, comments, KDoc)
Always declare the type of each variable and function (parameters and return value)
Avoid using any
Create necessary types instead of using overly generic structures
Use PascalCase for classes
Avoid magic numbers and define constants
Start each function with a verb
Use verbs for boolean variables (isLoading, hasError, canDelete, etc.)
Use complete words instead of abbreviations and correct spelling (allow standard ones like API, URL)
Allow well-known abbreviations: i, j for loops; err for errors; ctx for contexts; req, res, next for middleware-like parameters
Write short functions with a single purpose (less than 20 instructions)
Name functions with a verb plus a descriptor
If a function returns boolean, use prefixes like isX, hasX, canX
If a function returns Unit, use prefixes like executeX or saveX
Avoid nesting blocks via early returns, extracting utilities, and using higher-order functions (map, filter, reduce)
Use expression-bodied (arrow-style) functions for simple functions (fewer than 3 instructions)
Use named (block-bodied) functions for non-simple functions
Use default parameter values instead of checking for null
Reduce function parameters using RO-RO (pass/return objects)
Declare necessary types for input arguments and output
Use a single level of abstraction within functions
...

Files:

  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/projectiles/PotionProjectile.kt
  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/kits/BrawlKit.kt
  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/projectiles/BrawlProjectile.kt
  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/IronHookAbility.kt
plugin/src/main/kotlin/**/*.kt

📄 CodeRabbit inference engine (.cursor/rules/plugin-overview.mdc)

plugin/src/main/kotlin/**/*.kt: Handle events using the Twilight library’s event DSL
Use Manageable class/IManageable interface to store and manage event listeners

Files:

  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/projectiles/PotionProjectile.kt
  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/kits/BrawlKit.kt
  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/projectiles/BrawlProjectile.kt
  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/IronHookAbility.kt
plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/projectiles/**/*.kt

📄 CodeRabbit inference engine (.cursor/rules/plugin-overview.mdc)

Implement projectiles by extending BrawlProjectile and ensure correct lifecycle/metadata for smooth gameplay

Files:

  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/projectiles/PotionProjectile.kt
  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/projectiles/BrawlProjectile.kt
plugin/src/main/resources/data/lang/en.yml

📄 CodeRabbit inference engine (.cursor/rules/plugin-overview.mdc)

Store the English locale at plugin/src/main/resources/data/lang/en.yml

Files:

  • plugin/src/main/resources/data/lang/en.yml
plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/kits/**/*.kt

📄 CodeRabbit inference engine (.cursor/rules/plugin-overview.mdc)

Implement kits by extending the Kit base class

Files:

  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/kits/BrawlKit.kt
plugin/src/main/resources/data/{abilities,disguises,maps,kits,minigames,passives,projectiles,theme}.yml

📄 CodeRabbit inference engine (.cursor/rules/plugin-overview.mdc)

Keep core Brawl configuration in YAML files under plugin/src/main/resources/data with fixed filenames

Files:

  • plugin/src/main/resources/data/kits.yml
  • plugin/src/main/resources/data/abilities.yml
plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/**/*.kt

📄 CodeRabbit inference engine (.cursor/rules/plugin-overview.mdc)

Implement abilities by extending BrawlAbility and manage cooldown/usage via the base class

Files:

  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/IronHookAbility.kt
🧠 Learnings (5)
📚 Learning: 2025-09-22T00:09:59.281Z
Learnt from: CR
PR: BetrixDev/ssm-brawl#0
File: .cursor/rules/plugin-overview.mdc:0-0
Timestamp: 2025-09-22T00:09:59.281Z
Learning: Applies to plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/projectiles/**/*.kt : Implement projectiles by extending BrawlProjectile and ensure correct lifecycle/metadata for smooth gameplay

Applied to files:

  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/projectiles/PotionProjectile.kt
  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/projectiles/BrawlProjectile.kt
  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/IronHookAbility.kt
📚 Learning: 2025-09-22T00:09:59.281Z
Learnt from: CR
PR: BetrixDev/ssm-brawl#0
File: .cursor/rules/plugin-overview.mdc:0-0
Timestamp: 2025-09-22T00:09:59.281Z
Learning: Applies to plugin/src/main/resources/data/{abilities,disguises,maps,kits,minigames,passives,projectiles,theme}.yml : Keep core Brawl configuration in YAML files under plugin/src/main/resources/data with fixed filenames

Applied to files:

  • plugin/src/main/resources/data/lang/en.yml
📚 Learning: 2025-09-22T00:09:59.281Z
Learnt from: CR
PR: BetrixDev/ssm-brawl#0
File: .cursor/rules/plugin-overview.mdc:0-0
Timestamp: 2025-09-22T00:09:59.281Z
Learning: Applies to plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/**/*.kt : Implement abilities by extending BrawlAbility and manage cooldown/usage via the base class

Applied to files:

  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/kits/BrawlKit.kt
  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/IronHookAbility.kt
📚 Learning: 2025-09-22T00:09:59.281Z
Learnt from: CR
PR: BetrixDev/ssm-brawl#0
File: .cursor/rules/plugin-overview.mdc:0-0
Timestamp: 2025-09-22T00:09:59.281Z
Learning: Applies to plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/kits/**/*.kt : Implement kits by extending the Kit base class

Applied to files:

  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/kits/BrawlKit.kt
📚 Learning: 2025-09-22T00:09:59.281Z
Learnt from: CR
PR: BetrixDev/ssm-brawl#0
File: .cursor/rules/plugin-overview.mdc:0-0
Timestamp: 2025-09-22T00:09:59.281Z
Learning: Applies to plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/passives/**/*.kt : Implement passives by extending BrawlPassive and define metadata in the base construct

Applied to files:

  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/IronHookAbility.kt
🪛 detekt (1.23.8)
plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/projectiles/PotionProjectile.kt

[warning] 24-26: This empty block of code can be removed.

(detekt.empty-blocks.EmptyFunctionBlock)

🔇 Additional comments (1)
plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/kits/BrawlKit.kt (1)

83-83: New ability wiring looks good

iron_hook now resolves to IronHookAbility, so kits referencing it will load without falling into the fallback error path. Nicely slotted into the existing mapping.

Comment on lines +24 to +26
private val projectileKnockbackModifier = metadata.double("projectileKnockbackModifier") ?: 0.0
private val projectileDamage = metadata.double("projectileDamage") ?: 4.0
private val projectileSize = (metadata.double("projectileSize") ?: 0.6).coerceAtLeast(0.1)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Wire projectileKnockbackModifier into the pull logic

We read projectileKnockbackModifier from metadata, but we never use it. That makes the config knob inert and prevents balancing kits through data. Feed the modifier into the velocity application (e.g., adjust the base force or scale vector) so data changes take effect.

One way to honour the metadata is:

-            val pull = player.location.toVector().subtract(entity.location.toVector()).normalize()
-            entity.setVelocity(pull, 2.0, false, 0.0, 0.8, 1.5, true)
+            val pull = player.location.toVector().subtract(entity.location.toVector()).normalize()
+            val knockbackForce = 2.0 + projectileKnockbackModifier
+            entity.setVelocity(pull, knockbackForce, false, 0.0, 0.8, 1.5, true)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
private val projectileKnockbackModifier = metadata.double("projectileKnockbackModifier") ?: 0.0
private val projectileDamage = metadata.double("projectileDamage") ?: 4.0
private val projectileSize = (metadata.double("projectileSize") ?: 0.6).coerceAtLeast(0.1)
val pull = player.location.toVector().subtract(entity.location.toVector()).normalize()
val knockbackForce = 2.0 + projectileKnockbackModifier
entity.setVelocity(pull, knockbackForce, false, 0.0, 0.8, 1.5, true)
🤖 Prompt for AI Agents
In
plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/IronHookAbility.kt
around lines 24–26, projectileKnockbackModifier is read from metadata but never
applied; update the pull/knockback logic where you set the target's or
projectile's velocity so that the computed force is multiplied (or the velocity
vector scaled) by projectileKnockbackModifier (fall back to 1.0 if
zero/invalid), e.g., incorporate it into the base force calculation or multiply
the final velocity before calling setVelocity/launch so changes in metadata
affect actual knockback.

@BetrixDev BetrixDev merged commit 4c11fc2 into reimagined Sep 29, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant