diff --git a/Content.Server/Backmen/Vampiric/BkmVampireLevelingSystem.cs b/Content.Server/Backmen/Vampiric/BkmVampireLevelingSystem.cs index e3332ede960..f44c18a90c3 100644 --- a/Content.Server/Backmen/Vampiric/BkmVampireLevelingSystem.cs +++ b/Content.Server/Backmen/Vampiric/BkmVampireLevelingSystem.cs @@ -23,8 +23,10 @@ using Content.Shared.Polymorph; using Content.Shared.Popups; using Content.Shared.Slippery; +using Content.Shared.Store; using Content.Shared.Store.Components; using Content.Shared.Stunnable; +using Robust.Server.GameObjects; using Robust.Shared.Audio; using Robust.Shared.Audio.Systems; using Robust.Shared.Prototypes; @@ -54,6 +56,7 @@ public sealed class BkmVampireLevelingSystem : EntitySystem [Dependency] private readonly DamageableSystem _damageableSystem = default!; [Dependency] private readonly BloodSuckerSystem _bloodSucker = default!; + [Dependency] private readonly UserInterfaceSystem _ui = default!; public override void Initialize() { @@ -195,6 +198,12 @@ private void OnOpenShop(Entity ent, ref VampireShopActionEv public void InitShop(Entity ent) { + var ui = EnsureComp(ent); + if (!_ui.HasUi(ent, StoreUiKey.Key, ui)) + { + // у пользователя нет ui магазин! + return; + } _actions.AddAction(ent, VmpShop); var store = EnsureComp(ent); store.RefundAllowed = false; diff --git a/Content.Server/Backmen/Vampiric/BloodSuckerSystem.cs b/Content.Server/Backmen/Vampiric/BloodSuckerSystem.cs index dbfb586b54c..7aec448e87e 100644 --- a/Content.Server/Backmen/Vampiric/BloodSuckerSystem.cs +++ b/Content.Server/Backmen/Vampiric/BloodSuckerSystem.cs @@ -131,20 +131,20 @@ public void ConvertToVampire(EntityUid uid) TryComp(uid, out var bloodsucked) && bloodsucked.BloodSuckerMindId.HasValue && !TerminatingOrDeleted(bloodsucked.BloodSuckerMindId.Value) && - TryComp(bloodsucked.BloodSuckerMindId.Value, out var bloodsucker) + _roleSystem.MindHasRole(bloodsucked.BloodSuckerMindId.Value, out var bloodsucker) ) { var masterUid = CompOrNull(bloodsucked.BloodSuckerMindId.Value)?.CurrentEntity; if (TryComp(masterUid, out var master)) { _leveling.AddCurrency((masterUid.Value,master), - 10 * (bloodsucker.Tier + 1), + 10 * (bloodsucker.Value.Comp2.Tier + 1), "обращение" ); } - bloodsucker.Converted += 1; + bloodsucker.Value.Comp2.Converted += 1; } EnsureMindVampire(uid); diff --git a/Content.Server/Backmen/Vampiric/Objective/BloodsuckerObjectiveSystem.cs b/Content.Server/Backmen/Vampiric/Objective/BloodsuckerObjectiveSystem.cs index 486d8f07c9a..db3b4d22515 100644 --- a/Content.Server/Backmen/Vampiric/Objective/BloodsuckerObjectiveSystem.cs +++ b/Content.Server/Backmen/Vampiric/Objective/BloodsuckerObjectiveSystem.cs @@ -40,19 +40,6 @@ private void OnConvertAfterAssigned(Entity private void OnConvertAssigned(Entity ent, ref ObjectiveAssignedEvent args) { - if (args.Mind.OwnedEntity == null) - { - args.Cancelled = true; - return; - } - - var user = args.Mind.OwnedEntity.Value; - if (!HasComp(user)) - { - args.Cancelled = true; - return; - } - ent.Comp.Goal = _random.Next( 1, Math.Max(1, // min 1 of 1 @@ -66,30 +53,17 @@ private void OnConvertAssigned(Entity ent, private void OnGetConvertProgress(Entity ent, ref ObjectiveGetProgressEvent args) { - if (args.Mind.OwnedEntity == null || !TryComp(args.MindId, out var vmp)) + if (!_roleSystem.MindHasRole(args.MindId, out var vmp)) { args.Progress = 0; return; } - args.Progress = vmp.Converted / ent.Comp.Goal; + args.Progress = vmp.Value.Comp2.Converted / ent.Comp.Goal; } private void OnDrinkAssigned(Entity ent, ref ObjectiveAssignedEvent args) { - if (args.Mind.OwnedEntity == null) - { - args.Cancelled = true; - return; - } - - var user = args.Mind.OwnedEntity.Value; - if (!HasComp(user)) - { - args.Cancelled = true; - return; - } - ent.Comp.Goal = _random.Next( ent.Comp.MinGoal, Math.Max(ent.Comp.MinGoal + 1, // min 1 of 1 @@ -100,7 +74,7 @@ private void OnDrinkAssigned(Entity ent, ref private void OnGetDrinkProgress(Entity ent, ref ObjectiveGetProgressEvent args) { - if (args.Mind.OwnedEntity == null || !_roleSystem.MindHasRole(args.MindId, out var role)) + if (!_roleSystem.MindHasRole(args.MindId, out var role)) { args.Progress = 0; return; diff --git a/Content.Server/Backmen/Vampiric/Rule/BloodsuckerRuleSystem.cs b/Content.Server/Backmen/Vampiric/Rule/BloodsuckerRuleSystem.cs index 5a8b52cb28c..dbf302960cf 100644 --- a/Content.Server/Backmen/Vampiric/Rule/BloodsuckerRuleSystem.cs +++ b/Content.Server/Backmen/Vampiric/Rule/BloodsuckerRuleSystem.cs @@ -6,6 +6,7 @@ using Content.Server.Mind; using Content.Shared.GameTicking.Components; using Content.Shared.Mind; +using Content.Shared.Roles; namespace Content.Server.Backmen.Vampiric.Rule; @@ -13,6 +14,7 @@ public sealed class BloodsuckerRuleSystem : GameRuleSystem(player.Value); - var count = role?.Converted ?? 0; - var blood = role?.Drink ?? 0; + _roleSystem.MindHasRole(player.Value, out var role); + var count = role?.Comp2.Converted ?? 0; + var blood = role?.Comp2.Drink ?? 0; var countGoal = 0; var bloodGoal = 0f; @@ -81,21 +83,24 @@ protected override void AppendRoundEndText(EntityUid uid, var isAddLine = true; - var q = EntityQueryEnumerator(); - while (q.MoveNext(out var mindId,out var mind, out var role)) + var q = EntityQueryEnumerator(); + while (q.MoveNext(out var mindId,out var mind)) { if (skip.Contains(mindId)) { continue; } + if(!_roleSystem.MindHasRole(mindId, out var role)) + continue; + if (isAddLine) { ev.AddLine(Loc.GetString("vampire-bitten")); isAddLine = false; } - var count = role?.Converted ?? 0; - var blood = role?.Drink ?? 0; + var count = role?.Comp2.Converted ?? 0; + var blood = role?.Comp2.Drink ?? 0; var countGoal = 0; var bloodGoal = 0f; diff --git a/Resources/Prototypes/_Backmen/Entities/Mobs/Species/harpy.yml b/Resources/Prototypes/_Backmen/Entities/Mobs/Species/harpy.yml index f209fb652c3..97745041eac 100644 --- a/Resources/Prototypes/_Backmen/Entities/Mobs/Species/harpy.yml +++ b/Resources/Prototypes/_Backmen/Entities/Mobs/Species/harpy.yml @@ -38,6 +38,10 @@ type: HumanoidMarkingModifierBoundUserInterface enum.StrippingUiKey.Key: type: StrippableBoundUserInterface + enum.StoreUiKey.Key: + type: StoreBoundUserInterface + enum.SurgeryUIKey.Key: # backmen: surgery + type: SurgeryBui - type: Sprite scale: 0.9, 0.9 layers: diff --git a/Resources/Prototypes/_Backmen/GameRules/roundstart.yml b/Resources/Prototypes/_Backmen/GameRules/roundstart.yml index 540ab34708f..84c8c4b2a6a 100644 --- a/Resources/Prototypes/_Backmen/GameRules/roundstart.yml +++ b/Resources/Prototypes/_Backmen/GameRules/roundstart.yml @@ -62,6 +62,7 @@ - type: AntagSelection definitions: - prefRoles: [ Blob ] + min: 1 max: 2 playerRatio: 40 #players = 2 blobs allowNonHumans: true @@ -74,7 +75,7 @@ sound: /Audio/Backmen/Ambience/Antag/blob_start.ogg mindRoles: - MindRoleBlob - + - type: entity id: BlobSpawn parent: BaseGameRule @@ -108,6 +109,7 @@ - type: AntagSelection definitions: - prefRoles: [ Bloodsucker ] + min: 2 max: 8 playerRatio: 10 blacklist: @@ -128,7 +130,10 @@ categories: [ HideSpawnMenu ] components: - type: GameRule - minPlayers: 10 + minPlayers: 1 + delay: + min: 30 + max: 60 ## Vampire Outbreak - type: entity @@ -137,10 +142,15 @@ categories: [ HideSpawnMenu ] components: - type: StationEvent - earliestStart: 50 + earliestStart: 20 minimumPlayers: 15 weight: 5 - duration: 1 + maxOccurrences: 1 # can only happen once per round + startAnnouncement: station-event-communication-interception + startAudio: + path: /Audio/Announcements/intercept.ogg + duration: null # the rule has to last the whole round not 1 second + occursDuringRoundEnd: false # Shipwrecked - type: entity