Skip to content

новая целька#631

Open
benjii158 wants to merge 2 commits into
corvax-team:masterfrom
benjii158:teach-obj
Open

новая целька#631
benjii158 wants to merge 2 commits into
corvax-team:masterfrom
benjii158:teach-obj

Conversation

@benjii158

@benjii158 benjii158 commented May 30, 2026

Copy link
Copy Markdown
Contributor

Описание PR

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

кстати, это ПОРТ С ГУБОВ. ага

Почему / Баланс

таск

Технические детали

добавлена новая обж группа, 3 компача, все спизжено с губов

Медиа

не надо

Требования

Согласие с условиями

  • Я согласен с условиями LICENSE и CLA.

Критические изменения

Список изменений

🆑 benjamin

  • wl-add: добавлены две цели.

Summary by CodeRabbit

  • New Features

    • Introduced "Teach a Lesson" traitor objective: requires a designated target to die at least once during the shift. Available as a random traitor objective variant.
    • Added weighted-random objective group configuration supporting multiple teach-a-lesson variants alongside existing traitor objectives.
  • Documentation

    • Added Russian language localization strings for teach-a-lesson objective titles and descriptions.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 30, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

This PR adds a new "teach a lesson" traitor objective that requires a teacher to make a specific target die at least once during the shift. The implementation includes two components tracking state, an entity system managing objective lifecycle through events, objective definitions with configuration, and Russian localization.

Changes

Teach a Lesson Objective Implementation

Layer / File(s) Summary
Component Data Model
Content.Server/_CorvaxGoob/OfferItem/Objectives/TeachALessonConditionComponent.cs, Content.Server/_CorvaxGoob/OfferItem/Objectives/TeachALessonTargetComponent.cs
Defines TeachALessonConditionComponent with a HasDied boolean flag (initialized false) for tracking completion, and TeachALessonTargetComponent with a Teachers hash set to track which entities assigned the objective.
Condition System and Event Handling
Content.Server/_CorvaxGoob/OfferItem/Objectives/TeachALessonConditionSystem.cs
Implements the entity system orchestrating objective lifecycle through event subscriptions: OnAfterAssign resolves targets and registers teachers; OnMindAdded and OnMindRemoved propagate teacher associations; OnMobStateChanged and OnGhostAttempt trigger completion; OnGetProgress reports 1.0f when HasDied is true; TriggerObjective sets the flag across all registered teachers.
Objective Prototypes and Configuration
Resources/Prototypes/_CorvaxGoob/Objectives/Traitor.yml, Resources/Prototypes/_CorvaxGoob/Objectives/ObjectiveGroups.yml
Defines abstract BaseTeachALessonObjective with icon and blacklist for conflicting social objectives; adds TeachRandomPersonObjective and TeachRandomHeadObjective with target filters; configures TraitorObjectiveGroupTeach weighted-random group selecting between teach and existing kill objectives.
Russian Localization
Resources/Locale/ru-RU/_CorvaxGoob/Objective/teach-a-lesson.ftl, Resources/Locale/ru-RU/prototypes/_corvaxgoob/traitor.ftl
Provides Russian translations for objective condition title and descriptions for both person and head variants, with placeholder formatting for target names and jobs.

Sequence Diagram

sequenceDiagram
  participant Teacher
  participant System as TeachALessonConditionSystem
  participant Target
  participant TargetComponent
  participant ConditionComponent as HasDied Flag
  Teacher->>System: Objective assigned
  System->>TargetComponent: Register teacher in Teachers set
  Target->>System: Mob state changes to Dead
  System->>TargetComponent: Iterate through Teachers
  System->>ConditionComponent: Set HasDied = true per teacher
  Teacher->>System: Request progress
  System->>ConditionComponent: Check HasDied
  ConditionComponent-->>Teacher: Report progress 1.0f
Loading

Estimated Code Review Effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A lesson taught through spectral screams,
When targets fall to death's cold beams,
The teachers earn their twisted crown,
One soul must tumble, bloodied down,
A teaching moment, dark and grim!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'новая целька' (new objective) is vague and generic. While it refers to the general addition of objectives, it lacks specificity about which objectives were added or what they accomplish, making it uninformative for someone scanning the PR history. Use a more specific title describing the primary change, such as 'Add teach-a-lesson objectives for traitors' or similar descriptive phrasing that conveys the actual implementation details.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
Content.Server/_CorvaxGoob/OfferItem/Objectives/TeachALessonConditionComponent.cs (1)

