Conversation
WalkthroughДанный PR расширяет систему вампиров, добавляя механику обнаружения священников поблизости с нанесением святого урона, реализуя периодический спад крови для вампиров и гулей, переработав логику питания кровью с ранними выходами и разделением ветвлений. Одновременно изменены требования к глаголам действий (удаление проверки количества гулей), обновлены пороги способностей, расширены цели-кражи для антагониста-вампира, добавлены новые оповещения и переработана система обновления способностей. Sequence DiagramsequenceDiagram
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
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 📝 Coding Plan
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. Comment Tip CodeRabbit can approve the review once all CodeRabbit's comments are resolved.Enable the |
There was a problem hiding this comment.
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
📒 Files selected for processing (13)
Content.Server/Imperial/Vampire/VampireSystem.Abilities.csContent.Server/Imperial/Vampire/VampireSystem.Ghoul.csContent.Server/Imperial/Vampire/VampireSystem.csContent.Shared/Imperial/Vampire/Components/GhoulComponent.csContent.Shared/Imperial/Vampire/Components/VampireComponent.csContent.Shared/Imperial/Vampire/Event/VampireActionEvent.csContent.Shared/Imperial/Vampire/SharedVampireSystem.csResources/Locale/ru-RU/Imperial/Vampire/vampire.ftlResources/Prototypes/Imperial/Vampire/alert.ymlResources/Prototypes/Imperial/Vampire/game_rule.ymlResources/Prototypes/Imperial/Vampire/purposes.ymlResources/Prototypes/Imperial/Vampire/vampire_abilities.ymlResources/Prototypes/secret_weights.yml
💤 Files with no reviewable changes (1)
- Content.Shared/Imperial/Vampire/Event/VampireActionEvent.cs
О ПР`е
Тип: fix
Изменения: Исправлены баги с вампиром
Тип: fix
Изменения: Сытость вампира за 1 тик сосания крови повышена до 3-х ед
Тип: feat
Изменения: Вампиры и упыри могут пить кровь животных и игроков в ссд, но это не влияет на счетчик разблокировки способностей и в два раза хуже утоляет голод
Тип: feat
Изменения: Вампиру добавлены цели на убийство и кражу
Тип: remove
Изменения: Удалена цель на обращение экипажа в упырей
Тип: remove
Изменения: Удалено необходимое количество упырей для обращения
Тип: feat
Изменения: Вампир получает 3 ед ожогами каждые 2 секунды, если стоит на расстоянии до 7 тайлов от священника
Тип: fix
Изменения: Уменьшено требуемое количество выпитой крови для получения способностей
Тип: feat
Изменения: Прогресс бар гипноза вампиром теперь скрыт
Тип: feat
Изменения: Максимальное количество упырей, которых может иметь вампир - 5
Технические детали
Нет
Изменения в коде официальных разработчиков
Нет
Summary by CodeRabbit
Примечания к выпуску
New Features
Balance Changes
Gameplay Updates