Add IceMage kit and playstyle support

Introduce a new IceMage kit and wire playstyle support across the plugin. Changes include:

- Add IceMageKit with aggressive/defensive active & passive abilities, item distribution, and lifecycle hooks; caches ability instances and given items to reduce allocations.
- Register IceMageKit in SpeedHG on plugin startup.
- Update KitCommand to require a playstyle argument, validate it, select the kit's playstyle, and provide tab-completion for playstyles.
- Extend KitEventDispatcher with IceMage-specific handlers: spawn a circular volley of snowballs on ability use (cancelling the original projectile), mark spawned snowballs with persistent data, and apply freeze/slow effects on hit.
- Adjust GoblinKit to use a plugin getter and make inner ability classes static to avoid capturing the outer instance.
- Update language lines and plugin.yml usage to reflect the new /kit <kitName> <playstyle> usage.

These changes implement the IceMage feature and ensure proper playstyle selection and event handling while keeping allocations low and behavior consistent.
This commit is contained in:
TDSTOS
2026-03-25 05:02:59 +01:00
parent 19bd708b59
commit ea86272c01
7 changed files with 294 additions and 8 deletions

View File

@@ -6,6 +6,7 @@ import club.mcscrims.speedhg.game.GameManager
import club.mcscrims.speedhg.game.modules.AntiRunningManager
import club.mcscrims.speedhg.kit.KitManager
import club.mcscrims.speedhg.kit.impl.GoblinKit
import club.mcscrims.speedhg.kit.impl.IceMageKit
import club.mcscrims.speedhg.kit.listener.KitEventDispatcher
import club.mcscrims.speedhg.listener.ConnectListener
import club.mcscrims.speedhg.listener.GameStateListener
@@ -53,6 +54,7 @@ class SpeedHG : JavaPlugin() {
kitManager = KitManager( this )
// Register kits
kitManager.registerKit( GoblinKit() )
kitManager.registerKit( IceMageKit() )
registerCommands()
registerListener()