Skip to content

Add vampire#579

Open
stellarkov wants to merge 7 commits intoimperial-space:developfrom
stellarkov:add-vampire
Open

Add vampire#579
stellarkov wants to merge 7 commits intoimperial-space:developfrom
stellarkov:add-vampire

Conversation

@stellarkov
Copy link
Contributor

@stellarkov stellarkov commented Mar 15, 2026

О ПР`е

Тип: fix
Изменения: Исправлены баги с вампиром
Тип: fix
Изменения: Сытость вампира за 1 тик сосания крови повышена до 3-х ед
Тип: feat
Изменения: Вампиры и упыри могут пить кровь животных и игроков в ссд, но это не влияет на счетчик разблокировки способностей и в два раза хуже утоляет голод
Тип: feat
Изменения: Вампиру добавлены цели на убийство и кражу
Тип: remove
Изменения: Удалена цель на обращение экипажа в упырей
Тип: remove
Изменения: Удалено необходимое количество упырей для обращения
Тип: feat
Изменения: Вампир получает 3 ед ожогами каждые 2 секунды, если стоит на расстоянии до 7 тайлов от священника
Тип: fix
Изменения: Уменьшено требуемое количество выпитой крови для получения способностей
Тип: feat
Изменения: Прогресс бар гипноза вампиром теперь скрыт
Тип: feat
Изменения: Максимальное количество упырей, которых может иметь вампир - 5

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

Нет

Изменения в коде официальных разработчиков

Нет

Summary by CodeRabbit

Примечания к выпуску

  • New Features

    • Added divine damage mechanic triggered by nearby chaplains.
    • Introduced blood decay system for vampires and ghouls.
    • New steal-based objectives for vampires.
  • Balance Changes

    • Reduced blood costs for multiple abilities (up to 50%).
    • Increased blood loss per tick; extended ghoul decay interval.
    • Added maximum ghoul limit (5); increased appeal cooldown to 2.5 minutes.
    • Adjusted blood drinking objectives (250–300 targets).
  • Gameplay Updates

    • Replaced ghoul conversion objectives with randomized theft tasks.
    • Refined target requirements for vampire actions.

@github-actions github-actions bot added Change Wiz Code Изменения вмешиваются в код визардов Prototypes Изменения добавляет новые прототипы C# Изменения добавляют новый C# код Change WIz Prototypes Изменения вмешиваются в код прототипов визардов size/Small Насколько сложно будет апстримить labels Mar 15, 2026
@stellarkov stellarkov marked this pull request as draft March 15, 2026 19:16
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 15, 2026

Walkthrough

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

Sequence Diagram

sequenceDiagram
    participant Vampire as Vampire<br/>(VampireSystem)
    participant Update as Update Loop<br/>(BaseUpdate)
    participant World as World<br/>(Spatial Queries)
    participant Chaplain as Chaplain/Priest<br/>(BibleUserComponent)
    participant Alerts as AlertsSystem
    participant Audio as Audio System

    loop Every UpdateDelay interval
        Update->>Vampire: Check NextBloodDecay timer
        Vampire->>Vampire: Apply BloodDecayAmount<br/>to blood if interval passed
        Vampire->>World: Search for nearby<br/>BibleUserComponent entities
        World-->>Vampire: Return priests within range
        
        alt Priests found and alive
            Vampire->>Chaplain: Calculate distance<br/>and threat
            Chaplain-->>Vampire: Threat confirmed
            Vampire->>Vampire: Apply DivineDamage<br/>to blood
            Vampire->>Audio: Play DivineDamageSound<br/>(lightburn.ogg)
            Vampire->>Alerts: Show<br/>AdjacentChaplainAlert
            Vampire->>Vampire: Reset UpdateDelay
            Note over Vampire: Display popup:<br/>"Священная сила<br/>причиняет боль"
        else No priests or dead
            Note over Vampire: Continue normal<br/>blood decay
        end
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related PRs

  • Новый антагонист - "Вампир" #516 — Модифицирует ту же подсистему вампиров (VampireSystem), включая логику способностей, методы обновления (Update/AbilitiesUpdate) и обработку питания кровью.
🚥 Pre-merge checks | ✅ 1 | ❌ 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 'Add vampire' is extremely vague and generic. It does not meaningfully describe the actual changes, which involve multiple bug fixes, gameplay mechanic adjustments, objective system overhauls, and balance changes across several vampire subsystems. Use a more specific title that captures the main focus, such as 'Refactor vampire system: fix mechanics, rebalance abilities, and update objectives' or break changes into multiple PRs.
✅ Passed checks (1 passed)
Check name Status Explanation
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.

📝 Coding Plan
  • Generate coding plan for human review comments

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.

Tip

CodeRabbit can approve the review once all CodeRabbit's comments are resolved.

Enable the reviews.request_changes_workflow setting to automatically approve the review once all CodeRabbit's comments are resolved.

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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@Content.Server/Imperial/Vampire/VampireSystem.cs`:
- Around line 212-254: The DrinkingComplete block contains duplicated post-drink
actions; extract the repeated logic into small helpers and call them from both
branches: create e.g. ApplyBloodGainAndAbilities(VampireComponent vamp,
EntityUid drinker, int amount) to handle vamp.TotalDrunk, SetBloodCounterAlert
and granting abilities; Create ApplyBloodDamage(EntityUid target, Dictionary
damage, int amount) to set damage.DamageDict["Bloodloss"] and call
_damage.TryChangeDamage; Create PlayDrinkEffects(EntityUid drinker,
VampireComponent vamp) to play _audio.PlayPvs(vamp.DrinkSound, drinker) and to
set humanoid eye color via TryComp<HumanoidAppearanceComponent>/Dirty; and
Create StartDrinkingIfTargetAlive(EntityUid drinker, EntityUid target) to call
_mobState.IsAlive and StartDrinking; then replace the duplicated sections in
DrinkingComplete to call these helpers and keep branch-specific behavior (popup,
vamp.BloodDamage adjustment, _vampireSystem.SetBloodAlert) only where needed.

