Files
wylab-station-14/Content.Client/_Wega/Vampire/VampireSystem.cs
wylab f1d4f62047
Some checks failed
Build & Test Debug / build (ubuntu-latest) (push) Failing after 2m10s
Build & Test Debug / Build & Test Debug (push) Has been skipped
Test Packaging / Test Packaging (push) Failing after 1m57s
RGA schema validator / YAML RGA schema validator (push) Failing after 25s
RSI Validator / Validate RSIs (push) Successful in 28s
Map file schema validator / YAML map schema validator (push) Failing after 26s
Build & Test Map Renderer / build (ubuntu-latest) (push) Failing after 7m30s
Build & Test Map Renderer / Build & Test Debug (push) Has been skipped
YAML Linter / YAML Linter (push) Failing after 2m12s
Publish / build (push) Failing after 7m32s
feat: add Vampire antagonist from wega fork
Vampires are solo antagonists who must drink blood to gain power.
Features 4 class archetypes (Hemomancer, Umbrae, Gargantua, Dantalion)
each with 8 unique abilities unlocked through blood consumption.

Includes:
- Core vampire system with blood drinking mechanics
- 4 class archetypes with 32 total abilities
- Thrall system for Dantalion class
- Blood economy & skill progression
- Holy/unholy damage interactions
- Hallucinations system dependency
- Client UI for class selection
- 40+ sprite assets
- Russian localization

Also adds Hallucinations system (used by Mass Hysteria ability).

Requirements: 15h playtime
Min players: 20

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-17 00:41:55 +01:00

64 lines
2.5 KiB
C#

using Content.Client.Alerts;
using Content.Client.Movement.Systems;
using Content.Shared.StatusIcon.Components;
using Content.Shared.Vampire;
using Content.Shared.Vampire.Components;
using Robust.Client.GameObjects;
using Robust.Client.Player;
using Robust.Shared.Prototypes;
namespace Content.Client.Vampire;
public sealed class VampireSystem : SharedVampireSystem
{
[Dependency] private readonly IPrototypeManager _prototype = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;
[Dependency] private readonly ContentEyeSystem _contentEye = default!;
[Dependency] private readonly IEntityManager _entityManager = default!;
[Dependency] private readonly SpriteSystem _sprite = default!;
public override void Initialize()
{
base.Initialize();
SubscribeNetworkEvent<VampireToggleFovEvent>(OnToggleFoV);
SubscribeLocalEvent<VampireComponent, GetStatusIconsEvent>(GetVampireIcons);
SubscribeLocalEvent<ThrallComponent, GetStatusIconsEvent>(GetThrallIcons);
SubscribeLocalEvent<VampireComponent, UpdateAlertSpriteEvent>(OnUpdateAlert);
}
private void OnToggleFoV(VampireToggleFovEvent args)
{
var userEntity = _entityManager.GetEntity(args.User);
var eyeComponent = _entityManager.GetComponent<EyeComponent>(userEntity);
if (userEntity == _playerManager.LocalEntity)
_contentEye.RequestToggleFov(userEntity, eyeComponent);
}
private void GetVampireIcons(Entity<VampireComponent> ent, ref GetStatusIconsEvent args)
{
var iconPrototype = _prototype.Index(ent.Comp.StatusIcon);
args.StatusIcons.Add(iconPrototype);
}
private void GetThrallIcons(Entity<ThrallComponent> ent, ref GetStatusIconsEvent args)
{
if (HasComp<VampireComponent>(ent))
return;
var iconPrototype = _prototype.Index(ent.Comp.StatusIcon);
args.StatusIcons.Add(iconPrototype);
}
private void OnUpdateAlert(Entity<VampireComponent> ent, ref UpdateAlertSpriteEvent args)
{
if (args.Alert.ID != ent.Comp.BloodAlert)
return;
var blood = Math.Clamp(ent.Comp.CurrentBlood.Int(), 0, 999);
_sprite.LayerSetRsiState(args.SpriteViewEnt.Owner, VampireVisualLayers.Digit1, $"{(blood / 100) % 10}");
_sprite.LayerSetRsiState(args.SpriteViewEnt.Owner, VampireVisualLayers.Digit2, $"{(blood / 10) % 10}");
_sprite.LayerSetRsiState(args.SpriteViewEnt.Owner, VampireVisualLayers.Digit3, $"{blood % 10}");
}
}