From: Thinbug <101073555+Thinbug0@users.noreply.github.com> Date: Tue, 29 Apr 2025 13:07:57 +0000 (-0300) Subject: Push horn (#36009) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=ce080276dbd363cd5489b158efd42987900292b1;p=space-station-14.git Push horn (#36009) * Empty commit * epic super duper cool fr push horn draft * whoops turns out theres a system that does that thingi already x.x * bunch of like fixis and generalization * general progress * most stuffies done * last thingi hopefully * small fixies, mostly preventing bypassing the delay by spamming * rename to fit better * rename for real i forgor to add * weird fixie but last commit didn workie * oki shold be fine now * lastish cleanup * fixies * missed a space * removed unnecessary component check * getting the typos out of the way first * moved the component to shared * rest of fixies --- diff --git a/Content.Server/Explosion/EntitySystems/RepulseAttractOnTriggerSystem.cs b/Content.Server/Explosion/EntitySystems/RepulseAttractOnTriggerSystem.cs new file mode 100644 index 0000000000..9e595c5d9e --- /dev/null +++ b/Content.Server/Explosion/EntitySystems/RepulseAttractOnTriggerSystem.cs @@ -0,0 +1,29 @@ +using Content.Shared.Explosion.Components.OnTrigger; +using Content.Shared.Explosion.EntitySystems; +using Content.Shared.RepulseAttract; +using Content.Shared.Timing; + +namespace Content.Server.Explosion.EntitySystems; + +public sealed class RepulseAttractOnTriggerSystem : SharedRepulseAttractOnTriggerSystem +{ + [Dependency] private readonly RepulseAttractSystem _repulse = default!; + [Dependency] private readonly SharedTransformSystem _transform = default!; + [Dependency] private readonly UseDelaySystem _delay = default!; + + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnTrigger); + } + + private void OnTrigger(Entity ent, ref TriggerEvent args) + { + if (_delay.IsDelayed(ent.Owner)) + return; + + var position = _transform.GetMapCoordinates(ent); + _repulse.TryRepulseAttract(position, args.User, ent.Comp.Speed, ent.Comp.Range, ent.Comp.Whitelist, ent.Comp.CollisionMask); + } +} diff --git a/Content.Shared/Explosion/Components/OnTrigger/SharedRepulseAttractOnTriggerComponent.cs b/Content.Shared/Explosion/Components/OnTrigger/SharedRepulseAttractOnTriggerComponent.cs new file mode 100644 index 0000000000..43febff03b --- /dev/null +++ b/Content.Shared/Explosion/Components/OnTrigger/SharedRepulseAttractOnTriggerComponent.cs @@ -0,0 +1,37 @@ +using Content.Shared.Physics; +using Content.Shared.Whitelist; + +namespace Content.Shared.Explosion.Components.OnTrigger; + +/// +/// Generates a gravity pulse/repulse using the RepulseAttractComponent when the entity is triggered +/// +[RegisterComponent] +public sealed partial class SharedRepulseAttractOnTriggerComponent : Component +{ + /// + /// How fast should the Repulsion/Attraction be? + /// A positive value will repulse objects, a negative value will attract + /// + [DataField] + public float Speed; + + /// + /// How close do the entities need to be? + /// + [DataField] + public float Range; + + /// + /// What kind of entities should this effect apply to? + /// + [DataField] + public EntityWhitelist? Whitelist; + + /// + /// What collision layers should be excluded? + /// The default excludes ghost mobs, revenants, the AI camera etc. + /// + [DataField] + public CollisionGroup CollisionMask = CollisionGroup.GhostImpassable; +} diff --git a/Content.Shared/Explosion/EntitySystems/SharedRepulseAttractOnTriggerSystem.cs b/Content.Shared/Explosion/EntitySystems/SharedRepulseAttractOnTriggerSystem.cs new file mode 100644 index 0000000000..386024fbeb --- /dev/null +++ b/Content.Shared/Explosion/EntitySystems/SharedRepulseAttractOnTriggerSystem.cs @@ -0,0 +1,3 @@ +namespace Content.Shared.Explosion.EntitySystems; + +public abstract class SharedRepulseAttractOnTriggerSystem : EntitySystem; diff --git a/Resources/Audio/Items/Toys/attributions.yml b/Resources/Audio/Items/Toys/attributions.yml index 2dd0ce9ede..23caefc0d0 100644 --- a/Resources/Audio/Items/Toys/attributions.yml +++ b/Resources/Audio/Items/Toys/attributions.yml @@ -93,6 +93,16 @@ copyright: "Created by xprospero for ss14" source: "https://github.com/space-wizards/space-station-14/blob/master/Resources/Audio/Items/Toys/rubber_chicken_3.ogg" +- files: ["pushHornHonk.ogg"] + license: "CC0-1.0" + copyright: "Created by Matislav, modified by Thinbug" + source: "https://freesound.org/s/564697/" + +- files: ["pushHornFloor.ogg"] + license: "CC0-1.0" + copyright: "Created by Dedshot_Dyzek" + source: "https://freesound.org/people/Dedshot_Dyzek/sounds/769792/" + - files: ["arf.ogg"] license: "CC0-1.0" copyright: "Created by Orsoniks, from the game Casualties Unknown" diff --git a/Resources/Audio/Items/Toys/pushHornFloor.ogg b/Resources/Audio/Items/Toys/pushHornFloor.ogg new file mode 100644 index 0000000000..d1f368e516 Binary files /dev/null and b/Resources/Audio/Items/Toys/pushHornFloor.ogg differ diff --git a/Resources/Audio/Items/Toys/pushHornHonk.ogg b/Resources/Audio/Items/Toys/pushHornHonk.ogg new file mode 100644 index 0000000000..bb40a8f5df Binary files /dev/null and b/Resources/Audio/Items/Toys/pushHornHonk.ogg differ diff --git a/Resources/Locale/en-US/research/technologies.ftl b/Resources/Locale/en-US/research/technologies.ftl index c3c1f1dad7..b2c4b8bc0d 100644 --- a/Resources/Locale/en-US/research/technologies.ftl +++ b/Resources/Locale/en-US/research/technologies.ftl @@ -72,5 +72,6 @@ research-technology-meat-manipulation = Meat Manipulation research-technology-honk-mech = H.O.N.K. Mech research-technology-advanced-spray = Advanced Spray research-technology-bluespace-cargo-transport = Bluespace Cargo Transport +research-technology-clowning-utilities = Clowning Utilities research-technology-quantum-fiber-weaving = Quantum Fiber Weaving research-technology-bluespace-chemistry = Bluespace Chemistry diff --git a/Resources/Prototypes/Entities/Effects/gravity_pulse.yml b/Resources/Prototypes/Entities/Effects/gravity_pulse.yml new file mode 100644 index 0000000000..75849309a6 --- /dev/null +++ b/Resources/Prototypes/Entities/Effects/gravity_pulse.yml @@ -0,0 +1,19 @@ +- type: entity + id: EffectGravityPulse + categories: [ HideSpawnMenu ] + components: + - type: TimedDespawn + lifetime: 0.32 + - type: Sprite + drawdepth: Effects + noRot: true + layers: + - shader: unshaded + map: ["enum.EffectLayers.Unshaded"] + sprite: Effects/gravityPulse.rsi + state: gravityPulse + - type: EffectVisuals + - type: Tag + tags: + - HideContextMenu + - type: AnimationPlayer diff --git a/Resources/Prototypes/Entities/Objects/Fun/bike_horn.yml b/Resources/Prototypes/Entities/Objects/Fun/bike_horn.yml index 288c41dc6b..f21de4c79e 100644 --- a/Resources/Prototypes/Entities/Objects/Fun/bike_horn.yml +++ b/Resources/Prototypes/Entities/Objects/Fun/bike_horn.yml @@ -196,3 +196,37 @@ - type: Construction graph: BananiumHorn node: bananiumHorn + +- type: entity + parent: BaseItem + id: PushHorn + name: push horn + description: This powerful bikehorn is sure to blast frowns away. + components: + - type: Sprite + sprite: Objects/Fun/push_horn.rsi + state: icon + - type: Item + sprite: Objects/Fun/push_horn.rsi + size: Tiny + - type: Clothing + sprite: Objects/Fun/push_horn.rsi + slots: [Belt] + quickEquip: false + - type: EmitSoundOnUse + handle: false + sound: "/Audio/Items/Toys/pushHornHonk.ogg" + - type: EmitSoundOnLand + sound: "/Audio/Items/Toys/pushHornFloor.ogg" + - type: UseDelay + delay: 6 + - type: TriggerOnUse + - type: RepulseAttractOnTrigger + speed: 50 + range: 2 + whitelist: + components: + - MobMover + - Item + - type: SpawnOnTrigger + proto: EffectGravityPulse diff --git a/Resources/Prototypes/Recipes/Lathes/Packs/service.yml b/Resources/Prototypes/Recipes/Lathes/Packs/service.yml index b3b63009be..e23b5e90b7 100644 --- a/Resources/Prototypes/Recipes/Lathes/Packs/service.yml +++ b/Resources/Prototypes/Recipes/Lathes/Packs/service.yml @@ -50,6 +50,7 @@ id: Instruments recipes: - SynthesizerInstrument + - PushHorn - type: latheRecipePack id: ServiceBoards diff --git a/Resources/Prototypes/Recipes/Lathes/misc.yml b/Resources/Prototypes/Recipes/Lathes/misc.yml index 5cf10fb570..9d4ecf7697 100644 --- a/Resources/Prototypes/Recipes/Lathes/misc.yml +++ b/Resources/Prototypes/Recipes/Lathes/misc.yml @@ -105,6 +105,15 @@ Plastic: 300 Glass: 100 +- type: latheRecipe + id: PushHorn + result: PushHorn + completetime: 5 + materials: + Steel: 500 + Plastic: 500 + Plasma: 200 + - type: latheRecipe parent: BaseToolRecipe id: NodeScanner diff --git a/Resources/Prototypes/Research/civilianservices.yml b/Resources/Prototypes/Research/civilianservices.yml index 55298d05a1..b078dd7cd6 100644 --- a/Resources/Prototypes/Research/civilianservices.yml +++ b/Resources/Prototypes/Research/civilianservices.yml @@ -188,6 +188,18 @@ recipeUnlocks: - CargoTelepadMachineCircuitboard +- type: technology + id: PushHorn + name: research-technology-clowning-utilities + icon: + sprite: Objects/Fun/push_horn.rsi + state: icon + discipline: CivilianServices + tier: 2 + cost: 4000 + recipeUnlocks: + - PushHorn + # Tier 3 - type: technology diff --git a/Resources/Textures/Effects/gravityPulse.rsi/gravityPulse.png b/Resources/Textures/Effects/gravityPulse.rsi/gravityPulse.png new file mode 100644 index 0000000000..2d017bd483 Binary files /dev/null and b/Resources/Textures/Effects/gravityPulse.rsi/gravityPulse.png differ diff --git a/Resources/Textures/Effects/gravityPulse.rsi/meta.json b/Resources/Textures/Effects/gravityPulse.rsi/meta.json new file mode 100644 index 0000000000..38d9f7cfbf --- /dev/null +++ b/Resources/Textures/Effects/gravityPulse.rsi/meta.json @@ -0,0 +1,34 @@ +{ + "version": 1, + "license": "CC0-1.0", + "copyright": "Made by Thinbug for ss14", + "size": { + "x": 32, + "y": 32 + }, + "states": [ + { + "name": "gravityPulse", + "delays": [ + [ + 0.02, + 0.02, + 0.02, + 0.02, + 0.02, + 0.02, + 0.02, + 0.02, + 0.02, + 0.02, + 0.02, + 0.02, + 0.02, + 0.02, + 0.02, + 0.02 + ] + ] + } + ] +} diff --git a/Resources/Textures/Objects/Fun/push_horn.rsi/equipped-BELT.png b/Resources/Textures/Objects/Fun/push_horn.rsi/equipped-BELT.png new file mode 100644 index 0000000000..ada82d1936 Binary files /dev/null and b/Resources/Textures/Objects/Fun/push_horn.rsi/equipped-BELT.png differ diff --git a/Resources/Textures/Objects/Fun/push_horn.rsi/icon.png b/Resources/Textures/Objects/Fun/push_horn.rsi/icon.png new file mode 100644 index 0000000000..5c10c71554 Binary files /dev/null and b/Resources/Textures/Objects/Fun/push_horn.rsi/icon.png differ diff --git a/Resources/Textures/Objects/Fun/push_horn.rsi/inhand-left.png b/Resources/Textures/Objects/Fun/push_horn.rsi/inhand-left.png new file mode 100644 index 0000000000..498c3f4d7b Binary files /dev/null and b/Resources/Textures/Objects/Fun/push_horn.rsi/inhand-left.png differ diff --git a/Resources/Textures/Objects/Fun/push_horn.rsi/inhand-right.png b/Resources/Textures/Objects/Fun/push_horn.rsi/inhand-right.png new file mode 100644 index 0000000000..5741b385ab Binary files /dev/null and b/Resources/Textures/Objects/Fun/push_horn.rsi/inhand-right.png differ diff --git a/Resources/Textures/Objects/Fun/push_horn.rsi/meta.json b/Resources/Textures/Objects/Fun/push_horn.rsi/meta.json new file mode 100644 index 0000000000..77fe8221c0 --- /dev/null +++ b/Resources/Textures/Objects/Fun/push_horn.rsi/meta.json @@ -0,0 +1,26 @@ +{ + "version": 1, + "license": "CC0-1.0", + "copyright": "Made by Thinbug for ss14 :33", + "size": { + "x": 32, + "y": 32 + }, + "states": [ + { + "name": "icon" + }, + { + "name": "equipped-BELT", + "directions": 4 + }, + { + "name": "inhand-left", + "directions": 4 + }, + { + "name": "inhand-right", + "directions": 4 + } + ] +}