]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Tesla Gun (#23175)
authorEd <96445749+TheShuEd@users.noreply.github.com>
Sat, 6 Jan 2024 07:18:35 +0000 (10:18 +0300)
committerGitHub <noreply@github.com>
Sat, 6 Jan 2024 07:18:35 +0000 (18:18 +1100)
* add content

* u cant pickup lightning

* -5 heat damage

* Update battery_guns.yml

13 files changed:
Content.Server/Tesla/EntitySystem/LightningArcShooterSystem.cs
Resources/Prototypes/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml
Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml
Resources/Prototypes/Procedural/salvage_loot.yml
Resources/Textures/Objects/Weapons/Guns/Battery/tesla_gun.rsi/base.png [new file with mode: 0644]
Resources/Textures/Objects/Weapons/Guns/Battery/tesla_gun.rsi/inhand-left.png [new file with mode: 0644]
Resources/Textures/Objects/Weapons/Guns/Battery/tesla_gun.rsi/inhand-right.png [new file with mode: 0644]
Resources/Textures/Objects/Weapons/Guns/Battery/tesla_gun.rsi/mag-unshaded-0.png [new file with mode: 0644]
Resources/Textures/Objects/Weapons/Guns/Battery/tesla_gun.rsi/mag-unshaded-1.png [new file with mode: 0644]
Resources/Textures/Objects/Weapons/Guns/Battery/tesla_gun.rsi/mag-unshaded-2.png [new file with mode: 0644]
Resources/Textures/Objects/Weapons/Guns/Battery/tesla_gun.rsi/mag-unshaded-3.png [new file with mode: 0644]
Resources/Textures/Objects/Weapons/Guns/Battery/tesla_gun.rsi/mag-unshaded-4.png [new file with mode: 0644]
Resources/Textures/Objects/Weapons/Guns/Battery/tesla_gun.rsi/meta.json [new file with mode: 0644]

index 80cfab7035ab5224c7af8e04f47a4eb185261e0c..e901a9328816b16ae5cd90354dacf029c37af8ca 100644 (file)
@@ -23,7 +23,7 @@ public sealed class LightningArcShooterSystem : EntitySystem
 
     private void OnShooterMapInit(EntityUid uid, LightningArcShooterComponent component, ref MapInitEvent args)
     {
-        component.NextShootTime = _gameTiming.CurTime;
+        component.NextShootTime = _gameTiming.CurTime + TimeSpan.FromSeconds(component.ShootMaxInterval);
     }
 
     private void OnShooterUnpaused(EntityUid uid, LightningArcShooterComponent component, ref EntityUnpausedEvent args)
index 445abaf2a199356eccda63b04be1ddfb600c5fdc..49c79bb8fc3651976a0cef698004f93e497a7743 100644 (file)
     maxCharge: 500
     startingCharge: 500
 
+- type: entity
+  name: tesla gun
+  parent: BaseWeaponBattery
+  id: WeaponTeslaGun
+  description: The power of the primordial element of lightning in your hands.
+  components:
+  - type: Sprite
+    sprite: Objects/Weapons/Guns/Battery/tesla_gun.rsi
+    layers:
+      - state: base
+        map: ["enum.GunVisualLayers.Base"]
+      - state: mag-unshaded-4
+        map: ["enum.GunVisualLayers.MagUnshaded"]
+        shader: unshaded
+  - type: Gun
+    projectileSpeed: 10
+    soundGunshot:
+      path: /Audio/Effects/Lightning/lightningshock.ogg
+      params:
+        variation: 0.2
+  - type: ProjectileBatteryAmmoProvider
+    proto: TeslaGunBullet
+    fireCost: 300
+  - type: MagazineVisuals
+    magState: mag
+    steps: 5
+    zeroVisible: true
+  - type: Appearance
+
 - type: entity
   name: laser rifle
   parent: BaseWeaponBattery
index 29f10f38fee1d3ca7226fe4f68e2e9252863ab12..9ea27c6cbc75464339ecdaae66bbffe0e28499ed 100644 (file)
     soundHit:
       path: "/Audio/Weapons/tap.ogg"
     soundForce: true
+
+- type: entity
+  name: tesla gun lightning
+  id: TeslaGunBullet
+  parent: BaseBullet
+  noSpawn: true
+  components:
+  - type: TimedDespawn
+    lifetime: 5
+  - type: Sprite
+    sprite: Structures/Power/Generation/Tesla/energy_miniball.rsi
+    layers:
+    - state: tesla_projectile
+      shader: unshaded
+  - type: StaminaDamageOnCollide
+    damage: 15
+  - type: EmbeddableProjectile
+  - type: Projectile
+    deleteOnCollide: false
+    soundHit:
+      path: /Audio/Weapons/Guns/Hits/bullet_hit.ogg
+  - type: LightningArcShooter
+    arcDepth: 1
+    maxLightningArc: 3
+    shootMinInterval: 2.5
+    shootMaxInterval: 4.5
+    shootRange: 5
+    lightningPrototype: Lightning
+  - type: Electrified
+    requirePower: false
+  - type: Tag
+    tags:
+      - HideContextMenu
index 5456603ef9eb93dbae277cb12b66461e366ffe97..175e9ea9a3f1a33684347311fb864fdd33903796 100644 (file)
         - proto: WaterTankHighCapacity
         - proto: WeldingFuelTankHighCapacity
           cost: 3
+        - proto: WeaponTeslaGun
+          prob: 0.1
+          cost: 2
 
 # Mob loot table
 
diff --git a/Resources/Textures/Objects/Weapons/Guns/Battery/tesla_gun.rsi/base.png b/Resources/Textures/Objects/Weapons/Guns/Battery/tesla_gun.rsi/base.png
new file mode 100644 (file)
index 0000000..874ad2e
Binary files /dev/null and b/Resources/Textures/Objects/Weapons/Guns/Battery/tesla_gun.rsi/base.png differ
diff --git a/Resources/Textures/Objects/Weapons/Guns/Battery/tesla_gun.rsi/inhand-left.png b/Resources/Textures/Objects/Weapons/Guns/Battery/tesla_gun.rsi/inhand-left.png
new file mode 100644 (file)
index 0000000..0305412
Binary files /dev/null and b/Resources/Textures/Objects/Weapons/Guns/Battery/tesla_gun.rsi/inhand-left.png differ
diff --git a/Resources/Textures/Objects/Weapons/Guns/Battery/tesla_gun.rsi/inhand-right.png b/Resources/Textures/Objects/Weapons/Guns/Battery/tesla_gun.rsi/inhand-right.png
new file mode 100644 (file)
index 0000000..8eae981
Binary files /dev/null and b/Resources/Textures/Objects/Weapons/Guns/Battery/tesla_gun.rsi/inhand-right.png differ
diff --git a/Resources/Textures/Objects/Weapons/Guns/Battery/tesla_gun.rsi/mag-unshaded-0.png b/Resources/Textures/Objects/Weapons/Guns/Battery/tesla_gun.rsi/mag-unshaded-0.png
new file mode 100644 (file)
index 0000000..f17c98d
Binary files /dev/null and b/Resources/Textures/Objects/Weapons/Guns/Battery/tesla_gun.rsi/mag-unshaded-0.png differ
diff --git a/Resources/Textures/Objects/Weapons/Guns/Battery/tesla_gun.rsi/mag-unshaded-1.png b/Resources/Textures/Objects/Weapons/Guns/Battery/tesla_gun.rsi/mag-unshaded-1.png
new file mode 100644 (file)
index 0000000..b90deab
Binary files /dev/null and b/Resources/Textures/Objects/Weapons/Guns/Battery/tesla_gun.rsi/mag-unshaded-1.png differ
diff --git a/Resources/Textures/Objects/Weapons/Guns/Battery/tesla_gun.rsi/mag-unshaded-2.png b/Resources/Textures/Objects/Weapons/Guns/Battery/tesla_gun.rsi/mag-unshaded-2.png
new file mode 100644 (file)
index 0000000..60ab1cc
Binary files /dev/null and b/Resources/Textures/Objects/Weapons/Guns/Battery/tesla_gun.rsi/mag-unshaded-2.png differ
diff --git a/Resources/Textures/Objects/Weapons/Guns/Battery/tesla_gun.rsi/mag-unshaded-3.png b/Resources/Textures/Objects/Weapons/Guns/Battery/tesla_gun.rsi/mag-unshaded-3.png
new file mode 100644 (file)
index 0000000..5e3dd97
Binary files /dev/null and b/Resources/Textures/Objects/Weapons/Guns/Battery/tesla_gun.rsi/mag-unshaded-3.png differ
diff --git a/Resources/Textures/Objects/Weapons/Guns/Battery/tesla_gun.rsi/mag-unshaded-4.png b/Resources/Textures/Objects/Weapons/Guns/Battery/tesla_gun.rsi/mag-unshaded-4.png
new file mode 100644 (file)
index 0000000..9918cff
Binary files /dev/null and b/Resources/Textures/Objects/Weapons/Guns/Battery/tesla_gun.rsi/mag-unshaded-4.png differ
diff --git a/Resources/Textures/Objects/Weapons/Guns/Battery/tesla_gun.rsi/meta.json b/Resources/Textures/Objects/Weapons/Guns/Battery/tesla_gun.rsi/meta.json
new file mode 100644 (file)
index 0000000..c591453
--- /dev/null
@@ -0,0 +1,43 @@
+{
+    "version": 1,
+    "license": "CC-BY-SA-3.0",
+    "copyright": "taken from TGStation on commit https://github.com/tgstation/tgstation/commit/26818af618762ff52319b3417be8cdc1279e99b7",
+    "size": {
+        "x": 32,
+        "y": 32
+    },
+    "states": [
+        {
+            "name": "base"
+        },
+        {
+            "name": "inhand-left",
+            "directions": 4
+        },
+        {
+            "name": "inhand-right",
+            "directions": 4
+        },
+        {
+          "name": "mag-unshaded-0",
+          "delays": [
+            [
+              0.3,
+              0.3
+            ]
+          ]
+        },
+        {
+            "name": "mag-unshaded-1"
+        },
+        {
+            "name": "mag-unshaded-2"
+        },
+        {
+            "name": "mag-unshaded-3"
+        },
+        {
+            "name": "mag-unshaded-4"
+        }
+    ]
+}
\ No newline at end of file