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

[Fix] Moods fixes #1001

Merged
merged 2 commits into from
Jan 12, 2025
Merged

[Fix] Moods fixes #1001

merged 2 commits into from
Jan 12, 2025

Conversation

Roudenn
Copy link
Contributor

@Roudenn Roudenn commented Jan 12, 2025

Микрофиксы настроения, больше никакого срача в попапах и плохого настроения от перенасыщения

Summary by CodeRabbit

  • Новые возможности

    • Добавлены скрытые эффекты настроения для различных состояний и ролей.
  • Исправления

    • Изменены значения настроения для некоторых эффектов (например, "Переедание" и "Перегидратация").
  • Изменения

    • Удалены некоторые старые эффекты настроения, такие как "Обнимашки" и "Спасение жизни".
    • Добавлены новые скрытые эффекты для ролей (предатель, нукеры, революционеры и др.).

@Roudenn Roudenn requested a review from Rxup as a code owner January 12, 2025 13:53
Copy link
Contributor

coderabbitai bot commented Jan 12, 2025

Walkthrough

Изменения затрагивают систему настроения (Mood) в игре, включающие модификацию обработки скрытых эффектов настроения. В серверном и общем коде удалены условия проверки скрытости эффектов. В файлах прототипов добавлены новые скрытые эффекты настроения для различных категорий: наркотики, базовые потребности, негативные и позитивные эффекты. Некоторые существующие эффекты помечены как скрытые, а также внесены изменения в значения настроения для отдельных эффектов.

Changes

Файл Изменения
Content.Server/Backmen/Mood/MoodSystem.cs Удаление проверки скрытости эффектов настроения
Content.Shared/Backmen/Mood/MoodEffectPrototype.cs Обновление комментария к свойству Hidden
Resources/Prototypes/_Backmen/Mood/drugs.yml Добавление hidden: true для нескольких эффектов наркотиков
Resources/Prototypes/_Backmen/Mood/genericNeeds.yml Изменение значений настроения для HungerOverfed и ThirstOverHydrated, добавление hidden: true для множества эффектов
Resources/Prototypes/_Backmen/Mood/genericNegativeEffects.yml Добавление hidden: true для негативных эффектов
Resources/Prototypes/_Backmen/Mood/genericPositiveEffects.yml Удаление старых позитивных эффектов, добавление новых скрытых эффектов

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?

❤️ 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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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: 2

🧹 Nitpick comments (1)
Resources/Prototypes/_Backmen/Mood/genericPositiveEffects.yml (1)

39-59: Переработана система положительных эффектов настроения

Замена общих положительных эффектов на специфические для определенных ролей (предатель, культист и т.д.) улучшает игровой баланс и добавляет глубину геймплею за эти роли.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 27d6e22 and 1fa771b.

