From 8378ebdd98bd5ef7daca458f905dd52c455677c2 Mon Sep 17 00:00:00 2001 From: Zack Backmen Date: Thu, 29 Aug 2024 14:43:22 +0300 Subject: [PATCH] upd --- .../Backmen/Fugitive/FugitiveSystem.cs | 1 + Content.Server/Backmen/Soul/GolemSystem.cs | 19 +++++++++++-------- Resources/Prototypes/Maps/bagel.yml | 2 +- .../_Backmen/Entities/Mobs/Species/golem.yml | 3 +++ Resources/Prototypes/_Backmen/Maps/hive.yml | 2 +- Resources/Prototypes/_Backmen/Maps/rook.yml | 2 +- .../Prototypes/_Backmen/Maps/shoukou.yml | 2 +- .../Prototypes/_Backmen/Maps/tortuga.yml | 2 +- 8 files changed, 20 insertions(+), 13 deletions(-) diff --git a/Content.Server/Backmen/Fugitive/FugitiveSystem.cs b/Content.Server/Backmen/Fugitive/FugitiveSystem.cs index eddeea27d62..7dcdb56b239 100644 --- a/Content.Server/Backmen/Fugitive/FugitiveSystem.cs +++ b/Content.Server/Backmen/Fugitive/FugitiveSystem.cs @@ -84,6 +84,7 @@ public override void Initialize() SubscribeLocalEvent(OnSpawned); SubscribeLocalEvent(OnMindAdded); SubscribeLocalEvent(OnRoundEnd); + SubscribeLocalEvent(HandlePlayerSpawning, before: new []{ typeof(SpawnPointSystem) }); } [ValidatePrototypeId] diff --git a/Content.Server/Backmen/Soul/GolemSystem.cs b/Content.Server/Backmen/Soul/GolemSystem.cs index f66c4d8e706..1ff6d850ae2 100644 --- a/Content.Server/Backmen/Soul/GolemSystem.cs +++ b/Content.Server/Backmen/Soul/GolemSystem.cs @@ -58,13 +58,13 @@ public override void Initialize() private void OnGetLaws(EntityUid uid, GolemComponent component, ref GetSiliconLawsEvent args) { - if (args.Handled || component.Master == null) + if (args.Handled) return; // Add the first emag law args.Laws.Laws.Add(new SiliconLaw { - LawString = Loc.GetString("law-golem-1", ("name", component.Master)), + LawString = Loc.GetString("law-golem-1", ("name", component.Master ?? "----")), Order = 1 }); @@ -91,7 +91,7 @@ private void OnAfterInteract(EntityUid uid, SoulCrystalComponent component, Afte if (!TryComp(args.Target, out var golem)) return; - if (HasComp(args.Target)) + if (!(HasComp(args.Target) || Prototype(args.User)?.ID == AdminObserver)) return; if (!TryComp(args.User, out var userActor)) @@ -142,6 +142,9 @@ private void OnDispelled(EntityUid uid, GolemComponent component, DispelledEvent DirtyEntity(uid); } + [ValidatePrototypeId] + private const string Ash = "Ash"; + private void OnMobStateChanged(EntityUid uid, GolemComponent component, MobStateChangedEvent args) { if (args.NewMobState != MobState.Dead) @@ -151,7 +154,7 @@ private void OnMobStateChanged(EntityUid uid, GolemComponent component, MobState var ev = new DispelledEvent(); RaiseLocalEvent(uid, ev, false); - Spawn("Ash", Transform(uid).Coordinates); + Spawn(Ash, Transform(uid).Coordinates); _audioSystem.PlayPvs(component.DeathSound, uid); } @@ -163,10 +166,10 @@ private void OnInstallRequest(EntityUid uid, GolemComponent component, GolemInst if (!TryComp(uid, out var slots)) return; - if (!TryComp(component.PotentialCrystal, out var actor)) - return; + //if (!TryComp(component.PotentialCrystal, out var actor)) + // return; - if (!_mindSystem.TryGetMind(component.PotentialCrystal.Value, out var mindId, out var mind)) + if (!_mindSystem.TryGetMind(component.PotentialCrystal.Value, out var mindId, out var mind) || mind.Session == null) return; if (!_slotsSystem.TryGetSlot(uid, CrystalSlot, out var crystalSlot, slots)) // does it not have a crystal slot? @@ -217,7 +220,7 @@ private void OnInstallRequest(EntityUid uid, GolemComponent component, GolemInst //component.Master = null; component.GolemName = null; DirtyEntity(uid); - Dirty(uid, component); + //Dirty(uid, component); } private void OnNameChanged(EntityUid uid, GolemComponent golemComponent, GolemNameChangedMessage args) diff --git a/Resources/Prototypes/Maps/bagel.yml b/Resources/Prototypes/Maps/bagel.yml index 76fb3e3011d..8361f70baed 100644 --- a/Resources/Prototypes/Maps/bagel.yml +++ b/Resources/Prototypes/Maps/bagel.yml @@ -67,5 +67,5 @@ Deliveryman: [ 0, 1 ] Prisoner: [ 2, 3] #silicon - StationAi: [ 1, 0 ] + StationAi: [ 1, 1 ] Borg: [ 4, 4 ] diff --git a/Resources/Prototypes/_Backmen/Entities/Mobs/Species/golem.yml b/Resources/Prototypes/_Backmen/Entities/Mobs/Species/golem.yml index 821a70edfbe..bd5f17c7c5e 100644 --- a/Resources/Prototypes/_Backmen/Entities/Mobs/Species/golem.yml +++ b/Resources/Prototypes/_Backmen/Entities/Mobs/Species/golem.yml @@ -6,6 +6,9 @@ description: Искусственная конструкция, имитирующая жизнь. У этого еще не установлен кристалл души. components: - type: ComplexInteraction + - type: ActionGrant + actions: + - ActionViewLaws - type: Sprite noRot: true drawdepth: Mobs diff --git a/Resources/Prototypes/_Backmen/Maps/hive.yml b/Resources/Prototypes/_Backmen/Maps/hive.yml index 981504deebb..da3d5ce5718 100644 --- a/Resources/Prototypes/_Backmen/Maps/hive.yml +++ b/Resources/Prototypes/_Backmen/Maps/hive.yml @@ -66,7 +66,7 @@ SalvageSpecialist: [ 2, 3 ] Deliveryman: [ 2, 2 ] #silicon - StationAi: [ 1, 0 ] + StationAi: [ 1, 1 ] #BKBPLATech: [0, 3] #BKBPLAMED: [0, 3] Borg: [ 3, 3 ] diff --git a/Resources/Prototypes/_Backmen/Maps/rook.yml b/Resources/Prototypes/_Backmen/Maps/rook.yml index 051220b2d1c..1d42ef07bb7 100644 --- a/Resources/Prototypes/_Backmen/Maps/rook.yml +++ b/Resources/Prototypes/_Backmen/Maps/rook.yml @@ -92,7 +92,7 @@ SalvageSpecialist: [ 2, 2 ] CargoTechnician: [ 2, 3 ] #silicon - StationAi: [ 1, 0 ] + StationAi: [ 1, 1 ] #BKBPLATech: [0, 2] #BKBPLAMED: [0, 2] Borg: [ 1, 2 ] diff --git a/Resources/Prototypes/_Backmen/Maps/shoukou.yml b/Resources/Prototypes/_Backmen/Maps/shoukou.yml index b30fd7fd729..5393de67f19 100644 --- a/Resources/Prototypes/_Backmen/Maps/shoukou.yml +++ b/Resources/Prototypes/_Backmen/Maps/shoukou.yml @@ -61,7 +61,7 @@ SalvageSpecialist: [ 2, 4 ] CargoTechnician: [ 2, 3 ] #silicon - StationAi: [ 1, 0 ] + StationAi: [ 1, 1 ] #BKBPLATech: [0, 2] #BKBPLAMED: [0, 2] Borg: [ 3, 3 ] diff --git a/Resources/Prototypes/_Backmen/Maps/tortuga.yml b/Resources/Prototypes/_Backmen/Maps/tortuga.yml index 16d360dc874..969aa965c65 100644 --- a/Resources/Prototypes/_Backmen/Maps/tortuga.yml +++ b/Resources/Prototypes/_Backmen/Maps/tortuga.yml @@ -65,7 +65,7 @@ SalvageSpecialist: [ 3, 4 ] Deliveryman: [ 2, 2 ] #silicon - StationAi: [ 1, 0 ] + StationAi: [ 1, 1 ] #BKBPLATech: [0, 3] #BKBPLAMED: [0, 3] Borg: [ 3, 3 ]