Conversation
…ent naming Co-authored-by: rdbailey.dev <rdbailey.dev@gmail.com>
|
Cursor Agent can help with this pull request. Just |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. WalkthroughReplaces hardcoded constants with metadata-driven properties across several abilities and passives, and updates YAML metadata (abilities, passives, kits) to expose or rename configuration fields used at runtime. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Player
participant Ability as Ability (Kotlin)
participant YAML as Config (abilities.yml)
participant Engine as Game Engine
Player->>Ability: Activate ability
Ability->>YAML: Read metadata fields (radius, velocity, counts, timings)
YAML-->>Ability: Return configured values
Ability->>Engine: Spawn projectiles/particles, apply knockback/damage using values
Engine-->>Player: Resulting effects (movement, damage, visuals)
note right of Ability: Hardcoded literals replaced by metadata-driven values
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (12)
plugin/src/main/resources/data/passives.yml (1)
42-42: Add trailing newline.File is missing a newline at EOF per yamllint.
plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/ExplodeAbility.kt (1)
32-32: Add explicit type and surface the key in abilities.yml.Follow the guideline to declare types and expose configurable keys publicly.
Apply:
- private val explosionVelocityStrength = metadata.double("explosionVelocityStrength") ?: 1.8 + private val explosionVelocityStrength: Double = + metadata.double("explosionVelocityStrength") ?: 1.8Also add
explosionVelocityStrengthtoabilities.ymlunderexplode.metadatawith default1.8.plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/BoneExplosionAbility.kt (2)
16-19: Add explicit types and document keys.Declare types and add these keys to YAML to keep all tunables visible.
- private val explosionKnockbackMultiplier = - metadata.double("explosionKnockbackMultiplier") ?: 2.5 - private val explosionBoneCount = metadata.int("explosionBoneCount") ?: 48 - private val explosionBoneVelocity = metadata.double("explosionBoneVelocity") ?: 0.8 + private val explosionKnockbackMultiplier: Double = + metadata.double("explosionKnockbackMultiplier") ?: 2.5 + private val explosionBoneCount: Int = metadata.int("explosionBoneCount") ?: 48 + private val explosionBoneVelocity: Double = metadata.double("explosionBoneVelocity") ?: 0.8In
abilities.yml > bone_explosion.metadata, add:
explosionKnockbackMultiplier: 2.5explosionBoneCount: 48explosionBoneVelocity: 0.8
25-33: Consider externalizing effect duration (40 ticks).Make the particle/effect lifetime configurable (e.g.,
effectLifetimeTicks) for parity with other tunables.plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/MilkSpiralAbility.kt (1)
21-21: Add explicit type and YAML key for radius.Keep types explicit and surface the visual radius in YAML.
- private val particleSpiralRadius = metadata.double("particleSpiralRadius") ?: 1.5 + private val particleSpiralRadius: Double = + metadata.double("particleSpiralRadius") ?: 1.5Add
particleSpiralRadius: 1.5toabilities.yml > milk_spiral.metadata.plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/SulphurBombAbility.kt (1)
24-27: Types + bounds for projectile tunables; add YAML entries.Declare types and clamp to safe ranges to avoid visual/perf spikes.
- private val projectileVelocityMultiplier = - metadata.double("projectileVelocityMultiplier") ?: 1.55 - private val projectileSize = metadata.double("projectileSize") ?: 0.65 - private val projectileTrailMaxParticles = metadata.int("projectileTrailMaxParticles") ?: 8 + private val projectileVelocityMultiplier: Double = + metadata.double("projectileVelocityMultiplier") ?: 1.55 + private val projectileSize: Double = + (metadata.double("projectileSize") ?: 0.65).coerceAtLeast(0.1) + private val projectileTrailMaxParticles: Int = + (metadata.int("projectileTrailMaxParticles") ?: 8).coerceIn(0, 32)Add to
abilities.yml > sulphur_bomb.metadata:
projectileVelocityMultiplier: 1.55projectileSize: 0.65projectileTrailMaxParticles: 8plugin/src/main/resources/data/abilities.yml (6)
9-11: Expose all sulphur_bomb tunables referenced in code.Add the missing metadata keys so operators can tune without code changes.
metadata: projectileKnockbackModifier: 2.5 projectileDamage: 6.5 + projectileVelocityMultiplier: 1.55 + projectileSize: 0.65 + projectileTrailMaxParticles: 8
20-23: Add explode velocity strength to metadata.Keep parity with ExplodeAbility.
metadata: fuseTimeTicks: 30 explosionRadius: 8.0 explosionKnockbackMultiplier: 2.5 + explosionVelocityStrength: 1.8
32-34: Bone explosion: include all new keys.Reflect new tunables used by the ability.
metadata: explosionRadius: 7.0 baseDamage: 6.0 + explosionKnockbackMultiplier: 2.5 + explosionBoneCount: 48 + explosionBoneVelocity: 0.8
73-79: Add particleSpiralRadius to milk_spiral.Make the visual radius adjustable in YAML to match code usage.
metadata: spiralDurationMs: 3000 velocityDurationMs: 1800 hitboxRadius: 2.0 damage: 5.0 maxTimesHit: 2 damageCooldownMs: 250 + particleSpiralRadius: 1.5
98-102: Add block rotation step speed to block_toss.Surface the tick step for the display animation.
metadata: chargeTimeMs: 1200 maxCharge: 1.4 maxDamage: 9.0 damage: 8.0 knockbackMultiplier: 2.5 + blockRotationStepSpeedTicks: 4
102-102: Add trailing newline.File is missing a newline at EOF per yamllint.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/BlockTossAbility.kt(3 hunks)plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/BoneExplosionAbility.kt(2 hunks)plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/ExplodeAbility.kt(2 hunks)plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/MilkSpiralAbility.kt(2 hunks)plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/SulphurBombAbility.kt(2 hunks)plugin/src/main/resources/data/abilities.yml(7 hunks)plugin/src/main/resources/data/kits.yml(4 hunks)plugin/src/main/resources/data/passives.yml(1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.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/abilities/BoneExplosionAbility.ktplugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/ExplodeAbility.ktplugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/MilkSpiralAbility.ktplugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/BlockTossAbility.ktplugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/SulphurBombAbility.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/abilities/BoneExplosionAbility.ktplugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/ExplodeAbility.ktplugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/MilkSpiralAbility.ktplugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/BlockTossAbility.ktplugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/SulphurBombAbility.kt
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/BoneExplosionAbility.ktplugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/ExplodeAbility.ktplugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/MilkSpiralAbility.ktplugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/BlockTossAbility.ktplugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/SulphurBombAbility.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/passives.ymlplugin/src/main/resources/data/kits.ymlplugin/src/main/resources/data/abilities.yml
🧠 Learnings (5)
📓 Common learnings
Learnt from: CR
PR: BetrixDev/ssm-brawl#0
File: .cursor/rules/plugin-overview.mdc:0-0
Timestamp: 2025-09-22T00:09:59.268Z
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
📚 Learning: 2025-09-22T00:09:59.268Z
Learnt from: CR
PR: BetrixDev/ssm-brawl#0
File: .cursor/rules/plugin-overview.mdc:0-0
Timestamp: 2025-09-22T00:09:59.268Z
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/abilities/BoneExplosionAbility.ktplugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/ExplodeAbility.ktplugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/BlockTossAbility.ktplugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/SulphurBombAbility.kt
📚 Learning: 2025-09-22T00:09:59.268Z
Learnt from: CR
PR: BetrixDev/ssm-brawl#0
File: .cursor/rules/plugin-overview.mdc:0-0
Timestamp: 2025-09-22T00:09:59.268Z
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/abilities/BoneExplosionAbility.ktplugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/ExplodeAbility.ktplugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/BlockTossAbility.ktplugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/SulphurBombAbility.kt
📚 Learning: 2025-09-22T00:09:59.268Z
Learnt from: CR
PR: BetrixDev/ssm-brawl#0
File: .cursor/rules/plugin-overview.mdc:0-0
Timestamp: 2025-09-22T00:09:59.268Z
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/abilities.yml
📚 Learning: 2025-09-22T00:09:59.268Z
Learnt from: CR
PR: BetrixDev/ssm-brawl#0
File: .cursor/rules/plugin-overview.mdc:0-0
Timestamp: 2025-09-22T00:09:59.268Z
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/SulphurBombAbility.kt
🪛 YAMLlint (1.37.1)
plugin/src/main/resources/data/passives.yml
[error] 42-42: no new line character at the end of file
(new-line-at-end-of-file)
plugin/src/main/resources/data/abilities.yml
[error] 102-102: no new line character at the end of file
(new-line-at-end-of-file)
🔇 Additional comments (14)
plugin/src/main/resources/data/kits.yml (1)
29-29: Rename to healAmount is consistent with passives.yml.Looks good and aligns with the new regeneration metadata key.
Please confirm the regeneration passive implementation reads
healAmount(notregenRate) to avoid silent defaults.Also applies to: 55-55, 84-84, 109-109
plugin/src/main/resources/data/passives.yml (6)
4-8: Double-jump tuning metadata added correctly.Good externalization of motion params.
12-13: Time unit check (ms vs ticks).Confirm
hungerRestoreDelayMsis consumed as milliseconds across the codebase.
17-19: Regeneration keys look good.
healAmountandhealIntervalTicksread cleanly.Please verify the passive uses
healIntervalTicks(not ms) for timing.
25-27: Arrow recharge defaults adjusted.New fields read well; skeleton kit override to 60 ticks still applies.
32-34: Barrage metadata externalized.Looks consistent.
40-42: Stampede stacking config looks sensible.Nice consolidation.
plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/ExplodeAbility.kt (1)
141-141: Sanity-check setVelocity param order.Confirm the extension signature matches
(x, y, z, multiplyByLookDirection: Boolean)(or equivalent) so only the X component is metadata-driven as intended.plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/BlockTossAbility.kt (1)
141-141: Rotation runnable uses new step speed correctly.Interval and interpolation duration are wired to the metadata; looks good.
Also applies to: 144-144, 169-169
plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/BoneExplosionAbility.kt (1)
51-51: Knockback multiplier usage is correct.Good replacement of hardcoded value.
plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/MilkSpiralAbility.kt (1)
71-79: Radius substitution is correct.Both arc computations now use the configurable radius.
Also applies to: 82-89
plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/SulphurBombAbility.kt (1)
51-53: Projectile builder now uses metadata.Nice removal of hardcoded values.
plugin/src/main/resources/data/abilities.yml (2)
43-45: Roped arrow defaults look good.Velocity and damage are publicly configurable.
55-63: Angry herd metadata set looks consistent.Clear, self-descriptive field names.
| private val maxDamage = metadata.double("maxDamage") ?: 9.0 | ||
| private val damage = metadata.double("damage") ?: 8.0 | ||
| private val knockbackMultiplier = metadata.double("knockbackMultiplier") ?: 2.5 | ||
| private val blockRotationStepSpeedTicks = metadata.int("blockRotationStepSpeedTicks") ?: 4 |
There was a problem hiding this comment.
Clamp step speed and add explicit type.
Avoid 0/negative scheduling and follow explicit-type guideline.
- private val blockRotationStepSpeedTicks = metadata.int("blockRotationStepSpeedTicks") ?: 4
+ private val blockRotationStepSpeedTicks: Int =
+ (metadata.int("blockRotationStepSpeedTicks") ?: 4).coerceAtLeast(1)Expose blockRotationStepSpeedTicks in abilities.yml under block_toss.metadata with default 4.
📝 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.
| private val blockRotationStepSpeedTicks = metadata.int("blockRotationStepSpeedTicks") ?: 4 | |
| private val blockRotationStepSpeedTicks: Int = | |
| (metadata.int("blockRotationStepSpeedTicks") ?: 4).coerceAtLeast(1) |
🤖 Prompt for AI Agents
In
plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/BlockTossAbility.kt
around line 32, the property declaration uses inferred type and can be
zero/negative; change it to an explicit Int and clamp the value so it is at
least 1 (e.g., val blockRotationStepSpeedTicks: Int = max(1,
metadata.int("blockRotationStepSpeedTicks") ?: 4)) to prevent 0/negative
scheduling and keep default 4. Also update abilities.yml to expose
blockRotationStepSpeedTicks under block_toss.metadata with default: 4 and a
brief description.
Add and standardize metadata for Brawl abilities and passives, and update kit overrides to use the new metadata keys.
Summary by CodeRabbit
New Features
Refactor