diff --git a/Content.Client/Miracle/Changeling/ChemicalsAlertSystem.cs b/Content.Client/Miracle/Changeling/ChemicalsAlertSystem.cs new file mode 100644 index 0000000000..87eb39cec1 --- /dev/null +++ b/Content.Client/Miracle/Changeling/ChemicalsAlertSystem.cs @@ -0,0 +1,28 @@ +using Content.Client.Alerts; +using Content.Shared.Alert; +using Content.Shared.Changeling; +using Content.Shared.Revenant; + +namespace Content.Client.Miracle.Changeling; + +public sealed class ChemicalsAlertSystem : EntitySystem +{ + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnUpdateAlert); + } + + private void OnUpdateAlert(Entity ent, ref UpdateAlertSpriteEvent args) + { + if (args.Alert.AlertType != AlertType.Chemicals) + return; + + var sprite = args.SpriteViewEnt.Comp; + var chemicals = Math.Clamp(ent.Comp.ChemicalsBalance, 0, 999); + sprite.LayerSetState(RevenantVisualLayers.Digit1, $"{(chemicals / 100) % 10}"); + sprite.LayerSetState(RevenantVisualLayers.Digit2, $"{(chemicals / 10) % 10}"); + sprite.LayerSetState(RevenantVisualLayers.Digit3, $"{chemicals % 10}"); + } +} diff --git a/Content.Server/Body/Systems/RespiratorSystem.cs b/Content.Server/Body/Systems/RespiratorSystem.cs index 135e13799f..7f99018612 100644 --- a/Content.Server/Body/Systems/RespiratorSystem.cs +++ b/Content.Server/Body/Systems/RespiratorSystem.cs @@ -119,10 +119,7 @@ public sealed class RespiratorSystem : EntitySystem if (_gameTiming.CurTime >= respirator.LastGaspPopupTime + respirator.GaspPopupCooldown) { respirator.LastGaspPopupTime = _gameTiming.CurTime; - if (TryComp(uid, out var metaDataComponent)) - { - _popupSystem.PopupEntity($"{metaDataComponent.EntityName} задыхается!", uid); - } + _popupSystem.PopupEntity($"{Name(Identity.Entity(uid, EntityManager))} задыхается!", uid); } TakeSuffocationDamage((uid, respirator)); diff --git a/Content.Server/Changeling/ChangelingRuleSystem.cs b/Content.Server/Changeling/ChangelingRuleSystem.cs index 90b3789136..4d34a04bd3 100644 --- a/Content.Server/Changeling/ChangelingRuleSystem.cs +++ b/Content.Server/Changeling/ChangelingRuleSystem.cs @@ -53,6 +53,13 @@ public sealed class ChangelingRuleSystem : GameRuleSystem(OnGetBriefing); } + protected override void Added(EntityUid uid, ChangelingRuleComponent component, GameRuleComponent gameRule, GameRuleAddedEvent args) + { + base.Added(uid, component, gameRule, args); + + gameRule.MinPlayers = PlayersPerChangeling; + } + private void OnGetBriefing(Entity ent, ref GetBriefingEvent args) { args.Append(Loc.GetString("changeling-role-briefing-short")); @@ -182,7 +189,7 @@ public sealed class ChangelingRuleSystem : GameRuleSystem(implant, out var store) || store.Preset != "StorePresetChangeling") continue; - store.Refunds = true; store.RefundAllowed = true; } } @@ -972,7 +971,7 @@ public sealed partial class ChangelingSystem ClonePerson(polymorphEntity.Value, transformData.AppearanceComponent, polyAppearance); TransferDna(polymorphEntity.Value, transformData.Dna); - _humanoidAppearance.SetTTSVoice(polymorphEntity.Value, transformData.AppearanceComponent.Voice, + _humanoidAppearance.SetTTSVoice(polymorphEntity.Value, transformData.AppearanceComponent.Voice, humanoid: polyAppearance); if (!TryComp(polymorphEntity.Value, out var meta)) @@ -1210,4 +1209,4 @@ public sealed partial class ChangelingSystem } #endregion -} \ No newline at end of file +} diff --git a/Content.Server/Changeling/ChangelingSystem.Shop.cs b/Content.Server/Changeling/ChangelingSystem.Shop.cs index d24e908dd0..ddf691767c 100644 --- a/Content.Server/Changeling/ChangelingSystem.Shop.cs +++ b/Content.Server/Changeling/ChangelingSystem.Shop.cs @@ -39,7 +39,6 @@ public sealed partial class ChangelingSystem if (!TryComp(args.Store, out StoreComponent? storeComponent)) return; - storeComponent.Refunds = false; _storeSystem.DisableRefund(args.Store, storeComponent); } diff --git a/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs b/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs index 58c53afe24..db6fbab22b 100644 --- a/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs +++ b/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs @@ -161,11 +161,11 @@ public sealed class TraitorRuleSystem : GameRuleSystem Log.Error($"Player {mind.CharacterName} is already a traitor."); return false; } - + // WD START var richAspect = _gameTicker.GetActiveGameRules().Where(HasComp).Any(); // WD END - + var briefing = Loc.GetString("traitor-role-codewords-short", ("codewords", string.Join(", ", component.Codewords))); Note[]? code = null; if (giveUplink) @@ -179,7 +179,7 @@ public sealed class TraitorRuleSystem : GameRuleSystem { startingBalance += 10; } - + // creadth: we need to create uplink for the antag. // PDA should be in place already var pda = _uplink.FindUplinkTarget(traitor); @@ -214,7 +214,7 @@ public sealed class TraitorRuleSystem : GameRuleSystem _npcFaction.RemoveFaction(traitor, component.NanoTrasenFaction, false); _npcFaction.AddFaction(traitor, component.SyndicateFaction); - RaiseLocalEvent(mindId, new MoodEffectEvent("TraitorFocused")); // WD edit + RaiseLocalEvent(traitor, new MoodEffectEvent("TraitorFocused")); // WD edit // Give traitors their objectives if (giveObjectives) diff --git a/Content.Server/Store/Components/StoreComponent.cs b/Content.Server/Store/Components/StoreComponent.cs index db27482f82..0b7dbbea09 100644 --- a/Content.Server/Store/Components/StoreComponent.cs +++ b/Content.Server/Store/Components/StoreComponent.cs @@ -91,10 +91,6 @@ public sealed partial class StoreComponent : Component [DataField] public EntityUid? StartingMap; - // Miracle - [DataField] - public bool Refunds; - #region audio /// /// The sound played to the buyer when a purchase is succesfully made. diff --git a/Content.Server/Store/Systems/StoreSystem.Ui.cs b/Content.Server/Store/Systems/StoreSystem.Ui.cs index 4364307f14..4d3db60c68 100644 --- a/Content.Server/Store/Systems/StoreSystem.Ui.cs +++ b/Content.Server/Store/Systems/StoreSystem.Ui.cs @@ -173,7 +173,7 @@ public sealed partial class StoreSystem } } - if (!IsOnStartingMap(uid, component) || !component.Refunds) // Miracle edit + if (!IsOnStartingMap(uid, component)) component.RefundAllowed = false; //subtract the cash @@ -337,7 +337,7 @@ public sealed partial class StoreSystem if (args.Session.AttachedEntity is not { Valid: true } buyer) return; - if (!IsOnStartingMap(uid, component) || !component.Refunds) // Miracle edit + if (!IsOnStartingMap(uid, component)) { component.RefundAllowed = false; UpdateUserInterface(buyer, uid, component); @@ -403,4 +403,4 @@ public sealed partial class StoreSystem component.RefundAllowed = false; } -} \ No newline at end of file +} diff --git a/Content.Server/_White/ChangeTemperatureOnCollide/LowTemperatureSlowdownSystem.cs b/Content.Server/_White/ChangeTemperatureOnCollide/LowTemperatureSlowdownSystem.cs index da4f986857..cb1c676496 100644 --- a/Content.Server/_White/ChangeTemperatureOnCollide/LowTemperatureSlowdownSystem.cs +++ b/Content.Server/_White/ChangeTemperatureOnCollide/LowTemperatureSlowdownSystem.cs @@ -1,6 +1,7 @@ using Content.Server.Temperature.Components; using Content.Server.Temperature.Systems; using Content.Shared.Changeling; +using Content.Shared.Damage.Components; using Content.Shared.Movement.Components; using Content.Shared.Movement.Systems; @@ -21,7 +22,7 @@ public sealed class LowTemperatureSlowdownSystem : EntitySystem private void OnMoveSpeedRefresh(EntityUid uid, TemperatureComponent component, RefreshMovementSpeedModifiersEvent args) { - var modifier = HasComp(uid) || !component.Slowdown + var modifier = HasComp(uid) || HasComp(uid) || !component.Slowdown ? 1f : GetSpeedModifier(component.CurrentTemperature); args.ModifySpeed(modifier, modifier); diff --git a/Content.Server/_White/Cult/GameRule/CultRuleSystem.cs b/Content.Server/_White/Cult/GameRule/CultRuleSystem.cs index c465208e86..0a96c038a1 100644 --- a/Content.Server/_White/Cult/GameRule/CultRuleSystem.cs +++ b/Content.Server/_White/Cult/GameRule/CultRuleSystem.cs @@ -6,6 +6,7 @@ using Content.Server.Bible.Components; using Content.Server.Chat.Managers; using Content.Server.GameTicking; using Content.Server.GameTicking.Rules; +using Content.Server.GameTicking.Rules.Components; using Content.Server.NPC.Systems; using Content.Server.Roles; using Content.Server.Roles.Jobs; @@ -27,6 +28,7 @@ using Robust.Shared.Random; using Content.Shared._White; using Content.Shared._White.Cult.Components; using Content.Shared._White.Cult.Systems; +using Content.Shared._White.Mood; using Content.Shared.Mind; using Content.Shared.NPC.Systems; using Robust.Server.Player; @@ -74,6 +76,13 @@ public sealed class CultRuleSystem : GameRuleSystem SubscribeLocalEvent(OnGetBriefing); } + protected override void Added(EntityUid uid, CultRuleComponent component, GameRuleComponent gameRule, GameRuleAddedEvent args) + { + base.Added(uid, component, gameRule, args); + + gameRule.MinPlayers = _cfg.GetCVar(WhiteCVars.CultMinPlayers); + } + private void OnGetBriefing(Entity ent, ref GetBriefingEvent args) { args.Append(Loc.GetString("cult-role-briefing-short")); @@ -149,9 +158,11 @@ public sealed class CultRuleSystem : GameRuleSystem cult.CurrentCultists.Add(component); - if (TryComp(uid, out var actor)) + var name = Name(uid); + + if (TryComp(uid, out var actor) && !cult.CultistsCache.ContainsKey(name)) { - cult.CultistsCache.Add(MetaData(uid).EntityName, actor.PlayerSession.Name); + cult.CultistsCache.Add(name, actor.PlayerSession.Name); } UpdateCultistsAppearance(cult); @@ -187,10 +198,8 @@ public sealed class CultRuleSystem : GameRuleSystem private void DoCultistsStart(CultRuleComponent rule) { - var eligiblePlayers = - _antagSelection.GetEligiblePlayers(_playerManager.Sessions, rule.CultistRolePrototype); - - eligiblePlayers.RemoveAll(HasComp); + var eligiblePlayers = _antagSelection.GetEligiblePlayers(_playerManager.Sessions, rule.CultistRolePrototype, + customExcludeCondition: HasComp); if (eligiblePlayers.Count == 0) { @@ -357,7 +366,7 @@ public sealed class CultRuleSystem : GameRuleSystem MakeCultist(entity, cultistRule); } - + public bool MakeCultist(EntityUid cultist, CultRuleComponent rule) { if (!_mindSystem.TryGetMind(cultist, out var mindId, out var mind)) @@ -385,6 +394,8 @@ public sealed class CultRuleSystem : GameRuleSystem _factionSystem.RemoveFaction(cultist, "NanoTrasen", false); _factionSystem.AddFaction(cultist, "Cultist"); + RaiseLocalEvent(cultist, new MoodEffectEvent("CultFocused")); + if (_inventorySystem.TryGetSlotEntity(cultist, "back", out var backPack)) { foreach (var itemPrototype in rule.StartingItems) @@ -420,4 +431,4 @@ public sealed class CultRuleSystem : GameRuleSystem EnsureComp(transferTo); RemComp(transferFrom); } -} \ No newline at end of file +} diff --git a/Content.Server/_White/Cult/HolyWater/DeconvertCultist.cs b/Content.Server/_White/Cult/HolyWater/DeconvertCultist.cs index 0496b388ff..8989d11435 100644 --- a/Content.Server/_White/Cult/HolyWater/DeconvertCultist.cs +++ b/Content.Server/_White/Cult/HolyWater/DeconvertCultist.cs @@ -7,6 +7,7 @@ using Content.Shared.Chemistry.Reagent; using Content.Shared.IdentityManagement; using Content.Shared.Inventory; using Content.Shared._White.Cult.Components; +using Content.Shared._White.Mood; using Content.Shared.Mind; using JetBrains.Annotations; using Robust.Server.Containers; @@ -86,5 +87,7 @@ public sealed partial class DeconvertCultist : ReagentEffect if (roleSystem.MindHasRole(mindId)) roleSystem.MindRemoveRole(mindId); + + entityManager.EventBus.RaiseLocalEvent(uid, new MoodRemoveEffectEvent("CultFocused")); } } diff --git a/Content.Server/_White/Cult/Runes/Systems/CultSystem.Actions.cs b/Content.Server/_White/Cult/Runes/Systems/CultSystem.Actions.cs index 0d32b69faf..e1fe8b31cc 100644 --- a/Content.Server/_White/Cult/Runes/Systems/CultSystem.Actions.cs +++ b/Content.Server/_White/Cult/Runes/Systems/CultSystem.Actions.cs @@ -20,6 +20,7 @@ using Content.Shared._White.Cult.Components; using Content.Shared._White.Cult.Systems; using Content.Shared.ActionBlocker; using Content.Shared.Actions; +using Content.Shared.Cuffs; using Content.Shared.Cuffs.Components; using Content.Shared.DoAfter; using Content.Shared.Maps; @@ -79,8 +80,14 @@ public partial class CultSystem return; var cuffs = Spawn("ShadowShackles", Transform(ent).Coordinates); - if (!_cuffable.TryAddNewCuffs(args.Target.Value, args.User, cuffs, cuffable)) - QueueDel(cuffs); + var handcuffComponent = EnsureComp(cuffs); + if (_cuffable.TryAddNewCuffs(args.Target.Value, args.User, cuffs, cuffable, handcuffComponent)) + { + SharedCuffableSystem.SetUsed(handcuffComponent, true); + return; + } + + QueueDel(cuffs); } private void OnActionRemoved(Entity ent, ref ActionGettingRemovedEvent args) @@ -493,4 +500,4 @@ public partial class CultSystem _handsSystem.TryPickupAnyHand(args.Performer, dagger); args.Handled = true; } -} \ No newline at end of file +} diff --git a/Content.Server/_White/Cult/Structures/RunicDoorSystem.cs b/Content.Server/_White/Cult/Structures/RunicDoorSystem.cs index fbb2f805d9..388af6b294 100644 --- a/Content.Server/_White/Cult/Structures/RunicDoorSystem.cs +++ b/Content.Server/_White/Cult/Structures/RunicDoorSystem.cs @@ -9,6 +9,7 @@ using Content.Shared._White.Cult.Systems; using Content.Shared.Cuffs.Components; using Content.Shared.Doors.Components; using Content.Shared.Mobs.Systems; +using Content.Shared.Prying.Components; using Content.Shared.Weapons.Melee.Components; using Content.Shared.Weapons.Melee.Events; using Robust.Shared.Audio; @@ -38,6 +39,12 @@ public sealed class RunicDoorSystem : EntitySystem SubscribeLocalEvent(OnBeforeDoorClosed); // SubscribeLocalEvent(OnGetAttacked); SubscribeLocalEvent(OnConceal); + SubscribeLocalEvent(OnBeforePry); + } + + private void OnBeforePry(Entity ent, ref BeforePryEvent args) + { + args.Cancelled = true; } private void OnConceal(Entity ent, ref ConcealEvent args) @@ -112,7 +119,7 @@ public sealed class RunicDoorSystem : EntitySystem return true; } - _doorSystem.Deny(airlock); + // _doorSystem.Deny(airlock); if (!HasComp(user) || _holyWeapon.IsHoldingHolyWeapon(user) || TryComp(airlock, out ConcealableComponent? concealable) && concealable.Concealed) diff --git a/Content.Shared/Changeling/ChangelingComponent.cs b/Content.Shared/Changeling/ChangelingComponent.cs index 68171218cb..f12157f464 100644 --- a/Content.Shared/Changeling/ChangelingComponent.cs +++ b/Content.Shared/Changeling/ChangelingComponent.cs @@ -5,7 +5,7 @@ using Robust.Shared.Prototypes; namespace Content.Shared.Changeling; -[RegisterComponent, NetworkedComponent] +[RegisterComponent, NetworkedComponent, AutoGenerateComponentState] public sealed partial class ChangelingComponent : Component { [DataField("chemRegenRate")] @@ -14,7 +14,7 @@ public sealed partial class ChangelingComponent : Component [DataField("chemicalCap")] public int ChemicalCapacity = 75; - [ViewVariables(VVAccess.ReadWrite), DataField("chemicalsBalance")] + [ViewVariables(VVAccess.ReadWrite), AutoNetworkedField] public int ChemicalsBalance = 20; [ViewVariables(VVAccess.ReadWrite), DataField("pointsBalance")] diff --git a/Content.Shared/Changeling/ChemicalsSystem.cs b/Content.Shared/Changeling/ChemicalsSystem.cs index 728d11c948..9d18e8f608 100644 --- a/Content.Shared/Changeling/ChemicalsSystem.cs +++ b/Content.Shared/Changeling/ChemicalsSystem.cs @@ -75,6 +75,9 @@ public sealed class ChemicalsSystem : EntitySystem { base.Update(frameTime); + if (_net.IsClient) + return; + var query = EntityQueryEnumerator(); while (query.MoveNext(out var uid, out var component)) @@ -96,8 +99,7 @@ public sealed class ChemicalsSystem : EntitySystem { if(_net.IsServer) { - _alertsSystem.ShowAlert(uid, AlertType.Chemicals, - (short) Math.Clamp(Math.Round(component.ChemicalsBalance / 10f), 0, 16)); + _alertsSystem.ShowAlert(uid, AlertType.Chemicals); } } } diff --git a/Content.Shared/Cuffs/SharedCuffableSystem.cs b/Content.Shared/Cuffs/SharedCuffableSystem.cs index e3a1d3fed0..059e6c6c79 100644 --- a/Content.Shared/Cuffs/SharedCuffableSystem.cs +++ b/Content.Shared/Cuffs/SharedCuffableSystem.cs @@ -776,6 +776,13 @@ namespace Content.Shared.Cuffs cuff.Removing = false; } + // WD START + public static void SetUsed(HandcuffComponent cuffs, bool used) + { + cuffs.Used = used; + } + // WD END + #region ActionBlocker private void CheckAct(EntityUid uid, CuffableComponent component, CancellableEntityEventArgs args) @@ -815,4 +822,4 @@ namespace Content.Shared.Cuffs { } } -} \ No newline at end of file +} diff --git a/Content.Shared/Projectiles/SharedProjectileSystem.cs b/Content.Shared/Projectiles/SharedProjectileSystem.cs index d72df753da..6fa1b3910f 100644 --- a/Content.Shared/Projectiles/SharedProjectileSystem.cs +++ b/Content.Shared/Projectiles/SharedProjectileSystem.cs @@ -8,6 +8,7 @@ using Content.Shared.Interaction; using Content.Shared.Movement.Components; using Content.Shared.Throwing; using Content.Shared._White.Crossbow; +using Content.Shared.Item; using Robust.Shared.Audio.Systems; using Robust.Shared.Map; using Robust.Shared.Network; @@ -47,6 +48,7 @@ public abstract partial class SharedProjectileSystem : EntitySystem SubscribeLocalEvent(OnLand); // WD SubscribeLocalEvent(OnRemove); // WD SubscribeLocalEvent(OnEntityTerminating); // WD + SubscribeLocalEvent(OnTryPickUp); // WD } private void OnEmbedActivate(EntityUid uid, EmbeddableProjectileComponent component, ActivateInWorldEvent args) @@ -235,6 +237,12 @@ public abstract partial class SharedProjectileSystem : EntitySystem FreePenetrated(component); } + private void OnTryPickUp(Entity ent, ref GettingPickedUpAttemptEvent args) + { + if (ent.Comp.PenetratedUid != null) + args.Cancel(); + } + private void FreePenetrated(EmbeddableProjectileComponent component) { if (component.PenetratedUid == null) diff --git a/Resources/Prototypes/Actions/changeling.yml b/Resources/Prototypes/Actions/changeling.yml index 6d8f43f011..282b53f006 100644 --- a/Resources/Prototypes/Actions/changeling.yml +++ b/Resources/Prototypes/Actions/changeling.yml @@ -47,6 +47,7 @@ icon: White/Actions/changeling.rsi/reviving_stasis.png event: !type:RegenerateActionEvent checkCanInteract: false + checkConsciousness: false useDelay: 1 - type: entity diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml b/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml index e024062201..8a64ecf232 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml @@ -2782,6 +2782,7 @@ - type: Temperature heatDamageThreshold: 423 coldDamageThreshold: 0 + slowdown: false - type: PressureImmunity - type: InteractionPopup successChance: 0.7 diff --git a/Resources/Prototypes/_White/Entities/Cult/Items/shadow_shackles.yml b/Resources/Prototypes/_White/Entities/Cult/Items/shadow_shackles.yml index 68fc425b9d..b14761ef32 100644 --- a/Resources/Prototypes/_White/Entities/Cult/Items/shadow_shackles.yml +++ b/Resources/Prototypes/_White/Entities/Cult/Items/shadow_shackles.yml @@ -5,7 +5,6 @@ parent: Handcuffs components: - type: Handcuff - breakoutTime: 15 color: black breakOnRemove: true - type: Sprite