From 9950864b8b8b7678ac4ab1197cc541b5564d82ab Mon Sep 17 00:00:00 2001 From: Aviu00 <93730715+Aviu00@users.noreply.github.com> Date: Sun, 14 Jul 2024 12:27:20 +0000 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81=D1=8B=20(#439)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * - fix: Ebow. * - fix: Cult deconversion. * - add: Bola update. * - fix: Error. * - fix: Holoprojectors. * - fix: Clumsy. --- Content.Server/Cluwne/CluwneSystem.cs | 3 +- Content.Server/Hands/Systems/HandsSystem.cs | 6 +- Content.Server/Holosign/HolosignSystem.cs | 5 +- .../_White/Cult/HolyWater/DeconvertCultist.cs | 2 + .../_White/Wizard/Magic/WizardSpellsSystem.cs | 7 ++- .../Collision/BlurOnCollideComponent.cs | 8 +++ .../_White/Collision/BlurOnCollideSystem.cs | 38 ++++++++++++ .../Collision/KnockdownOnCollideComponent.cs | 11 ++++ .../KnockdownOnCollideSystem.cs | 10 +--- .../Knockdown/KnockdownOnCollideComponent.cs | 11 ---- .../Objects/Devices/holoprojectors.yml | 20 ------- .../Weapons/Guns/Projectiles/bolts.yml | 3 + .../Objects/Weapons/Guns/mini_ebow.yml | 1 - .../Objects/Weapons/Throwable/bola.yml | 59 ++++++++----------- 14 files changed, 104 insertions(+), 80 deletions(-) create mode 100644 Content.Shared/_White/Collision/BlurOnCollideComponent.cs create mode 100644 Content.Shared/_White/Collision/BlurOnCollideSystem.cs create mode 100644 Content.Shared/_White/Collision/KnockdownOnCollideComponent.cs rename Content.Shared/_White/{Knockdown => Collision}/KnockdownOnCollideSystem.cs (65%) delete mode 100644 Content.Shared/_White/Knockdown/KnockdownOnCollideComponent.cs diff --git a/Content.Server/Cluwne/CluwneSystem.cs b/Content.Server/Cluwne/CluwneSystem.cs index c170886a80..09803ca392 100644 --- a/Content.Server/Cluwne/CluwneSystem.cs +++ b/Content.Server/Cluwne/CluwneSystem.cs @@ -72,7 +72,8 @@ public sealed class CluwneSystem : EntitySystem EnsureComp(uid); _autoEmote.AddEmote(uid, "CluwneGiggle"); - EnsureComp(uid); + var clumsy = EnsureComp(uid); + clumsy.ClumsyDamage = new DamageSpecifier(_prototypeManager.Index("Brute"), 12); _popupSystem.PopupEntity(Loc.GetString("cluwne-transform", ("target", uid)), uid, PopupType.LargeCaution); _audio.PlayPvs(component.SpawnSound, uid); diff --git a/Content.Server/Hands/Systems/HandsSystem.cs b/Content.Server/Hands/Systems/HandsSystem.cs index 4af131e5dd..d6c93594af 100644 --- a/Content.Server/Hands/Systems/HandsSystem.cs +++ b/Content.Server/Hands/Systems/HandsSystem.cs @@ -10,6 +10,7 @@ using Content.Shared.ActionBlocker; using Content.Shared.Body.Part; using Content.Shared.CombatMode; using Content.Shared.Damage.Systems; +using Content.Shared.Ensnaring.Components; using Content.Shared.Explosion; using Content.Shared.Hands.Components; using Content.Shared.Hands.EntitySystems; @@ -73,7 +74,7 @@ namespace Content.Server.Hands.Systems { args.State = new HandsComponentState(hands); } - + private void OnExploded(Entity ent, ref BeforeExplodeEvent args) { if (ent.Comp.DisableExplosionRecursion) @@ -193,7 +194,8 @@ namespace Content.Server.Hands.Systems return false; // WD EDIT START - if (HasComp(throwEnt) && !_cultItem.CanThrow(player, throwEnt)) + if ((HasComp(throwEnt) || HasComp(throwEnt)) && + !_cultItem.CanThrow(player, throwEnt)) return false; // WD EDIT END diff --git a/Content.Server/Holosign/HolosignSystem.cs b/Content.Server/Holosign/HolosignSystem.cs index 33ac124631..e8a1d87101 100644 --- a/Content.Server/Holosign/HolosignSystem.cs +++ b/Content.Server/Holosign/HolosignSystem.cs @@ -5,6 +5,7 @@ using Content.Shared.Interaction; using Content.Shared.Interaction.Events; using Content.Shared.Popups; using Content.Shared.Storage; +using Robust.Shared.Utility; namespace Content.Server.Holosign; @@ -42,7 +43,7 @@ public sealed class HolosignSystem : EntitySystem private void OnUse(EntityUid uid, HolosignProjectorComponent comp, UseInHandEvent args) { - foreach (var sign in comp.Signs) + foreach (var sign in comp.Signs.ShallowClone()) { comp.Signs.Remove(sign); QueueDel(sign); @@ -97,4 +98,4 @@ public sealed class HolosignSystem : EntitySystem { return component.Signs.Count; // wd edit } -} \ 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 640943ae27..02aab1ca51 100644 --- a/Content.Server/_White/Cult/HolyWater/DeconvertCultist.cs +++ b/Content.Server/_White/Cult/HolyWater/DeconvertCultist.cs @@ -2,6 +2,7 @@ using System.Threading; using Content.Server._White.Cult.GameRule; using Content.Server.Popups; using Content.Server.Stunnable; +using Content.Shared._White.Antag; using Content.Shared.Chemistry.Reagent; using Content.Shared.IdentityManagement; using Content.Shared.Jittering; @@ -55,6 +56,7 @@ public sealed partial class DeconvertCultist : ReagentEffect entityManager.RemoveComponent(uid); entityManager.RemoveComponent(uid); + entityManager.RemoveComponent(uid); var cultRuleSystem = entityManager.System(); cultRuleSystem.RemoveObjectiveAndRole(uid); diff --git a/Content.Server/_White/Wizard/Magic/WizardSpellsSystem.cs b/Content.Server/_White/Wizard/Magic/WizardSpellsSystem.cs index 1599db00fd..f2852a95e8 100644 --- a/Content.Server/_White/Wizard/Magic/WizardSpellsSystem.cs +++ b/Content.Server/_White/Wizard/Magic/WizardSpellsSystem.cs @@ -29,6 +29,8 @@ using Content.Shared.Actions; using Content.Shared.Borer; using Content.Shared.Cluwne; using Content.Shared.Coordinates.Helpers; +using Content.Shared.Damage; +using Content.Shared.Damage.Prototypes; using Content.Shared.Hands.Components; using Content.Shared.Hands.EntitySystems; using Content.Shared.Humanoid; @@ -49,6 +51,7 @@ using Robust.Shared.Audio.Systems; using Robust.Shared.Map; using Robust.Shared.Physics.Components; using Robust.Shared.Player; +using Robust.Shared.Prototypes; using Robust.Shared.Random; namespace Content.Server._White.Wizard.Magic; @@ -59,6 +62,7 @@ public sealed class WizardSpellsSystem : EntitySystem [Dependency] private readonly IMapManager _mapManager = default!; [Dependency] private readonly IRobustRandom _random = default!; + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; [Dependency] private readonly EntityLookupSystem _lookup = default!; [Dependency] private readonly GunSystem _gunSystem = default!; [Dependency] private readonly SharedTransformSystem _transformSystem = default!; @@ -310,7 +314,8 @@ public sealed class WizardSpellsSystem : EntitySystem } SetOutfitCommand.SetOutfit(msg.Target, "ClownGear", EntityManager); - EnsureComp(msg.Target); + var clumsy = EnsureComp(msg.Target); + clumsy.ClumsyDamage = new DamageSpecifier(_prototypeManager.Index("Brute"), 12); Spawn("AdminInstantEffectSmoke3", Transform(msg.Target).Coordinates); diff --git a/Content.Shared/_White/Collision/BlurOnCollideComponent.cs b/Content.Shared/_White/Collision/BlurOnCollideComponent.cs new file mode 100644 index 0000000000..f89f71dfe0 --- /dev/null +++ b/Content.Shared/_White/Collision/BlurOnCollideComponent.cs @@ -0,0 +1,8 @@ +namespace Content.Shared._White.Collision; + +[RegisterComponent] +public sealed partial class BlurOnCollideComponent : Component +{ + [DataField] + public float BlurTime = 20f; +} diff --git a/Content.Shared/_White/Collision/BlurOnCollideSystem.cs b/Content.Shared/_White/Collision/BlurOnCollideSystem.cs new file mode 100644 index 0000000000..0de21bea62 --- /dev/null +++ b/Content.Shared/_White/Collision/BlurOnCollideSystem.cs @@ -0,0 +1,38 @@ +using Content.Shared.Eye.Blinding.Components; +using Content.Shared.Projectiles; +using Content.Shared.Standing.Systems; +using Content.Shared.StatusEffect; +using Content.Shared.Throwing; + +namespace Content.Shared._White.Collision; + +public sealed class BlurOnCollideSystem : EntitySystem +{ + [Dependency] private readonly StatusEffectsSystem _statusEffects = default!; + + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnProjectileHit); + SubscribeLocalEvent(OnEntityHit); + } + + private void OnEntityHit(Entity ent, ref ThrowDoHitEvent args) + { + ApplyEffects(args.Target, ent.Comp); + } + + private void OnProjectileHit(Entity ent, ref ProjectileHitEvent args) + { + ApplyEffects(args.Target, ent.Comp); + } + + private void ApplyEffects(EntityUid target, BlurOnCollideComponent component) + { + _statusEffects.TryAddStatusEffect(target, + "BlurryVision", + TimeSpan.FromSeconds(component.BlurTime), + true); + } +} diff --git a/Content.Shared/_White/Collision/KnockdownOnCollideComponent.cs b/Content.Shared/_White/Collision/KnockdownOnCollideComponent.cs new file mode 100644 index 0000000000..70144f0435 --- /dev/null +++ b/Content.Shared/_White/Collision/KnockdownOnCollideComponent.cs @@ -0,0 +1,11 @@ +using Content.Shared.Standing.Systems; + +namespace Content.Shared._White.Collision; + +[RegisterComponent] +public sealed partial class KnockdownOnCollideComponent : Component +{ + [DataField] + public SharedStandingStateSystem.DropHeldItemsBehavior Behavior = + SharedStandingStateSystem.DropHeldItemsBehavior.NoDrop; +} diff --git a/Content.Shared/_White/Knockdown/KnockdownOnCollideSystem.cs b/Content.Shared/_White/Collision/KnockdownOnCollideSystem.cs similarity index 65% rename from Content.Shared/_White/Knockdown/KnockdownOnCollideSystem.cs rename to Content.Shared/_White/Collision/KnockdownOnCollideSystem.cs index 748130f4d4..007fd4712f 100644 --- a/Content.Shared/_White/Knockdown/KnockdownOnCollideSystem.cs +++ b/Content.Shared/_White/Collision/KnockdownOnCollideSystem.cs @@ -1,15 +1,12 @@ -using Content.Shared.Eye.Blinding.Components; using Content.Shared.Projectiles; using Content.Shared.Standing.Systems; -using Content.Shared.StatusEffect; using Content.Shared.Throwing; -namespace Content.Shared._White.Knockdown; +namespace Content.Shared._White.Collision; public sealed class KnockdownOnCollideSystem : EntitySystem { [Dependency] private readonly SharedStandingStateSystem _standing = default!; - [Dependency] private readonly StatusEffectsSystem _statusEffects = default!; public override void Initialize() { @@ -31,9 +28,6 @@ public sealed class KnockdownOnCollideSystem : EntitySystem private void ApplyEffects(EntityUid target, KnockdownOnCollideComponent component) { - _standing.TryLieDown(target, null, SharedStandingStateSystem.DropHeldItemsBehavior.AlwaysDrop); - - if (component.UseBlur) - _statusEffects.TryAddStatusEffect(target, "BlurryVision", TimeSpan.FromSeconds(component.BlurTime), true); + _standing.TryLieDown(target, null, component.Behavior); } } diff --git a/Content.Shared/_White/Knockdown/KnockdownOnCollideComponent.cs b/Content.Shared/_White/Knockdown/KnockdownOnCollideComponent.cs deleted file mode 100644 index 475788eb80..0000000000 --- a/Content.Shared/_White/Knockdown/KnockdownOnCollideComponent.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace Content.Shared._White.Knockdown; - -[RegisterComponent] -public sealed partial class KnockdownOnCollideComponent : Component -{ - [DataField] - public float BlurTime = 20f; - - [DataField] - public bool UseBlur; -} diff --git a/Resources/Prototypes/Entities/Objects/Devices/holoprojectors.yml b/Resources/Prototypes/Entities/Objects/Devices/holoprojectors.yml index d26bfb222e..f670a69385 100644 --- a/Resources/Prototypes/Entities/Objects/Devices/holoprojectors.yml +++ b/Resources/Prototypes/Entities/Objects/Devices/holoprojectors.yml @@ -22,11 +22,6 @@ parent: Holoprojector id: HoloprojectorEmpty suffix: Empty - components: - - type: ItemSlots - slots: - cell_slot: - name: power-cell-slot-component-slot-name-default - type: entity parent: Holoprojector @@ -56,11 +51,6 @@ parent: HolofanProjector id: HolofanProjectorEmpty suffix: Empty - components: - - type: ItemSlots - slots: - cell_slot: - name: power-cell-slot-component-slot-name-default - type: entity parent: Holoprojector @@ -84,11 +74,6 @@ parent: HoloprojectorField id: HoloprojectorFieldEmpty suffix: Empty - components: - - type: ItemSlots - slots: - cell_slot: - name: power-cell-slot-component-slot-name-default - type: entity parent: Holoprojector @@ -112,8 +97,3 @@ parent: HoloprojectorSecurity id: HoloprojectorSecurityEmpty suffix: Empty - components: - - type: ItemSlots - slots: - cell_slot: - name: power-cell-slot-component-slot-name-default diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/bolts.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/bolts.yml index 35f2450e09..a87ef17836 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/bolts.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/bolts.yml @@ -26,3 +26,6 @@ hard: false mask: - Opaque + - type: KnockdownOnCollide + behavior: AlwaysDrop + - type: BlurOnCollide diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/mini_ebow.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/mini_ebow.yml index 3402f57bdc..9e058ee512 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/mini_ebow.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/mini_ebow.yml @@ -34,4 +34,3 @@ True: { state: icon } False: { state: empty } - type: Appearance - useBlur: true diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Throwable/bola.yml b/Resources/Prototypes/Entities/Objects/Weapons/Throwable/bola.yml index 4bece7e24f..4d878e8c1c 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Throwable/bola.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Throwable/bola.yml @@ -1,18 +1,9 @@ - type: entity name: bola - parent: BaseItem + parent: BaseBola id: Bola description: Linked together with some spare cuffs and metal. components: - - type: Item - size: Normal - - type: Sprite - sprite: Objects/Weapons/Throwable/bola.rsi - state: icon - - type: EmitSoundOnThrow - sound: /Audio/Weapons/bolathrow.ogg - - type: EmitSoundOnLand - sound: /Audio/Effects/snap.ogg - type: Construction graph: Bola node: bola @@ -39,6 +30,25 @@ damage: types: Blunt: 5 + +# WD added + +- type: entity + name: bola + parent: BaseItem + abstract: true + id: BaseBola + description: Linked together with some spare cuffs and metal. + components: + - type: Item + size: Normal + - type: Sprite + sprite: Objects/Weapons/Throwable/bola.rsi + state: icon + - type: EmitSoundOnThrow + sound: /Audio/Weapons/bolathrow.ogg + - type: EmitSoundOnLand + sound: /Audio/Effects/snap.ogg - type: Ensnaring freeTime: 2.0 breakoutTime: 3.5 #all bola should generally be fast to remove @@ -49,10 +59,8 @@ canMoveBreakout: true - type: KnockdownOnCollide -# WD added - - type: entity - parent: Bola + parent: BaseBola id: CultBola name: Bola description: Linked together with some spare cuffs and metal. @@ -60,14 +68,12 @@ - type: Sprite sprite: White/Cult/bola.rsi - type: Ensnaring - freeTime: 2.0 - breakoutTime: 3.5 #all bola should generally be fast to remove walkSpeed: 0.5 sprintSpeed: 0.5 - canThrowTrigger: true + - type: CultItem - type: entity - parent: Bola + parent: BaseBola id: EnergyBola name: Bola description: Linked together with some spare cuffs and metal. @@ -77,22 +83,7 @@ - type: Sprite sprite: White/Objects/Weapons/Throwable/energybola.rsi - type: Ensnaring - freeTime: 1 - breakoutTime: 2 - walkSpeed: 0.8 - sprintSpeed: 0.8 - staminaDamage: 33 + walkSpeed: 0.6 + sprintSpeed: 0.6 - type: EmitSoundOnLand collection: sparks - - type: Destructible - thresholds: - - trigger: - !type:DamageTrigger - damage: 10 - behaviors: - - !type:PlaySoundBehavior - sound: - collection: EnergyMiss - - !type:DoActsBehavior - acts: [ "Destruction" ] - - type: KnockdownOnCollide