diff --git a/Content.Client/Vampire/VampireMutationMenu.xaml b/Content.Client/Vampire/VampireMutationMenu.xaml index 5dca219d2ee..970cb2a2975 100644 --- a/Content.Client/Vampire/VampireMutationMenu.xaml +++ b/Content.Client/Vampire/VampireMutationMenu.xaml @@ -1,7 +1,7 @@ + MinSize="300 300" + SetSize="300 300"> diff --git a/Content.Server/GameTicking/Rules/VampireRuleSystem.cs b/Content.Server/GameTicking/Rules/VampireRuleSystem.cs index a5522848dcc..64b611c3cd8 100644 --- a/Content.Server/GameTicking/Rules/VampireRuleSystem.cs +++ b/Content.Server/GameTicking/Rules/VampireRuleSystem.cs @@ -1,4 +1,5 @@ using Content.Server.Antag; +using Content.Server.Atmos.Components; using Content.Server.GameTicking.Rules.Components; using Content.Server.Mind; using Content.Server.Objectives; @@ -10,6 +11,9 @@ using Content.Shared.Roles; using Content.Shared.Store; using Content.Shared.Store.Components; +using Content.Shared.Atmos; +using Content.Shared.Atmos.Rotting; +using Content.Shared.Nutrition.Components; using Robust.Server.GameObjects; using Robust.Shared.Audio; using Robust.Shared.Prototypes; @@ -82,13 +86,19 @@ public bool MakeVampire(EntityUid target, VampireRuleComponent rule) if (HasComp(target)) _uiSystem.SetUiState(target, VampireMutationUiKey.Key, new VampireMutationBoundUserInterfaceState(vampireComponent.VampireMutations, vampireComponent.CurrentMutation)); + + var vampire = new Entity(target, vampireComponent); + + RemComp(vampire); + RemComp(vampire); + RemComp(vampire); vampireComponent.Balance = new() { { VampireComponent.CurrencyProto, 0 } }; rule.VampireMinds.Add(mindId); - if (HasComp(target)) - _vampire.AddStartingAbilities(target); + _vampire.AddStartingAbilities(vampire); + _vampire.MakeVulnerableToHoly(vampire); Random random = new Random(); diff --git a/Content.Server/Vampire/VampireSystem.Transform.cs b/Content.Server/Vampire/VampireSystem.Transform.cs index 21f29b67f90..045bf0051fa 100644 --- a/Content.Server/Vampire/VampireSystem.Transform.cs +++ b/Content.Server/Vampire/VampireSystem.Transform.cs @@ -50,7 +50,7 @@ private void MakeVampire(EntityUid vampireUid) /// /// Add vulnerability to holy water when ingested or slashed, and take damage from the bible /// - private void MakeVulnerableToHoly(Entity vampire) + public void MakeVulnerableToHoly(Entity vampire) { //React to being beaten with the bible EnsureComp(vampire); @@ -101,16 +101,21 @@ public void AddStartingAbilities(EntityUid vampire) if (!action.HasValue) return; - if (!TryComp(action, out var instantActionComponent)) - return; - - var actionEvent = instantActionComponent.Event as VampireSelfPowerEvent; - - if (actionEvent == null) - return; + if (TryComp(action, out var instantActionComponent)) + { + if (instantActionComponent.Event is VampireSelfPowerEvent instantActionEvent) + { + comp.UnlockedPowers.Add(instantActionEvent.DefinitionName, action); + } + } - comp.UnlockedPowers.Add(actionEvent.DefinitionName, action); - + if (TryComp(action, out var entityActionComponent)) + { + if (entityActionComponent.Event is VampireTargetedPowerEvent entityActionEvent) + { + comp.UnlockedPowers.Add(entityActionEvent.DefinitionName, action); + } + } } UpdateBloodDisplay(vampire);