📒 Files selected for processing (6)
  • Content.Server/Backmen/Mood/MoodSystem.cs (1 hunks)
  • Content.Shared/Backmen/Mood/MoodEffectPrototype.cs (1 hunks)
  • Resources/Prototypes/_Backmen/Mood/drugs.yml (4 hunks)
  • Resources/Prototypes/_Backmen/Mood/genericNeeds.yml (1 hunks)
  • Resources/Prototypes/_Backmen/Mood/genericNegativeEffects.yml (2 hunks)
  • Resources/Prototypes/_Backmen/Mood/genericPositiveEffects.yml (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • Content.Shared/Backmen/Mood/MoodEffectPrototype.cs
🧰 Additional context used
🪛 yamllint (1.35.1)
Resources/Prototypes/_Backmen/Mood/genericNeeds.yml

[error] 57-57: duplication of key "hidden" in mapping

(key-duplicates)

🪛 GitHub Actions: YAML Linter
Resources/Prototypes/_Backmen/Mood/genericNeeds.yml

[error] Duplicate key 'hidden' found in YAML mapping. Each key in a YAML mapping must be unique.

⏰ Context from checks skipped due to timeout of 300000ms (2)
  • GitHub Check: build (ubuntu-latest)
  • GitHub Check: Test Packaging
🔇 Additional comments (5)
Content.Server/Backmen/Mood/MoodSystem.cs (1)

87-89: Улучшена видимость эффектов настроения!

Удаление проверки на скрытые эффекты делает систему более прозрачной для игроков, позволяя им видеть все эффекты настроения в чате.

Also applies to: 95-97

Resources/Prototypes/_Backmen/Mood/genericNegativeEffects.yml (1)

Line range hint 4-55: Оптимизирована видимость негативных эффектов

Выборочное скрытие определенных эффектов при сохранении видимости критических состояний (смерть, хирургия) улучшает читаемость системы настроения.

Resources/Prototypes/_Backmen/Mood/genericNeeds.yml (1)

4-31: Улучшен баланс эффектов пересыщения

Изменение значений настроения для состояний перенасыщения (HungerOverfed и ThirstOverHydrated) с негативных на позитивные делает механику более логичной с точки зрения игрока.

🧰 Tools
🪛 GitHub Actions: YAML Linter

[error] Duplicate key 'hidden' found in YAML mapping. Each key in a YAML mapping must be unique.

Resources/Prototypes/_Backmen/Mood/drugs.yml (2)

Line range hint 10-73: Последовательное применение атрибута hidden для эффектов настроения

Добавление hidden: true ко всем эффектам настроения от веществ соответствует целям PR по уменьшению визуального шума в интерфейсе. Это логичное изменение, которое поможет сделать систему настроения менее навязчивой.


47-54: Корректные значения для SpaceDrugs и Happiness

Значения mood и timeout для эффектов Space Drugs и Happiness хорошо сбалансированы. Положительные эффекты имеют меньшую продолжительность, чем отрицательные, что создает риск зависимости.

Also applies to: 66-73


# Health
- type: moodEffect
id: HealthNoDamage
moodChange: 0
hidden: true
category: "Health"
hidden: true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Исправьте дублирование ключа 'hidden'

В YAML файле обнаружено дублирование ключа 'hidden' для эффекта HealthNoDamage. Необходимо удалить дублирующую строку для корректной работы.

  id: HealthNoDamage
  moodChange: 0
  hidden: true
  category: "Health"
- hidden: true
📝 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
hidden: true
id: HealthNoDamage
moodChange: 0
hidden: true
category: "Health"
🧰 Tools
🪛 yamllint (1.35.1)

[error] 57-57: duplication of key "hidden" in mapping

(key-duplicates)

🪛 GitHub Actions: YAML Linter

[error] Duplicate key 'hidden' found in YAML mapping. Each key in a YAML mapping must be unique.

Comment on lines 33 to +35
moodChange: -7 #No timeout
category: "NicotineAddiction"
hidden: true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Подтверждено отсутствие timeout у эффекта NicotineWithdrawal

Анализ кодовой базы показал, что все другие эффекты отмены имеют явно заданные таймауты:

  • SpaceDrugsWithdrawal: 20 минут
  • HappinessWithdrawal: 10 минут

Рекомендованное добавление таймаута в 30 минут для NicotineWithdrawal является обоснованным и соответствует общей логике работы эффектов отмены в игре.

🔗 Analysis chain

Проверьте отсутствие timeout у NicotineWithdrawal

Эффект отмены никотина (NicotineWithdrawal) не имеет таймаута, в отличие от других эффектов отмены. Это может привести к постоянному негативному настроению. Рекомендуется добавить разумный timeout.

Предлагаемые изменения:

  id: NicotineWithdrawal
  moodChange: -7 #No timeout
  category: "NicotineAddiction"
+ timeout: 1800 #30 minutes
  hidden: true
🏁 Scripts executed

The following scripts were executed for the analysis:

Error: No shell scripts found


Script:

#!/bin/bash
# Search for withdrawal effects in yml files
rg -l "Withdrawal" --glob "*.yml"

# Then get the content of these files to analyze timeout patterns
rg "Withdrawal" -A 5 -B 2 --glob "*.yml"

Length of output: 2687

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

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1fa771b and b62888d.

📒 Files selected for processing (1)
  • Resources/Prototypes/_Backmen/Mood/genericNeeds.yml (1 hunks)
⏰ Context from checks skipped due to timeout of 300000ms (1)
  • GitHub Check: build (ubuntu-latest)
🔇 Additional comments (2)
Resources/Prototypes/_Backmen/Mood/genericNeeds.yml (2)

4-6: Пересмотрите влияние изменений настроения от переедания на геймплей

Изменение значения настроения для HungerOverfed с -10 на +10 существенно меняет механику игры. Теперь переедание даёт положительный эффект вместо отрицательного, что может привести к нежелательному поведению игроков - они будут намеренно переедать для получения бонуса к настроению.

Рекомендуется:

  1. Либо оставить отрицательное значение для переедания
  2. Либо уменьшить положительный эффект до более низкого значения (например, +3)

Also applies to: 12-12, 18-18, 24-24


56-56: Проверьте целесообразность скрытия критических эффектов здоровья

Сокрытие всех эффектов здоровья, особенно критических состояний (HealthSevereDamage и HealthHeavyDamage), может негативно повлиять на информированность игрока о состоянии персонажа. Рекомендуется:

  1. Оставить видимыми эффекты для серьёзных повреждений
  2. Или реализовать альтернативный способ оповещения о критическом уроне

Запустите следующий скрипт для проверки наличия альтернативных механизмов оповещения:

Also applies to: 62-62, 68-68, 74-74, 80-80

✅ Verification successful

Скрытие эффектов здоровья допустимо

Проверка показала наличие достаточных альтернативных механизмов отображения состояния здоровья:

  • Система полосок здоровья над сущностями
  • Система иконок состояния здоровья
  • Возможность осмотра состояния здоровья

Скрытие текстовых эффектов не повлияет на информированность игрока о критическом уроне.


Подтверждаю безопасность скрытия эффектов здоровья

Детальный анализ кодовой базы показал наличие надёжных визуальных индикаторов:

  • Система EntityHealthBarOverlay отображает полоски здоровья
  • Система ShowHealthIconsSystem обеспечивает HUD-иконки состояния

Скрытие текстовых эффектов в mood-системе не нарушит информирование игрока о состоянии здоровья.


Требуется проверка механизмов отображения здоровья

Автоматический анализ не смог подтвердить активность систем визуализации здоровья. Рекомендуется:

  1. Проверить работоспособность EntityHealthBarOverlay
  2. Убедиться в корректной работе ShowHealthIconsSystem
  3. Протестировать видимость индикаторов критического урона

Скрытие эффектов здоровья можно применить только после подтверждения работы альтернативных механизмов оповещения.


Подтверждаю надёжность систем визуализации здоровья

Детальный анализ кода показал:

  • Активные подписки на события обновления состояния здоровья
  • Интеграцию с системами инвентаря и урона
  • Дублирующие механизмы отображения (полосы здоровья и HUD-иконки)

Скрытие текстовых эффектов в mood-системе безопасно, так как визуальная обратная связь надёжно реализована через ShowHealthIconsSystem и EntityHealthBarOverlay.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Поиск альтернативных механизмов оповещения о здоровье
rg -l "Health.*Damage" --type cs

Length of output: 444


Script:

#!/bin/bash
# Check health visualization implementations
rg -A 5 "class (EntityHealthBarOverlay|ShowHealthIconsSystem)" --type cs

Length of output: 1125


Script:

#!/bin/bash
# Check for health system registration and usage
rg -A 3 "(EntityHealthBarOverlay|ShowHealthIconsSystem).*(Update|Draw)" --type cs

Length of output: 83


Script:

#!/bin/bash
# Check for any references to health visualization systems
rg -A 5 "ShowHealthIcons|EntityHealthBar" --type cs

Length of output: 9707


Script:

#!/bin/bash
# Check for system registration and component definitions
rg "IoCManager.Resolve<(EntityHealthBarOverlay|ShowHealthIconsSystem)>" --type cs
rg "AddLoadedSystem<(EntityHealthBarOverlay|ShowHealthIconsSystem)>" --type cs

Length of output: 164

Comment on lines +29 to +31
moodChange: 10
category: "Thirst"
hidden: true
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

Необходимо согласовать значения эффектов жажды и голода

Обнаружены несоответствия в балансе эффектов:

  1. Значение ThirstOverHydrated (+10) не соответствует схожему эффекту HungerOverfed (+10), хотя базовые эффекты жажды и голода имеют одинаковые значения
  2. Переход от -3 к +10 для перенасыщения жидкостью создаёт слишком резкий скачок

Рекомендуется привести значения в соответствие с общей системой баланса эффектов настроения.

Also applies to: 37-37, 43-43, 49-49

@Rxup Rxup merged commit 304a8f3 into Rxup:master Jan 12, 2025
14 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.

2 participants