From 7d30b5ae63c99d10394dac4841d20dc99465946d Mon Sep 17 00:00:00 2001 From: Ed <96445749+TheShuEd@users.noreply.github.com> Date: Sat, 6 Jan 2024 10:18:35 +0300 Subject: [PATCH] Tesla Gun (#23175) * add content * u cant pickup lightning * -5 heat damage * Update battery_guns.yml --- .../EntitySystem/LightningArcShooterSystem.cs | 2 +- .../Weapons/Guns/Battery/battery_guns.yml | 29 ++++++++++++ .../Weapons/Guns/Projectiles/projectiles.yml | 33 ++++++++++++++ .../Prototypes/Procedural/salvage_loot.yml | 3 ++ .../Guns/Battery/tesla_gun.rsi/base.png | Bin 0 -> 569 bytes .../Battery/tesla_gun.rsi/inhand-left.png | Bin 0 -> 666 bytes .../Battery/tesla_gun.rsi/inhand-right.png | Bin 0 -> 660 bytes .../Battery/tesla_gun.rsi/mag-unshaded-0.png | Bin 0 -> 139 bytes .../Battery/tesla_gun.rsi/mag-unshaded-1.png | Bin 0 -> 205 bytes .../Battery/tesla_gun.rsi/mag-unshaded-2.png | Bin 0 -> 202 bytes .../Battery/tesla_gun.rsi/mag-unshaded-3.png | Bin 0 -> 196 bytes .../Battery/tesla_gun.rsi/mag-unshaded-4.png | Bin 0 -> 199 bytes .../Guns/Battery/tesla_gun.rsi/meta.json | 43 ++++++++++++++++++ 13 files changed, 109 insertions(+), 1 deletion(-) create mode 100644 Resources/Textures/Objects/Weapons/Guns/Battery/tesla_gun.rsi/base.png create mode 100644 Resources/Textures/Objects/Weapons/Guns/Battery/tesla_gun.rsi/inhand-left.png create mode 100644 Resources/Textures/Objects/Weapons/Guns/Battery/tesla_gun.rsi/inhand-right.png create mode 100644 Resources/Textures/Objects/Weapons/Guns/Battery/tesla_gun.rsi/mag-unshaded-0.png create mode 100644 Resources/Textures/Objects/Weapons/Guns/Battery/tesla_gun.rsi/mag-unshaded-1.png create mode 100644 Resources/Textures/Objects/Weapons/Guns/Battery/tesla_gun.rsi/mag-unshaded-2.png create mode 100644 Resources/Textures/Objects/Weapons/Guns/Battery/tesla_gun.rsi/mag-unshaded-3.png create mode 100644 Resources/Textures/Objects/Weapons/Guns/Battery/tesla_gun.rsi/mag-unshaded-4.png create mode 100644 Resources/Textures/Objects/Weapons/Guns/Battery/tesla_gun.rsi/meta.json 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 0000000000000000000000000000000000000000..874ad2ea23c9bd2f5dba5a2d0262e92d83a97f93 GIT binary patch literal 569 zcmV-90>=G`P)q$gGRCt{2l)p;?VI0Q4g3zG5(&8Wv;c!D+A=KoM1c6%+Vt+tj zKMq`?2IDG(rlv%KHiw1=ZPCT4$st0-!A<`Fx4`cE()04(dnZ`Yx!eQCbKd*)eLmm! z-h0EHPKTDMFfCaDKmZT`1OPt%phBTQ!{Lwyg8`*dDd~+yL(~Gw4iUd! zs^oIRFvOghOvd3VL|6?UO{YZBsF)byP}NP-q;h*U>O7HGb|EfZkWr+Y?2+!y9qDB`#XK^@QAsT`sTmtYw!X_QPe^B4P z5|IdzeR&076?jbT60eS55x@bVj`pOo&4$_2n*1i}%7uDuSDziOeQ*lX$j z1%NxmuGe>~F97NZ=$9M->gVW3_bvcGgXaSHtpFeZSUSKLoPx%R7pfZRCt{2+P`bmU>FDR?}?k;G9;Tgxd<l* zh=_=Yh^RToc9mnh>Q9fOj{7<;YMLf2%K`v(b$!v(agVm#({a($vy)zuBoIQtv0ddw z@k+D7i{jD@TBjLR68NFoIU18;v18kCM-yCgWatF~UfR*vn~PC_yG z{QR!Q+p1#lb(63t_~Ngwv1(ZZ0656`hNy;*qt#`Ff`;W-8e zdk{jD&euun3LW^Ndirv!6chj~dNbrtxfuNA@gYvnPPC3u`zxxL1OUjg42EHplHk~` z%C`gPEO?-U1OT%Dg%B8xMlcLx{*6-`ah=C{|xTPLK!Rw0fkaLnKX80J9R; zv*(+52dFlZ;6<_8-QUJ|xQWZ-!})!h&{iF`ENfm7-re8Es$C*?{RnMR)Ij_A>Oc z-hjI2>g*lpqz=EVH=xQt(>t)NH=qi82Z*%!2GXmiG80k{;s5{u07*qoM6N<$f)IN< A!~g&Q literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..8eae981c9f610aec46bdeee7f6b4a16ac4a61a83 GIT binary patch literal 660 zcmV;F0&D$=P)Px%PDw;TRCt{2+P`btKoke?uS>RO(;#i7Q8bLM%1ZRZmHYin2Fvojr+25}J%EUa zh=_=Yh=``Sj;CD5Q>$J_S)QbQ={laWZ5yU(R<)kWElhwPgh~fL9*^<$+m}Yw3wx~D zigg`N`9YYyg8d*=qsgt>I~u5Vt5d7eU$kBKjs|Kpxy_b@Wbm%zsqOb4YQ6vU`qPrI zp+ERRsCxY_PEXD-IM|16+Ymy)wrv1VmsjVt+6Kw>4-WPL?4Z~0Vi!=O&!6I0;xk}# zay=LP+mAaCLaZc+yprqJNjN<@!{+3A>bf`+y3~`wUmPFS>HwV8ZgteFciU4B6#$ae z+yL%_mr}wo3;# uPNDFdFYUvpSerS8Jbn28VNQYQA94pxC7mgNs!3Y_0000 literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..f17c98d680d4f66d332df9b1d1ccdae1bdb82b47 GIT binary patch literal 139 zcmeAS@N?(olHy`uVBq!ia0vp^4nVBH!3HE3&8=$zQjEnx?oJHr&dIz4a$G%K978f1 z-(GSQJmA2=d|*%3ih1XR&%J7kdf_8)b0bthNQi-<;jPw7uPUqK9bUgYcNM?YOMLq= l-lzWf&dbLgfJS_{&duT{!g?fvHxI~T@O1TaS?83{1OOOGE{OmD literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..b90deab11e0d55d8d82cabb55b97bb3e98245b72 GIT binary patch literal 205 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?4jBOuH;Rhv&5C|K|5 z;uumf=k4WSlH3qkt43_|7>r;9mfmP zU0G&r4B%sA5pZB&Ol2&4?zC!a$4}V_v$k(ETVZhgdwd7`1gUk`S@`C1-s#wW{_X>( z{fu>|*#B&4IjwO_IseoyCMFJr1_maM3nw_^D`dJJtUE6WbP9u~tDnm{r-UW|I|W7F literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..60ab1cca16466dcc7afd9e3d17f1e93026ddf9bf GIT binary patch literal 202 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?4jBOuH;Rhv&5C|Kj^ z;uumf=k4WFVdQ&MBb@06lv|dH?_b literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..5e3dd971157a64f06cfbb87f7b8266d7dfe61f4e GIT binary patch literal 196 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?4jBOuH;Rhv&5C|Ks{ z;uumf=k4WcfD+g(_?C3n4**`_K5Y1Q|Mvd8cjR1%-@_(O!$7h=2#yc o>nAa5>%ImCCJqH4q4S9$OJC~1ixrFVdQ&MBb@06wWf@Bjb+ literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..9918cff25c82deb6fb65cca94d04d4261d101de3 GIT binary patch literal 199 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?4jBOuH;Rhv&5C|K#~ z;uumf=k4W2UE*@miXap7q7A>U*l&oopI{W?U&?&hNVJ`AO}7&}&9} r*+h#gtsSd=Ue{M>U|`|^65TOolchI?WM9| literal 0 HcmV?d00001 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 -- 2.51.2