* vampire returns + transformstions redo * carcat fangs fix + greetings music update * vampire skill trees * Blood essence gathering Introduces the vampire blood essence mechanic, including the CP14SpellVampireGatherEssence spell, new skill point consumable component, and related UI/localization updates. Adds clientside effects for spell casting, new vampire skill and action, and refines skill point gain/loss popups. Also restructures vampire components, updates spell logic for client/server prediction, and removes unused parallax files. * perma damage * Add skill point cost to magic system and vampire essence spell Introduced CP14MagicEffectSkillPointCostComponent to allow magic effects to consume skill points. Updated the shared magic system to handle skill point checks and consumption. Added a new vampire spell for creating blood essence, including new icons and localization. Adjusted vampire component to grant and remove skill points, and updated related skill tree and spell prototypes. Minor fixes and refactoring in spell logic and descriptions. * blood step + blood vision skills * vampire clans icons * 50 players limit + vampire objectives * fixes * devourers altar transmutation * Remove StealTarget component from animal, dino, and mole NPCs The StealTarget component and associated stealGroup were removed from boar, dinosaur, and mole NPC definitions. This likely disables these entities from being targeted for stealing, possibly to adjust gameplay balance or fix unintended behavior. * fix * essence creation improve * altars * voice masks * transmutation fix * teleportation glyph * crimson candles * candle crafting * fix pointer predictions * Add Vampire Clan Battle gamemode and update vampire roles Introduces the 'Vampire Clan Battle' gamemode with new localization in English and Russian, updated game preset definitions, and secret weights. Refactors vampire antagonist briefings and objectives for multiple clans, adjusts vampire role preferences and team settings, and reduces the damage of the Vampire Gather Essence spell. Also includes minor improvements to spell and game mode descriptions, and corrects file naming for game preset locales. * powerful kicks in * time gates + vampire tree * vampire proto faction * fix * fixes * tree progression * search enemy * Update CP14SharedVampireSystem.cs * blood essence gathering redo * essence gathering refactor 2 * blood healing * Update secret_weights.yml * tree planting * boodgrass * tree upgrade announcement * construction graph integration * delete transmutation system * workbench crafting returns * cloaks crafting + cloak invisibility * make vampire tree is generic red tree (sad) * clan heart sprite * Refactor vampire tree to clan heart system Replaces the CP14VampireTreeComponent with CP14VampireClanHeartComponent, updating all related logic, appearance, and localization. Adjusts skill requirements, examination, and level progression to use the new clan heart system. Updates entity prototypes, visuals, and adds new orb sprites for clan heart levels. Localization strings and logic are updated to reflect the new terminology and mechanics. * Update SpeciesBlacklist.cs * Refactor vampire clan heart and remove tree spell Refactored the vampire clan heart to support essence regeneration over time and adjusted level thresholds. Removed the vampire tree planting spell and related prototype fields, as well as unused tree system code. Updated localization, entity prototypes, and faction definitions to reflect these changes. * Add clan heart construction for vampire clans Introduces construction graphs, entities, and conditions for building unique clan hearts for each vampire clan (Unnameable, Devourers, NightChildrens). Adds new construction conditions (all clan vampires required, singleton enforcement), updates skill tree to unlock constructions, and removes the now-obsolete CP14MagicEffectAllVampireClanRequiredComponent. Also adds new frame sprites and updates localization and prototype files accordingly. * level up vfx * VFX + lobby track * orb resprite * sprites * Add vampire altar mechanics and improve clan heart behavior Introduces the CP14VampireAltarComponent and altar entity, which doubles blood essence extraction when victims are strapped to the altar. Adds a custom explosion behavior for vampire clan hearts upon destruction, updates construction graphs and recipes for altars, and improves localization. Also refines skill description handling and adjusts vampire bite action text. * essence get when heart destruction * Add clan heart damage and destruction announcements Introduces announcements for when a vampire clan heart is damaged or destroyed, with cooldown to prevent spam. Refactors examination logic and updates localization files for both English and Russian to support new messages and sender formatting. * glyph adaptation * resurrection * Add round end summary for Vampire Clan Battles Implemented detailed round end text for the Vampire Clan Battles game mode, displaying victory, defeat, or draw outcomes based on surviving factions and population percentage. Refactored alive player percentage logic into a shared method and updated localization files with new outcome messages in English and Russian. Also removed an unused field from the defence condition component. * Update vampire_cloak.yml * fix * fix * Update portal_glyph.yml
219 lines
7.4 KiB
C#
219 lines
7.4 KiB
C#
using Content.Shared._CP14.Skill;
|
|
using Content.Shared._CP14.Skill.Components;
|
|
using Content.Shared._CP14.Skill.Prototypes;
|
|
using Content.Shared._CP14.Vampire.Components;
|
|
using Content.Shared.Actions;
|
|
using Content.Shared.Body.Systems;
|
|
using Content.Shared.Buckle.Components;
|
|
using Content.Shared.DoAfter;
|
|
using Content.Shared.Examine;
|
|
using Content.Shared.FixedPoint;
|
|
using Content.Shared.Humanoid;
|
|
using Content.Shared.Jittering;
|
|
using Robust.Shared.Prototypes;
|
|
using Robust.Shared.Serialization;
|
|
using Robust.Shared.Timing;
|
|
|
|
namespace Content.Shared._CP14.Vampire;
|
|
|
|
public abstract partial class CP14SharedVampireSystem : EntitySystem
|
|
{
|
|
[Dependency] private readonly SharedBloodstreamSystem _bloodstream = default!;
|
|
[Dependency] private readonly SharedActionsSystem _action = default!;
|
|
[Dependency] private readonly SharedDoAfterSystem _doAfter = default!;
|
|
[Dependency] private readonly SharedJitteringSystem _jitter = default!;
|
|
[Dependency] private readonly IGameTiming _timing = default!;
|
|
[Dependency] private readonly CP14SharedSkillSystem _skill = default!;
|
|
[Dependency] protected readonly IPrototypeManager Proto = default!;
|
|
|
|
private readonly ProtoId<CP14SkillPointPrototype> _skillPointType = "Blood";
|
|
private readonly ProtoId<CP14SkillPointPrototype> _memorySkillPointType = "Memory";
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
InitializeSpell();
|
|
|
|
SubscribeLocalEvent<CP14VampireComponent, MapInitEvent>(OnVampireInit);
|
|
SubscribeLocalEvent<CP14VampireComponent, ComponentRemove>(OnVampireRemove);
|
|
|
|
SubscribeLocalEvent<CP14VampireComponent, CP14ToggleVampireVisualsAction>(OnToggleVisuals);
|
|
SubscribeLocalEvent<CP14VampireComponent, CP14VampireToggleVisualsDoAfter>(OnToggleDoAfter);
|
|
|
|
SubscribeLocalEvent<CP14VampireVisualsComponent, ComponentInit>(OnVampireVisualsInit);
|
|
SubscribeLocalEvent<CP14VampireVisualsComponent, ComponentShutdown>(OnVampireVisualsShutdown);
|
|
SubscribeLocalEvent<CP14VampireVisualsComponent, ExaminedEvent>(OnVampireExamine);
|
|
|
|
SubscribeLocalEvent<CP14VampireEssenceHolderComponent, ExaminedEvent>(OnEssenceHolderExamined);
|
|
}
|
|
|
|
private void OnEssenceHolderExamined(Entity<CP14VampireEssenceHolderComponent> ent, ref ExaminedEvent args)
|
|
{
|
|
if (!HasComp<CP14ShowVampireEssenceComponent>(args.Examiner))
|
|
return;
|
|
|
|
if (!args.IsInDetailsRange)
|
|
return;
|
|
|
|
args.PushMarkup(Loc.GetString("cp14-vampire-essence-holder-examine", ("essence", ent.Comp.Essence)));
|
|
}
|
|
|
|
protected virtual void OnVampireInit(Entity<CP14VampireComponent> ent, ref MapInitEvent args)
|
|
{
|
|
//Bloodstream
|
|
_bloodstream.ChangeBloodReagent(ent.Owner, ent.Comp.NewBloodReagent);
|
|
|
|
//Actions
|
|
foreach (var proto in ent.Comp.ActionsProto)
|
|
{
|
|
EntityUid? newAction = null;
|
|
_action.AddAction(ent, ref newAction, proto);
|
|
}
|
|
|
|
//Skill tree
|
|
_skill.AddSkillPoints(ent, ent.Comp.SkillPointProto, ent.Comp.SkillPointCount, silent: true);
|
|
_skill.AddSkillTree(ent, ent.Comp.SkillTreeProto);
|
|
|
|
//Skill tree base nerf
|
|
_skill.RemoveSkillPoints(ent, _memorySkillPointType, 2, true);
|
|
|
|
//Remove blood essence
|
|
if (TryComp<CP14VampireEssenceHolderComponent>(ent, out var essenceHolder))
|
|
{
|
|
essenceHolder.Essence = 0;
|
|
Dirty(ent, essenceHolder);
|
|
}
|
|
}
|
|
|
|
private void OnVampireRemove(Entity<CP14VampireComponent> ent, ref ComponentRemove args)
|
|
{
|
|
RemCompDeferred<CP14VampireVisualsComponent>(ent);
|
|
|
|
//Bloodstream todo
|
|
|
|
//Metabolism todo
|
|
|
|
//Actions
|
|
foreach (var action in ent.Comp.Actions)
|
|
{
|
|
_action.RemoveAction(ent.Owner, action);
|
|
}
|
|
|
|
//Skill tree
|
|
_skill.RemoveSkillTree(ent, ent.Comp.SkillTreeProto);
|
|
if (TryComp<CP14SkillStorageComponent>(ent, out var storage))
|
|
{
|
|
foreach (var skill in storage.LearnedSkills)
|
|
{
|
|
if (!Proto.TryIndex(skill, out var indexedSkill))
|
|
continue;
|
|
|
|
if (indexedSkill.Tree == ent.Comp.SkillTreeProto)
|
|
_skill.TryRemoveSkill(ent, skill);
|
|
}
|
|
}
|
|
_skill.RemoveSkillPoints(ent, ent.Comp.SkillPointProto, ent.Comp.SkillPointCount);
|
|
_skill.AddSkillPoints(ent, _memorySkillPointType, 2, null, true);
|
|
}
|
|
|
|
private void OnToggleVisuals(Entity<CP14VampireComponent> ent, ref CP14ToggleVampireVisualsAction args)
|
|
{
|
|
if (_timing.IsFirstTimePredicted)
|
|
_jitter.DoJitter(ent, ent.Comp.ToggleVisualsTime, true);
|
|
|
|
var doAfterArgs = new DoAfterArgs(EntityManager, ent, ent.Comp.ToggleVisualsTime, new CP14VampireToggleVisualsDoAfter(), ent)
|
|
{
|
|
Hidden = true,
|
|
NeedHand = false,
|
|
};
|
|
|
|
_doAfter.TryStartDoAfter(doAfterArgs);
|
|
}
|
|
|
|
private void OnToggleDoAfter(Entity<CP14VampireComponent> ent, ref CP14VampireToggleVisualsDoAfter args)
|
|
{
|
|
if (args.Cancelled || args.Handled)
|
|
return;
|
|
|
|
if (HasComp<CP14VampireVisualsComponent>(ent))
|
|
{
|
|
RemCompDeferred<CP14VampireVisualsComponent>(ent);
|
|
}
|
|
else
|
|
{
|
|
EnsureComp<CP14VampireVisualsComponent>(ent);
|
|
}
|
|
|
|
args.Handled = true;
|
|
}
|
|
|
|
protected virtual void OnVampireVisualsShutdown(Entity<CP14VampireVisualsComponent> vampire, ref ComponentShutdown args)
|
|
{
|
|
if (!EntityManager.TryGetComponent(vampire, out HumanoidAppearanceComponent? humanoidAppearance))
|
|
return;
|
|
|
|
humanoidAppearance.EyeColor = vampire.Comp.OriginalEyesColor;
|
|
|
|
Dirty(vampire, humanoidAppearance);
|
|
}
|
|
|
|
protected virtual void OnVampireVisualsInit(Entity<CP14VampireVisualsComponent> vampire, ref ComponentInit args)
|
|
{
|
|
if (!EntityManager.TryGetComponent(vampire, out HumanoidAppearanceComponent? humanoidAppearance))
|
|
return;
|
|
|
|
vampire.Comp.OriginalEyesColor = humanoidAppearance.EyeColor;
|
|
humanoidAppearance.EyeColor = vampire.Comp.EyesColor;
|
|
|
|
Dirty(vampire, humanoidAppearance);
|
|
}
|
|
|
|
private void OnVampireExamine(Entity<CP14VampireVisualsComponent> ent, ref ExaminedEvent args)
|
|
{
|
|
args.PushMarkup(Loc.GetString("cp14-vampire-examine"));
|
|
}
|
|
|
|
public void GatherEssence(Entity<CP14VampireComponent?> vampire,
|
|
Entity<CP14VampireEssenceHolderComponent?> victim,
|
|
FixedPoint2 amount)
|
|
{
|
|
if (!Resolve(vampire, ref vampire.Comp, false))
|
|
return;
|
|
|
|
if (!Resolve(victim, ref victim.Comp, false))
|
|
return;
|
|
|
|
var extractedEssence = MathF.Min(victim.Comp.Essence.Float(), amount.Float());
|
|
|
|
if (TryComp<BuckleComponent>(victim, out var buckle) && buckle.BuckledTo is not null)
|
|
{
|
|
if (TryComp<CP14VampireAltarComponent>(buckle.BuckledTo, out var altar))
|
|
{
|
|
extractedEssence *= altar.Multiplier;
|
|
}
|
|
}
|
|
|
|
if (extractedEssence <= 0)
|
|
return;
|
|
|
|
_skill.AddSkillPoints(vampire, _skillPointType, extractedEssence);
|
|
victim.Comp.Essence -= amount;
|
|
|
|
Dirty(victim);
|
|
}
|
|
}
|
|
|
|
|
|
public sealed partial class CP14ToggleVampireVisualsAction : InstantActionEvent;
|
|
|
|
[Serializable, NetSerializable]
|
|
public sealed partial class CP14VampireToggleVisualsDoAfter : SimpleDoAfterEvent;
|
|
|
|
|
|
// Appearance Data key
|
|
[Serializable, NetSerializable]
|
|
public enum VampireClanLevelVisuals : byte
|
|
{
|
|
Level,
|
|
}
|