In `@Content.Shared/Imperial/Vampire/Components/VampireComponent.cs`:
- Around line 191-194: The public runtime field NextBloodDecay in
VampireComponent lacks the [ViewVariables] attribute; add [ViewVariables]
immediately above the declaration of the NextBloodDecay field (public TimeSpan
NextBloodDecay = TimeSpan.Zero) so the runtime state is exposed per project
standards, keeping the field unchanged otherwise.
- Around line 363-364: The field UpdateDelay in VampireComponent is marked
[AutoNetworkedField] but is only used server-side in BaseUpdate for timing
priest damage; remove the network synchronization attribute and make UpdateDelay
a plain private/protected (or non-networked) field so it is not sent to clients,
or alternatively mark it with a non-networking attribute and/or move it out of
the networked state; update references to VampireComponent.UpdateDelay and
BaseUpdate accordingly to keep server-only timing behavior intact.
- Around line 208-218: There are two duplicate puddle ID fields—GhoulPuddleID
(EntProtoId) and VampirePuddleID (string); remove the duplication by keeping a
single canonical field (preferably GhoulPuddleID of type EntProtoId for
canonical entity prototype usage) in VampireComponent and delete
VampirePuddleID, then update all references: change uses in
SharedVampireSystem.Hemomancer.cs (and anywhere else) to read the retained
GhoulPuddleID (convert string usages to EntProtoId where needed) so all code
compiles and consistently uses the same field and type.

In `@Content.Shared/Imperial/Vampire/SharedVampireSystem.cs`:
- Around line 438-474: The duplicate EntityQueryEnumerator<VampireComponent>
iteration in BaseUpdate causes double-processing; remove the second enumerator
(vampirelQuery) and merge its logic into the existing VampireComponent loop (the
first EntityQueryEnumerator<VampireComponent> loop) so each vampire is handled
only once per tick, and rename the variable to vampireQuery (fixing the
vampirelQuery typo); ensure you preserve the checks and actions (NextBloodDecay
initialization, blood decay timing, DealBloodDamage, BloodDamage/ CritThreshold
debuff application, DamageSpecifier creation, SpawnBloodPuddle,
TakeStaminaDamage, and jitter call) inside the single loop and call Dirty(uid,
comp) where previously done.

In `@Resources/Prototypes/Imperial/Vampire/purposes.yml`:
- Around line 13-16: В файле определена группа целей VampireObjectiveGroups, но
она содержит только один элемент VampireObjectiveGroupSteal; решите: если в
будущем будут другие группы (например VampireObjectiveGroupKill) — расширьте
VampireObjectiveGroups, добавив новые id и соответствующие веса в ту же
структуру (ключи: type: weightedRandom, id: VampireObjectiveGroups, weights:
{NewGroup: n, VampireObjectiveGroupSteal: m}); если дополнительных групп не
планируется — удалите промежуточную сущность VampireObjectiveGroups и в
game_rule.yml замените ссылку на VampireObjectiveGroups прямой ссылкой на
VampireObjectiveGroupSteal, чтобы убрать лишный уровень индirection.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 0bb036b2-1427-4d36-9213-817ba7cd57d2

📥 Commits

Reviewing files that changed from the base of the PR and between 26b2d11 and ee3d766.

📒 Files selected for processing (13)
  • Content.Server/Imperial/Vampire/VampireSystem.Abilities.cs
  • Content.Server/Imperial/Vampire/VampireSystem.Ghoul.cs
  • Content.Server/Imperial/Vampire/VampireSystem.cs
  • Content.Shared/Imperial/Vampire/Components/GhoulComponent.cs
  • Content.Shared/Imperial/Vampire/Components/VampireComponent.cs
  • Content.Shared/Imperial/Vampire/Event/VampireActionEvent.cs
  • Content.Shared/Imperial/Vampire/SharedVampireSystem.cs
  • Resources/Locale/ru-RU/Imperial/Vampire/vampire.ftl
  • Resources/Prototypes/Imperial/Vampire/alert.yml
  • Resources/Prototypes/Imperial/Vampire/game_rule.yml
  • Resources/Prototypes/Imperial/Vampire/purposes.yml
  • Resources/Prototypes/Imperial/Vampire/vampire_abilities.yml
  • Resources/Prototypes/secret_weights.yml
💤 Files with no reviewable changes (1)
  • Content.Shared/Imperial/Vampire/Event/VampireActionEvent.cs

@stellarkov stellarkov marked this pull request as ready for review March 15, 2026 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C# Изменения добавляют новый C# код Change Wiz Code Изменения вмешиваются в код визардов Change WIz Prototypes Изменения вмешиваются в код прототипов визардов Prototypes Изменения добавляет новые прототипы size/Small Насколько сложно будет апстримить

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant