diff --git a/Content.Client/Backmen/FootPrint/FootPrintsVisualizerSystem.cs b/Content.Client/Backmen/FootPrint/FootPrintsVisualizerSystem.cs index 03df85e0ea6..31309ccd671 100644 --- a/Content.Client/Backmen/FootPrint/FootPrintsVisualizerSystem.cs +++ b/Content.Client/Backmen/FootPrint/FootPrintsVisualizerSystem.cs @@ -1,6 +1,7 @@ using Content.Shared.Backmen.FootPrint; using Robust.Client.GameObjects; using Robust.Client.Graphics; +using Robust.Shared.GameStates; using Robust.Shared.Random; using Robust.Shared.Utility; @@ -17,6 +18,15 @@ public override void Initialize() SubscribeLocalEvent(OnInitialized); SubscribeLocalEvent(OnShutdown); + SubscribeLocalEvent(OnHandleState); + } + + private void OnHandleState(Entity ent, ref ComponentHandleState args) + { + if (args.Current is not FootPrintState state || !TryGetEntity(state.PrintOwner, out var entity)) + return; + + ent.Comp.PrintOwner = entity.Value; } private void OnInitialized(EntityUid uid, FootPrintComponent comp, ComponentInit args) diff --git a/Content.Server/Backmen/FootPrint/FootPrintsSystem.cs b/Content.Server/Backmen/FootPrint/FootPrintsSystem.cs index 62c00672a57..221c2584377 100644 --- a/Content.Server/Backmen/FootPrint/FootPrintsSystem.cs +++ b/Content.Server/Backmen/FootPrint/FootPrintsSystem.cs @@ -7,6 +7,7 @@ using Content.Shared.Chemistry.Components.SolutionManager; using Content.Shared.Chemistry.EntitySystems; using Content.Shared.Gravity; +using Robust.Shared.GameStates; using Robust.Shared.Map; using Robust.Shared.Random; @@ -39,9 +40,15 @@ public override void Initialize() SubscribeLocalEvent(OnStartupComponent); SubscribeLocalEvent(OnMove); + SubscribeLocalEvent(OnGetState); } - private void OnStartupComponent(EntityUid uid, FootPrintsComponent comp, ComponentStartup args) + private void OnGetState(Entity ent, ref ComponentGetState args) + { + args.State = new FootPrintState(TerminatingOrDeleted(ent.Comp.PrintOwner) ? NetEntity.Invalid : GetNetEntity(ent.Comp.PrintOwner)); + } + + private void OnStartupComponent(EntityUid uid, FootPrintsComponent comp, ComponentStartup args) { comp.StepSize += _random.NextFloat(-0.05f, 0.05f); } @@ -52,7 +59,7 @@ private void OnMove(EntityUid uid, FootPrintsComponent comp, ref MoveEvent args) if (comp.PrintsColor.A <= 0f) return; - if (!_transformQuery.TryComp(uid, out var transform)) + if (TerminatingOrDeleted(uid) || !_transformQuery.TryComp(uid, out var transform)) return; if (_gravity.IsWeightless(uid, xform: transform)) diff --git a/Content.Server/Backmen/FootPrint/PuddleFootPrintsSystem.cs b/Content.Server/Backmen/FootPrint/PuddleFootPrintsSystem.cs index c27165f024a..3f07c03725f 100644 --- a/Content.Server/Backmen/FootPrint/PuddleFootPrintsSystem.cs +++ b/Content.Server/Backmen/FootPrint/PuddleFootPrintsSystem.cs @@ -12,19 +12,28 @@ public sealed class PuddleFootPrintsSystem : EntitySystem { [Dependency] private readonly SharedAppearanceSystem _appearance = default!; [Dependency] private readonly SharedSolutionContainerSystem _solutionContainerSystem = default!; + private EntityQuery _appearanceQuery; + private EntityQuery _puddleQuery; + private EntityQuery _footPrintsQuery; + private EntityQuery _solutionContainerManageQuery; - public override void Initialize() + public override void Initialize() { base.Initialize(); SubscribeLocalEvent(OnStepTrigger); + + _appearanceQuery = GetEntityQuery(); + _puddleQuery = GetEntityQuery(); + _footPrintsQuery = GetEntityQuery(); + _solutionContainerManageQuery = GetEntityQuery(); } private void OnStepTrigger(EntityUid uid, PuddleFootPrintsComponent comp, ref EndCollideEvent args) { - if (!TryComp(uid, out var appearance) || - !TryComp(uid, out var puddle) || - !TryComp(args.OtherEntity, out var tripper) || - !TryComp(uid, out var solutionManager)) + if (!_appearanceQuery.TryComp(uid, out var appearance) || + !_puddleQuery.TryComp(uid, out var puddle) || + !_footPrintsQuery.TryComp(args.OtherEntity, out var tripper) || + !_solutionContainerManageQuery.TryComp(uid, out var solutionManager)) { return; } diff --git a/Content.Server/Backmen/Xeno/Components/XenoAgentComponent.cs b/Content.Server/Backmen/Xeno/Components/XenoAgentComponent.cs new file mode 100644 index 00000000000..e5a13749579 --- /dev/null +++ b/Content.Server/Backmen/Xeno/Components/XenoAgentComponent.cs @@ -0,0 +1,7 @@ +namespace Content.Server.Backmen.Xeno.Components; + +[RegisterComponent] +public sealed partial class XenoAgentComponent : Component +{ + +} diff --git a/Content.Server/Backmen/Xeno/Roles/XenoAgentRoleComponent.cs b/Content.Server/Backmen/Xeno/Roles/XenoAgentRoleComponent.cs new file mode 100644 index 00000000000..f00e2067084 --- /dev/null +++ b/Content.Server/Backmen/Xeno/Roles/XenoAgentRoleComponent.cs @@ -0,0 +1,9 @@ +using Content.Shared.Roles; + +namespace Content.Server.Backmen.Blob.Roles; + +[RegisterComponent] +public sealed partial class XenoAgentRoleComponent : BaseMindRoleComponent +{ + +} diff --git a/Content.Server/Backmen/Xeno/XenoAgentSystem.cs b/Content.Server/Backmen/Xeno/XenoAgentSystem.cs new file mode 100644 index 00000000000..483c5d34d3c --- /dev/null +++ b/Content.Server/Backmen/Xeno/XenoAgentSystem.cs @@ -0,0 +1,32 @@ +using Content.Server.Backmen.Language; +using Content.Server.Backmen.Language.Events; +using Content.Server.Backmen.Xeno.Components; +using Content.Shared.Backmen.Language; + +namespace Content.Server.Backmen.Xeno; + +public sealed class XenoAgentSystem : EntitySystem +{ + [Dependency] private readonly LanguageSystem _language = default!; + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnInit); + SubscribeLocalEvent(OnApplyLanguages); + } + + [ValidatePrototypeId] + private const string XenoLanguage = "Xeno"; + + private void OnApplyLanguages(Entity ent, ref DetermineEntityLanguagesEvent args) + { + args.SpokenLanguages.Add(XenoLanguage); + args.UnderstoodLanguages.Add(XenoLanguage); + } + + private void OnInit(Entity ent, ref MapInitEvent args) + { + _language.UpdateEntityLanguages(ent.Owner); + } +} diff --git a/Content.Server/StationEvents/Events/MeteorSwarmSystem.cs b/Content.Server/StationEvents/Events/MeteorSwarmSystem.cs index 948fedf6fc1..a466f48e1bd 100644 --- a/Content.Server/StationEvents/Events/MeteorSwarmSystem.cs +++ b/Content.Server/StationEvents/Events/MeteorSwarmSystem.cs @@ -1,3 +1,4 @@ +using System.Linq; using System.Numerics; using Content.Server.Chat.Systems; using Content.Server.GameTicking.Rules; @@ -44,11 +45,12 @@ protected override void ActiveTick(EntityUid uid, MeteorSwarmComponent component component.NextWaveTime += TimeSpan.FromSeconds(component.WaveCooldown.Next(RobustRandom)); + var stations = _station.GetStations().Where(HasComp).ToList(); - if (_station.GetStations().Count == 0) + if (stations.Count == 0) return; - var station = RobustRandom.Pick(_station.GetStations()); + var station = RobustRandom.Pick(stations); // backmen: centcomm if (_station.GetLargestGrid(Comp(station)) is not { } grid) return; diff --git a/Content.Shared/Backmen/FootPrint/FootPrintComponent.cs b/Content.Shared/Backmen/FootPrint/FootPrintComponent.cs index cdb639665a8..e72b7266142 100644 --- a/Content.Shared/Backmen/FootPrint/FootPrintComponent.cs +++ b/Content.Shared/Backmen/FootPrint/FootPrintComponent.cs @@ -6,13 +6,13 @@ namespace Content.Shared.Backmen.FootPrint; /// /// This is used for marking footsteps, handling footprint drawing. /// -[RegisterComponent, NetworkedComponent, AutoGenerateComponentState] +[RegisterComponent, NetworkedComponent] public sealed partial class FootPrintComponent : Component { /// /// Owner (with ) of a print (this component). /// - [ViewVariables(VVAccess.ReadWrite), AutoNetworkedField] + [ViewVariables(VVAccess.ReadWrite)] public EntityUid PrintOwner; [DataField("solution")] public string SolutionName = "step"; diff --git a/Content.Shared/Backmen/FootPrint/FootPrintState.cs b/Content.Shared/Backmen/FootPrint/FootPrintState.cs new file mode 100644 index 00000000000..f354fafa34d --- /dev/null +++ b/Content.Shared/Backmen/FootPrint/FootPrintState.cs @@ -0,0 +1,9 @@ +using Robust.Shared.Serialization; + +namespace Content.Shared.Backmen.FootPrint; + +[Serializable, NetSerializable] +public sealed class FootPrintState(NetEntity netEntity) : ComponentState +{ + public NetEntity PrintOwner { get; private set; } = netEntity; +} diff --git a/Content.Shared/Backmen/FootPrint/FootPrintsComponent.cs b/Content.Shared/Backmen/FootPrint/FootPrintsComponent.cs index fdf759f3b75..b00a52fc4ac 100644 --- a/Content.Shared/Backmen/FootPrint/FootPrintsComponent.cs +++ b/Content.Shared/Backmen/FootPrint/FootPrintsComponent.cs @@ -1,10 +1,11 @@ using System.Numerics; +using Robust.Shared.GameStates; using Robust.Shared.Prototypes; using Robust.Shared.Utility; namespace Content.Shared.Backmen.FootPrint; -[RegisterComponent] +[RegisterComponent, NetworkedComponent] public sealed partial class FootPrintsComponent : Component { [ViewVariables(VVAccess.ReadOnly), DataField("path")] @@ -36,7 +37,7 @@ public sealed partial class FootPrintsComponent : Component [ViewVariables(VVAccess.ReadOnly), DataField("protoId")] public EntProtoId StepProtoId = "Footstep"; - + [ViewVariables(VVAccess.ReadWrite), DataField] public Vector2 OffsetPrint = new(0.1f, 0f); diff --git a/Resources/Locale/ru-RU/backmen/reagents/toxins.ftl b/Resources/Locale/ru-RU/backmen/reagents/toxins.ftl index e742355b135..850e3814d58 100644 --- a/Resources/Locale/ru-RU/backmen/reagents/toxins.ftl +++ b/Resources/Locale/ru-RU/backmen/reagents/toxins.ftl @@ -6,5 +6,8 @@ reagent-desc-lotophagoi-oil = Сверхсильный наркотик, кот reagent-name-bloodsucker-toxin = вампирский вирус reagent-desc-bloodsucker-toxin = Многие называют это лекарством от старости, его состав говорит о том что он относится к классу токсинов и вызывает множество негативных мутаций. -reagent-name-slerm = слерма ксено -reagent-desc-slerm = Самая мерзкая жидкость в галактике, которая при попадании на кожу вызывает сильные мутации. +reagent-name-slerm = слерм +reagent-desc-slerm = Вкуснейший напиток в галактике + +reagent-name-slerm-queen = слерм королевский +reagent-desc-slerm-queen = Вкуснейший деликатес! Секретный ингредиент который не так просто получить! diff --git a/Resources/Prototypes/_Backmen/Entities/Mobs/NPCs/blob/blob_base.yml b/Resources/Prototypes/_Backmen/Entities/Mobs/NPCs/blob/blob_base.yml index 3a23c1f2e97..ff6e7a7dd86 100644 --- a/Resources/Prototypes/_Backmen/Entities/Mobs/NPCs/blob/blob_base.yml +++ b/Resources/Prototypes/_Backmen/Entities/Mobs/NPCs/blob/blob_base.yml @@ -7,6 +7,12 @@ snap: - Wall components: + - type: MobThresholds + thresholds: + 0: Alive + currentThresholdState: Alive + showOverlays: false + - type: MobState - type: ZombieImmune - type: StatusEffects allowed: diff --git a/Resources/Prototypes/_Backmen/Entities/Mobs/NPCs/xeno.yml b/Resources/Prototypes/_Backmen/Entities/Mobs/NPCs/xeno.yml index fa18187424b..c185b30b367 100644 --- a/Resources/Prototypes/_Backmen/Entities/Mobs/NPCs/xeno.yml +++ b/Resources/Prototypes/_Backmen/Entities/Mobs/NPCs/xeno.yml @@ -22,9 +22,19 @@ state: running noRot: true netsync: false + - type: SolutionContainerManager + solutions: + udder: + maxVol: 250 + reagents: + - ReagentId: Slerm + Quantity: 30 + - type: Udder + reagentId: Slerm + quantityPerUpdate: 25 + growthDelay: 30 - type: Clickable - type: InteractionOutline - - type: SolutionContainerManager - type: AtmosExposed - type: MobThresholds thresholds: diff --git a/Resources/Prototypes/_Backmen/Entities/Mobs/Species/harpy.yml b/Resources/Prototypes/_Backmen/Entities/Mobs/Species/harpy.yml index 97745041eac..5c40ee32480 100644 --- a/Resources/Prototypes/_Backmen/Entities/Mobs/Species/harpy.yml +++ b/Resources/Prototypes/_Backmen/Entities/Mobs/Species/harpy.yml @@ -134,6 +134,7 @@ - type: MovementSpeedModifier baseWalkSpeed: 2.5 baseSprintSpeed: 5.0 + - type: FootPrints - type: entity save: false diff --git a/Resources/Prototypes/_Backmen/GameRules/roundstart.yml b/Resources/Prototypes/_Backmen/GameRules/roundstart.yml index 84c8c4b2a6a..e7fed260eea 100644 --- a/Resources/Prototypes/_Backmen/GameRules/roundstart.yml +++ b/Resources/Prototypes/_Backmen/GameRules/roundstart.yml @@ -66,6 +66,8 @@ max: 2 playerRatio: 40 #players = 2 blobs allowNonHumans: true + components: + - type: BlobCarrier blacklist: components: - AntagImmune @@ -291,3 +293,34 @@ components: - type: GameRule - type: BabelTowerRule + +#xeno +- type: entity + id: XenoAgentGameMode + parent: BaseGameRule + categories: [ HideSpawnMenu ] + components: + - type: GameRule + minPlayers: 15 + #delay: # 7-10 minutes + # min: 420 + # max: 600 + - type: AntagSelection + definitions: + - prefRoles: [ XenoAgent ] + min: 1 + max: 2 + playerRatio: 40 #players = 2 blobs + allowNonHumans: true + components: + - type: XenoAgent + - type: NpcFactionMember + factions: + - Xeno + - NanoTrasen + - type: XenoAcidSpiller + blacklist: + components: + - AntagImmune + mindRoles: + - MindRoleXenoAgent diff --git a/Resources/Prototypes/_Backmen/Reagents/toxins.yml b/Resources/Prototypes/_Backmen/Reagents/toxins.yml index fdd35f52367..6037aed1ae7 100644 --- a/Resources/Prototypes/_Backmen/Reagents/toxins.yml +++ b/Resources/Prototypes/_Backmen/Reagents/toxins.yml @@ -21,9 +21,9 @@ # Xeno maid liquid real - type: reagent id: SlermQueenPlus - name: reagent-name-slerm + name: reagent-name-slerm-queen group: Toxins - desc: reagent-desc-slerm + desc: reagent-desc-slerm-queen physicalDesc: reagent-physical-desc-bubbling flavor: bitter color: "#b428c9" @@ -55,4 +55,73 @@ min: 5 causeChance: 0.3 disease: XenoMaidVirus + - !type:GenericStatusEffect + key: SeeingRainbows + component: SeeingRainbows + type: Add + time: 5 + refresh: false + - !type:ChemAddMoodlet + moodPrototype: SpaceDrugsBenefit + conditions: + - !type:ReagentThreshold + reagent: Slerm + min: 6 # end-backmen: Disease + +- type: reagent + id: Slerm + name: reagent-name-slerm + group: Narcotics + desc: reagent-desc-slerm + physicalDesc: reagent-physical-desc-bubbling + flavor: soda + color: "#b428c9" + metabolisms: + Narcotic: + effects: + - !type:GenericStatusEffect + key: SeeingRainbows + component: SeeingRainbows + type: Add + time: 5 + refresh: false + - !type:ChemAddMoodlet + moodPrototype: SpaceDrugsBenefit + conditions: + - !type:ReagentThreshold + reagent: Slerm + min: 6 +# end-backmen: Disease + +- type: entity + parent: DrinkGlass + id: DrinkSlermGlass + suffix: Slerm + components: + - type: SolutionContainerManager + solutions: + drink: + maxVol: 30 + reagents: + - ReagentId: Slerm + Quantity: 30 + - type: Icon + sprite: Objects/Consumable/Drinks/gsodaglass.rsi + state: icon + +- type: entity + parent: DrinkGlass + id: DrinkSlermPlusGlass + suffix: Slerm Plus + components: + - type: SolutionContainerManager + solutions: + drink: + maxVol: 30 + reagents: + - ReagentId: SlermQueenPlus + Quantity: 30 + - type: Icon + sprite: Objects/Consumable/Drinks/gsodaglass.rsi + state: icon diff --git a/Resources/Prototypes/_Backmen/Roles/Antags/blob.yml b/Resources/Prototypes/_Backmen/Roles/Antags/blob.yml index 65052a123e7..f348e36bfc7 100644 --- a/Resources/Prototypes/_Backmen/Roles/Antags/blob.yml +++ b/Resources/Prototypes/_Backmen/Roles/Antags/blob.yml @@ -9,3 +9,15 @@ - !type:OverallPlaytimeRequirement time: 54000 # 15h # Corvax-RoleTime discordRequired: true # backmen: antag + +- type: antag + id: XenoAgent + name: roles-antag-XenoAgent-name + antagonist: true + setPreference: true + objective: roles-antag-XenoAgent-objective + guides: [ ] + requirements: + - !type:OverallPlaytimeRequirement + time: 540000 # 150h + discordRequired: true # backmen: antag diff --git a/Resources/Prototypes/_Backmen/Roles/MindRoles/mind_roles.yml b/Resources/Prototypes/_Backmen/Roles/MindRoles/mind_roles.yml index d376b4553fd..f1ad75a58f5 100644 --- a/Resources/Prototypes/_Backmen/Roles/MindRoles/mind_roles.yml +++ b/Resources/Prototypes/_Backmen/Roles/MindRoles/mind_roles.yml @@ -1,3 +1,14 @@ +- type: entity + parent: BaseMindRoleAntag + id: MindRoleXenoAgent + name: Xeno Agent Role + # description: mind-role-blob-description + components: + - type: MindRole + antagPrototype: XenoAgent + exclusiveAntag: true + - type: XenoAgentRole + # Blob - type: entity parent: BaseMindRoleAntag diff --git a/Resources/Prototypes/_Backmen/game_presets.yml b/Resources/Prototypes/_Backmen/game_presets.yml index c9c0819a25c..1b9a275d7ce 100644 --- a/Resources/Prototypes/_Backmen/game_presets.yml +++ b/Resources/Prototypes/_Backmen/game_presets.yml @@ -43,6 +43,20 @@ - SubGamemodesRule - CalmMeteorSwarmScheduler +- type: gamePreset + id: XenoAgent + alias: [] + name: xeno-agent-title + description: xeno-agent-description + showInVote: false + rules: + - XenoAgentGameMode + - CalmStationEventScheduler + - WageScheduler #backmen: currency + - BasicRoundstartVariation + - SubGamemodesRule + - CalmMeteorSwarmScheduler + - type: gamePreset id: FleshCult alias: