Enhance Tripwire System with New Configurations and API Interfaces
- Update `TripwireConfig.cs` to add new configurations for tripwire appearance and behavior, including multipliers for out-of-line-of-sight detection and settings for size, color, and thickness.
- Refactor `TripwireMovementListener.cs` to improve tripwire activation logic by adopting a new listener and tripwire tracking approach, hence enhancing code maintainability and operational checks.
- Introduce the `TripwireInstance.cs` file to define a record structure for managing tripwire-related properties, integrating with existing APIs.
- Implement new interfaces in `ITripwireActivator.cs` and `ITripwireTracker.cs` to support modular activation and tracking of tripwire instances, facilitating clear interaction definitions within the system.
- Revise `TripwireItem.cs` to refine tripwire management, incorporating new utility methods for vector-to-angle conversions and applying configuration-based settings for visual aspects of tripwires.
- Adjust the `VectorExtensions.cs` to include a new method for converting vectors to angles, improving calculations in tripwire functionalities.
Additionally, integrate changes across related files to enhance the overall functionality and maintainability of the Tripwire system within the platform.
### Features
* Added **Tripwire** item
* Added **[DETECTIVE]** role prefix support for **MAUL**
### Fixes
* Fixed a bug causing **negative damage** to be logged
### Updates
* **Reduced time granted per kill** in speed rounds from **10 → 8
seconds**
* **Rebalanced special round weights**
* **Adjusted killfeed visibility** for traitors
* **Modified hurt stations** to only play the hurt sound **to yourself**
- Undid an unnecessary game hook for role assignments
- Make all rounds give 1 karma to all players
- Re-apply body paint price
- Reduce min requirement of players for special rounds from 8 -> 5
### Features
* Added **Silent Rounds**
* Added **Suppressed Rounds**
* Players can now use `+inspect` (default F) to interact with objects as
an alternative to +use
### Fixes
* Shop now automatically **closes after a purchase**
### Updates
* **Healthshot** cost increased from **25 → 40**
* **Body / Player Compass** cost reduced from **70 → 60**
* **Body Paint** cost reduced from **40 → 30**
* **Camouflage** visibility reduced from **60% → 50%**
* **Speed Round** time capped at **90 seconds**
* **Default weapons removed**
* **Default Detective weapon** changed to **Silenced M4A1**
* **Detective Ratio** reduced during higher populations
- Use weights for generating special rounds
- Add teleport decoy
- Map hooking for traitor rooms / buttons
- Prevent being able to buy m4a1-s or revolver before round start
- Clean up logs
- Add [BAD] prefix to bad actions
Refactor configuration initialization and improve code readability across multiple modules
- **GameHandlers/RoundStart_GameStartHandler.cs**: Change `config` initialization to a property to streamline retrieval and improve formatting for better readability.
- **Shop/Items/Traitor/C4/C4ShopItem.cs**: Refactor `config` to enable lazy loading through the Service Provider and remove the `readonly` keyword.
- **Karma/KarmaStorage.cs**: Simplify code by removing the lazy-loaded property `_configStorage` and directly using `_config`.
- **Game/RoundBasedGame.cs**: Implement lazy loading for configuration retrieval, update player initialization logic, and improve method structure for clarity.
- **Shop/Listeners/RoleAssignCreditor.cs**: Change `config` to a read-only property for lazy loading and enhance performance with delayed instantiation.
Implement AFK Management and Enhance Reward and Purchase Systems
- **TTTConfig.cs**: Add `CheckAFKTimespan` configuration to manage player inactivity during game rounds.
- **HealthshotConfig.cs**: Introduce `MaxPurchases` property to limit healthshot item usage per player.
- **Command/Test/TestCommand.cs**: Implement "reload" sub-command with permission checks for restricted execution.
- **CS2ServiceCollection.cs**: Integrate `AfkTimerListener` for handling inactive players and remove conditional compilation for `TestCommand`.
- **Listeners/AfkTimerListener.cs**: Develop an AFK detection system, moving idle players to spectator mode and issuing warnings.
**Additional updates:**
- **ReloadModule.cs**: Implement class to handle reloading of modules with user feedback and error handling.
- **CS2/lang/CS2Msgs.cs**: Add message templates for AFK warnings and notifications.
- **RoundTimerListener.cs**: Streamline TTTConfig access and remove redundant scheduler handling.
- **TeamChangeHandler.cs**: Enhance team change logic with new dependencies and player checks.
- **ShopConfig.cs**: Rework reward distribution system, introducing flexible reward ranges and removing the old fixed interval configuration.
- **HealthshotItem.cs**: Implement purchase tracking and finalize configurations for purchase limits.
- **PeriodicRewarder.cs**: Split reward and update timers, integrate player position tracking, and enhance reward calculation logic based on player movement.
- **GameHandlers/LateSpawnListener.cs**: Add game state checks to improve player respawn logic during specific states.
- Increase the price of camo configuration in `CamoConfig.cs` from 55 to 75
- Add `CS2CamoConfig` behavior to `CS2ServiceCollection.cs` for extended configuration options
- Update logic in `PlayerKillListener.cs` to enhance role-based kill classification by checking differing roles
- Introduce `CS2CamoConfig.cs` with configuration variables for camo items and player visibility
- Adjust starting credits in `CS2ShopConfig.cs` for Innocents, Traitors, and Detectives
- Reduce interval reward amount for credits in `ShopConfig.cs` from 8 to 5
Refactor configuration initialization for improved code readability and maintainability
- Update `PoisonSmokeListener.cs` to use a property for `PoisonSmokeConfig` initialization, adding conditional access and null-coalescing logic.
- Adjust `KarmaConfig.cs` to reduce karma gain values, affecting end-of-round and winning scenarios.
- Refactor `HealthshotItem.cs`, using an expression-bodied property for `config` to enhance code clarity.
- Enhance `ArmorItem.cs` with lazy loading for `ArmorConfig` by transitioning `config` to a property using an expression-bodied member.
- Modify `PeriodicRewarder.cs` to initialize `ShopConfig` using a property, ensuring fallback configuration with unchanged core logic.
Other file changes focus on transitioning configuration retrieval to properties, promoting lazy loading and streamlined expressions across items and listeners, thereby refining consistency and readability throughout the codebase.
```markdown
Implement player muting feature and enhance game mechanics
- Add `RTD_MUTED` message in `RtdMsgs.cs` utilizing the existing message creation method.
- Enhance `PlayerMuter.cs` by checking game state before muting players and implementing event handler to unmute players when the game finishes.
- Update `TraitorChatHandler.cs` to handle muted players in chat and prevent dead players from participating in traitor chat.
- Introduce `MuteReward` class in `MuteReward.cs` to mute players for the next round and manage muted player voice events.
- Modify `RewardGenerator.cs` to include `MuteReward` and adjust reward probabilities, enhancing the reward system.
These changes collectively introduce and integrate a system for managing player muting, ensuring robust gameplay dynamics and clarity for players during active game sessions.
```
Introduce RTD Project and Enhance Codebase with Localization and Config Improvements
- Introduce a new RTD project with multiple enhancements to reward and command systems:
- Add new interfaces and classes for `IRtdReward`, `IRewardGenerator`, and several types of rewards like `ShopItemReward`, `CreditReward`, `HealthReward`, and `WeaponReward`.
- Implement new command functionality through `RtdCommand` and `RtdStatsCommand`.
- Strengthen the code architecture by refactoring configuration access:
- Convert `config` fields to properties using expression-bodied members across various items and listeners, promoting improved readability and potential lazy loading.
- Integrate localization features:
- Add and standardize import statements for `TTT.Game.lang` to support upcoming language and localization developments across different game modules.
- Create new language configuration files, like `en.yml`, and introduce classes such as `RtdMsgs` for localized message handling.
- Improve game mechanics:
- Enhance poison effect handling within `PoisonShotsListener` with periodic damage application and improved player interaction updates.
- Extend the `IIconManager` to offer additional player visibility options, enhancing game dynamics through methods like `RevealToAll`.
- Optimize plugin and module management:
- Add logging features with `ShopPurchaseLogger` and new logging statements for plugin module registration.
- Ensure cohesive project structure by updating project files and solution configuration for the new RTD module.
- Refactor utility and helper functions for better clarity:
- Introduce utility classes like `WeaponTranslations` to map internal to user-friendly weapon names.
- Clean up and streamline namespaces for clarity and consistency, especially within utilities like `GrenadeDataHelper`.
This commit collectively enhances the system's modularity, readability, and capability for future localization and extensibility.
- Change `killedWithStation` data structure to `Dictionary` for enhanced player interaction tracking in `DamageStation.cs`
- Update `PoisonShotsListener.cs` to use `Dictionary` for poison kill tracking and adjust related logic
- Specify priority levels for event handlers in `GlovesListener.cs` to optimize execution order
This PR implements a comprehensive set of game balancing changes, bug fixes, and new features for a Trouble in Terrorist Town (TTT) game mode in Counter-Strike 2.
Key Changes:
Shop item pricing rebalance: Adjusted prices across multiple traitor and detective items to improve game economy balance
New cluster grenade item: Added a new traitor shop item that splits into multiple grenades on detonation
Compass system refactor: Split the single compass into two separate items (player compass and body compass) with a shared abstract base class
Karma system improvements: Updated karma calculation values and added proper storage/disposal patterns
Bug fixes: Fixed damage application, ragdoll spawning, and team change handling issues
Refactor and Enhance Gameplay Mechanics
- Remove unnecessary type checks and modify logic for handling victim HP in `OneHitKnifeListener`.
- Add configurable properties in `HealthStationConfig` for improved control over healing behavior.
- Enhance `BodySpawner` with optional parameters and improve code readability for ragdoll management.
- Simplify array initialization and item sorting logic in `BuyCommand`.
- Refactor health-related variables and update sound effects in `HealthStation` to standardize behavior.
- Introduce `DealPoisonDamage` method and utility imports in `PlayerExtensions` for improved poison damage handling.
- Implement tracking and handling of poison-related events in `PoisonShotsListener` and `PoisonSmokeListener`.
- Update `DamageStation` with tracking mechanisms and improved health adjustment logic.
- Enhance item search logic in `GiveItemCommand` and introduce `DebugMessage` management in `CS2ServiceCollection`.
- Revise communication consistency in `lang/en.yml` and add `DebugMessage` class for handling debug scenarios.
- Streamline damage handling and weapon verification in `DeagleDamageListener`.
- Increase the price of the Poison Smoke item in `PoisonSmokeConfig.cs` from 30 to 35 and ensure a newline at the end of the file.
- Reduce the price of the gloves in `GlovesConfig.cs` from 65 to 50.
- Refactor `BuyMenuHandler.cs` to improve command management and handling robustness.
- Reduce the default price of armor in `ArmorConfig.cs` from 80 to 60.
- Adjust prices in various Traitor and Detective configurations, including `C4Config.cs`, `PoisonShotsConfig.cs`, and `StickersConfig.cs` for better game balance.
```
- Add section for `CHEGrenadeProjectile_CreateFunc` in gamedata for new grenade functionality
- Update BuyMenuHandler to recognize "weapon_hegrenade" alias for purchase process
- Enhance ClusterGrenadeListener to implement multi-projectile detonation logic and remove unused fields
- Introduce `GrenadeDataHelper` class for handling grenade projectile creation
- Extend ClusterGrenadeConfig with `UpForce` and `ThrowForce` properties for customization
```
- Increase the price of the One-Shot Deagle item in CS2OneShotDeagleConfig.cs from 100 to 110.
- Reduce item prices in CamoConfig.cs and Detective/DnaScannerConfig.cs, adjusting the game's economy and item valuation.
- Introduce the Cluster Grenade item in ClusterGrenadeItem.cs and implement its related services.
- Create ClusterGrenadeListener.cs to handle events and dependencies for cluster grenades.
- Add the Cluster Grenade item description in en.yml.
- Reduce the price of HealthStationConfig.cs to improve affordability and balance.
- Update BodyPaintConfig.cs to allow for increased usage flexibility.
- Add new configuration for the traitor shop's Cluster Grenade in Traitor/ClusterGrenadeConfig.cs.
- Add the Cluster Grenade to the shop services and adjust service ordering in ShopServiceCollection.cs.
Implement New Compass Item System and Remove Legacy CompassItem
- Remove `CompassItem.cs`, eliminating the legacy radar-like compass functionality for traitors and any associated gameplay mechanics.
- Introduce `InnoCompassItem` class, providing role-specific target identification and implementing extension methods for service collection integration.
- Add `AbstractCompassItem` class as a base for compass-related items, including periodic updates, abstract methods for target logic, and a visual compass display.
- Split and rename `AddCompassServices` to `AddInnoCompassServices` and `AddBodyCompassServices` in `ShopServiceCollection.cs` for better service management.
- Update `CompassMsgs.cs` by refining message identifiers and adding new instances to support expanded in-game functionalities.
- Enhance `StationItem` object spawning logic for more accurate placement based on player orientation.
- Amend `en.yml` to include "Body Compass" item details and adjust existing labels for clarity and consistency.
- Implement `BodyCompassItem` class, extending abstract compass functionality for detective roles, with methods for ownership checks and target retrieval.
```
- Add JetBrains.Annotations to PlayerStatsTracker and annotate methods with [UsedImplicitly] to enhance code quality and maintainability.
- Reorder logic in CombatHandler's `OnPlayerDeath_Pre` to ensure necessary operations are executed before checking game state.
- Move `info.DontBroadcast` setting in CombatHandler to occur only when game is in progress.
- Modify operation sequence in `OnPlayerDeath_Pre` to spoof player status before dispatching death event.
- Clarify comment in `OnPlayerHurt` method in CombatHandler for better understanding on non-Windows platforms.
```
- Introduce `PlayerMuter` class in `GameHandlers` for muting dead players and send appropriate messages
- Add `PlayerMuter` behavior to `CS2ServiceCollection` and organize mod behaviors
- Remove unnecessary debug print and simplify logic in `SilentAWPItem`'s `onWeaponSound` method
- Add reminder message in `en.yml` for dead players indicating they cannot be heard
- Add `DEAD_MUTE_REMINDER` message in `CS2Msgs.cs` to notify muted dead players
- Change dictionary key types from `IOnlinePlayer` to `string` in `ListCommand` for consistency, using `executor.Id` as the key.
- Update method calls in `ListCommand` to align with new dictionary key types.
- Update `silentShots` dictionary in `SilentAWPItem` to use player IDs (`string`) instead of `IOnlinePlayer` objects.
- Modify `OnPurchase` method in `SilentAWPItem` to handle weapon management asynchronously.
- Add server logging for debug messages in `SilentAWPItem`.
- Update the traitor chat format label to pluralize "TRAITOR" to "TRAITORS" in `en.yml`
- Replace `ChatHandler` with `TraitorChatHandler` in `CS2ServiceCollection.cs` to enhance focus on traitor-specific chat functionality
- Rename `ChatHandler` to `TraitorChatHandler` and update to manage traitor roles in `ChatHandler.cs`
- Ensure message processing occurs only if the game is in progress or finished in `ChatHandler.cs`
- Modify command message handling in `ChatHandler.cs` to strip backslashes from messages
- Add new message format function for traitor chat in CS2Msgs.cs
- Update ChatHandler.cs with new API modules and role-checking logic
- Modify onSay method in ChatHandler.cs to support traitor message formatting
- Add new chat format specification for traitors in en.yml
```
Enhance logging and visibility management in game commands and role handling
- Update `LogsCommand.cs` to integrate messaging and localization with `IMessenger` and `IMsgLocalizer`, and conditionally adjust player visibility using `IIconManager`.
- Add new localized message in `GameMsgs.cs` for player's log viewing activity, using player's name.
- Overload `SetVisiblePlayers` in `IIconManager.cs` to increase flexibility by accepting an `IOnlinePlayer` object.
- Implement `SetVisiblePlayers` in `RoleIconsHandler.cs` to improve player visibility and role management, and integrate rules for specific roles like `DetectiveRole` and `TraitorRole`.
- Modify `en.yml` to include a log message for when a player views logs alive.
```
```
- Improve player respawn logic in RoundTimerListener for better team handling and secure timer disposal.
- Enhance initial setup and end game logic in RoundBasedGame with robust role assignment, game state checks, and localization support.
- Increase default Healthshot item price in HealthshotConfig.
```
- Change dependency injection lifetime for services implementing `TExtension` from scoped to singleton in `ServiceCollectionExtensions.cs`
- Register `ITerrorModule` as a transient service in `ServiceCollectionExtensions.cs`
- Replace `Dictionary<IPlayer, int>` with `ConcurrentDictionary<string, int>` in `KarmaStorage.cs` for thread-safe operations.
- Introduce caching logic with semaphore for serialized writes in `KarmaStorage.cs`.
- Add periodic data flushing mechanism to the database with improved error handling in `KarmaStorage.cs`.
- Seal `KarmaStorage` class to prevent inheritance and ensure configuration loading precedes database operations.
- Improve error handling with logging and ensure reliable database connections in `KarmaStorage.cs`.
- Enhance thread safety and performance in `FlushAsync` and `Write` methods, improving idempotency and preventing race conditions.
- Increase robustness with null checks, additional validations, and modular code separation in `KarmaStorage.cs`.
```
- Introduce `IItemSorter` interface across multiple components to enhance item sorting capabilities in shop commands.
- Enhance `ListCommand` with caching mechanisms, improved sorting logic, and item formatting adjustments for better performance and usability.
- Implement `PlayerPingShopAlias` for enhanced player interaction, including command listeners and shop command processing tied to player actions.
- Set default price for Silent AWP in `SilentAWPConfig` to standardize item pricing.
- Conduct significant cleanup and optimization in `PoisonShotsListener` to improve gameplay experience and reduce unnecessary debug messages.
```
```
- Increase delay time in KarmaListenerTests to ensure proper karma update processing.
- Change `Event` class from abstract to concrete, and modify `Id` property implementation.
- Adjust CS2GameConfig timing settings for more balanced gameplay.
- Enhance PoisonShotsListener functionality with player health parameters and item removal.
- Make SimpleLogger methods virtual to improve subclass flexibility.
- Implement new logging capabilities in CS2Logger with Serilog integration.
- Enhance GiveItemCommand with new event handling for item purchases.
- Update DeagleTests for accurate simulation of weapon damage.
- Modify PlayerDamagedEvent structure for more precise damage calculations.
- Improve DamageStation logic to align with new damage handling.
- Refactor DamageCanceler for better code organization and cross-platform support.
```
- Change database connection string constant name for consistency in `CS2KarmaConfig.cs`
- Extend description of minimum karma for clarification of its impact
- Refine descriptions of player actions related to karma for improved clarity
- Rename karma-related constants to generic terms for simplicity
- Introduce configurable warning window for low karma to prevent repeat warnings
- Add configurable karma delta values for in-game actions
- Update Load method to include new karma-related configurations
```
- Add detailed XML documentation comments to `KarmaConfig.cs` to improve code understanding and maintainability.
- Remove the default value of `MinKarma` in `KarmaConfig.cs`, making it a mandatory setting.
- Introduce new properties in `KarmaConfig.cs` for handling different karma scenarios in player interactions.
- Add a dependency on `TTT.API.Storage` in `KarmaListener.cs` for loading configurations.
- Replace hardcoded karma values in `KarmaListener.cs` with configurable options, enhancing flexibility and adaptability.
```
- Update `DeagleDamageListener.cs` to enhance type safety and address edge cases related to item removal and friendly fire logic.
- Improve the purchase validation logic in `Stickers.cs` using a type-specific item check.
- Refactor `Shop.cs` to use generic type parameters in item removal methods, enhancing type safety.
- Simplify `IShop.cs` by removing default implementations and focusing on type-based item checks.
- Enhance overall code clarity and maintainability with type-specific method improvements.
```
- Introduce validation to `EventBus` listener methods to enforce `void` return type and enhance exception messaging for parameter constraints.
- Refactor `RoleAssignCreditor` to simplify execution path by making `OnRoleAssign` synchronous and handling asynchronous operations with `Task.Run`.
```
- Remove asynchronous calls and convert to synchronous dispatch in multiple files, improving performance and reducing complexity.
- Refactor `RoundBasedGame.cs` to enhance game state management, implement team victory determination, and ensure resource disposal.
- Update `IEventBus.cs` and `EventBus.cs` to change the dispatch method to synchronous operation, altering method return types.
- Modify karma-related tests and storage in `KarmaListenerTests.cs`, `KarmaStorage.cs`, and `MemoryKarmaStorage.cs` to reflect synchronization changes, ensuring correct behavior.
- Refactor `EventModifiedMessenger.cs` to improve message handling by switching to synchronous calls.
- Implement new karma penalty logic in `KarmaListener.cs` for certain actions, adjusting the handling and calculations of karma.
- Implement Silent AWP item functionality with
`SilentAWPServiceCollection` and `SilentAWPItem` class for `TraitorRole`
- Add Silent AWP shop item and related localized texts in `en.yml`
- Define message constants for Silent AWP in `SilentAWPMsgs.cs` for
internationalization
- Modify `GiveItemCommand.cs` to incorporate `OnPurchase` logic for item
purchases
- Manage player validity in `CS2AliveSpoofer.cs` by removing players
with null handles
- Enhance player detail replies in `IndexCommand.cs`
- Introduce messaging functionality in `BaseItem.cs` and use via
`Messenger` field
- Add Silent AWP service integration in `ShopServiceCollection.cs` and
`Traitor` config in `SilentAWPConfig.cs`
- Implement Silent AWP item functionality with `SilentAWPServiceCollection` and `SilentAWPItem` class for `TraitorRole`
- Add Silent AWP shop item and related localized texts in `en.yml`
- Define message constants for Silent AWP in `SilentAWPMsgs.cs` for internationalization
- Modify `GiveItemCommand.cs` to incorporate `OnPurchase` logic for item purchases
- Manage player validity in `CS2AliveSpoofer.cs` by removing players with null handles
- Enhance player detail replies in `IndexCommand.cs`
- Introduce messaging functionality in `BaseItem.cs` and use via `Messenger` field
- Add Silent AWP service integration in `ShopServiceCollection.cs` and `Traitor` config in `SilentAWPConfig.cs`
- Add new configuration fields in CompassConfig.cs to customize compass FOV and length
- Implement maximum range check and refactor angle calculations in CompassItem.cs
- Update distance descriptions in CompassItem.cs for thematic clarity
- Enhance code readability and maintainability in CompassItem.cs through refactoring
- Enhance `CompassItem` in `CompassItem.cs` with refined enemy detection, directional compass, and improved documentation.
- Add `TextCompass` utility class in `TextCompass.cs` featuring static method for compass line generation with direction normalization and cardinal placements.
```
Introduce Compass Item for Traitor Role
- Add a new configuration file `CompassConfig.cs` for the traitor-exclusive compass with default settings, including a price of 70 and a maximum range of 10,000.
- Integrate the `Compass` service into the shop by updating `ShopServiceCollection.cs` to support the new item.
- Extend `BaseItem.cs` with additional dependencies for game management, enhancing item functionality.
- Update localization in `en.yml` to include the "Player Compass" item, ensuring descriptions and structure accommodate the new addition.
- Create `CompassMsgs.cs` to manage compass-related messages with `SHOP_ITEM_COMPASS` and `SHOP_ITEM_COMPASS_DESC` for localization.
- Enhance vector handling in `VectorExtensions.cs` by adding nullability checks and support for nullable objects.
- Implement `CompassItem.cs` to support traitor-specific gameplay features like real-time radar updates and enemy tracking.
```
```
- Update PlayerKillListener to modify balance adjustments and simplify kill log messages.
- Add TeamChangeHandler to CS2ServiceCollection for managing team changes.
- Introduce TaseRewarder to ShopServiceCollection, enabling taser damage event handling.
- Make RoleAssignCreditor asynchronous and integrate karma-based credit adjustments.
- Update SpectatorRole assignment logic with new IRoleAssigner dependency.
- Make player parameter nullable in KarmaConfig's MaxKarma method.
- Refactor BuyListener to remove server chat notifications and streamline armor setting.
```
- Update `KarmaStorage.cs` to increase karma update frequency and integrate Counter Strike features.
- Enhance `CS2ServiceCollection.cs` with new `BuyListener` behavior for handling purchase activities.
- Add `GetArmor` method in `PlayerExtensions.cs` to retrieve player armor and helmet status.
- Implement `BuyListener.cs` to manage player purchases, logging, and inventory adjustments.
- Simplify `PlayerDamagedEvent` instantiation by removing an unused parameter in `DeagleTests.cs` and `PlayerActionsTest.cs`.
- Update `HpLeft` calculation in `PlayerDamagedEvent.cs` to use a new formula for determining remaining health, improving damage calculation accuracy.
- Enhance debugging in `PoisonShotsListener.cs` by adding debug logs and null checks for more reliable damage event tracking.
- Refactor tests in `DeagleTests.cs` to verify unique item kill behavior after the first use.
- Simplify `PlayerDamagedEvent` constructor and update health calculations for clarity and consistency.
- Add context to damage events in `DamageStation.cs` by including weapon property and streamline damage calculation logic.
- Enhance `PoisonShotsListener.cs` with localization support for weapon names, improve poison effect handling, and cleanup code for better maintainability.
- Refactor `OneHitKnifeListener` to set victim's health directly to zero for simplified one-hit kill logic.
- Add `PlayerDamagedEvent` in `DamageStation` to allow external interference in damage calculation and consider event modifications.
- Streamline `PlayerDamagedEvent` class by refactoring damage calculation logic and removing unnecessary properties and fields.
- Update `PoisonShotsListener` to include dependency on `IEventBus`, enhance poison effects, and dispatch relevant events such as `PlayerDamagedEvent` and `PlayerDeathEvent`.
- Remove `DamageEventTest` class, indicating a refactor or change in damage event management/testing strategy.
```
- Update DamageStation.cs to enhance event handling and player interaction:
- Integrate `IEventBus` for event dispatching.
- Improve `onInterval` to provide health boosts, handle player deaths, and ensure sound commands are issued post-death event.
- Modify RoundBasedGame.cs to increase class extensibility:
- Update variable access levels and rename to maintain consistency.
- Adjust OneHitKnife.cs to change service registration approach and extend functionality.
- Enhance DamageCanceler.cs with OS-specific cleanup logic and streamlined damage handling.
- Update OneHitKnifeListener.cs for improved damage calculation and to incorporate JetBrains annotations.
- Simplify station tracking and ownership in StationItem.cs and StationInfo.cs.
- Introduce EmitSoundCommand.cs to expand command module functionality.
```
```
Refactor and optimize multiple components
- Remove obsolete attributes and unused dependencies in `IEventBus.cs`, `KarmaListener.cs`, `KarmaSyncer.cs`, and `ICommandManager.cs` to clean up code and improve maintainability.
- Enhance asynchronous event handling in `EventModifiedMessenger.cs` by integrating `await` for dispatch operations, improving consistency in message processing.
- Refine `CombatHandler.cs` logic with improved null-checking and better statistics handling, enhancing robustness during player events.
- Enable caching by default in `KarmaStorage.cs`, and update karmas asynchronously to boost performance.
- Simplify `Game/RoundBasedGame.cs` by removing unnecessary dependencies and improving state management and role assignment logic, enhancing game flow control.
```
- Add new shop item "One-Hit Knife" with description in `en.yml`
- Introduce `OneHitKnifeMsgs` class for handling localization messages related to "One-Hit Knife" item
- Implement `OneHitKnifeListener` class to handle game events for the "One-Hit Knife" item functionality
- Create `OneHitKnife` class, extending the item functionality for the `TraitorRole` with service integration
- Update `ShopServiceCollection.cs` to include "One-Hit Knife" in the item collection and shop services
- Add `OneHitKnifeConfig.cs` to define configuration settings including price and friendly fire options for the "One Hit Knife" feature
Implement enhanced Karma system functionalities and refactorings
- Update `KarmaConfig.cs` to make properties non-virtual and add immutability with "init" accessors, and introduce new configuration properties to support additional karma functionalities.
- Add `KarmaSyncer` behavior to `CS2ServiceCollection.cs` for managing Karma-related synchronization tasks.
- Enhance `SpectatorRole.cs` with an `OnAssign` method to facilitate role assignments and automatically convert players to spectators when needed.
- Filter player assignments in `RoundBasedGame.cs` to include only specific roles and refine non-traitor calculations to only consider assigned players.
- Introduce a comprehensive `KarmaSyncer` class in `Listeners/KarmaSyncer.cs` for managing Karma synchronization, including event handling for Karma updates and safe operations checks.
- Refactor `CS2KarmaConfig.cs` by simplifying structure, adding descriptive updates, and altering command usages related to Karma configurations.
- Remove `KarmaSyncer.cs` from `GameHandlers` to accommodate code restructuring and potential modality changes for player data management.
- Refactor and expand methods in `KarmaMsgs.cs` to adopt simpler expression-bodied syntax and create structured warning messages.
- Introduce dependency checks and reward temporal conditions in `PeriodicRewarder.cs` to ensure balanced issuance aligns with game progression.
- Enhance `KarmaBanner.cs` with new dependencies, tracking mechanisms, and advanced event handling for role assignments and karma-related notifications.
- Improve `KarmaListener.cs` by changing class inheritance, adding debugging capabilities, and switching to batch processing for Karma updates.
- Extend language file `en.yml` with additional warning messages targeting users with critically low Karma levels.
```
- Update TTT/Plugin/Plugin.csproj to target .NET 8.0 and add Microsoft.Data.Sqlite reference
- Enhance TTT/CS2/CS2ServiceCollection.cs with new KarmaBanner mod behavior
- Add TTT/Karma/lang/KarmaMsgs.cs for Karma language messages handling
- Introduce configuration command in TTT/CS2/Configs/CS2KarmaConfig.cs for low karma actions
- Add old karma value property in TTT/Karma/Events/KarmaUpdateEvent.cs
- Implement KarmaBanner class in TTT/CS2/Listeners/KarmaBanner.cs for monitoring karma updates
- Develop new KarmaCommand class in TTT/Karma/KarmaCommand.cs for retrieving karma values
- Enhance TTT/Karma/KarmaStorage.cs with cache support and better SQL handling
- Introduce NameDisplayer OS check in TTT/CS2/GameHandlers/NameDisplayer.cs
- Add CommandUponLowKarma configuration in TTT/Karma/KarmaConfig.cs
- Register KarmaCommand in TTT/Karma/KarmaServiceCollection.cs
- Create English language file TTT/Karma/lang/en.yml for Karma messages
```
```
Implement Karma Configuration and Improve Event Handling
- Add `IStorage<KarmaConfig>` service registration in `CS2ServiceCollection`, enhancing support for karma configurations.
- Make `KarmaUpdateEvent` dispatch asynchronous in `KarmaStorage`, and improve error checking for database connections.
- Introduce `CS2KarmaConfig`, a new configuration class with settings for managing karma, including connection strings and value limits.
- Convert karma properties and methods to virtual in `KarmaConfig`, allowing for potential overrides in derived classes.
```
- Update `Karma.csproj` to include Microsoft.Data.Sqlite and SQLite packages.
- Refactor `KarmaSyncer.cs` by removing the unused `IPlayerFinder` initialization, adding the `UsedImplicitly` attribute, and streamlining player validation logic.
- Change database backend in `KarmaStorage.cs` from MySQL to SQLite.
- Define a default value for the `DbString` property in `KarmaConfig.cs`.
- Adjust service configuration in `KarmaServiceCollection.cs` by modifying `IKarmaService` registration and introducing `KarmaListener`.
**Summary**
This PR delivers a substantial TTT update that expands the shop, refines
gameplay flow, and improves player feedback. It adds multiple new items
with CS2-specific behavior, introduces a periodic reward system,
implements configurable sounds and full localization, and cleans up
internal command and event handling.
**Scope**
* 56 commits
* 117 files changed
* +2,518 −301
**Why**
* Broaden traitor and detective toolkits to increase strategic variety.
* Make messaging consistent and translatable.
* Reduce friction in command handling and event wiring.
* Close a set of outstanding issues.
**Highlights**
New items and features
* C4 item with CS2 configuration (resolves#79).
* M4A1 item and storage support (resolves#71).
* Traitor gloves item (resolves#81).
* Camouflage item with async fix.
* Poison shots with enhanced effects and feedback (resolves#75).
* Poison smoke (resolves#74).
* Armor item (resolves#67).
* Taser item (resolves#69).
* Healthshot and role reveal (resolves#98).
* Body Paint item and service registration with default config.
* Periodic reward system for players (resolves#97).
* Credits granted for kills and identifications with tuned penalties.
Player experience
* Configurable sound support.
* Full localization for commands and messages.
* Increased HUD font size and adjusted text positioning.
* Shop prefix and HUD tweaks. Skull hidden in HUD.
Core refactors
* Command execution support on main thread. Command structure
consolidated and clarified.
* Round timer and C4 event handling refactored. Old C4 listener logic
removed.
* Event namespaces and item handling reorganized.
* Name formatting utilities updated.
Stability and fixes
* Shop events now reliably fire.
* Role assignment logging corrected.
* Credits no longer overridden by balance clearer.
* Various cleanup, reformatting, and unused line removals.
Administrative
* Licenses updated for new dependencies and content.
* Multiple merges and resyncs with main to keep branch current.
**Configuration changes**
* New item configs: C4, M4A1, Gloves, Camouflage, Poison Shots, Poison
Smoke, Armor, Taser, Healthshot, Body Paint.
* Added localization keys for new messages, commands, and out-of-ammo
lines.
* Sound configuration is now user configurable.
* Station role behavior updated to support Poison Smoke changes.
**API and plugin touchpoints**
* Storage and plugin modules extended for M4A1Config.
* PlayerKillListener added and registered.
* BodyPaint service registered and applied by default where configured.
**Testing**
* Unit and runtime checks for:
* Shop purchase flows for each new item.
* Command execution on main thread and permission checks.
* Credits earn and clear at round transitions.
* Poison effects timing, damage application, particles, and feedback.
* HUD text size and positions across common resolutions.
* Localization fallback behavior for missing keys.
* Manual CS2 tests for C4 behavior and item equips.
* Verified shop events fire for buy, equip, and use.
```
Enhance poison effect management and resource disposal
- Improve resource management in `PoisonSmokeListener.cs` by ensuring proper disposal of poison smoke timers, clearing the timer list upon disposal, and ensuring termination of damage effects according to configuration settings. Remove unnecessary debug output for cleaner logs.
- Refactor `PoisonShotsListener.cs` to reset poison shot data and improve disposal logic. Enhance poison shot usage management and streamline game mechanics related to poison damage and effects, ensuring a more efficient game experience.
```
```
- Modify `DamageStation.cs` to check `_Config.TotalHealthGiven` before health comparison and improve `onInterval` method for better clarity and robustness.
- Enhance `ShopServiceCollection.cs` by adding `PeriodicRewarder`, introducing periodic rewards functionality.
- Update `StationConfig.cs` by setting `TotalHealthGiven` to 0 and increasing `StationHealth` from 100 to 1000, enhancing station durability.
- Implement `PeriodicRewarder.cs`, a new class for issuing periodic rewards to players using dependency injection and a timed approach.
- Introduce new properties `CreditRewardInterval` and `IntervalRewardAmount` in `ShopConfig.cs` to define frequency and amount of periodic rewards, supporting a new credit accumulation strategy.
```
Enhance Game Messaging and Item Functionality
- Update `GameMsgs.cs` to add new messages for role reveal on death and traitor reveal, ensuring consistency with message factory use.
- Add "Health Shot" item to `en.yml`, enhancing shop content with healing capabilities.
- Refine `RoundBasedGame.cs` to improve game state transitions, event handling, and winning team determination.
- Create `HealthshotConfig.cs` for configuring "Health Shot" item specifics, including pricing and weapon identifiers.
- Modify `BuyCommand.cs` to implement main thread execution and enhance item search logic for partial matches.
- Introduce `TraitorBuddyInformer` class to inform traitors of their allies during rounds.
- Expand `OutOfRoundCanceler.cs` logic to allow damage events in finished game states.
- Add `PlayerDeathInformer` class for revealing player killers, enhancing game event transparency.
- Introduce and register `HealthshotItem` within the shop, defining purchase logic and localized messaging.
- Remove redundant debug information from `PoisonSmokeListener.cs`, optimizing poison effect logic.
Introduce Poison Smoke Item and Enhance Role Configurations
- Create `CS2PoisonSmokeConfig.cs` to configure the new Poison Smoke item, defining parameters like price, damage, and sound effect.
- Update `CS2ServiceCollection.cs` to handle poison smoke configuration using new implementations.
- Add `PoisonSmokeMsgs.cs` to define messages for the Poison Smoke item, facilitating localization.
- Enhance `DamageStation.cs` with role management by excluding `TraitorRole` from damage and adding sound feedback.
- Implement `PoisonSmokeListener.cs` to manage poison smoke events with dependencies and scheduled effects.
- Refactor `StationItem.cs` to introduce a generic role parameter, increasing flexibility.
- Update `HealthStation.cs` to specify the detective role with the generic `StationItem`.
- Introduce new configuration files for the traitor's poison smoke in `Traitor/PoisonSmokeConfig.cs`, detailing item properties.
- Simplify `ListCommand.cs` by adjusting item formatting logic for consistency.
- Update `PoisonShotsListener.cs` to handle refined poison configurations.
- Create `PoisonSmokeItem.cs` to define and manage the Poison Smoke item with dependency injection and role restrictions.
- Increase default font size in TextSetting.cs for improved visibility
- Adjust world units per pixel in TextSetting.cs for better text scaling
- Modify text hat positioning in TextSpawner.cs relative to player’s rotation
- Enhance `BuyCommand` with usage guidance and unified query logic
- Improve `ListCommand` with async task handling, dependency injections, and enhanced filtering and sorting based on player roles and game state
- Introduce a shorthand alias for `ShopCommand` balance and add usage property for better command guidance
- Upgrade `RoleIconsHandler` event handling, visibility management, and hot-reload logic
- Implement standard pricing and new properties in Traitor and Detective configuration files; adjust color mapping for health display
- Improve player equality handling by implementing `IEquatable` in `CS2Player` and `IPlayer` classes
- Integrate `CounterStrikeSharp.API` in `BuyCommand.cs` for enhanced shop functionality.
- Refactor health color calculation in `HealthStationConfig.cs` to increase intensity as health increases.
- Revamp `CS2CommandManager.cs` with improved synchronous command processing and robust exception handling.
- Add `MustBeOnMainThread` property in `ICommand.cs` to manage command execution context.
- Update `ShopCommand.cs` to refine execution flow and description formatting.
- Revise logical comment and color calculation in `DamageStationConfig.cs` for correctness.
- Enhance clarity in `PlayerKillListener.cs` by refining event handling messages.
```
- Update `BalanceCommand.cs` to include message localization and update reply format
- Refactor `Shop.cs` logging methods and simplify item handling
- Enhance `ShopMsgs.cs` with message prefix logic and credit prefix determination
- Update `en.yml` with consistent shop prefix and add new balance display message
```
```
- Modify RoundShopClearer to reset balances and items only when the game state is "FINISHED"
- Add debug logging and correct logic in PlayerKillListener to improve event handling
- Comment out obsolete Roles property in TestPlayer
- Enhance debug logging and initialize item lists correctly in Shop
- Update BalanceClearTest with role-related imports and new test for role assignments
```
```
- Integrate Taser functionality into the Shop module by updating the `ShopServiceCollection.cs` to include the Taser item in the shop services.
- Add a new `TaserConfig` file to define default configurations for the taser item in `TTT/ShopAPI/Configs`.
- Update `en.yml` to include localization for the new Taser item with its description.
- Introduce `CS2TaserConfig` for advanced configuration management of taser items within the CS2 module, and integrate it into `CS2ServiceCollection.cs`.
- Implement the `TaserItem` class in `TTT/Shop/Items/Taser` along with the supporting `TaserMsgs` class for handling messages related to the taser in the shop.
```
```plaintext
Add comprehensive armor functionalities and improvements
- Introduce `ArmorConfig` class to configure shop items with default armor and helmet settings.
- Create `ArmorMsgs` class to handle message creation for armor-related items in the game.
- Enhance `PlayerExtensions` with new `SetArmor` method and improve `SetColor` handling and state management.
- Register armor services within `ShopServiceCollection` to integrate armor features into the shop framework.
- Refactor `RoundTimerListener` for improved readability and consistency in round-ending logic.
- Include "Armor with Helmet" in the language file with its description for better item localization.
- Develop `ArmorItem` class to manage armor items, incorporating configuration, purchase logic, and localization.
```
- Enhance `PoisonShotsListener.cs` by adding utility functions, refining weapon event handling, and improving player feedback with configurable effects and sounds.
- Update `PoisonShotMsgs.cs` to include personalized messages for poison hit events by leveraging the player's name.
- Refactor `GiveItemCommand.cs` for improved targeting and async item delivery, adding clearer command usage instructions.
- Add a new localization message in `en.yml` for poison shot hit feedback.
- Modify `PoisonShotsConfig.cs` to adjust damage interval and introduce configurable sound and color for poison effects.
- Remove event handler for item purchases in `BodyPaintListener` and enhance logic for body identification and use tracking
- Integrate `IPluginModule` interface in `PoisonShotsListener` and refactor poison shot handling to improve inventory management and dependency injection
- Update `PoisonShotsItem` to use specific configuration and storage mechanisms
- Register PoisonShots service in `ShopServiceCollection` to expand shop functionalities
```
- Add new configuration for poison shots in `Traitor/PoisonShotsConfig.cs` to manage properties like price, damage, and total shots.
- Implement `PoisonShotsListener` in the game to handle item usage, apply poison effects, and ensure resource management.
- Create `PoisonShotsItem` class to introduce a new item restricted to the Traitor role, integrating it with shop functionalities.
- Update `lang/en.yml` to include a new shop item description for "Poison Shots".
- Define message constants for poison shots in `PoisonShotMsgs.cs` to facilitate localization and UI display.
```
```
- Add descriptions and labels for "Body Paint" in English language file
- Update Detective's DNA Scanner and Sticker configurations for improved namespace specificity
- Implement BodyPaintMsgs class for handling body paint item messages
- Introduce BodyPaintListener for handling body paint purchase and usage events
- Restructure PlayerEvent files to align with new ShopAPI directory and namespace
- Add BodyPaintConfig for shop item configuration with default settings
```
- Adjust handling of round win conditions in `RoundTimerListener.cs` by adding commands to ignore and re-enable conditions during round end process; improve round end subscription logic and add `Dispose` method to clean up resources.
- Remove addition of `C4Listener` from the service collection in `C4ShopItem.cs`.
- Delete `C4Listener.cs`, removing event handlers for bomb-related events.
```
- Refactor `CS2Player.cs` to improve name formatting with `CreatePaddedName`, eliminating redundant methods and enhancing alignment.
- Integrate `C4Listener` into `C4ShopItem.cs` for improved C4 item handling in the shop.
- Comment out the `RoundEnd_GameEndHandler` registration in `CS2ServiceCollection.cs` to potentially defer its functional roles.
- Refactor `EndRound` method in `RoundUtil.cs` to utilize `VirtualFunctions.TerminateRoundFunc`, comment out obsolete implementations.
- Update `RoundTimerListener.cs` to incorporate `System.Reactive.Concurrency`, optimize round timing logic, and introduce resource disposal to prevent leaks.
- Implement `C4Listener.cs` to handle bomb events and announce activities, enhancing player communication.
- Simplify `StationItem.cs` by removing unused imports and redundant debug announcements while maintaining core functionality.
- Adjust `RoundBasedGame.cs` to ensure the game state is accurately set to `IN_PROGRESS` post player preparation, without changing game flow logic.
```
- Add support for M4A1Config storage in CS2ServiceCollection by including a new `AddModBehavior` for `IStorage<M4A1Config>`
- Implement a new configuration class for the M4A1 shop item in CS2M4A1Config with storage and plugin module interfaces
- Define static configuration variables with validators for price, clear slots, and associated weapons in CS2M4A1Config
- Implement plugin initialization methods and register fake config variables in CS2M4A1Config
- Load configuration in CS2M4A1Config, parsing clear slots and weapons from strings into arrays, with nullable type inference and asynchronous processing
```
- Refactor balance deduction in Shop.cs to use `AddBalance` method for improved consistency and added player notification for successful purchases.
- Enhance BuyCommand.cs by updating Execute method to return Task.FromResult, adding a health check, and modifying item search logic for better accuracy.
- Update PlayerKillListener.cs to extend from BaseListener, integrate ShopAPI, and add methods for handling on-kill and body identification events with balance adjustments.
- Use JetBrains.Annotations in RoleAssignCreditor.cs for potential external or reflective method use, adding UsedImplicitly attribute for OnRoleAssign method.
- Extend ShopMsgs.cs and en.yml with new purchase success messages including item names, improving player feedback.
```
- Add `CamouflageItem` class for managing camouflage items in the game
- Implement `AddCamoServices` in service collection extension for mod behavior
- Introduce configuration loading for camouflage settings with `IStorage<CamoConfig>`
- Provide localization for item name and description
- Implement purchasing logic: visibility settings and ownership check in `CamouflageItem`
- Add "Camouflage" item and description to the language file
- Expand shop services to include camouflage features via `AddCamoServices`
- Establish `CamoConfig` in `ShopAPI` with default pricing and visibility properties
- Create `CamoMsgs` class for managing camouflage item messages
- Add new "Gloves" item to traitor shop with localization and descriptions
- Allow modification of `Killer` property in `IBody.cs` for enhanced gameplay flexibility
- Reorganize configuration files under relevant directories for better clarity (e.g., HealthStationConfig, DnaScannerConfig)
- Introduce `GlovesListener` class to handle event-driven interactions for the "Gloves" item
- Implement traitor-specific configurations and services for items like C4 and gloves, including default pricing and usage limits
```
Add M4A1 Item to Shop with Configuration and Localization
- Add TTT/Shop/Items/M4A1/M4A1Msgs.cs to manage localized messages for the M4A1 item.
- Update TTT/Shop/lang/en.yml with a new shop item "M4A1 Rifle and USP-S" and its description.
- Modify TTT/Shop/ShopServiceCollection.cs to include M4A1 services and adjust service ordering for better organization.
- Introduce TTT/ShopAPI/Configs/M4A1Config.cs for setting up the M4A1 item configuration, including price and weapon slots.
- Create TTT/Shop/Items/M4A1/M4A1ShopItem.cs to define the M4A1 shop item with purchase and inventory management logic.
```
- Add C4Msgs class for localization of C4 shop item in the Traitor category
- Introduce C4ShopItem class with methods for purchase, limitations, and role restriction handling
- Update ShopServiceCollection to include C4 service for Traitor role
- Introduce C4Config class for configuration of C4 shop items with various properties
- Add English localization entry for "C4 Explosive" shop item with description
- Add configuration for `UseSound` property in `DamageStationConfig` and `HealthStationConfig`
- Implement localization support in `HealthStation.cs` by replacing hardcoded strings with localized messages
- Introduce `UseSound` abstract property in `StationConfig`
- Update localization files with new shop items and descriptions in `lang/en.yml`
- Create `StationMsgs.cs` to manage station-related item messages via a factory pattern
- Enhance `DamageStation.cs` for internationalization and configurable sound settings
- Annotate unused or implicitly used methods in `StickerListener.cs` with `[UsedImplicitly]`
```
- Integrate ShopAPI into various components including PlayerPurchaseItemEvent, DnaScanner, and multiple stations for improved shop functionalities.
- Introduce new HealthStationConfig and DamageStationConfig for configuring health and damage-related station items.
- Update CS2 project to target .NET 8.0 and enable advanced C# features, while removing outdated folder references for streamlined project structure.
- Correct namespace declarations across multiple files, enhancing consistency and organizational clarity within the codebase.
- Add new or updated commands and extensions, such as SetHealthCommand, to improve player health management and interaction.
- Enhance localization features by importing TTT.Game.lang across various roles, commands, and logging implementations.
- Incorporate new logic in DNA scanning and station interactions, including damage dealing and healing over time based on player proximity.
```
```
- Integrate ShopAPI into various components including PlayerPurchaseItemEvent, DnaScanner, and multiple stations for improved shop functionalities.
- Introduce new HealthStationConfig and DamageStationConfig for configuring health and damage-related station items.
- Update CS2 project to target .NET 8.0 and enable advanced C# features, while removing outdated folder references for streamlined project structure.
- Correct namespace declarations across multiple files, enhancing consistency and organizational clarity within the codebase.
- Add new or updated commands and extensions, such as SetHealthCommand, to improve player health management and interaction.
- Enhance localization features by importing TTT.Game.lang across various roles, commands, and logging implementations.
- Incorporate new logic in DNA scanning and station interactions, including damage dealing and healing over time based on player proximity.
```
- Add a new message for item not found in `en.yml` to enhance user error feedback
- Clean up `GiveItemCommand.cs` by importing `TTT.Locale` and removing debug messages
- Improve `CS2AliveSpoofer.cs` readability with better conditional logic and early return handling
- Enhance `BuyCommand.cs` by removing redundant searches and utilizing localization for consistency
- Change `DecayTime` in `DnaScannerConfig.cs` from 3 minutes to 10 seconds for faster testing
- Clean up `ShopAPI.csproj` by removing redundant project references.
- Remove the DNA Scanner item and its description from the English language file in `Shop`.
- Streamline `DnaScanner.cs` by eliminating an unnecessary using directive.
- Enhance `DnaListener.cs` to improve messaging logic with role information and implement new message templating for DNA scans.
- Refactor `DnaMsgs.cs` by adjusting namespaces and adding message properties for enhanced DNA scan functionalities.
- Update `CS2.csproj` by removing a duplicate project reference.
- Expand `en.yml` in `CS2` with translations for DNA scanner items and messages for DNA scanning, including specific scenarios involving suicide.
- Extend functionality in `DnaListener.cs` by adding dependency injection and enhancing the `OnPropPickup` event handler with player and body checks.
- Add `TimeOfDeath` property to `CS2Body.cs` for improved tracking of body creation time.
- Introduce `DnaScannerServiceCollection` in `DnaScanner.cs` for better service management and mod behavior registration.
- Extend `IBody` interface with `TimeOfDeath` to track deceased player identification time.
- Update `ShopServiceCollection.cs` to integrate `AddDnaScannerServices`, enhancing shop capabilities with DNA scanner features.
```
- Rename and reorganize directories for DNA-related items to new path under "CS2/Items/DNA"
- Relocate RoleRestrictedItem.cs while maintaining its original functionality
- Move and update DnaListener.cs with a low-priority event handler and add an execution order comment
- Rename BaseItem.cs file path as part of project structure reorganization
- Update CS2.csproj by adding "Items\" folder and correcting duplicate project reference
```
```
- Rename property `Name` to `Id` across various commands and classes for consistency and clarity, affecting files like `Test/SetRoleCommand.cs`, `GameHandlers/KarmaSyncer.cs`, and `Command/Test/TestCommand.cs`.
- Add new interface `IIconManager` to manage player visibility with methods for handling up to 64 players using a bitmask in `API/Player/IIconManager.cs`.
- Introduce `ShowIconsCommand` and `IndexCommand` classes to enhance game command functionality, leveraging the new `IIconManager` for icon management.
- Implement a new shop item "Stickers" with associated classes `Stickers.cs`, `StickerListener.cs`, and `StickerMsgs.cs`, providing role-revealing capabilities for detective players.
- Refactor shop item and command structures to use a new `BaseItem` abstract class, enhancing code organization and inheritance patterns.
- Update logging in `Plugin/TTT.cs` to use `Id` instead of `Name` for module identification, standardizing log outputs.
- Adjust visibility and color duration settings in `Listeners/ScreenColorApplier.cs` for improved gameplay feedback.
- Refactor service registration and command handling to remove redundancies and improve icon manager integrations in files like `CS2ServiceCollection.cs` and `Command/Test/ScreenColorCommand.cs`.
```
- Add new localized messages for shop interactions in `TTT/Shop/lang/en.yml`
- Implement `PurchaseResultExtensions` in `TTT/Shop/Shop/PurchaseResult.cs` to translate purchase outcomes to user-friendly messages
- Streamline and optimize purchase process in `TTT/Shop/Commands/BuyCommand.cs`
- Localize error messages and improve test setup in `TTT/Test/Shop/Commands/BuyTest.cs`
- Update `TTT/Shop/Shop.cs` to use localized messages and enhance error handling logic
```
- Introduce a new configuration variable in `CS2OneShotDeagleConfig.cs` to determine if the shooter should be killed upon friendly fire, and update the `Load` method accordingly.
- Add a static message `SHOP_ITEM_DEAGLE_HIT_FF` in `DeagleMsgs.cs` for handling new Deagle functionality messages.
- Rename "One-Hit Deagle" to "One-Hit Revolver" in `en.yml` and update description and messages for consistency.
- Refactor friendly fire logic in `DeagleDamageListener.cs` by integrating nested conditions and simplifying weapon verification logic for damage events.
- Add `KillShooterOnFF` configuration option in `OneShotDeagle.cs` to manage shooter consequences on friendly fire.
```
<p dir="auto">This pull request appears to be a development branch merge
that implements several enhancements and fixes to the TTT (Trouble in
Terrorist Town) game system. The changes focus on improving weapon
handling, adding new test coverage, and enhancing player visual
effects.</p>
<ul dir="auto">
<li>Refactors weapon API by renaming <code class="notranslate">Id</code>
property to <code class="notranslate">WeaponId</code> for better
clarity</li>
<li>Implements comprehensive shop and weapon testing infrastructure</li>
<li>Adds screen color effects and player visual enhancements</li>
</ul>
<h3 dir="auto">Reviewed Changes</h3>
<p dir="auto">Copilot reviewed 32 out of 32 changed files in this pull
request and generated 2 comments.</p>
<details open="">
<summary>Show a summary per file</summary>
<markdown-accessiblity-table data-catalyst="">
File | Description
-- | --
TTT/API/IWeapon.cs | Renames weapon identifier property from Id to
WeaponId
TTT/Test/Shop/ShopTests.cs | Adds comprehensive test coverage for shop
functionality
TTT/Test/Shop/Items/DeagleTests.cs | Implements tests for one-shot
deagle weapon behavior
TTT/Test/TestPlayer.cs | Enhances test player with computed IsAlive
property
TTT/CS2/Player/CS2InventoryManager.cs | Adds weapon slot management and
refactors weapon handling
TTT/CS2/Extensions/PlayerExtensions.cs | Implements screen color fade
effects for players
TTT/CS2/Listeners/ScreenColorApplier.cs | Adds role-based screen color
feedback
TTT/Game/Roles/BaseWeapon.cs | Updates weapon class to use WeaponId
property
TTT/Shop/Items/OneShotDeagle/OneShotDeagle.cs | Updates deagle
implementation for new weapon API
</markdown-accessiblity-table></details>
- Add environment variables and steps for OpenAI API usage in
`.github/workflows/release.yml`
- Retain raw changelog on AI rewrite failure and differentiate naming
- Introduce conditional logic for selective changelog rewriting
- Update GitHub release creation to utilize AI-rewritten changelog when
available
- Add `fetch-tags: true` to actions/checkout in release workflow to ensure all tags are fetched during checkout.
- Improve tag determination process with lineage-aware strategy and refined pattern matching.
- Change changelog generation to use local git log for better control over commit messages.
- Enhance logic for finding commits for changelog, specifically handling first and subsequent releases.
- Improve error handling and retry mechanism for OpenAI API calls, and refine changelog rewrite logic with fallback strategies.
- Update comment styles for better clarity and organization.
- Add environment variables and steps for OpenAI API usage in `.github/workflows/release.yml`
- Retain raw changelog on AI rewrite failure and differentiate naming
- Introduce conditional logic for selective changelog rewriting
- Update GitHub release creation to utilize AI-rewritten changelog when available
- Remove debug logging statements and simplify service registration logic in `ServiceCollectionExtensions.cs`
- Adjust the event handler's priority in `RoundShopClearer.cs` without functional changes
- Update wording in `README.md` for clearer public API usage
- Modify event handler priority in `PlayerStatsTracker.cs` while maintaining existing functionality
- Streamline `IOnlinePlayer.cs` by removing obsolete commented-out code and refining interface properties
- Lower event handler priority in `PlayerActionsLogger.cs` for player kills
- Rename property `Id` to `WeaponId` in `IWeapon.cs`, `BaseWeapon.cs`, and `OneShotDeagle.cs` for improved clarity.
- Update weapon removal method in `IInventoryManager.cs` to use `weapon.WeaponId`.
- Refactor `PlayerDamagedEvent.cs` to initialize `Weapon` property with `init` for stricter immutability.
- Revise `IsAlive` logic in `TestPlayer.cs` to adjust `Health` based on `IsAlive` status; deprecate the `Roles` property.
- Add `using` directive and `[UsedImplicitly]` attribute to `DeagleDamageListener.cs` for dependency management and traceability.
- Develop `DeagleTests.cs` to ensure proper functionality of Deagle weapon behaviors using Xunit.
- Adjust the alpha value handling in `SetColor` method within `PlayerExtensions.cs` to ensure it stays within limits.
- Simplify player color setting in `RoundTimerListener.cs` by using `Color.White` for improved readability.
- Update `BodySpawner.cs` to change player post-death color to fully opaque white and simplify round start color setting using `Color.White`.
- Fix typo in comment and clarify kill detection process in `PlayerStatsTracker.cs`
- Add `RemoveWeaponInSlot` method for slot-based weapon removal in `FakeInventoryManager.cs` and update `IInventoryManager.cs` for enhanced functionality
- Reformat `BaseWeapon` constructor for readability and standardize file formatting
- Simplify `CS2Body.cs` API by removing overloaded weapon method and reinforce `IWeapon` interface usage
- Refactor `CS2InventoryManager.cs` for improved weapon management, add methods for slot conversion and weapon removal, and streamline code structure
- Add debug messaging to `DeagleDamageListener.cs` for better runtime clarity on friendly fire and one-shot kill conditions
- Modify `BodySpawner.cs` to incorporate `BaseWeapon` wrapper for improved weapon management without affecting core functionality
- Adjust `OnPlayerKill` event handler priority in `PlayerActionsLogger.cs` to ensure kill logging before game ends
```
Enhance game management and command structure with new features and optimizations
- Add logic in `PlayerJoinStarting.cs` to handle failure in game instance creation and ensure game starts only upon successful creation.
- Introduce IMessenger service in `CS2GameManager.cs` using dependency injection; add debug logging for the game creation process.
- Implement new behavior for `ScreenColorApplier` in `CS2ServiceCollection.cs` to enhance listening capabilities.
- Create a new `StateCommand` in `StateCommand.cs` to check active game state and implement basic command lifecycle methods.
- Remove "screentext" command and add "state" and "screencolor" commands in `TestCommand.cs` to revamp command options.
- Simplify vector operations in `TextSpawner.cs` by replacing `GetRightVector`; enhance screen text positioning.
- Expand `VectorExtensions.cs` with `ToRight` and `ToUp` methods for better angle-to-vector conversions.
- Remove `ScreenTextCommand.cs` to streamline project and potentially refactor screen text feature.
- Add `ScreenColorApplier` to apply screen color effects upon role assignment, enhancing player interaction experience.
- Introduce `ScreenColorCommand` for player screen color effects with configurable parameters, enriching command functionality.
```
- Refactor `TextSpawner.cs` to improve angle calculations and text positioning with respect to the player.
- Replace static `screenAngle` with local computations for better clarity and maintainability in `TextSpawner.cs`.
- Introduce `angle` object in `TextSpawner.cs` to enhance readability and explicitness in rotation management.
- Add `FadeFlags` enum and implement `ColorScreen` method in `PlayerExtensions.cs` to manage screen color fade effects.
- Enhance color fade handling in `PlayerExtensions.cs` by utilizing `UserMessage` with custom flag settings and improved color configurations.
Pinned System.Text.Json at 8.0.5.
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions
You can disable automated security fix PRs for this repo from the
[Security Alerts page](https://github.com/MSWS/TTT/network/alerts).
</details>
```
Implement player state spoofing and enhance body identification
- Introduce `CS2AliveSpoofer` class and `IAliveSpoofer` interface to manage "fake alive" player states in `CombatHandler` and `ForceAliveCommand`.
- Modify `BODY_IDENTIFIED` logic in `GameMsgs.cs` for nullable identifiers, providing a default "Someone" message when missing.
- Update `ForceAliveCommand` and `IdentifyAllCommand` to use new spoofing and identification utilities.
- Enhance body tracking with `BodyTracker` class, integrating event handling improvements for game state changes and body creation.
- Refine `OneShotDeagle` functionality by clearing player's inventory before assigning the weapon, improving game balance.
- Adjust `BodyPickupListener` to use `IBodyTracker` for efficient body management and consolidate event handling logic.
- Update various components to utilize dependency injection and new APIs, improving service management and system robustness.
```
- Modify `RoundBasedGame.cs` to improve encapsulation, consistency, and maintainability by refactoring game-ending logic and updating access modifiers for subclassing.
- Implement player data caching in `CS2Player.cs` to enhance performance and improve debug logging capabilities.
- Refactor message formatting in `CS2Messenger.cs` for improved consistency in debug modes.
- Enhance `PlayerConnectionsHandler.cs` by adding asynchronous behavior and a dependency on `IMessenger` for potential future enhancements.
- Add a validity check in `RoundTimerListener.cs` to ensure team scores are only updated with a defined winning role, improving robustness.
- Update `CS2Game.cs` to broadcast notifications for game start states and handle countdowns effectively.
- Introduce `CheckEndConditions()` method in `IGame.cs` interface and deprecate `IsInProgress()` to promote explicit state management.
- Centralize and simplify end game logic in `PlayerCausesEndListener.cs` by implementing `CheckEndConditions()`, eliminating redundant code.
- Rename test method `Round_EndsWhen_PlayerLeaves` to `Round_EndsWhen_PlayerLeavesAndDies` in `RoundEndingTest.cs` and add `PlayerDiesOnLeaveListener`.
- Improve code efficiency and readability in player iteration and event creation in `PlayerConnectionsHandler.cs`.
- Remove redundant console logging for player disconnections and streamline control flow in `disconnectFromServer` method in `PlayerConnectionsHandler.cs`.
- Move dispatching of `PlayerLeaveEvent` to the next world update for consistency in `PlayerConnectionsHandler.cs`.
- Reorder `AddModBehavior` entries in `CS2ServiceCollection.cs` for improved readability and logical grouping, adding `BodySpawner`, `DamageCanceler`, and `LateSpawnListener` earlier in their sections and maintaining order consistency by moving various handlers.
- Remove duplicated entries and ensure all necessary handlers and listeners are included in `CS2ServiceCollection.cs`.
- Add new class `LateSpawnListener` in `Listeners/LateSpawnListener.cs` to handle player join events, implementing a respawn mechanism for new players joining when the game is not in progress.
- Remove game state condition and deferred respawn logic in `PlayerConnectionsHandler.cs`, changing player respawn behavior upon joining the server.
```
Integrate New Features and Enhance Codebase
- Add a new project reference to `CS2.csproj` for integration with the Shop project.
- Introduce a new configuration class `CS2ShopConfig` to manage shop settings and player interactions.
- Implement new player event handling with `PlayerPurchaseItemEvent` and `PlayerBalanceEvent`, enabling cancellable item purchases and balance updates.
- Enhance the `ShopServiceCollection` with new behaviors for extended functionality, including `RoleAssignCreditor`, `BuyCommand`, and `BalanceCommand`.
- Improve `Shop.cs` by replacing `IPlayer` references with string identifiers, introducing event-driven balance updates, and enhancing messaging logic.
- Comprehensive changes across multiple utilities and configurations to support new team score management and event-driven architecture.
```
Refactor and Simplify Codebase with Improved Readability and Efficiency
- **OneShotDeagle.cs:**
- Remove event-related dependencies and streamline class to focus on core functionality.
- **PlayerKillListener.cs:**
- Simplify `OnKill` method, preparing for future enhancements, and clean up unused code.
- **IListener.cs and IEventBus.cs:**
- Remove `IDisposable` dependency from `IListener`. Add obsolescence message for `RegisterListener` in `IEventBus`.
- **LogsCommand.cs and TTTCommand.cs:**
- Consolidate logic for game checking and logging, enhancing error handling and readability.
- **RoundTimerListener.cs and CombatHandler.cs:**
- Refactor event handlers for clear separation of responsibilities and process optimization.
- **Various CS2 Handlers and Commands:**
- Streamline and modularize event handling and role management with newly introduced helper methods across handlers.
- Refactor command logic for improved organization and maintenance.
- **Locale/StringLocalizer.cs and EventBus.cs:**
- Refactor string handling and listener registration for enhanced clarity and performance.
```
- Simplify and enhance `PlayerActionsLogger.cs` by using pattern matching for game status checks and improve logging calls with a `Provider` parameter.
- Update `DeathAction.cs` to support dependency injection and role management by modifying constructors and formatting methods.
- Add role management in `FakeAction.cs` by introducing `PlayerRole` and `OtherRole` properties.
- Mark `IsGameActive` in `IGameManager.cs` as obsolete to guide towards direct game state checks.
- Modify logging in `BodyIdentifyLogger.cs` to use a `Provider` parameter for better context.
- Improve role management in `IdentifyBodyAction.cs` with new properties and constructor overloads supporting dependency injection.
- Refactor `ActionTest.cs` to accommodate constructor changes in `FakeAction`, ensuring backward compatibility.
- Expand `IAction` interface with role properties and enhance `Format` method.
- Add footer text in `en.yml` and `GameMsgs.cs` for clearer game log outputs.
- Enhance `DamagedAction.cs` with dependency injection and role properties, improving role management.
- Adjust `CombatHandler.cs` to refine player event handling and platform checks.
- Clear up documentation comments in `StringLocalizer.cs`.
- Enhance `SimpleLogger.cs` with role management and improved log formatting.
- Deprecate `IsInProgress()` in `IGame` for more explicit game state checks.
```
- Enhance message styling in `en.yml` by adding grey color to `TASER_SCANNED` translation.
- Align logical flow in `RoundTimerListener.cs` by moving the remaining time check in `OnRoundEnd`.
- Clean up `RoundTimerListener.cs` by removing commented-out code related to `EventRoundEnd`.
- Maintain role setting and team switching functionality in `RoundTimerListener.cs` within `OnRoundEnd`.
- Adjust winning team logic and event firing in `RoundTimerListener.cs` based on end reason.
- Ensure correct round transitions in `RoundTimerListener.cs` using scheduled timing logic.
- Add a new translation entry for "TASER_SCANNED" in TTT/CS2/lang/en.yml, ensuring a dynamic message format.
- Enhance TTT/Game/Listeners/BaseListener.cs with dependencies for role assignment and message localization.
- Refactor TTT/Game/Events/Player/PlayerDamagedEvent.cs to improve attacker retrieval logic and robustness.
- Improve TTT/Game/lang/GameMsgs.cs by extracting role prefix determination into a separate method for clarity.
- Introduce new methods and directives in TTT/CS2/lang/CS2Msgs.cs for better integration with TTT API and improved message clarity.
- Update TTT/CS2/GameHandlers/DamageCancelers/TaserListenCanceler.cs to refine event handling logic with taser-specific enhancements.
```
- Add OutOfRoundCanceler and TaserListenCanceler classes for improved damage cancellation in specific scenarios
- Mark RegisterListener method in IEventBus as obsolete
- Update ShopServiceCollection to remove generic type parameter from ShopCommand addition
- Change color representation for DetectiveRole in GameMsgs to DarkBlue
- Enhance ServiceCollectionExtensions with transient service registration and ICommand type handling
- Transition DamageCanceler to an event-driven architecture for improved flexibility
- Allow Player property in PlayerEvent to be set during initialization
- Register new damage cancelers in CS2ServiceCollection and simplify command service addition
- Refactor RoleIconsHandler to improve icon management and refine role assignments
- Update PlayerDamagedEvent for dynamic initialization and error handling
- Remove excessive "Respawning..." message from PlayerConnectionsHandler
- Narrow ShopCommand registration to only the "buy" subcommand
```
```
Refactor and enhance module management and logging across multiple components
- Update `TTT.cs` to differentiate between base and plugin modules during loading, improve logging for module operations, and revise initialization and activation of plugin modules.
- Enhance debugging and registration in `ServiceCollectionExtensions.cs` by adding diagnostic logs and ensuring proper registration of plugin modules and listeners with transient lifetimes.
- Remove redundant `Name` property from multiple logger and listener classes (`PlayerActionsLogger.cs`, `BodyIdentifyLogger.cs`, and `PlayerCausesEndListener.cs`), cleaning up unused code and simplifying logic for handling game-related events.
- Improve event dispatching efficiency in `EventBus.cs` by optimizing handler checks, and update DEBUG logging to handle nullability issues.
- Simplify `DamageCanceler.cs` by removing incorrect interface implementation and clarifying constructor and method usage.
```
Refactor Codebase for Simplification and Improved Modularization
- **RoundEndHandler.cs**
- Removed `Name` and `Version` properties to simplify the class.
- Maintained functionality for handling end-of-round events.
- **BaseListener.cs**
- Removed `ITerrorModule` interface implementation and unnecessary properties.
- Updated `Start` method to change listener lifecycle management.
- **CS2GameConfig.cs**
- Simplified by removing `Name` and `Version` properties, focusing solely on game parameters.
- **GameServiceCollection.cs**
- Changed listener addition method from `AddListener` to `AddModBehavior`, updated service registration terms.
- **DamageCanceler.cs**
- Simplified class by removing `Name` and `Version` properties.
- Enhanced damage processing with additional validity checks.
- Further updates include transitioning from `AddListener` to `AddModBehavior` across files, deprecating old registration methods in `EventBus.cs`, and comprehensive removal of `Name` and `Version` properties from various classes to streamline and refactor code structure. Additionally, obsolete methods were removed, and dependency injection patterns were adopted for intuitive system integration.
```plaintext
Implement comprehensive testing and enhance purchase logic
- Add `BuyTest` class to thoroughly test `BuyCommand` in the shop, covering various scenarios and ensuring correct game rule validation.
- Modify `OneShotDeagle`'s `CanPurchase` method to return a `PurchaseResult` enum for detailed purchasing results.
- Update `IShopItem` interface's `CanPurchase` method signature to use `PurchaseResult` for consistent result handling.
- Add `TestShopItem` class implementing the `IShopItem` interface, complete with properties, methods, and a successful `CanPurchase` implementation for testing.
- Improve `TestMessenger` with a null check for the player parameter and message logging for null player scenarios.
- Move `PurchaseResult.cs` to a new directory within the `Shop` folder for better organization.
- Refactor `CommandManagerTests` to use `ICommandManager` interface, ensuring interface-based testing without functional changes.
- Enhance `BuyCommand` with new aliases, asynchronous `Execute` method, and improved transaction logic, including balance checks and item search refactor.
```
- Await the `bus.Dispatch(deathEvent)` call in `OnKill_WithoutGame_DoesNothing` test.
- Remove unused import and eliminate the unused `IMessenger` component in `PropMover.cs`.
- Rename `refreshBodies` method to `refreshBody` for clarity in `PropMover.cs`.
- Refactor the iteration over `playersPressingE` to call the updated method in `PropMover.cs`.
- Enhance code readability in `PropMover.cs` through minor code style improvements, including removal of unnecessary exclamation points.
- Rename `RoundStartHandler` to `RoundStart_GameStartHandler` and update `Dispose()` method in `RoundStartHandler.cs`
- Rename `RoundEndHandler` to `RoundEnd_GameEndHandler` in `RoundEndHandler.cs`
- Update target framework to .NET 8.0 and add project reference to Karma project in `CS2.csproj`
- Update service collection for specific game start/end handlers and add plugin for player karma in `CS2ServiceCollection.cs`
- Introduce `KarmaSyncer` class for handling player karma with appropriate dependencies and event handling in `KarmaSyncer.cs`
```
- Remove `KarmaTest.cs`, eliminating a test case for default player karma verification upon creation.
- Introduce `KarmaListenerTests.cs` file, laying the groundwork for future KarmaListener test cases.
- Adjust `KeyedMemoryStorage.cs` to enable subclass access and method overriding by changing `data` dictionary to protected and marking `Load` and `Write` methods as virtual.
- Update `MemoryKarmaStorage.cs` with `Xunit.Internal` import, modify generic type parameter to `int`, refine code with target-typed `new()`, and override `Load` method with default karma value handling.
- Refactor `KarmaStorage.cs` to batch process karma updates asynchronously, simplify default karma handling, enhance error management, and refine karma caching.
```
```
- Add `KarmaServiceCollection` for dependency injection setup, facilitating the registration of `IKarmaService` with scoped lifetime.
- Update `TTTServiceCollection` to include new services for Karma management and necessary game services.
- Refactor `KarmaStorage` to implement `IKarmaService`, simplifying interface responsibilities and removing previous interface implementations.
- Configure `Plugin.csproj` with .NET 8.0, implicit usings, nullable reference types, and setup publish output handling.
- Introduce `IKarmaService` interface to streamline access and interaction with karma functionalities.
- Create `KarmaListener` class for managing karma adjustments during game events, implementing event handling and asynchronous tasks.
```
- Create a new KarmaStorage class to handle player karma with MySQL and caching
- Add the Karma project file with .NET 8.0 target and necessary references
- Include the Karma project in TTT.sln with Debug and Release configurations
- Define a Karma configuration file with database and karma settings
- Introduce a KarmaUpdateEvent class for managing player karma updates with event cancellation support
- Add a `Skip` method to `CS2CommandInfo` for argument skipping
- Rename `sub` to `subcommands` in `ShopCommand` for clarity and update execution logic
- Make `caller` parameter nullable in `TestCommandInfo` and introduce `Skip` method for better argument handling
- Add `Skip` method to `ICommandInfo` interface for consistent argument skipping functionality
- Add a `Skip` method to `CS2CommandInfo` for argument skipping
- Rename `sub` to `subcommands` in `ShopCommand` for clarity and update execution logic
- Make `caller` parameter nullable in `TestCommandInfo` and introduce `Skip` method for better argument handling
- Add `Skip` method to `ICommandInfo` interface for consistent argument skipping functionality
- Await the `bus.Dispatch(deathEvent)` call in `OnKill_WithoutGame_DoesNothing` test.
- Remove unused import and eliminate the unused `IMessenger` component in `PropMover.cs`.
- Rename `refreshBodies` method to `refreshBody` for clarity in `PropMover.cs`.
- Refactor the iteration over `playersPressingE` to call the updated method in `PropMover.cs`.
- Enhance code readability in `PropMover.cs` through minor code style improvements, including removal of unnecessary exclamation points.
- Rename `RoundStartHandler` to `RoundStart_GameStartHandler` and update `Dispose()` method in `RoundStartHandler.cs`
- Rename `RoundEndHandler` to `RoundEnd_GameEndHandler` in `RoundEndHandler.cs`
- Update target framework to .NET 8.0 and add project reference to Karma project in `CS2.csproj`
- Update service collection for specific game start/end handlers and add plugin for player karma in `CS2ServiceCollection.cs`
- Introduce `KarmaSyncer` class for handling player karma with appropriate dependencies and event handling in `KarmaSyncer.cs`
```
- Remove `KarmaTest.cs`, eliminating a test case for default player karma verification upon creation.
- Introduce `KarmaListenerTests.cs` file, laying the groundwork for future KarmaListener test cases.
- Adjust `KeyedMemoryStorage.cs` to enable subclass access and method overriding by changing `data` dictionary to protected and marking `Load` and `Write` methods as virtual.
- Update `MemoryKarmaStorage.cs` with `Xunit.Internal` import, modify generic type parameter to `int`, refine code with target-typed `new()`, and override `Load` method with default karma value handling.
- Refactor `KarmaStorage.cs` to batch process karma updates asynchronously, simplify default karma handling, enhance error management, and refine karma caching.
```
```
- Add `KarmaServiceCollection` for dependency injection setup, facilitating the registration of `IKarmaService` with scoped lifetime.
- Update `TTTServiceCollection` to include new services for Karma management and necessary game services.
- Refactor `KarmaStorage` to implement `IKarmaService`, simplifying interface responsibilities and removing previous interface implementations.
- Configure `Plugin.csproj` with .NET 8.0, implicit usings, nullable reference types, and setup publish output handling.
- Introduce `IKarmaService` interface to streamline access and interaction with karma functionalities.
- Create `KarmaListener` class for managing karma adjustments during game events, implementing event handling and asynchronous tasks.
```
- Create a new KarmaStorage class to handle player karma with MySQL and caching
- Add the Karma project file with .NET 8.0 target and necessary references
- Include the Karma project in TTT.sln with Debug and Release configurations
- Define a Karma configuration file with database and karma settings
- Introduce a KarmaUpdateEvent class for managing player karma updates with event cancellation support
Bumps
[softprops/action-gh-release](https://github.com/softprops/action-gh-release)
from 1 to 2.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/softprops/action-gh-release/releases">softprops/action-gh-release's
releases</a>.</em></p>
<blockquote>
<h2>v2.0.0</h2>
<ul>
<li>update actions.yml declaration to node20 to address warnings</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md">softprops/action-gh-release's
changelog</a>.</em></p>
<blockquote>
<h2>0.1.12</h2>
<ul>
<li>fix bug leading to empty strings subsituted for inputs users don't
provide breaking api calls <a
href="https://redirect.github.com/softprops/action-gh-release/pull/144">#144</a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="72f2c25fcb"><code>72f2c25</code></a>
release 2.3.2</li>
<li><a
href="552dc5524b"><code>552dc55</code></a>
fix: revert <code>fs:readableWebStream</code> change (<a
href="https://redirect.github.com/softprops/action-gh-release/issues/632">#632</a>)</li>
<li><a
href="f3cad8bcbf"><code>f3cad8b</code></a>
release 2.3.1</li>
<li><a
href="07a2257003"><code>07a2257</code></a>
fix: fix file closing issue (<a
href="https://redirect.github.com/softprops/action-gh-release/issues/629">#629</a>)</li>
<li><a
href="d5382d3e6f"><code>d5382d3</code></a>
release 2.3.0</li>
<li><a
href="a0e2122208"><code>a0e2122</code></a>
feat: migrate from jest to vitest (<a
href="https://redirect.github.com/softprops/action-gh-release/issues/626">#626</a>)</li>
<li><a
href="8836085300"><code>8836085</code></a>
chore: replace <code>mime</code> with <code>mime-types</code> (<a
href="https://redirect.github.com/softprops/action-gh-release/issues/624">#624</a>)</li>
<li><a
href="86463358d8"><code>8646335</code></a>
chore: bump node to 20.19.2</li>
<li><a
href="46b284799f"><code>46b2847</code></a>
chore(deps): bump the npm group across 1 directory with 5 updates (<a
href="https://redirect.github.com/softprops/action-gh-release/issues/623">#623</a>)</li>
<li><a
href="37fd9d0351"><code>37fd9d0</code></a>
chore(deps): bump undici from 5.28.5 to 5.29.0 (<a
href="https://redirect.github.com/softprops/action-gh-release/issues/621">#621</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/softprops/action-gh-release/compare/v1...v2">compare
view</a></li>
</ul>
</details>
<br />
[](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
</details>
```
- Update player death description in DeathAction to ensure clarity in scenarios involving a killer.
- Add Format method in DeathAction for structured death action descriptions.
- Implement client event notification in CombatHandler with conditional checks for attacker presence.
- Remove role initialization constructor in CS2Player to streamline code and refactor formatting.
```
- Adjust the logic in `RoundTimerListener.cs` to set final event results based on the winning team, assigning 2 for Counter-Terrorist wins and 3 for others, and refine win panel settings.
- Update `README.md` to reflect completed statuses for "Basic Gameplay," including the subcategories Traitors, Detectives, and Innocents, showcasing project progress.
- Reorder operations in `PlayerStatsTracker.cs` to update `PawnIsAlive` earlier in the `revealDeaths` method for clarity and consistent player state updates.
- Expand `RoleIconsHandler.cs` by adding `RevealIconFor` and `HideIconFor` methods to enhance control over traitor visual representation, allowing dynamic updates of player roles.
```
- Refine game start logic in RoundBasedGame.cs to ensure proper handling of game states and manage player notifications.
- Adjust state management and disposal process in RoundBasedGame.cs for better state handling and resource cleanup.
- Comment out deprecated EventRoundEnd logic in RoundTimerListener.cs and adjust timer settings for improved round transitions.
- Enhance BodyPickupListener.cs with new dependencies and logic for team adjustments during OnPropPickup events.
- Clean up PropMover.cs by removing unnecessary debug logging while maintaining current functionality.
```
- Introduce a server command for handling win conditions during round end in `RoundTimerListener.cs`
- Wrap round end logic processing within a server update block in `RoundTimerListener.cs`
- Improve timing logic for round endings using `Observable.Timer` in `RoundTimerListener.cs`
- Ensure events/messages indicate the winner and specifics in `RoundTimerListener.cs`
- Update `PlayerStatsTracker.cs` to enhance pawn alive state tracking and accuracy
- Modify `GameMsgs.cs` to enhance role identification through improved color coding and type checking for roles.
- Update `RoundTimerListener.cs` to incorporate reactive programming, improve event handling at round end, and refine role assignment logic.
- Enhance version string format in `TTTCommand.cs` by adding a short Git SHA for detailed version information.
- Simplify `EndRound` function in `RoundUtil.cs` by removing unnecessary delay parameter.
- Reorganize `connectToServer` method in `PlayerConnectionsHandler.cs` to delay certain operations until the next world update.
- Add player validity check before printing respawn chat message and update respawn logic to occur during the next world update in `PlayerConnectionsHandler.cs`.
- Consolidate respawn message to a generic "Respawning..." in `PlayerConnectionsHandler.cs`.
- Add new test cases in `ColoredRoleTest.cs` to verify pluralization functionality for role names, including special character handling.
- Ensure `HandlePluralization` method in `ColoredRoleTest.cs` correctly manages singular and plural forms with color formatting and dashes.
- Implement `PlayerStatsTracker` to monitor player statistics using
dependency injection and event handlers for tracking kills, deaths, and
assists.
- Update `CS2ServiceCollection` to add `PlayerStatsTracker` listener for
enhanced player statistics tracking.
- Modify `RoundTimerListener` to incorporate player color settings at
round start and ensure proper player state updates.
- Enhance `CombatHandler` with game activity checks in
`OnPlayerDeath_Pre` and `OnPlayerHurt` methods to ensure efficient and
correct handling of game operations.
echo "CHANGELOG.md is empty. Skipping AI rewrite."
echo "skipped=true" >> $GITHUB_OUTPUT
exit 0
fi
head -c "${MAX_CHANGELOG_CHARS}" CHANGELOG.md > CHANGELOG_RAW.md
jq -Rs --arg sys "You are an expert release-notes writer. Given a list of changes in various formats (e.g: commits, merges, etc.), write release notes intended for reading by the public, grouping by features, features, and other pertinent groups where appropriate. Do not include a group if it is unnecessary. Remove internal ticket IDs and commit hashes unless essential. Merge duplicates. Use imperative, past tense voice with proper prose. Output valid Markdown only." \
| Microsoft.Reactive.Testing | 6.0.1 | Expression | MIT | https://licenses.nuget.org/MIT | Copyright (c) .NET Foundation and Contributors. | .NET Foundation and Contributors | https://github.com/dotnet/reactive |
| System.Reactive | 6.0.1 | Expression | MIT | https://licenses.nuget.org/MIT | Copyright (c) .NET Foundation and Contributors. | .NET Foundation and Contributors | https://github.com/dotnet/reactive |
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.