Add perk system with GUI and integrations

Introduce a complete passive perk system: Perk base class, PerkManager (registration, selection, lifecycle, persistence), and PlayerPerksRepository (DB schema + upsert/find). Add four example perks (Oracle, Vampire, Featherweight, Bloodlust) and a single PerkEventDispatcher to route combat/environment/kill events to active perks. Provide PerkSelectorMenu GUI and /perks command, integrate perk initialization, registration, application and cleanup into SpeedHG and GameManager, and hook load/evict into StatsListener. Also add language entries and register the command in plugin.yml. This change enables players to select up to two passive perks, persists selections, and dispatches relevant events to perk implementations.
This commit is contained in:
TDSTOS
2026-04-04 03:16:43 +02:00
parent 88b0ba8b97
commit 8c2ab684bb
15 changed files with 977 additions and 1 deletions

View File

@@ -200,6 +200,7 @@ class GameManager(
teleportRandomly( player, world, startBorder / 2 )
plugin.kitManager.applyKit( player ) // verteilt Items + ruft onAssign + passive.onActivate
plugin.perkManager.applyPerks( player )
player.inventory.addItem(ItemStack( Material.COMPASS ))
player.sendMsg( "game.started" )
@@ -304,6 +305,7 @@ class GameManager(
}
plugin.kitManager.clearAll()
plugin.perkManager.removeAllActivePerks()
Bukkit.getOnlinePlayers().forEach { p ->
p.showTitle(Title.title(