]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Push horn (#36009)
authorThinbug <101073555+Thinbug0@users.noreply.github.com>
Tue, 29 Apr 2025 13:07:57 +0000 (10:07 -0300)
committerGitHub <noreply@github.com>
Tue, 29 Apr 2025 13:07:57 +0000 (09:07 -0400)
* 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

19 files changed:
Content.Server/Explosion/EntitySystems/RepulseAttractOnTriggerSystem.cs [new file with mode: 0644]
Content.Shared/Explosion/Components/OnTrigger/SharedRepulseAttractOnTriggerComponent.cs [new file with mode: 0644]
Content.Shared/Explosion/EntitySystems/SharedRepulseAttractOnTriggerSystem.cs [new file with mode: 0644]
Resources/Audio/Items/Toys/attributions.yml
Resources/Audio/Items/Toys/pushHornFloor.ogg [new file with mode: 0644]
Resources/Audio/Items/Toys/pushHornHonk.ogg [new file with mode: 0644]
Resources/Locale/en-US/research/technologies.ftl
Resources/Prototypes/Entities/Effects/gravity_pulse.yml [new file with mode: 0644]
Resources/Prototypes/Entities/Objects/Fun/bike_horn.yml
Resources/Prototypes/Recipes/Lathes/Packs/service.yml
Resources/Prototypes/Recipes/Lathes/misc.yml
Resources/Prototypes/Research/civilianservices.yml
Resources/Textures/Effects/gravityPulse.rsi/gravityPulse.png [new file with mode: 0644]
Resources/Textures/Effects/gravityPulse.rsi/meta.json [new file with mode: 0644]
Resources/Textures/Objects/Fun/push_horn.rsi/equipped-BELT.png [new file with mode: 0644]
Resources/Textures/Objects/Fun/push_horn.rsi/icon.png [new file with mode: 0644]
Resources/Textures/Objects/Fun/push_horn.rsi/inhand-left.png [new file with mode: 0644]
Resources/Textures/Objects/Fun/push_horn.rsi/inhand-right.png [new file with mode: 0644]
Resources/Textures/Objects/Fun/push_horn.rsi/meta.json [new file with mode: 0644]

diff --git a/Content.Server/Explosion/EntitySystems/RepulseAttractOnTriggerSystem.cs b/Content.Server/Explosion/EntitySystems/RepulseAttractOnTriggerSystem.cs
new file mode 100644 (file)
index 0000000..9e595c5
--- /dev/null
@@ -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<SharedRepulseAttractOnTriggerComponent, TriggerEvent>(OnTrigger);
+    }
+
+    private void OnTrigger(Entity<SharedRepulseAttractOnTriggerComponent> 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 (file)
index 0000000..43febff
--- /dev/null
@@ -0,0 +1,37 @@
+using Content.Shared.Physics;
+using Content.Shared.Whitelist;
+
+namespace Content.Shared.Explosion.Components.OnTrigger;
+
+/// <summary>
+/// Generates a gravity pulse/repulse using the RepulseAttractComponent when the entity is triggered
+/// </summary>
+[RegisterComponent]
+public sealed partial class SharedRepulseAttractOnTriggerComponent : Component
+{
+    /// <summary>
+    /// How fast should the Repulsion/Attraction be?
+    /// A positive value will repulse objects, a negative value will attract
+    /// </summary>
+    [DataField]
+    public float Speed;
+
+    /// <summary>
+    /// How close do the entities need to be?
+    /// </summary>
+    [DataField]
+    public float Range;
+
+    /// <summary>
+    /// What kind of entities should this effect apply to?
+    /// </summary>
+    [DataField]
+    public EntityWhitelist? Whitelist;
+
+    /// <summary>
+    /// What collision layers should be excluded?
+    /// The default excludes ghost mobs, revenants, the AI camera etc.
+    /// </summary>
+    [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 (file)
index 0000000..386024f
--- /dev/null
@@ -0,0 +1,3 @@
+namespace Content.Shared.Explosion.EntitySystems;
+
+public abstract class SharedRepulseAttractOnTriggerSystem : EntitySystem;
index 2dd0ce9eded07fb15c1d4bed832ce7cb6595b06b..23caefc0d0b800dcf89f46f3ea95657ea292385a 100644 (file)
   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 (file)
index 0000000..d1f368e
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 (file)
index 0000000..bb40a8f
Binary files /dev/null and b/Resources/Audio/Items/Toys/pushHornHonk.ogg differ
index c3c1f1dad7b05f68a48676502459b5f947e5d798..b2c4b8bc0d57db5d7cf95be944a089c871fff02c 100644 (file)
@@ -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 (file)
index 0000000..7584930
--- /dev/null
@@ -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
index 288c41dc6bc3630f4de61e9d2d085a0b24ccf712..f21de4c79eff99c48981334ecceeb3cd964ac1a5 100644 (file)
   - 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
index b3b63009be4fc0e8a797fa225c0f7fd0120bbeb4..e23b5e90b7fe3ba8e4b15a951741600fff35c0d9 100644 (file)
@@ -50,6 +50,7 @@
   id: Instruments
   recipes:
   - SynthesizerInstrument
+  - PushHorn
 
 - type: latheRecipePack
   id: ServiceBoards
index 5cf10fb570377a84388a51776b1f3e03ac3d8267..9d4ecf76978aba3ae1708d90cc817138c56689d9 100644 (file)
     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
index 55298d05a1789dc373109a652b48c0f7eaba7378..b078dd7cd65495f9743d48bbc01561859866fd93 100644 (file)
   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 (file)
index 0000000..2d017bd
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 (file)
index 0000000..38d9f7c
--- /dev/null
@@ -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 (file)
index 0000000..ada82d1
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 (file)
index 0000000..5c10c71
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 (file)
index 0000000..498c3f4
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 (file)
index 0000000..5741b38
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 (file)
index 0000000..77fe822
--- /dev/null
@@ -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
+      }
+    ]
+}