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
This commit is contained in:
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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;
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
namespace Content.Shared.Explosion.EntitySystems;
|
||||||
|
|
||||||
|
public abstract class SharedRepulseAttractOnTriggerSystem : EntitySystem;
|
||||||
@@ -93,6 +93,16 @@
|
|||||||
copyright: "Created by xprospero for ss14"
|
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"
|
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"]
|
- files: ["arf.ogg"]
|
||||||
license: "CC0-1.0"
|
license: "CC0-1.0"
|
||||||
copyright: "Created by Orsoniks, from the game Casualties Unknown"
|
copyright: "Created by Orsoniks, from the game Casualties Unknown"
|
||||||
|
|||||||
BIN
Resources/Audio/Items/Toys/pushHornFloor.ogg
Normal file
BIN
Resources/Audio/Items/Toys/pushHornFloor.ogg
Normal file
Binary file not shown.
BIN
Resources/Audio/Items/Toys/pushHornHonk.ogg
Normal file
BIN
Resources/Audio/Items/Toys/pushHornHonk.ogg
Normal file
Binary file not shown.
@@ -72,5 +72,6 @@ research-technology-meat-manipulation = Meat Manipulation
|
|||||||
research-technology-honk-mech = H.O.N.K. Mech
|
research-technology-honk-mech = H.O.N.K. Mech
|
||||||
research-technology-advanced-spray = Advanced Spray
|
research-technology-advanced-spray = Advanced Spray
|
||||||
research-technology-bluespace-cargo-transport = Bluespace Cargo Transport
|
research-technology-bluespace-cargo-transport = Bluespace Cargo Transport
|
||||||
|
research-technology-clowning-utilities = Clowning Utilities
|
||||||
research-technology-quantum-fiber-weaving = Quantum Fiber Weaving
|
research-technology-quantum-fiber-weaving = Quantum Fiber Weaving
|
||||||
research-technology-bluespace-chemistry = Bluespace Chemistry
|
research-technology-bluespace-chemistry = Bluespace Chemistry
|
||||||
|
|||||||
19
Resources/Prototypes/Entities/Effects/gravity_pulse.yml
Normal file
19
Resources/Prototypes/Entities/Effects/gravity_pulse.yml
Normal file
@@ -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
|
||||||
@@ -196,3 +196,37 @@
|
|||||||
- type: Construction
|
- type: Construction
|
||||||
graph: BananiumHorn
|
graph: BananiumHorn
|
||||||
node: 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
|
||||||
|
|||||||
@@ -50,6 +50,7 @@
|
|||||||
id: Instruments
|
id: Instruments
|
||||||
recipes:
|
recipes:
|
||||||
- SynthesizerInstrument
|
- SynthesizerInstrument
|
||||||
|
- PushHorn
|
||||||
|
|
||||||
- type: latheRecipePack
|
- type: latheRecipePack
|
||||||
id: ServiceBoards
|
id: ServiceBoards
|
||||||
|
|||||||
@@ -105,6 +105,15 @@
|
|||||||
Plastic: 300
|
Plastic: 300
|
||||||
Glass: 100
|
Glass: 100
|
||||||
|
|
||||||
|
- type: latheRecipe
|
||||||
|
id: PushHorn
|
||||||
|
result: PushHorn
|
||||||
|
completetime: 5
|
||||||
|
materials:
|
||||||
|
Steel: 500
|
||||||
|
Plastic: 500
|
||||||
|
Plasma: 200
|
||||||
|
|
||||||
- type: latheRecipe
|
- type: latheRecipe
|
||||||
parent: BaseToolRecipe
|
parent: BaseToolRecipe
|
||||||
id: NodeScanner
|
id: NodeScanner
|
||||||
|
|||||||
@@ -188,6 +188,18 @@
|
|||||||
recipeUnlocks:
|
recipeUnlocks:
|
||||||
- CargoTelepadMachineCircuitboard
|
- 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
|
# Tier 3
|
||||||
|
|
||||||
- type: technology
|
- type: technology
|
||||||
|
|||||||
BIN
Resources/Textures/Effects/gravityPulse.rsi/gravityPulse.png
Normal file
BIN
Resources/Textures/Effects/gravityPulse.rsi/gravityPulse.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 890 B |
34
Resources/Textures/Effects/gravityPulse.rsi/meta.json
Normal file
34
Resources/Textures/Effects/gravityPulse.rsi/meta.json
Normal file
@@ -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
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
BIN
Resources/Textures/Objects/Fun/push_horn.rsi/equipped-BELT.png
Normal file
BIN
Resources/Textures/Objects/Fun/push_horn.rsi/equipped-BELT.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 293 B |
BIN
Resources/Textures/Objects/Fun/push_horn.rsi/icon.png
Normal file
BIN
Resources/Textures/Objects/Fun/push_horn.rsi/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 299 B |
BIN
Resources/Textures/Objects/Fun/push_horn.rsi/inhand-left.png
Normal file
BIN
Resources/Textures/Objects/Fun/push_horn.rsi/inhand-left.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 409 B |
BIN
Resources/Textures/Objects/Fun/push_horn.rsi/inhand-right.png
Normal file
BIN
Resources/Textures/Objects/Fun/push_horn.rsi/inhand-right.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 432 B |
26
Resources/Textures/Objects/Fun/push_horn.rsi/meta.json
Normal file
26
Resources/Textures/Objects/Fun/push_horn.rsi/meta.json
Normal file
@@ -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
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user