diff --git a/Content.Client/NPC/Systems/NpcFactionSpriteStateSetterSystem.cs b/Content.Client/NPC/Systems/NpcFactionSpriteStateSetterSystem.cs index 1e57d917be..9e0c462dff 100644 --- a/Content.Client/NPC/Systems/NpcFactionSpriteStateSetterSystem.cs +++ b/Content.Client/NPC/Systems/NpcFactionSpriteStateSetterSystem.cs @@ -23,6 +23,10 @@ public sealed partial class NpcFactionSpriteStateSetterSystem : EntitySystem return; SpriteComponent spriteComponent = _entityManager.GetComponent(entity); - spriteComponent.LayerSetState(0, new Robust.Client.Graphics.RSI.StateId(args.FactionID)); + + var rsi = spriteComponent.LayerGetActualRSI(0); + + if(rsi != null && rsi.TryGetState(args.FactionID, out _)) + spriteComponent.LayerSetState(0, new Robust.Client.Graphics.RSI.StateId(args.FactionID)); } } diff --git a/Content.Shared/Silicon/Components/EmagReplaceFactionsComponent.cs b/Content.Shared/Silicon/Components/EmagReplaceFactionsComponent.cs index 41ec2fbb68..f7c157dc0b 100644 --- a/Content.Shared/Silicon/Components/EmagReplaceFactionsComponent.cs +++ b/Content.Shared/Silicon/Components/EmagReplaceFactionsComponent.cs @@ -17,6 +17,12 @@ public sealed partial class EmagReplaceFactionsComponent : Component [DataField(required: false)] public int StunSeconds = 5; + /// + /// Should the component add factions to the existing list of factions instead of replacing them? + /// + [DataField(required:false)] + public bool Additive = false; + /// /// Factions to replace from the original set. /// diff --git a/Content.Shared/Silicon/Systems/EmagReplaceFactionsSystem.cs b/Content.Shared/Silicon/Systems/EmagReplaceFactionsSystem.cs index 82d2c53680..87a7b51e64 100644 --- a/Content.Shared/Silicon/Systems/EmagReplaceFactionsSystem.cs +++ b/Content.Shared/Silicon/Systems/EmagReplaceFactionsSystem.cs @@ -40,7 +40,9 @@ public sealed class EmagReplaceFactionsSystem : EntitySystem newFactions.Add(comp.Factions[i]); } - _npcFactionSystem.ClearFactions(uid, false); + if(!comp.Additive) + _npcFactionSystem.ClearFactions(uid, false); + _npcFactionSystem.AddFactions(uid, newFactions); if(comp.StunSeconds > 0) diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/gladiabot.yml b/Resources/Prototypes/Entities/Mobs/NPCs/gladiabot.yml index 78faa6f6cb..c910e28b58 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/gladiabot.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/gladiabot.yml @@ -33,6 +33,10 @@ - GladiabotBlue - GladiabotGreen - GladiabotYellow + - type: EmagReplaceFactions + additive: true + factions: + - Syndicate - type: NpcFactionSpriteStateSetter - type: CombatMode - type: MeleeWeapon diff --git a/Resources/Prototypes/ai_factions.yml b/Resources/Prototypes/ai_factions.yml index 09ced01cc6..f6e16b4343 100644 --- a/Resources/Prototypes/ai_factions.yml +++ b/Resources/Prototypes/ai_factions.yml @@ -7,6 +7,11 @@ - PetsNT - Zombie - Revolutionary + - GladiabotFFA + - GladiabotRed + - GladiabotGreen + - GladiabotBlue + - GladiabotYellow - type: npcFaction id: NanoTrasen @@ -16,6 +21,7 @@ - Xeno - Zombie - Revolutionary + - Dragon - type: npcFaction id: Mouse @@ -45,6 +51,11 @@ - Zombie - Revolutionary - GeometerOfBlood + - GladiabotFFA + - GladiabotRed + - GladiabotGreen + - GladiabotBlue + - GladiabotYellow - type: npcFaction id: SimpleNeutral @@ -67,6 +78,11 @@ - PetsNT - Zombie - Revolutionary + - GladiabotFFA + - GladiabotRed + - GladiabotGreen + - GladiabotBlue + - GladiabotYellow - type: npcFaction id: Zombie @@ -78,6 +94,11 @@ - Passive - PetsNT - Revolutionary + - GladiabotFFA + - GladiabotRed + - GladiabotGreen + - GladiabotBlue + - GladiabotYellow - type: npcFaction id: Revolutionary @@ -119,6 +140,10 @@ - GladiabotGreen - GladiabotBlue - GladiabotYellow + - SimpleHostile + - Xeno + - Zombie + - Dragon - type: npcFaction id: GladiabotRed @@ -127,6 +152,10 @@ - GladiabotGreen - GladiabotBlue - GladiabotYellow + - SimpleHostile + - Xeno + - Zombie + - Dragon - type: npcFaction id: GladiabotGreen @@ -135,6 +164,10 @@ - GladiabotRed - GladiabotBlue - GladiabotYellow + - SimpleHostile + - Xeno + - Zombie + - Dragon - type: npcFaction id: GladiabotBlue @@ -143,6 +176,10 @@ - GladiabotRed - GladiabotGreen - GladiabotYellow + - SimpleHostile + - Xeno + - Zombie + - Dragon - type: npcFaction id: GladiabotYellow @@ -151,3 +188,7 @@ - GladiabotRed - GladiabotGreen - GladiabotBlue + - SimpleHostile + - Xeno + - Zombie + - Dragon