Skip to content
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

Merged
merged 1 commit into from
Nov 23, 2024
Merged

[Balance] RevenantBuff #935

merged 1 commit into from
Nov 23, 2024

Conversation

Rxup
Copy link
Owner

@Rxup Rxup commented Nov 23, 2024

Изменения
Теперь у ревенанта есть шанс убить одиночек, если прямо рядом с человеком ждать пока он заснет! (не ходите в техи, дети, гулять! 🗡️ )

🆑

  • tweak: изменения SpectralTiredness (болезнь сна ревенанта Blight) с 3сек до 6сек усыпление

Summary by CodeRabbit

  • Новые функции

    • Улучшена функциональность способностей Ревенанта, улучшая применение болезней к сущностям.
    • Добавлена новая болезнь "Ультрагигаракарцинома".
    • Продлён срок действия эффекта "Спектральная усталость" с 3 до 6 секунд.
  • Исправления ошибок

    • Оптимизировано взаимодействие с системой болезней для лучшей ясности и поддерживаемости.
  • Документация

    • Обновлены определения и свойства неинфекционных болезней, обеспечивая согласованность и ясность.

Copy link
Contributor

coderabbitai bot commented Nov 23, 2024

Walkthrough

Изменения в этом запросе на извлечение улучшают функциональность класса RevenantSystem, в частности, в том, как он взаимодействует с DiseaseSystem. Метод OnBlightAction был модифицирован для использования новой переменной для ссылки на систему болезней, что улучшает читаемость кода. В файле noninfectious.yml продолжительность эффекта болезни Spectral Tiredness была увеличена, в то время как другие болезни остались неизменными, сохранив свою структуру и свойства.

Changes

File Path Change Summary
Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs - Обновлен метод OnBlightAction для использования var disSys = EntityManager.System<Backmen.Disease.DiseaseSystem>() для применения болезней.
- Изменен TryGetComponent на TryComp для проверки DiseaseCarrierComponent.
Resources/Prototypes/_Backmen/Diseases/noninfectious.yml - Увеличено значение свойства time для Spectral Tiredness с 3 до 6 в DiseaseGenericStatusEffect.
- Без изменений для других болезней и их исцелений.

Sequence Diagram(s)

sequenceDiagram
    participant RevenantSystem
    participant DiseaseSystem
    participant EntityManager

    RevenantSystem->>EntityManager: Получить ссылку на DiseaseSystem
    EntityManager-->>RevenantSystem: Вернуть DiseaseSystem (disSys)
    RevenantSystem->>RevenantSystem: OnBlightAction
    RevenantSystem->>DiseaseSystem: Применить эффекты болезни
    DiseaseSystem-->>RevenantSystem: Эффекты применены
Loading

Poem

В тенях, где Revenants играют,
Новая система их путь направляет.
С болезнями, что linger, и временем, что тянется,
Блестит их блажь, на мир она прольется.
Прыжок, прыжок, ура! За изменения яркие,
В царстве Revenant все кажется правильным! 🐇✨


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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 checks

The 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

📥 Commits

Reviewing files that changed from the base of the PR and between e52a95a and e68f902.

📒 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:

Comment on lines +329 to +330
if (emo.TryComp(ent, out var comp))
disSys.TryAddDisease(ent, component.BlightDiseasePrototypeId, comp);
Copy link
Contributor

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.

Suggested change
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)}");
}
}

Copy link
Contributor

coderabbitai bot commented Nov 23, 2024

✅ Actions performed

Summary regeneration triggered.

@Rxup Rxup merged commit 0f756cc into master Nov 23, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant