]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
TriggerOnSpawn + Admin toys (#23999)
authorEd <96445749+TheShuEd@users.noreply.github.com>
Tue, 23 Jan 2024 22:25:25 +0000 (01:25 +0300)
committerGitHub <noreply@github.com>
Tue, 23 Jan 2024 22:25:25 +0000 (17:25 -0500)
* spawn on trigger, or trigger on spawn?

* fixes

* fix?

* revert

* fixes

* Update admin_triggers.yml

* pip

Content.Server/Explosion/Components/TriggerOnSpawnComponent.cs [new file with mode: 0644]
Content.Server/Explosion/EntitySystems/TriggerSystem.cs
Resources/Prototypes/Entities/Effects/admin_triggers.yml [new file with mode: 0644]

diff --git a/Content.Server/Explosion/Components/TriggerOnSpawnComponent.cs b/Content.Server/Explosion/Components/TriggerOnSpawnComponent.cs
new file mode 100644 (file)
index 0000000..704ff41
--- /dev/null
@@ -0,0 +1,9 @@
+namespace Content.Server.Explosion.Components;
+
+/// <summary>
+/// calls the trigger when the object is initialized
+/// </summary>
+[RegisterComponent]
+public sealed partial class TriggerOnSpawnComponent : Component
+{
+}
index 5bb60abdc98b4c90d68b902851e260b22ca3b4c2..7b3e0b0e6267157de4504de3a07b27a8b4833e61 100644 (file)
@@ -78,6 +78,7 @@ namespace Content.Server.Explosion.EntitySystems
             InitializeVoice();
             InitializeMobstate();
 
+            SubscribeLocalEvent<TriggerOnSpawnComponent, MapInitEvent>(OnSpawnTriggered);
             SubscribeLocalEvent<TriggerOnCollideComponent, StartCollideEvent>(OnTriggerCollide);
             SubscribeLocalEvent<TriggerOnActivateComponent, ActivateInWorldEvent>(OnActivate);
             SubscribeLocalEvent<TriggerImplantActionComponent, ActivateImplantEvent>(OnImplantTrigger);
@@ -193,6 +194,11 @@ namespace Content.Server.Explosion.EntitySystems
                 Trigger(uid);
         }
 
+        private void OnSpawnTriggered(EntityUid uid, TriggerOnSpawnComponent component, MapInitEvent args)
+        {
+            Trigger(uid);
+        }
+
         private void OnActivate(EntityUid uid, TriggerOnActivateComponent component, ActivateInWorldEvent args)
         {
             Trigger(uid, args.User);
diff --git a/Resources/Prototypes/Entities/Effects/admin_triggers.yml b/Resources/Prototypes/Entities/Effects/admin_triggers.yml
new file mode 100644 (file)
index 0000000..e1f3666
--- /dev/null
@@ -0,0 +1,112 @@
+- type: entity
+  id: AdminInstantEffectBase
+  abstract: true
+  name: instant effect
+  components:
+  - type: Sprite
+    sprite: /Textures/Objects/Fun/goldbikehorn.rsi
+    visible: false
+    state: icon
+  - type: TriggerOnSpawn   
+  - type: TimedDespawn
+    lifetime: 5
+
+- type: entity
+  id: AdminInstantEffectEMP
+  suffix: EMP
+  parent: AdminInstantEffectBase
+  components:
+  - type: EmpOnTrigger
+    range: 4
+    energyConsumption: 50000
+
+- type: entity
+  id: AdminInstantEffectFlash
+  suffix: Flash
+  parent: AdminInstantEffectBase
+  components:
+  - type: FlashOnTrigger
+    range: 7
+  - type: SpawnOnTrigger 
+    proto: GrenadeFlashEffect
+  
+- type: entity
+  id: AdminInstantEffectSmoke3
+  suffix: Smoke (03 sec)
+  parent: AdminInstantEffectBase
+  components:
+  - type: SmokeOnTrigger
+    duration: 3
+    spreadAmount: 1
+  - type: SoundOnTrigger
+    sound: /Audio/Effects/smoke.ogg
+  - type: TimerTriggerVisuals
+    primingSound:
+      path: /Audio/Effects/Smoke-grenade.ogg
+  
+- type: entity
+  id: AdminInstantEffectSmoke10
+  suffix: Smoke (10 sec)
+  parent: AdminInstantEffectBase
+  components:
+  - type: SmokeOnTrigger
+    duration: 10
+    spreadAmount: 30
+  - type: SoundOnTrigger
+    sound: /Audio/Effects/smoke.ogg
+  - type: TimerTriggerVisuals
+    primingSound:
+      path: /Audio/Effects/Smoke-grenade.ogg
+  
+- type: entity
+  id: AdminInstantEffectSmoke30
+  suffix: Smoke (30 sec)
+  parent: AdminInstantEffectBase
+  components:
+  - type: SmokeOnTrigger
+    duration: 30
+    spreadAmount: 50
+  - type: SoundOnTrigger
+    sound: /Audio/Effects/smoke.ogg
+  - type: TimerTriggerVisuals
+    primingSound:
+      path: /Audio/Effects/Smoke-grenade.ogg
+
+- type: entity
+  id: AdminInstantEffectTearGas
+  suffix: Tear Gas
+  parent: AdminInstantEffectBase
+  components:
+  - type: SmokeOnTrigger
+    duration: 10
+    spreadAmount: 30
+    solution:
+      reagents:
+      - ReagentId: TearGas
+        Quantity: 50
+
+- type: entity
+  id: AdminInstantEffectGravityWell
+  suffix: Gravity Well
+  parent: AdminInstantEffectBase
+  components: 
+  - type: SoundOnTrigger
+    removeOnTrigger: true
+    sound:
+      path: /Audio/Effects/Grenades/Supermatter/supermatter_start.ogg
+      volume: 5
+  - type: AmbientSound
+    enabled: true
+    volume: -5
+    range: 14
+    sound:
+      path: /Audio/Effects/Grenades/Supermatter/supermatter_loop.ogg
+  - type: GravityWell
+    maxRange: 8
+    baseRadialAcceleration: 10
+    baseTangentialAcceleration: 0
+    gravPulsePeriod: 0.01
+  - type: SingularityDistortion
+    intensity: 10
+    falloffPower: 1.5
+