1-1: 💤 Low value

Namespace doesn't match the fork's folder convention.

The file lives under _CorvaxGoob/OfferItem/Objectives, but the namespace is Content.Server._Starlight.Objectives — a leftover from the upstream port. The same mismatch exists in TeachALessonTargetComponent.cs and TeachALessonConditionSystem.cs. Align the namespace with the fork's layout for consistency and discoverability.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@Content.Server/_CorvaxGoob/OfferItem/Objectives/TeachALessonConditionComponent.cs`
at line 1, The namespace in TeachALessonConditionComponent.cs (and the related
TeachALessonTargetComponent.cs and TeachALessonConditionSystem.cs) is wrong — it
currently uses Content.Server._Starlight.Objectives; update the namespace to
match the folder layout (Content.Server._CorvaxGoob.OfferItem.Objectives) so the
types (TeachALessonConditionComponent, TeachALessonTargetComponent,
TeachALessonConditionSystem) live in the correct namespace and are discoverable.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Resources/Locale/ru-RU/prototypes/_corvaxgoob/traitor.ftl`:
- Line 4: The player-facing description string in the traitor.ftl entry (.desc)
is missing a comma before "что"; update the .desc value to insert a comma before
"что" so it reads "Убедитесь, что этот человек умрёт хотя бы раз за смену, он
знает, что натворил." (ensure the comma placement mirrors the style used on line
6 and adjust any punctuation spacing accordingly).

---

Nitpick comments:
In
`@Content.Server/_CorvaxGoob/OfferItem/Objectives/TeachALessonConditionComponent.cs`:
- Line 1: The namespace in TeachALessonConditionComponent.cs (and the related
TeachALessonTargetComponent.cs and TeachALessonConditionSystem.cs) is wrong — it
currently uses Content.Server._Starlight.Objectives; update the namespace to
match the folder layout (Content.Server._CorvaxGoob.OfferItem.Objectives) so the
types (TeachALessonConditionComponent, TeachALessonTargetComponent,
TeachALessonConditionSystem) live in the correct namespace and are discoverable.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 21623069-b119-49df-8ef8-7e8df73eb0e1

📥 Commits

Reviewing files that changed from the base of the PR and between fc06a6f and 053094f.

📒 Files selected for processing (7)
  • Content.Server/_CorvaxGoob/OfferItem/Objectives/TeachALessonConditionComponent.cs
  • Content.Server/_CorvaxGoob/OfferItem/Objectives/TeachALessonConditionSystem.cs
  • Content.Server/_CorvaxGoob/OfferItem/Objectives/TeachALessonTargetComponent.cs
  • Resources/Locale/ru-RU/_CorvaxGoob/Objective/teach-a-lesson.ftl
  • Resources/Locale/ru-RU/prototypes/_corvaxgoob/traitor.ftl
  • Resources/Prototypes/_CorvaxGoob/Objectives/ObjectiveGroups.yml
  • Resources/Prototypes/_CorvaxGoob/Objectives/Traitor.yml

ent-BaseTeachALessonObjective = { ent-BaseTargetObjective }
.desc = { ent-BaseTargetObjective.desc }
ent-TeachRandomPersonObjective = { ent-BaseTraitorObjective }
.desc = Убедитесь, что этот человек умрёт хотя бы раз за смену. Он знает что натворил.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Missing comma in player-facing description.

Inconsistent with line 6 — "что" should be preceded by a comma.

✏️ Proposed fix
-    .desc = Убедитесь, что этот человек умрёт хотя бы раз за смену. Он знает что натворил.
+    .desc = Убедитесь, что этот человек умрёт хотя бы раз за смену. Он знает, что натворил.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Resources/Locale/ru-RU/prototypes/_corvaxgoob/traitor.ftl` at line 4, The
player-facing description string in the traitor.ftl entry (.desc) is missing a
comma before "что"; update the .desc value to insert a comma before "что" so it
reads "Убедитесь, что этот человек умрёт хотя бы раз за смену, он знает, что
натворил." (ensure the comma placement mirrors the style used on line 6 and
adjust any punctuation spacing accordingly).

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