From 9a72a48c4bd5fcaa8dda090bfb437c5e380174d6 Mon Sep 17 00:00:00 2001 From: Aviu00 <93730715+Aviu00@users.noreply.github.com> Date: Tue, 23 Apr 2024 22:20:16 +0900 Subject: [PATCH] Fixes mostly (#292) * - fix: Fix animals standing. * - fix: Stuff drop from hands on stun or death even if lying. * - tweak: Tentacle gun no longer stuns. * - fix: Space cleaner now evaporates. * - remove: No crew monitor objective. * - fix: Fix time beacon. * - tweak: Revert neuro implant buff. * - tweak: Nerf dagger. * - fix: Fix void adaptation not working. --- .../Store/Systems/StoreSystem.Ui.cs | 11 ++++++++ .../Other/CritSystem/BloodLustComponent.cs | 6 ++--- .../_White/Other/CritSystem/CritSystem.cs | 26 ++++++++++++++++--- .../_White/TimeBeacon/TimeBeaconSystem.cs | 5 +++- .../Changeling/SharedTentacleGun.cs | 9 +++---- .../Fluids/SharedPuddleSystem.Evaporation.cs | 7 +++-- .../Systems/SharedStandingStateSystem.cs | 6 ++--- Content.Shared/Store/ListingPrototype.cs | 6 ++++- Content.Shared/Stunnable/SharedStunSystem.cs | 12 +++++++++ .../NeuroControl/NeuroStabilizationSystem.cs | 2 +- .../Prototypes/Catalog/changeling_catalog.yml | 7 +++-- .../Prototypes/Objectives/objectiveGroups.yml | 2 +- .../Prototypes/_White/Catalog/uplink.yml | 2 +- 13 files changed, 76 insertions(+), 25 deletions(-) diff --git a/Content.Server/Store/Systems/StoreSystem.Ui.cs b/Content.Server/Store/Systems/StoreSystem.Ui.cs index 4d3db60c68..9333061d92 100644 --- a/Content.Server/Store/Systems/StoreSystem.Ui.cs +++ b/Content.Server/Store/Systems/StoreSystem.Ui.cs @@ -264,6 +264,17 @@ public sealed partial class StoreSystem RaiseLocalEvent(buyer, listing.ProductEvent); } + // WD START + foreach (var name in listing.Components) + { + if (EntityManager.HasComponent(buyer, EntityManager.ComponentFactory.GetRegistration(name).Type)) + continue; + + var newComp = (Component) EntityManager.ComponentFactory.GetComponent(name); + EntityManager.AddComponent(buyer, newComp); + } + // WD END + //log dat shit. _admin.Add(LogType.StorePurchase, LogImpact.Low, $"{ToPrettyString(buyer):player} purchased listing \"{ListingLocalisationHelpers.GetLocalisedNameOrEntityName(listing, _prototypeManager)}\" from {ToPrettyString(uid)}"); diff --git a/Content.Server/_White/Other/CritSystem/BloodLustComponent.cs b/Content.Server/_White/Other/CritSystem/BloodLustComponent.cs index 7b1232fe51..6733761533 100644 --- a/Content.Server/_White/Other/CritSystem/BloodLustComponent.cs +++ b/Content.Server/_White/Other/CritSystem/BloodLustComponent.cs @@ -4,11 +4,11 @@ namespace Content.Server._White.Other.CritSystem; public sealed partial class BloodLustComponent : Component { [ViewVariables(VVAccess.ReadWrite)] - public float SprintModifier = 1.4f; + public float SprintModifier = 1.2f; [ViewVariables(VVAccess.ReadWrite)] - public float WalkModifier = 1.3f; + public float WalkModifier = 1.2f; [ViewVariables(VVAccess.ReadWrite)] - public float AttackRateModifier = 1.5f; + public float AttackRateModifier = 1.3f; } diff --git a/Content.Server/_White/Other/CritSystem/CritSystem.cs b/Content.Server/_White/Other/CritSystem/CritSystem.cs index 1c6825f300..0e8c3ae079 100644 --- a/Content.Server/_White/Other/CritSystem/CritSystem.cs +++ b/Content.Server/_White/Other/CritSystem/CritSystem.cs @@ -95,25 +95,41 @@ public sealed class CritSystem : EntitySystem return; var ohio = 0; + var absorbed = 0; if (component.IsBloodDagger) { var bruteGroup = _prototypeManager.Index("Brute"); var burnGroup = _prototypeManager.Index("Burn"); + var airlossGroup = _prototypeManager.Index("Airloss"); ohio = _random.Next(1, 21); + if (args.Direction != null) // Heavy attack + ohio = (int) MathF.Round(ohio * 0.7f); + foreach (var target in args.HitEntities) { if (!TryComp(target, out BloodstreamComponent? bloodstream)) continue; + var blood = bloodstream.BloodSolution; + + if (blood == null) + continue; + + var bloodLevel = blood.Value.Comp.Solution.Volume.Int(); + if (!_bloodstream.TryModifyBloodLevel(target, -ohio, bloodstream, false)) continue; - _bloodstream.TryModifyBloodLevel(args.User, ohio); - _damageableSystem.TryChangeDamage(args.User, new DamageSpecifier(bruteGroup, -ohio)); - _damageableSystem.TryChangeDamage(args.User, new DamageSpecifier(burnGroup, -ohio)); + var toHeal = Math.Min(ohio, bloodLevel); + + absorbed += toHeal; + _bloodstream.TryModifyBloodLevel(args.User, toHeal); + _damageableSystem.TryChangeDamage(args.User, new DamageSpecifier(bruteGroup, -toHeal)); + _damageableSystem.TryChangeDamage(args.User, new DamageSpecifier(burnGroup, -toHeal)); + _damageableSystem.TryChangeDamage(args.User, new DamageSpecifier(airlossGroup, -toHeal)); } } @@ -122,7 +138,9 @@ public sealed class CritSystem : EntitySystem args.BonusDamage = new DamageSpecifier(_prototypeManager.Index("Slash"), damage - args.BaseDamage.GetTotal()); - _popup.PopupEntity($"Crit! {damage}", args.User, args.User, PopupType.MediumCaution); + var extra = component.IsBloodDagger ? $" Высосано крови: {absorbed}" : ""; + + _popup.PopupEntity($"Crit! {damage}" + extra, args.User, args.User, PopupType.MediumCaution); } private bool IsCriticalHit(CritComponent component) diff --git a/Content.Server/_White/TimeBeacon/TimeBeaconSystem.cs b/Content.Server/_White/TimeBeacon/TimeBeaconSystem.cs index 65915263db..acac2dd354 100644 --- a/Content.Server/_White/TimeBeacon/TimeBeaconSystem.cs +++ b/Content.Server/_White/TimeBeacon/TimeBeaconSystem.cs @@ -6,6 +6,7 @@ using Content.Shared.Movement.Pulling.Systems; using Content.Shared.Popups; using Robust.Server.Audio; using Robust.Server.GameObjects; +using Robust.Shared.Map; using Robust.Shared.Timing; namespace Content.Server._White.TimeBeacon; @@ -13,6 +14,7 @@ namespace Content.Server._White.TimeBeacon; public sealed class TimeBeaconSystem : EntitySystem { [Dependency] private readonly IGameTiming _timing = default!; + [Dependency] private readonly IMapManager _mapManager = default!; [Dependency] private readonly PopupSystem _popup = default!; [Dependency] private readonly AudioSystem _audio = default!; [Dependency] private readonly TransformSystem _transform = default!; @@ -42,7 +44,8 @@ public sealed class TimeBeaconSystem : EntitySystem if (!TryComp(ent, out TransformComponent? xform) || !TryComp(entity, out TransformComponent? entXform)) return; - if (xform.MapID != entXform.MapID) + // If entity polymorphed or something + if (_mapManager.IsMapPaused(entXform.MapID)) return; // break pulls before portal enter so we dont break shit diff --git a/Content.Shared/Changeling/SharedTentacleGun.cs b/Content.Shared/Changeling/SharedTentacleGun.cs index 154743fb2c..17be944a95 100644 --- a/Content.Shared/Changeling/SharedTentacleGun.cs +++ b/Content.Shared/Changeling/SharedTentacleGun.cs @@ -4,6 +4,7 @@ using Content.Shared.Humanoid; using Content.Shared.Mobs.Components; using Content.Shared.Physics; using Content.Shared.Projectiles; +using Content.Shared.Standing.Systems; using Content.Shared.Stunnable; using Content.Shared.Throwing; using Content.Shared.Weapons.Misc; @@ -27,9 +28,8 @@ public abstract class SharedTentacleGun : EntitySystem [Dependency] private readonly SharedAppearanceSystem _appearance = default!; [Dependency] private readonly ThrowingSystem _throwingSystem = default!; [Dependency] private readonly ITimerManager _timerManager = default!; - [Dependency] private readonly SharedStunSystem _stunSystem = default!; + [Dependency] private readonly SharedStandingStateSystem _standing = default!; [Dependency] private readonly SharedHandsSystem _handsSystem = default!; - [Dependency] private readonly IRobustRandom _random = default!; public override void Initialize() { @@ -155,10 +155,7 @@ public abstract class SharedTentacleGun : EntitySystem private bool PullMob(ProjectileEmbedEvent args) { - var stunTime = _random.Next(TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(3)); - - if (!_stunSystem.TryParalyze(args.Embedded, stunTime, true)) - return false; + _standing.TryLieDown(args.Embedded); _throwingSystem.TryThrow(args.Embedded, Transform(args.Shooter!.Value).Coordinates, 5f); diff --git a/Content.Shared/Fluids/SharedPuddleSystem.Evaporation.cs b/Content.Shared/Fluids/SharedPuddleSystem.Evaporation.cs index bf841e861b..da1ed1fe18 100644 --- a/Content.Shared/Fluids/SharedPuddleSystem.Evaporation.cs +++ b/Content.Shared/Fluids/SharedPuddleSystem.Evaporation.cs @@ -11,10 +11,13 @@ public abstract partial class SharedPuddleSystem [ValidatePrototypeId] private const string HolyWater = "Holywater"; - public static readonly string[] EvaporationReagents = { Water, HolyWater }; + [ValidatePrototypeId] + private const string SpaceCleaner = "SpaceCleaner"; + + public static readonly string[] EvaporationReagents = { Water, HolyWater, SpaceCleaner }; public bool CanFullyEvaporate(Solution solution) { return solution.GetTotalPrototypeQuantity(EvaporationReagents) == solution.Volume; } -} \ No newline at end of file +} diff --git a/Content.Shared/Standing/Systems/SharedStandingStateSystem.cs b/Content.Shared/Standing/Systems/SharedStandingStateSystem.cs index 26b1e499e2..d0384f7377 100644 --- a/Content.Shared/Standing/Systems/SharedStandingStateSystem.cs +++ b/Content.Shared/Standing/Systems/SharedStandingStateSystem.cs @@ -176,9 +176,6 @@ public abstract partial class SharedStandingStateSystem : EntitySystem // Optional component. Resolve(uid, ref appearance, ref hands, false); - if (standingState.CurrentState is StandingState.Lying or StandingState.GettingUp) - return true; - // This is just to avoid most callers doing this manually saving boilerplate // 99% of the time you'll want to drop items but in some scenarios (e.g. buckling) you don't want to. // We do this BEFORE downing because something like buckle may be blocking downing but we want to drop hand items anyway @@ -188,6 +185,9 @@ public abstract partial class SharedStandingStateSystem : EntitySystem RaiseLocalEvent(uid, new DropHandItemsEvent()); } + if (standingState.CurrentState is StandingState.Lying or StandingState.GettingUp) + return true; + var msg = new DownAttemptEvent(); RaiseLocalEvent(uid, msg); diff --git a/Content.Shared/Store/ListingPrototype.cs b/Content.Shared/Store/ListingPrototype.cs index f67188eea5..22be29f363 100644 --- a/Content.Shared/Store/ListingPrototype.cs +++ b/Content.Shared/Store/ListingPrototype.cs @@ -122,6 +122,9 @@ public partial class ListingData : IEquatable, ICloneable public int SaleAmount; public Dictionary OldCost = new(); + + [DataField] + public List Components = new(); // WD END public bool Equals(ListingData? listing) @@ -186,6 +189,7 @@ public partial class ListingData : IEquatable, ICloneable SaleBlacklist = SaleBlacklist, SaleAmount = SaleAmount, OldCost = OldCost, + Components = Components, // WD END }; } @@ -196,4 +200,4 @@ public partial class ListingData : IEquatable, ICloneable /// Defines a set item listing that is available in a store /// [Prototype("listing"), Serializable, NetSerializable, DataDefinition] -public sealed partial class ListingPrototype : ListingData, IPrototype; \ No newline at end of file +public sealed partial class ListingPrototype : ListingData, IPrototype; diff --git a/Content.Shared/Stunnable/SharedStunSystem.cs b/Content.Shared/Stunnable/SharedStunSystem.cs index 01ca89ef21..8586e46a9a 100644 --- a/Content.Shared/Stunnable/SharedStunSystem.cs +++ b/Content.Shared/Stunnable/SharedStunSystem.cs @@ -37,6 +37,7 @@ public abstract class SharedStunSystem : EntitySystem public override void Initialize() { SubscribeLocalEvent(OnKnockInit); + SubscribeLocalEvent(OnKnockShutdown); SubscribeLocalEvent(OnStandAttempt); SubscribeLocalEvent(OnSlowInit); @@ -106,6 +107,17 @@ public abstract class SharedStunSystem : EntitySystem _standingState.Down(uid); } + private void OnKnockShutdown(EntityUid uid, KnockedDownComponent component, ComponentShutdown args) + { + // WD EDIT START + // Don't stand up if we can lie down via keybind + if (!TryComp(uid, out StandingStateComponent? standing) || standing.CanLieDown) + return; + + _standingState.Stand(uid, standing); + // WD EDIT END + } + private void OnStandAttempt(EntityUid uid, KnockedDownComponent component, StandAttemptEvent args) { if (component.LifeStage <= ComponentLifeStage.Running) diff --git a/Content.Shared/_White/Implants/NeuroControl/NeuroStabilizationSystem.cs b/Content.Shared/_White/Implants/NeuroControl/NeuroStabilizationSystem.cs index 51f3e23318..411a82ab3f 100644 --- a/Content.Shared/_White/Implants/NeuroControl/NeuroStabilizationSystem.cs +++ b/Content.Shared/_White/Implants/NeuroControl/NeuroStabilizationSystem.cs @@ -18,7 +18,7 @@ public sealed class NeuroStabilizationSystem : EntitySystem private void BeforeStaminaDamage(Entity ent, ref BeforeStaminaDamageEvent args) { args.Cancelled = true; - Electrocute(ent, (int) MathF.Round(args.Value * 2f / 4f)); + Electrocute(ent, (int) MathF.Round(args.Value * 2f / 3f)); } public void Electrocute(EntityUid uid, int damage, StatusEffectsComponent? status = null) diff --git a/Resources/Prototypes/Catalog/changeling_catalog.yml b/Resources/Prototypes/Catalog/changeling_catalog.yml index 4185b09665..8a87d4b5fa 100644 --- a/Resources/Prototypes/Catalog/changeling_catalog.yml +++ b/Resources/Prototypes/Catalog/changeling_catalog.yml @@ -82,7 +82,8 @@ name: changeling-ability-void-adaptation description: changeling-ability-void-adaptation-desc icon: { sprite: /Textures/White/Actions/changeling.rsi, state: organic_suit } - productEvent: !type:VoidAdaptationPurchasedEvent + components: + - VoidAdaptation cost: ChangelingPoint: 2 categories: @@ -215,7 +216,9 @@ name: changeling-ability-eyesight description: changeling-ability-eyesight-desc productAction: ActionAugmentedEyesight - productEvent: !type:AugmentedEyesightPurchasedEvent + components: + - FlashImmunity + - EyeProtection cost: ChangelingPoint: 2 categories: diff --git a/Resources/Prototypes/Objectives/objectiveGroups.yml b/Resources/Prototypes/Objectives/objectiveGroups.yml index 74453c7650..26d324fa0f 100644 --- a/Resources/Prototypes/Objectives/objectiveGroups.yml +++ b/Resources/Prototypes/Objectives/objectiveGroups.yml @@ -12,7 +12,7 @@ weights: CaptainIDStealObjective: 1 CMOHyposprayStealObjective: 1 - CMOCrewMonitorStealObjective: 1 + #CMOCrewMonitorStealObjective: 1 RDHardsuitStealObjective: 1 NukeDiskStealObjective: 1 MagbootsStealObjective: 1 diff --git a/Resources/Prototypes/_White/Catalog/uplink.yml b/Resources/Prototypes/_White/Catalog/uplink.yml index 1af7e55b2d..57ee01636b 100644 --- a/Resources/Prototypes/_White/Catalog/uplink.yml +++ b/Resources/Prototypes/_White/Catalog/uplink.yml @@ -32,7 +32,7 @@ icon: { sprite: /Textures/Objects/Weapons/Melee/blood_dagger.rsi, state: icon } productEntity: BloodSuckerDagger cost: - Telecrystal: 6 + Telecrystal: 8 categories: - UplinkWeaponry conditions: