From e02714787c3c8c9f580edeec29294826eb421d44 Mon Sep 17 00:00:00 2001 From: Aviu00 Date: Tue, 5 Mar 2024 08:47:31 +0300 Subject: [PATCH 1/7] - add: Rubber bullet stamina damage resist. --- .../StaminaDamageOnCollideComponent.cs | 3 ++ .../Damage/Systems/StaminaSystem.cs | 14 +++++++- .../Inventory/InventorySystem.Relay.cs | 2 ++ .../StaminaProtectionSystem.cs | 32 +++++++++++++++++++ .../Guns/Ammunition/Projectiles/grenade.yml | 3 +- .../Guns/Ammunition/Projectiles/magnum.yml | 1 + .../Guns/Ammunition/Projectiles/shotgun.yml | 3 +- .../Weapons/Guns/Projectiles/projectiles.yml | 1 + 8 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 Content.Shared/_White/StaminaProtection/StaminaProtectionSystem.cs diff --git a/Content.Shared/Damage/Components/StaminaDamageOnCollideComponent.cs b/Content.Shared/Damage/Components/StaminaDamageOnCollideComponent.cs index 5ed2bb628e..496614fbda 100644 --- a/Content.Shared/Damage/Components/StaminaDamageOnCollideComponent.cs +++ b/Content.Shared/Damage/Components/StaminaDamageOnCollideComponent.cs @@ -11,6 +11,9 @@ public sealed partial class StaminaDamageOnCollideComponent : Component [ViewVariables(VVAccess.ReadWrite), DataField("damage")] public float Damage = 55f; + [ViewVariables(VVAccess.ReadWrite), DataField] + public bool IgnoreResistances = true; + [DataField("sound")] public SoundSpecifier? Sound; } diff --git a/Content.Shared/Damage/Systems/StaminaSystem.cs b/Content.Shared/Damage/Systems/StaminaSystem.cs index 52eef1183a..0b1e9f083c 100644 --- a/Content.Shared/Damage/Systems/StaminaSystem.cs +++ b/Content.Shared/Damage/Systems/StaminaSystem.cs @@ -1,4 +1,5 @@ using System.Linq; +using Content.Shared._White.StaminaProtection; using Content.Shared.Administration.Logs; using Content.Shared.Alert; using Content.Shared.CombatMode; @@ -204,7 +205,18 @@ public sealed partial class StaminaSystem : EntitySystem if (ev.Cancelled) return; - TakeStaminaDamage(target, component.Damage, source: uid, sound: component.Sound); + // WD EDIT START + var damage = component.Damage; + + if (!component.IgnoreResistances) + { + var modifyEv = new StaminaDamageModifyEvent {Damage = damage}; + RaiseLocalEvent(target, modifyEv); + damage = modifyEv.Damage; + } + + TakeStaminaDamage(target, damage, source: uid, sound: component.Sound); + // WD EDIT END } private void SetStaminaAlert(EntityUid uid, StaminaComponent? component = null) diff --git a/Content.Shared/Inventory/InventorySystem.Relay.cs b/Content.Shared/Inventory/InventorySystem.Relay.cs index 89cb3c61a6..bb5413bfb2 100644 --- a/Content.Shared/Inventory/InventorySystem.Relay.cs +++ b/Content.Shared/Inventory/InventorySystem.Relay.cs @@ -1,3 +1,4 @@ +using Content.Shared._White.StaminaProtection; using Content.Shared.Chemistry; using Content.Shared.Damage; using Content.Shared.Electrocution; @@ -27,6 +28,7 @@ public partial class InventorySystem SubscribeLocalEvent(RelayInventoryEvent); SubscribeLocalEvent(RelayInventoryEvent); SubscribeLocalEvent(RelayInventoryEvent); // WD + SubscribeLocalEvent(RelayInventoryEvent); // WD SubscribeLocalEvent(RelayInventoryEvent); // by-ref events diff --git a/Content.Shared/_White/StaminaProtection/StaminaProtectionSystem.cs b/Content.Shared/_White/StaminaProtection/StaminaProtectionSystem.cs new file mode 100644 index 0000000000..934ebce818 --- /dev/null +++ b/Content.Shared/_White/StaminaProtection/StaminaProtectionSystem.cs @@ -0,0 +1,32 @@ +using Content.Shared.Armor; +using Content.Shared.Inventory; + +namespace Content.Shared._White.StaminaProtection; + +public sealed class StaminaProtectionSystem : EntitySystem +{ + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent>(OnDamageModify); + } + + private void OnDamageModify(Entity ent, ref InventoryRelayedEvent args) + { + var modifiers = ent.Comp.Modifiers; + + if (modifiers.FlatReduction.TryGetValue("Blunt", out var flat)) + args.Args.Damage = MathF.Max(0f, args.Args.Damage - flat); + + if (modifiers.Coefficients.TryGetValue("Blunt", out var coefficient)) + args.Args.Damage *= coefficient; + } +} + +public sealed class StaminaDamageModifyEvent : EntityEventArgs, IInventoryRelayEvent +{ + public SlotFlags TargetSlots => ~SlotFlags.POCKET; + + public float Damage; +} diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/grenade.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/grenade.yml index ec62121c6b..133eadb047 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/grenade.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/grenade.yml @@ -15,7 +15,8 @@ - type: CanPenetrate penetrationLayer: MobLayer - type: StaminaDamageOnCollide - damage: 55 + ignoreResistances: false + damage: 70 - type: TimedDespawn lifetime: 0.25 diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/magnum.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/magnum.yml index ddb4b52396..8ed25153e2 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/magnum.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/magnum.yml @@ -31,6 +31,7 @@ types: Blunt: 3 - type: StaminaDamageOnCollide + ignoreResistances: false damage: 35 # 3 hits to stun cuz revolver - type: entity diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/shotgun.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/shotgun.yml index 7720dd58da..fb4d422a0d 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/shotgun.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/shotgun.yml @@ -26,7 +26,8 @@ types: Blunt: 10 - type: StaminaDamageOnCollide - damage: 40 # 3 hits to stun + ignoreResistances: false + damage: 70 - type: entity id: PelletShotgun diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml index 8eb5fb26bf..ca3d638c65 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml @@ -121,6 +121,7 @@ soundHit: path: /Audio/Weapons/Guns/Hits/snap.ogg - type: StaminaDamageOnCollide + ignoreResistances: false damage: 22 # 5 hits to stun sounds reasonable - type: entity From 79565e13715b6f1afd0834831aaa8e52d8f3a55c Mon Sep 17 00:00:00 2001 From: Aviu00 Date: Tue, 5 Mar 2024 08:48:55 +0300 Subject: [PATCH 2/7] - tweak: Lower chaplain damage resist. --- .../White/Entities/Clothing/Head/chaplain_helmets.yml | 4 ++-- .../White/Entities/Clothing/OuterClothing/chaplain_armor.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Resources/Prototypes/White/Entities/Clothing/Head/chaplain_helmets.yml b/Resources/Prototypes/White/Entities/Clothing/Head/chaplain_helmets.yml index 3b2e96c123..1627735e3e 100644 --- a/Resources/Prototypes/White/Entities/Clothing/Head/chaplain_helmets.yml +++ b/Resources/Prototypes/White/Entities/Clothing/Head/chaplain_helmets.yml @@ -11,8 +11,8 @@ - type: Armor modifiers: coefficients: - Blunt: 0.8 - Slash: 0.8 + Blunt: 0.85 + Slash: 0.85 Piercing: 0.95 - type: Tag tags: diff --git a/Resources/Prototypes/White/Entities/Clothing/OuterClothing/chaplain_armor.yml b/Resources/Prototypes/White/Entities/Clothing/OuterClothing/chaplain_armor.yml index e9d6d946ed..4267448a7d 100644 --- a/Resources/Prototypes/White/Entities/Clothing/OuterClothing/chaplain_armor.yml +++ b/Resources/Prototypes/White/Entities/Clothing/OuterClothing/chaplain_armor.yml @@ -11,8 +11,8 @@ - type: Armor modifiers: coefficients: - Blunt: 0.4 - Slash: 0.4 + Blunt: 0.5 + Slash: 0.5 Piercing: 0.9 Heat: 0.5 - type: ClothingSpeedModifier From 1e1e031e4f2ca55db608a70964cb3fa0e4f9ae71 Mon Sep 17 00:00:00 2001 From: Aviu00 Date: Tue, 5 Mar 2024 18:49:54 +0300 Subject: [PATCH 3/7] - tweak: Temperature bolts don't go through glass. --- .../Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml index ca3d638c65..48568e0b00 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml @@ -1351,7 +1351,8 @@ bounds: "-0.15,-0.3,0.15,0.3" hard: false mask: - - Opaque + - Impassable + - BulletImpassable fly-by: *flybyfixture - type: Ammo muzzleFlash: null From 7238b9a47fd7f66436a17f66e59269878f130ad7 Mon Sep 17 00:00:00 2001 From: Aviu00 Date: Tue, 5 Mar 2024 18:51:51 +0300 Subject: [PATCH 4/7] - add: Bolas for sec. --- Resources/Prototypes/Catalog/VendingMachines/Inventories/sec.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/Resources/Prototypes/Catalog/VendingMachines/Inventories/sec.yml b/Resources/Prototypes/Catalog/VendingMachines/Inventories/sec.yml index d3b7b41cad..cd72ef973e 100644 --- a/Resources/Prototypes/Catalog/VendingMachines/Inventories/sec.yml +++ b/Resources/Prototypes/Catalog/VendingMachines/Inventories/sec.yml @@ -9,6 +9,7 @@ GrenadeStinger: 4 Flash: 5 Tourniquet: 5 + Bola: 5 FlashlightSeclite: 5 ClothingEyesGlassesSunglasses: 2 ClothingEyesHudSecurity: 2 From 1635f7b15bc374aa031413c88f873eab25d799de Mon Sep 17 00:00:00 2001 From: Aviu00 Date: Tue, 5 Mar 2024 19:20:18 +0300 Subject: [PATCH 5/7] - tweak: No discounts for uplink implanter. --- .../Objects/Misc/subdermal_implants.yml | 2 +- Resources/Prototypes/Store/presets.yml | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Resources/Prototypes/Entities/Objects/Misc/subdermal_implants.yml b/Resources/Prototypes/Entities/Objects/Misc/subdermal_implants.yml index 91a6c60465..8d2b4d24d2 100644 --- a/Resources/Prototypes/Entities/Objects/Misc/subdermal_implants.yml +++ b/Resources/Prototypes/Entities/Objects/Misc/subdermal_implants.yml @@ -155,7 +155,7 @@ components: - Hands # prevent mouse buying grenade penguin since its not telepathic - type: Store - preset: StorePresetUplink + preset: StorePresetUplinkNoDiscounts balance: Telecrystal: 0 - type: UserInterface diff --git a/Resources/Prototypes/Store/presets.yml b/Resources/Prototypes/Store/presets.yml index 3f18fb70d3..a70e4fb533 100644 --- a/Resources/Prototypes/Store/presets.yml +++ b/Resources/Prototypes/Store/presets.yml @@ -24,6 +24,24 @@ maxItems: 10 salesCategory: UplinkSales +- type: storePreset + id: StorePresetUplinkNoDiscounts + storeName: Uplink + categories: + - UplinkWeapons + - UplinkAmmo + - UplinkExplosives + - UplinkMisc + - UplinkBundles + - UplinkTools + - UplinkUtility + - UplinkImplants + - UplinkJob + - UplinkArmor + - UplinkPointless + currencyWhitelist: + - Telecrystal + - type: storePreset id: StorePresetChangeling storeName: Evolution Shop From 163d51a75eeda862d45f50e7bf9e71c7f40bc494 Mon Sep 17 00:00:00 2001 From: Aviu00 Date: Tue, 5 Mar 2024 19:34:34 +0300 Subject: [PATCH 6/7] - tweak: Increase hardsuit temp adjustment rate. --- .../ClothingTemperatureAdjustComponent.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Content.Server/_White/ChangeTemperatureOnCollide/ClothingTemperatureAdjustComponent.cs b/Content.Server/_White/ChangeTemperatureOnCollide/ClothingTemperatureAdjustComponent.cs index a5739c2034..73943783e7 100644 --- a/Content.Server/_White/ChangeTemperatureOnCollide/ClothingTemperatureAdjustComponent.cs +++ b/Content.Server/_White/ChangeTemperatureOnCollide/ClothingTemperatureAdjustComponent.cs @@ -4,7 +4,7 @@ namespace Content.Server._White.ChangeTemperatureOnCollide; public sealed partial class ClothingTemperatureAdjustComponent : Component { [DataField, ViewVariables(VVAccess.ReadWrite)] - public float Rate = 1f; + public float Rate = 2f; [DataField, ViewVariables(VVAccess.ReadWrite)] public float TargetTemperature = 310.15f; From 0c65e35cd8f54cc0bddd0ad436af3b49158fda83 Mon Sep 17 00:00:00 2001 From: Aviu00 Date: Tue, 5 Mar 2024 21:18:11 +0300 Subject: [PATCH 7/7] - fix: Fix cult popups. --- Content.Server/_White/Cult/Runes/Systems/CultSystem.Verb.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Content.Server/_White/Cult/Runes/Systems/CultSystem.Verb.cs b/Content.Server/_White/Cult/Runes/Systems/CultSystem.Verb.cs index d4b8cb238f..059fa77710 100644 --- a/Content.Server/_White/Cult/Runes/Systems/CultSystem.Verb.cs +++ b/Content.Server/_White/Cult/Runes/Systems/CultSystem.Verb.cs @@ -57,7 +57,7 @@ public sealed partial class CultSystem if (comp.SelectedEmpowers.Count >= 1) { - _popupSystem.PopupEntity(Loc.GetString("verb-spell-create-too-much"), ent); + _popupSystem.PopupEntity(Loc.GetString("verb-spell-create-too-much"), ent, ent); return; } @@ -106,7 +106,7 @@ public sealed partial class CultSystem { if (ent.Comp.SelectedEmpowers.Count == 0) { - _popupSystem.PopupEntity(Loc.GetString("verb-spell-remove-no-spells"), ent); + _popupSystem.PopupEntity(Loc.GetString("verb-spell-remove-no-spells"), ent, ent); return; }