diff --git a/Content.Server/Tesla/EntitySystem/LightningArcShooterSystem.cs b/Content.Server/Tesla/EntitySystem/LightningArcShooterSystem.cs index 80cfab7035..e901a93288 100644 --- a/Content.Server/Tesla/EntitySystem/LightningArcShooterSystem.cs +++ b/Content.Server/Tesla/EntitySystem/LightningArcShooterSystem.cs @@ -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) diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml index 445abaf2a1..49c79bb8fc 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml @@ -168,6 +168,35 @@ 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 diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml index 29f10f38fe..9ea27c6cbc 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml @@ -839,3 +839,36 @@ 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 diff --git a/Resources/Prototypes/Procedural/salvage_loot.yml b/Resources/Prototypes/Procedural/salvage_loot.yml index 5456603ef9..175e9ea9a3 100644 --- a/Resources/Prototypes/Procedural/salvage_loot.yml +++ b/Resources/Prototypes/Procedural/salvage_loot.yml @@ -110,6 +110,9 @@ - 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 index 0000000000..874ad2ea23 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 index 0000000000..03054122c1 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 index 0000000000..8eae981c9f 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 index 0000000000..f17c98d680 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 index 0000000000..b90deab11e 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 index 0000000000..60ab1cca16 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 index 0000000000..5e3dd97115 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 index 0000000000..9918cff25c 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 index 0000000000..c591453e1c --- /dev/null +++ b/Resources/Textures/Objects/Weapons/Guns/Battery/tesla_gun.rsi/meta.json @@ -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