Commit Graph

86 Commits

Author SHA1 Message Date
Teriuihi 816c429346 Remove leftover debug logging in broadcastNextPhaseStartTime
The debug log statement was unnecessary and likely left in by mistake. This change cleans up the code by removing it, ensuring the method only contains relevant functionality.
2025-03-01 01:17:58 +01:00
Teriuihi afbd1a9f09 Todo removed from tank class since the shield is strong enough now 2025-03-01 01:16:39 +01:00
Teriuihi 5430af2149 Remove completed TODO comments
Cleaned up obsolete TODO comments related to powdered snow mechanics and mage behavior.
2025-03-01 01:16:07 +01:00
Teriuihi ce7297afb8 Refactor flag point update logic for winning team.
Fixed the logic for updating flag point. Ensures correct handling of winning and losing teams by directly iterating through entries. This way points are reduced if a team is no longer "winning".
2025-03-01 01:15:48 +01:00
Teriuihi a10607092b Refactor snow bucket creation to return a list of snow buckets.
Updated `getPowderedSnow` to generate a list of 16 individual snow bucket items instead of modifying the amount of a single item. Adjusted `getTools` to handle the list returned by this method, ensuring proper item handling and consistency.
2025-03-01 00:49:01 +01:00
Teriuihi fe39cdf5a1 Change Mage class display item to Snowball 2025-03-01 00:46:07 +01:00
Teriuihi 6008378258 Fix mage class damage and improve mage snowball throw logic
Updated Mage health regeneration from 3 to 1 and adjusted snowball velocity randomness for better gameplay balance. Fixed comparison in SnowballEvent to use `equals` and corrected parameter assignment in `consumer.apply`. Incremented build number to reflect the changes.
2025-03-01 00:45:07 +01:00
Teriuihi 18b211f681 Reduce Mage class default damage from 5 to 3. 2025-03-01 00:26:28 +01:00
Teriuihi b5c59cf173 Implement knockback effect for players near captured flag
Added a feature to knock back nearby players when a flag is captured, creating space for the flag bearer.
2025-03-01 00:25:52 +01:00
Teriuihi 436b462ffe Removed TODO that was done 2025-03-01 00:09:30 +01:00
Teriuihi d11cf25fc8 Add Mage character class with snowball duplication ability
Introduced the Mage class as a playable character along with its creation logic, tools, and armor setup. Mages can duplicate snowballs upon throwing, creating multiple projectiles with varying directions and velocities to enhance gameplay dynamics. Updated relevant systems to accommodate this new class.
2025-03-01 00:05:57 +01:00
Teriuihi e8c015790f Fix Trapper using Tank constructor.
Replaced the use of Tank with Trapper in the TrapperCreator class and adjusted associated parameters. Modified Trapper's constructor to be public, ensuring proper accessibility for instantiation.
2025-03-01 00:05:45 +01:00
Teriuihi ba8fbe83e0 Remove TODO comment in TrapperCreator class.
The comment about adding temporary invulnerability was removed, it was meant for the tank class.
2025-02-28 23:12:45 +01:00
Teriuihi d56e8eaea5 Add Trapper game class to the CTF system
Introduced the new "Trapper" class with unique armor, tools, and abilities to enhance gameplay. The Trapper specializes in utilizing powdered snow traps to hinder the enemy team. This includes creating necessary implementations and updating retrieval logic.
2025-02-28 23:12:13 +01:00
Teriuihi 3550d75634 Introduce TeamScoreboard and highest stat tracking functionality.
This commit refactors scoreboard management into a dedicated TeamScoreboard class, improving modularity and readability. It also adds a new command to track and display the highest player stats across all game metrics, enhancing gameplay insights.
2025-02-28 22:21:23 +01:00
Teriuihi 14158f73b8 Handle null player check in resetWorldBorder method.
Previously, the method assumed the player object was never null, which could cause potential issues. This update adds a null check to ensure stability and prevent unexpected errors when invoking the resetWorldBorder method.
2025-02-26 22:40:58 +01:00
Teriuihi c738f02d17 Add persistent player statistics tracking
Introduced the `PlayerStat` system to persist player statistics across sessions. Enhanced player management by linking `PlayerStat` with teams and saving/updating stats periodically. Refactored related methods to support the new functionality and ensure data integrity.
2025-02-26 22:00:46 +01:00
Teriuihi e62d0df9df Refactor potion healing to exclude non-teammates.
Split logic into smaller methods for clarity and maintainability. Added `shouldHeal` to determine team eligibility and `calculateActualHealing` to handle precise healing calculations. Updated intensity handling to exclude non-teammates during healing.
2025-02-23 01:22:52 +01:00
Teriuihi eeed5b4c54 Add player statistics tracking and integration.
Introduced a comprehensive system for tracking player stats, including kills, flags captured, damage dealt, and more. Integrated stat recording into related game events and ensured proper handling for both individual and team actions. This enhances gameplay analysis and future feature potential.
2025-02-23 01:14:27 +01:00
Teriuihi 8386e773ce Add glowing effect to flag carrier
The flag carrier now receives a glowing effect to improve visibility and make them easier to track during gameplay. This change enhances player experience and adds a strategic element to capturing the flag.
2025-02-23 00:34:43 +01:00
Teriuihi e5656f23ce Fix class change restriction and track player death state
Ensure players can change classes when they are dead or near spawn if alive. Added logic to track and update player death state, improving clarity and game mechanics around death handling.
2025-02-23 00:33:30 +01:00
Teriuihi 409a1aa596 Make addToScoreboard public and reset team scores.
Changed addToScoreboard visibility to public for external usage, allowing it to be called when a player joins a team. Added a reset for team scores in the Flag class to ensure scores are cleared when resetting the game state.
2025-02-23 00:27:49 +01:00
Teriuihi 57f2898451 Update OnPlayerOnlineStatus to assign a class to a joining player
The constructor of OnPlayerOnlineStatus was updated to include WorldBorderApi, and its functionality now integrates FighterCreator for enhanced player handling. This change ensures proper application of a class and world border logic during player teleport and initialization.
2025-02-16 00:13:05 +01:00
Teriuihi 2242fea737 Prevent block breaking during active game phases
Added an event handler to cancel block breaking unless the block is snow or the game phase is inactive. This ensures players cannot modify the environment during ongoing games.
2025-02-15 23:44:22 +01:00
Teriuihi e04892156c Gracefully handle null or offline players in game phases.
Added checks to ensure players are online and not null before interacting with them during the game phases. This prevents potential null pointer exceptions and improves overall code robustness. Also added a null check for the executorService in the CombatPhase end method.
2025-02-15 23:44:15 +01:00
Teriuihi c09c55ed7a Add Discord integration for teams and user linking
Introduced database connectivity and Discord role management via MyBatis and JDA. Enhanced `Team` functionality to support Discord roles and integrated player-Discord linking during server join. Updated Gradle build to include required dependencies.
2025-02-15 22:31:35 +01:00
Teriuihi 2c80b2d474 Handle null player in resetFlagCarrier method
Added a null check for the flagCarrier player before clearing active potion effects to prevent potential NullPointerExceptions. This ensures stable behavior when resetting the flag carrier.
2025-02-15 04:18:08 +01:00
Teriuihi 4f0a4eff6f Update flag capture flow to notify players visually
Added a title notification for players when a team can capture the flag, improving communication during gameplay.
2025-02-15 04:10:52 +01:00
Teriuihi c02bda6ea7 Add slowness effect to flag carriers and clear it on reset
Flag carriers now receive a slowness effect to hinder movement while holding the flag. The effect is cleared when the flag carrier is reset to ensure consistent gameplay behavior. Updated build number to reflect these changes.
2025-02-15 04:07:07 +01:00
Teriuihi 400032a94c Switch from UUID to Player & add scoreboard for teams
Replaced UUID-based logic with Player objects across all game systems. Added team scorebaord sfor colors in tab and clarity for players as to who is in the laed
2025-02-15 03:53:35 +01:00
Teriuihi 6893e07619 Prevent armor manipulation with InventoryClick and Drag events
Implemented handling for InventoryClick and InventoryDrag events to block interactions with armor slots. This ensures that players cannot equip or remove armor through inventory actions, maintaining consistency with existing item interaction restrictions.
2025-02-15 02:54:02 +01:00
Teriuihi f27038f91d Ensure snowball hit events are properly canceled outside combat phase.
Previously, events where players were hit outside the combat phase or by non-snowball entities were not being canceled appropriately. This commit adds `event.setCancelled(true)` to prevent unintended behaviors in these scenarios.
2025-02-15 02:48:20 +01:00
Teriuihi 07b700bc32 Shuffle player list before assigning teams
Added logic to randomize the order of players before assigning them to teams. This ensures a fairer distribution when teams are being populated.
2025-02-15 02:47:04 +01:00
Teriuihi 7ae91bcf06 Add customizable flag material for Capture the Flag
Introduced a configurable `Material` property for flags to enhance flexibility. Updated relevant classes and methods to support dynamic flag material. Default material is set to `RED_BANNER`, with the option to override via configuration or team settings.
2025-02-15 02:42:27 +01:00
Teriuihi 56455b4c50 Fix executor handling in phase transitions and game ending
Ensure proper management of executor service during CombatPhase and shutdown when the game ends. Avoids potential resource leaks or invalid executor state during phase transitions.
2025-02-11 23:17:10 +01:00
Teriuihi 3b4beefb37 Remove redundant TODO comment in CombatPhase.java
The comment about adding players to the boss bar list was removed as it is completed.
2025-02-11 23:10:06 +01:00
Teriuihi 9ae63ba1e4 Refine title message for flag capture notification.
Adjusted the title message to simplify formatting and better align with gameplay context. Removed redundant text and ensured proper use of placeholders for dynamic content.
2025-02-11 23:08:59 +01:00
Teriuihi c3b11995c7 Update phase transition notifications with detailed timing
Introduced specific second-based notifications for better accuracy as a phase approaches. Added distinct messaging for the game ending phase to improve clarity for players. Simplified code by replacing hard-coded values with a predefined list of notification intervals.
2025-02-11 23:06:05 +01:00
Teriuihi 8b09e54106 Fix flag capture and game phase timing bugs
Adjusted the flag capture sequence to ensure proper update of the carrier before notifying about the capture. Fixed the phaseStartTime initialization to correctly track phase transitions. Updated the build number for the new changes.
2025-02-11 23:02:38 +01:00
Teriuihi 237cae37ca Refactor flag capture and turn-in notifications.
Extracted and separated notification logic for flag capture and turn-in events into distinct methods to improve clarity and maintainability. Updated messaging to better align with game events and streamlined title displays for players.
2025-02-11 22:12:31 +01:00
Teriuihi a3c22cf074 Refactor flag reset logic for clarity and reuse.
Consolidated flag reset responsibilities into `resetFlagCarrier` and `resetAll` methods to improve code readability and maintainability. Replaced redundant flag reset operations with the new methods across the codebase. Updated `EndedPhase` to use `resetAll` for consistent behavior.
2025-02-11 22:08:58 +01:00
Teriuihi 4cfc8f1572 Fix flag particle spawn location during turn-in
Updated the particle spawning method to use the flag's turn-in location instead of the world border center. This ensures particles are correctly displayed at the intended location, aligning with gameplay expectations.
2025-02-11 21:46:44 +01:00
Teriuihi 9563e9641f Add skip phase command to bypass game phases
Introduced a new `/ctf skipphase` command allowing admins to skip the current game phase. Updated relevant classes to handle phase-skipping logic and ensure proper game state transitions. Added corresponding message configuration and subcommand registration.
2025-02-11 21:45:14 +01:00
Teriuihi aad63f174e Refactor phase transitions and add particle effects for flags
Simplified phase transition logic by removing unnecessary parameters and added proper executor shutdown at the end of the game. Enhanced visuals by introducing particle effects around flags when a team wins. Also implemented a method to skip the current game phase.
2025-02-11 21:41:33 +01:00
Teriuihi 66c24d852d Refactor and enhance flag capture notification system.
Extracted the flag capture notification logic into a dedicated method for better readability and reusability. Added team-specific title messages to notify players of the flag capture, improving clarity and game immersion.
2025-02-11 21:27:34 +01:00
Teriuihi 7acf39b600 Fix armor color setting method from BGR to RGB.
The method for setting armor colors was incorrect and used `Color.fromBGR` instead of `Color.fromRGB`. This ensures proper color rendering and aligns with expected behavior.
2025-02-11 21:27:26 +01:00
Teriuihi 6f99402d16 Add TURN_IN_RADIUS config and spawn particles at turn in point as well
Introduced a new TURN_IN_RADIUS configuration parameter to manage flag turn-in distance. Refactored particle spawning logic to use configurable radii and adjusted related methods accordingly for better flexibility and maintainability.
2025-02-11 21:08:20 +01:00
Teriuihi 5f2fb8fe0a Send death message with respawn timer on player death
Players now receive a formatted message indicating their death and the respawn time remaining. This enhances feedback and improves the overall player experience.
2025-02-09 22:12:50 +01:00
Teriuihi dbcbb10079 Refactor player status handling and improve flag logic
Rename OnPlayerJoin to OnPlayerOnlineStatus, adding logic for player disconnects. Enhance OnPlayerDeath and Flag classes to handle flag reset and notifications when a flag carrier dies or disconnects.
2025-02-09 22:10:48 +01:00
Teriuihi 7070165a94 Rename WINNING_SCORE to CAPTURE_SCORE in GameConfig.
Updated variable and configuration references to reflect the renaming of WINNING_SCORE to CAPTURE_SCORE for clarity and consistency. Adjusted related usage in Flag class to align with the new naming convention.
2025-02-09 22:01:12 +01:00