-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Balance] RevenantBuff #935
Conversation
WalkthroughИзменения в этом запросе на извлечение улучшают функциональность класса Changes
Sequence Diagram(s)sequenceDiagram
participant RevenantSystem
participant DiseaseSystem
participant EntityManager
RevenantSystem->>EntityManager: Получить ссылку на DiseaseSystem
EntityManager-->>RevenantSystem: Вернуть DiseaseSystem (disSys)
RevenantSystem->>RevenantSystem: OnBlightAction
RevenantSystem->>DiseaseSystem: Применить эффекты болезни
DiseaseSystem-->>RevenantSystem: Эффекты применены
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (2)
Resources/Prototypes/_Backmen/Diseases/noninfectious.yml (1)
31-31
: Document the gameplay impact in a comment.Consider adding a YAML comment above this configuration to explain the intended gameplay mechanics (e.g., interaction with Revenant's abilities) for future reference.
Here's a suggested addition:
component: ForcedSleeping + # 6 second sleep duration enables Revenant's isolation elimination mechanic time: 6
Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs (1)
327-331
: Consider adding validation checksThe current implementation could benefit from additional validation to ensure robust operation.
Consider adding these validations:
var disSys = EntityManager.System<Backmen.Disease.DiseaseSystem>(); var emo = GetEntityQuery<Shared.Backmen.Disease.DiseaseCarrierComponent>(); + +// Validate disease prototype exists +if (!_proto.HasIndex<DiseasePrototype>(component.BlightDiseasePrototypeId)) +{ + _sawmill.Error($"Invalid disease prototype: {component.BlightDiseasePrototypeId}"); + return; +} + foreach (var ent in _lookup.GetEntitiesInRange(uid, component.BlightRadius)) { + // Skip if too far or obstructed + if (!_interact.InRangeUnobstructed(ent, uid, component.BlightRadius)) + continue; + if (emo.TryComp(ent, out var comp)) disSys.TryAddDisease(ent, component.BlightDiseasePrototypeId, comp); }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs
(1 hunks)Resources/Prototypes/_Backmen/Diseases/noninfectious.yml
(1 hunks)
🔇 Additional comments (3)
Resources/Prototypes/_Backmen/Diseases/noninfectious.yml (1)
31-31
: Consider the gameplay balance implications of doubling the sleep duration.
The increase from 3 to 6 seconds significantly enhances the Revenant's ability to eliminate isolated players. While this aligns with the PR objectives, consider if this duration provides sufficient counterplay opportunity for affected players, especially given the additional poison damage effect.
Let's check for any related balance configurations:
✅ Verification successful
Let me gather more information about the ability's cooldown and cost to better assess the balance implications.
The increased sleep duration is balanced by ability constraints
The 6-second sleep duration is balanced by several factors in the Revenant's Blight ability:
- High essence cost (75 stolen essence)
- 20-second cooldown between uses
- Multiple cure mechanisms (240s natural, 60s bed rest)
- The disease has a low proc chance (3%) for the sleep effect
- Additional effects (poison damage, yawn) remain unchanged
The doubled duration provides meaningful impact while maintaining counterplay through the ability's cost, cooldown, and cure options.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for related Revenant ability configurations
rg -A 5 "Revenant.*Blight|SpectralTiredness" --type yaml
Length of output: 1999
Script:
#!/bin/bash
# Search for Revenant ability configurations and related files
rg -l "RevenantBlight|SpectralTiredness" --type yaml | xargs cat
Length of output: 5354
Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs (2)
325-326
: LGTM! Good system access pattern
The changes follow good practices by properly accessing the DiseaseSystem and caching the component query.
332-332
: Verify the psionic power logging parameters
The power logging uses hardcoded values (6, 10) which could benefit from configuration.
Let's check if these values are used consistently across other abilities:
if (emo.TryComp(ent, out var comp)) | ||
disSys.TryAddDisease(ent, component.BlightDiseasePrototypeId, comp); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Add error handling for disease application
The disease application should handle potential failures to ensure robustness.
Consider updating the code to handle failures:
-if (emo.TryComp(ent, out var comp))
- disSys.TryAddDisease(ent, component.BlightDiseasePrototypeId, comp);
+if (emo.TryComp(ent, out var comp))
+{
+ if (!disSys.TryAddDisease(ent, component.BlightDiseasePrototypeId, comp))
+ {
+ _sawmill.Warning($"Failed to apply Blight disease to {ToPrettyString(ent)}");
+ }
+}
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
if (emo.TryComp(ent, out var comp)) | |
disSys.TryAddDisease(ent, component.BlightDiseasePrototypeId, comp); | |
if (emo.TryComp(ent, out var comp)) | |
{ | |
if (!disSys.TryAddDisease(ent, component.BlightDiseasePrototypeId, comp)) | |
{ | |
_sawmill.Warning($"Failed to apply Blight disease to {ToPrettyString(ent)}"); | |
} | |
} |
✅ Actions performedSummary regeneration triggered. |
Изменения
Теперь у ревенанта есть шанс убить одиночек, если прямо рядом с человеком ждать пока он заснет! (не ходите в техи, дети, гулять! 🗡️ )
🆑
Summary by CodeRabbit
Новые функции
Исправления ошибок
Документация