Add team system and team-based win condition

Introduce a full in-memory team system and integrate it into gameplay and UI.

- Add Team, TeamManager, TeamListener and TeamCommand to manage teams, invites, accept/deny, leave, kick and info. TeamManager stores teams and pending invites (INVITE_TTL_MS) using concurrent maps and exposes helper/query methods (areInSameTeam, allAliveInSameTeam, getInviterFor, cleanExpiredInvites, reset).
- Wire TeamManager into SpeedHG: initialize, schedule periodic invite cleanup, register command and listener, and reset teams on plugin disable.
- Update GameManager to consider teams for win conditions, build team winner names, exclude teammates from random teleport/compass logic, and credit all winning team members for stats/ranking.
- Move ability charge feedback out of individual kits into KitEventDispatcher: remove per-kit onFullyCharged overrides and add centralized ActionBar/sound feedback (sendChargeUpdateActionBar/sendChargeReadyActionBar). ActiveAbility no longer defines onFullyCharged.
- Make OraclePerk ignore teammates when finding nearest enemy.
- Add config entries for teams and corresponding language strings; tweak some default values in CustomGameSettings (gladiator arena radius/height and minor formatting changes).

These changes enable 2-player teams (configurable), friendly-fire prevention, invite lifecycle handling, and team-aware endgame logic.
This commit is contained in:
TDSTOS
2026-04-09 02:33:14 +02:00
parent a6675c882b
commit 4d32fe677c
23 changed files with 788 additions and 110 deletions

View File

@@ -81,6 +81,53 @@ disasters:
warning-main: '<yellow><bold>THUNDERSTORM!</bold></yellow>'
warning-sub: '<gray>Your height attracts lightning!</gray>'
team:
disabled: '<prefix><red>Teams are disabled in this round.</red>'
usage: '<prefix><gray>Usage: /team <invite|accept|deny|leave|kick|info> [player]</gray>'
game_running: '<prefix><red>Teams cannot be changed while the game is running!</red>'
not_in_team: '<prefix><red>You are not in a team.</red>'
already_in_team: '<prefix><red>You are already in a team!</red>'
player_not_found: '<prefix><red>Player <name> is not online.</red>'
invite:
usage: '<prefix><red>Usage: /team invite <player></red>'
sent: '<prefix><green>✉ Invite sent to <yellow><name></yellow>. (Expires in <time>s)</green>'
received: '<prefix><gold>✉ <yellow><name></yellow> invited you to their team! <green>/team accept <name></green> or <red>/team deny <name></red> (expires in <time>s)</gold>'
self: '<prefix><red>You cannot invite yourself.</red>'
already_teammate: '<prefix><red>This player is already your teammate.</red>'
target_has_team: '<prefix><red><name> is already in a team.</red>'
team_full: '<prefix><red>Your team is full!</red>'
already_pending: '<prefix><red>There is already a pending invite for <name>.</red>'
accept:
usage: '<prefix><red>Usage: /team accept <player></red>'
no_invite: '<prefix><red>You have no pending invite from <name>.</red>'
expired: '<prefix><red>The invite from <name> has expired.</red>'
joined: '<prefix><green>✔ <yellow><name></yellow> joined the team! Members: <white><members></white></green>'
deny:
usage: '<prefix><red>Usage: /team deny <player></red>'
success: '<prefix><gray>Invite from <name> declined.</gray>'
received: '<prefix><gray><name> declined your team invite.</gray>'
leave:
success: '<prefix><gray>You left the team.</gray>'
disbanded: '<prefix><red>The team has been disbanded.</red>'
member_left: '<prefix><gray><name> left the team.</gray>'
kick:
usage: '<prefix><red>Usage: /team kick <player></red>'
success: '<prefix><yellow>Kicked <name> from the team.</yellow>'
received: '<prefix><red>You were kicked from the team by <name>.</red>'
not_leader: '<prefix><red>Only the team leader can kick players.</red>'
not_in_your_team: '<prefix><red><name> is not in your team.</red>'
self: '<prefix><red>You cannot kick yourself. Use /team leave.</red>'
info:
header: '<gray>━━━━━ <gold>Team Members</gold> ━━━━━</gray>'
member: ' <gray>#<index></gray> <white><name></white><yellow><leader></yellow>'
footer: '<gray>━━━━━━━━━━━━━━━━━━━━━ (<size>/<max>)</gray>'
commands:
kit:
usage: '<red>Usage: /kit <kitName> <playstyle></red>'
@@ -239,6 +286,9 @@ perks:
message: '<gold>🍎 Scavenged a Golden Apple!</gold>'
kits:
needed_hits: '<gold>⚡ Ability: <white><current>/<required> Hits</white></gold>'
ability_charged: '<green><bold>⚡ ABILITY READY!</bold></green>'
backup:
name: '<gradient:gold:#ff841f><bold>Backup</bold></gradient>'
lore: