From 90498edbbb5aff4f161c2fa62698f7c503e6728a Mon Sep 17 00:00:00 2001 From: Chris V Date: Tue, 15 Mar 2022 18:11:29 -0700 Subject: [PATCH] Add the Omnitool, drone adjustments (#6948) --- Content.Server/Drone/DroneSystem.cs | 24 ++++--- Resources/Prototypes/Body/Presets/drone.yml | 2 +- .../Fills/Backpacks/StarterGear/satchel.yml | 9 +++ .../Entities/Mobs/Player/silicon.yml | 5 +- .../Entities/Objects/Tools/tools.yml | 60 ++++++++++++++++++ Resources/Prototypes/tags.yml | 3 + .../Objects/Tools/omnitool.rsi/meta.json | 26 ++++++++ .../Tools/omnitool.rsi/omnitool-prying.png | Bin 0 -> 694 bytes .../Tools/omnitool.rsi/omnitool-pulsing.png | Bin 0 -> 710 bytes .../Tools/omnitool.rsi/omnitool-screwing.png | Bin 0 -> 662 bytes .../Tools/omnitool.rsi/omnitool-snipping.png | Bin 0 -> 757 bytes .../Tools/omnitool.rsi/omnitool-wrenching.png | Bin 0 -> 680 bytes 12 files changed, 118 insertions(+), 11 deletions(-) create mode 100644 Resources/Textures/Objects/Tools/omnitool.rsi/meta.json create mode 100644 Resources/Textures/Objects/Tools/omnitool.rsi/omnitool-prying.png create mode 100644 Resources/Textures/Objects/Tools/omnitool.rsi/omnitool-pulsing.png create mode 100644 Resources/Textures/Objects/Tools/omnitool.rsi/omnitool-screwing.png create mode 100644 Resources/Textures/Objects/Tools/omnitool.rsi/omnitool-snipping.png create mode 100644 Resources/Textures/Objects/Tools/omnitool.rsi/omnitool-wrenching.png diff --git a/Content.Server/Drone/DroneSystem.cs b/Content.Server/Drone/DroneSystem.cs index 516eba3819..4857696fbf 100644 --- a/Content.Server/Drone/DroneSystem.cs +++ b/Content.Server/Drone/DroneSystem.cs @@ -1,3 +1,4 @@ +using System.Linq; using Content.Shared.Drone; using Content.Server.Drone.Components; using Content.Shared.Actions; @@ -88,9 +89,16 @@ namespace Content.Server.Drone { var body = Comp(uid); //There's no way something can have a mobstate but not a body... - foreach (var item in drone.ToolUids) + foreach (var item in drone.ToolUids.Select((value, i) => ( value, i ))) { - EntityManager.DeleteEntity(item); + if (_tagSystem.HasTag(item.value, "Drone")) + { + RemComp(item.value); + } + else + { + EntityManager.DeleteEntity(item.value); + } } body.Gib(); EntityManager.DeleteEntity(uid); @@ -111,12 +119,12 @@ namespace Content.Server.Drone if (TryComp(uid, out var hands) && hands.Count >= drone.Tools.Count) { foreach (var entry in drone.Tools) - { - var item = EntityManager.SpawnEntity(entry.PrototypeId, spawnCoord); - AddComp(item); - hands.PutInHand(item); - drone.ToolUids.Add(item); - } + { + var item = EntityManager.SpawnEntity(entry.PrototypeId, spawnCoord); + AddComp(item); + hands.PutInHand(item); + drone.ToolUids.Add(item); + } } if (TryComp(uid, out var actions) && TryComp(uid, out var flashlight)) diff --git a/Resources/Prototypes/Body/Presets/drone.yml b/Resources/Prototypes/Body/Presets/drone.yml index 08eb753086..6e4813ad40 100644 --- a/Resources/Prototypes/Body/Presets/drone.yml +++ b/Resources/Prototypes/Body/Presets/drone.yml @@ -5,6 +5,6 @@ hand 1: LeftHandDrone hand 2: LeftHandDrone hand 3: LeftHandDrone - hand 4: RightHandDrone + hand 4: LeftHandDrone hand 5: RightHandDrone hand 6: RightHandDrone diff --git a/Resources/Prototypes/Catalog/Fills/Backpacks/StarterGear/satchel.yml b/Resources/Prototypes/Catalog/Fills/Backpacks/StarterGear/satchel.yml index faacbd24f5..2042694def 100644 --- a/Resources/Prototypes/Catalog/Fills/Backpacks/StarterGear/satchel.yml +++ b/Resources/Prototypes/Catalog/Fills/Backpacks/StarterGear/satchel.yml @@ -102,3 +102,12 @@ - id: BoxSurvival - id: AcousticGuitarInstrument - id: SaxophoneInstrument + +- type: entity + abstract: true + parent: ClothingBackpackSatchel + id: ClothingBackpackSatchelDrone + components: + - type: Tag + tags: + - Drone diff --git a/Resources/Prototypes/Entities/Mobs/Player/silicon.yml b/Resources/Prototypes/Entities/Mobs/Player/silicon.yml index 48c7d4a6f5..6d610c9ef8 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/silicon.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/silicon.yml @@ -72,8 +72,9 @@ components: - type: Drone tools: - - id: PowerDrill - - id: JawsOfLife + - id: ClothingBackpackSatchelDrone + - id: trayScanner + - id: Omnitool - id: WelderExperimental - type: NameIdentifier group: Drone diff --git a/Resources/Prototypes/Entities/Objects/Tools/tools.yml b/Resources/Prototypes/Entities/Objects/Tools/tools.yml index 3832af41d0..4507d53043 100644 --- a/Resources/Prototypes/Entities/Objects/Tools/tools.yml +++ b/Resources/Prototypes/Entities/Objects/Tools/tools.yml @@ -276,3 +276,63 @@ Blunt: 10 - type: Item sprite: Objects/Tools/shovel.rsi + +- type: entity + name: omnitool + parent: BaseItem + id: Omnitool + description: A drone's best friend. + components: + - type: Sprite + sprite: Objects/Tools/omnitool.rsi + state: omnitool-screwing + - type: Item + sprite: Objects/Tools/omnitool.rsi + size: 20 + - type: TilePrying + - type: SignalLinker + - type: Tool + qualities: + - Screwing + speed: 1.2 # Kept for future adjustments. Currently 1.2x for balance + - type: MultipleTool + statusShowBehavior: true + entries: + - behavior: Screwing + sprite: + sprite: Objects/Tools/omnitool.rsi + state: omnitool-screwing + useSound: + path: /Audio/Items/drill_use.ogg + changeSound: + path: /Audio/Items/change_drill.ogg + - behavior: Prying + sprite: + sprite: Objects/Tools/omnitool.rsi + state: omnitool-prying + useSound: + path: /Audio/Items/jaws_pry.ogg + changeSound: + path: /Audio/Items/change_drill.ogg + - behavior: Anchoring + sprite: + sprite: Objects/Tools/omnitool.rsi + state: omnitool-wrenching + useSound: + path: /Audio/Items/ratchet.ogg + changeSound: + path: /Audio/Items/change_drill.ogg + - behavior: Cutting + sprite: + sprite: Objects/Tools/omnitool.rsi + state: omnitool-snipping + useSound: + path: /Audio/Items/jaws_cut.ogg + changeSound: + path: /Audio/Items/change_drill.ogg + - behavior: Pulsing + sprite: + sprite: Objects/Tools/omnitool.rsi + state: omnitool-pulsing + changeSound: + path: /Audio/Items/change_drill.ogg diff --git a/Resources/Prototypes/tags.yml b/Resources/Prototypes/tags.yml index 9bdff42442..c330825096 100644 --- a/Resources/Prototypes/tags.yml +++ b/Resources/Prototypes/tags.yml @@ -318,3 +318,6 @@ - type: Tag id: Write + +- type: Tag + id: Drone diff --git a/Resources/Textures/Objects/Tools/omnitool.rsi/meta.json b/Resources/Textures/Objects/Tools/omnitool.rsi/meta.json new file mode 100644 index 0000000000..dea5db6174 --- /dev/null +++ b/Resources/Textures/Objects/Tools/omnitool.rsi/meta.json @@ -0,0 +1,26 @@ +{ + "version": 1, + "license": "CC-BY-NC-SA-3.0", + "copyright": "Taken from https://github.com/goonstation/goonstation at commit 68aa9d134c07ed345755ff4cc0e11eae531f624e", + "size": { + "x": 32, + "y": 32 + }, + "states": [ + { + "name": "omnitool-prying" + }, + { + "name": "omnitool-screwing" + }, + { + "name": "omnitool-pulsing" + }, + { + "name": "omnitool-snipping" + }, + { + "name": "omnitool-wrenching" + } + ] +} diff --git a/Resources/Textures/Objects/Tools/omnitool.rsi/omnitool-prying.png b/Resources/Textures/Objects/Tools/omnitool.rsi/omnitool-prying.png new file mode 100644 index 0000000000000000000000000000000000000000..fea44447afc8d1f62fe30730a9b5cc6d1e55fbb2 GIT binary patch literal 694 zcmV;n0!jUeP)VU!L08iKG|J!#jWgIXEgonp~sQ zzlFI2PWglsPqG|Hv;!VKcml*rz@bA;fZ+g;MIfN3Yrt@N>n;WzuIFGrsRg($R z=C`)=FjUu+V08r6TmSfYJa6Y(Po_Ad7GTm?cSl3?u`r4ge)U2)GSS12D_qv8Z6EoiV$UqDl&9Q49j* z&~gBj&2UvlK=l;0AMmDu{^JiA?rb+^xShc8|L8LZtOW`v*HF@k!EgX5)xyArwX+zk z?IamKo_P)zLr!4S02mH{mEXt~9p3YS;ne2?a6X}wO_2lW4e&Yuxjldkkn4IFpjsM$ z6`k>(8el#s_>loDiePF%06E=I>;PEN**5X8w~D5 cI3gSX07AJXlg{DXg#Z8m07*qoM6N<$g7Ix30ssI2 literal 0 HcmV?d00001 diff --git a/Resources/Textures/Objects/Tools/omnitool.rsi/omnitool-pulsing.png b/Resources/Textures/Objects/Tools/omnitool.rsi/omnitool-pulsing.png new file mode 100644 index 0000000000000000000000000000000000000000..af8c5a962cc9ea87832f3fedc77061a8f05594ea GIT binary patch literal 710 zcmV;%0y+JOP)VU!L08iKG|J!#jWyB^9V`G!2nghbaV?fk@ zUpHBXC)aK>B!=E+$m`dHiNnBuYB>bM0Vhr#V31dkVQB5$%rIq29s|G0CWcVm<3O1h zup9`0U;sLRT>CK{ z0J8{W@ae6)7<9OvgZZ#vM+TcWZ(*Q%6d)(IpSye+4)2j;s9nYh3~p45L4Z=ru{r=5 zB={IHEZA}mXwe@=P+Y^rsbMir2OuZ53zuIqXv#4#OzW=r56Y5l^Vj0F`1UrV|Hyn* zuX6+)N-z;_KF!TAvoDR|)QQ~;)3j9oqszm}3J~BokwlTZYbEyoaMD6JKOw~v!$DXR z;ghFN7_6-=7&^1W8G`FSz~%fS(=Z$eau}$rKn7bnu7hcN21JO?nB9prG%y^1p4xp) zzcP>lK$dT>V1;lxco=5%b>fW%yirg-4Uz^xz61dnO-(>l8b}VqEe|RytnC;WKAwS; z7q%_}K%YaR4U~Ns%-If3H`wAIrvpG~00cH5r2&vdxBx89!ImS@49kAP(?CXQ`G0Kb z0ILH)2@nEqgVO-aazfc~9)l7}E_wRm9^;JJ_={!ph46DvD&{}rv{jRc+Uq0TE#zB2Y@UG s)%R`l$!}&+VU!L08iKG|J!#jWkeUhz0K%9GGEo}9EKXI zI3PSc21Nb$b(3Xya_u%lV(5LaIKPP`in_a2V*d{(Eo4YY@ubKh7!Ejb@&JRpf(%1z z?`DQ6Q}TcoZ$gpZ(s3P3+XFGBmSc4QJ^-@3!u1Q7-NC@az;NsprS=cPMELN*6ELl( zYrt@N>n;XsI|hc2XP$$_Y+VExI(9?U)h^?tjRT;G5Db3q@&yLF9Ncnbnqk>bhK$tm z|1)NHQa2GIg9INVh6P*BF{H2h!#IyY2_+joeQ}R*#_X#Mlme`|00u5xe#xK-41j6f z760!5vt--+wN%ObcpZQaHlOBZnAw-caO%WvhG|-=|Iy`PWd*qf6V^odK>vO|0C=GzX2Bb6q zvIrMAyypW0Iq{Fv0iXm30k^?v0A~3+78M3i99P$r0Ly`^w5g6^MKK7JL(2hB{+E`} z{_pFnf>KVJt=oX?r`A5<}slCmjsfUmC) znBKg33!D#%cTmuSd=GLUwc;PE1F(UWE0=(2YFkdw0ie{sdHW4GpW2pVbpR}w<2^NK wW+`3=z=FALKIL^iSq`AJj|n<}-eA-L0In?T6v|_tJ^%m!07*qoM6N<$f_1hYEC2ui literal 0 HcmV?d00001 diff --git a/Resources/Textures/Objects/Tools/omnitool.rsi/omnitool-snipping.png b/Resources/Textures/Objects/Tools/omnitool.rsi/omnitool-snipping.png new file mode 100644 index 0000000000000000000000000000000000000000..6e9f3681c0880a23a15f7ead5f9ea41d21acbe62 GIT binary patch literal 757 zcmVVU!L08iKG|J!#jWkeUxNG<F(B%{ubV8xlWVsb5<~BU#g9I7U^sE|0EPkb3NknyO_l>dmVgXx?cK~U zWlA0czsV+sk7u64WA z1`MaS?qbm4dXAw96zAw-R7(TULRE3$L9#Fxc~+(Tz<)*2@HT~-4*{q zS#sg_3+T#GEQeVPG6NJk6o&u^Y(CA+Ftaa>;na!U3^H1(81hf9Y5WJ36}{_a;EpHO za;y#jX@2tb34^t@1w&_+I74v#2e_PnWEzG6Acuj<3bQ?{fmt<_B+Icn02FV?z}NIE z1F?Wq%dt8D8I(_hqydmGK>$YM0wBvZ+2@nEqgVO-a^0xVFaT*9JCtx8! ziX(6q#UM})EeAjr-`-{f%x*^TB3RYy9E!o9ga;~gKx~jhU|EuoBk-nyJ1;*lWY_62 z+)iNl&u=1$B6rtH?Em4Ug$&4s!%{!YAs{egb|+~efLyLmnbHN$5F@eGiIZzp^5`= nrQoE#dsJ(P;&lMM!KecOxB6CHXmuT!00000NkvXXu0mjfmk~SZ literal 0 HcmV?d00001 diff --git a/Resources/Textures/Objects/Tools/omnitool.rsi/omnitool-wrenching.png b/Resources/Textures/Objects/Tools/omnitool.rsi/omnitool-wrenching.png new file mode 100644 index 0000000000000000000000000000000000000000..821cb7de591ecc3c43fdd4b6e0db5a15ce123ef7 GIT binary patch literal 680 zcmV;Z0$2TsP)VU!L08iKG|J!#jWkeU3meBt1>+1t%Z{ECx z;pvO37;32Efbj4b5cS{JO_t%wwc8AB^VgzS^zgwG25JHf2b?&0fI(hChM~20GsBcA zc?{CqZ~WKOH2{mz0uW3CpkTK!cK|yKHugW1cRTue1Vq!p}M7b9e@lHe2jqPx&P^_h<8LrYWaV3u^F>F zaq7pK3t-^F<(CYaatsX9x-0%;%aYhE2PIf^0E||wWeZjZpo7h)xfy2mr7@g3v72F< zmMVttKn_a`y$@y|edd7T0T=*fVO#|q)ivX=mn0i=~to*I=trt!>P{);Cy0p4BjXxp9V<-AYXz2jHV_a zDh(uu;g$!L6*^qcF~mV}jxI)28UO)M8UTR}NNE6M5iS4#h@UC1uL#R4YlMy4somiZyLDs z@&iM5ogRbdd(HpIMKsJ3Yz`r{zQAw*a$HTB(gn`rp}NO`ycl>P1IwzQRuZKZ6ovzk zn_b8NTL}kJyLmGMMUEi4QHrZ621;~52asz&eg`1uacoU8YBWx<<^oVUi1*Y0^FevM zb{QuyxKS+z0ctc*uqHx~!EN(VgB29lFg8uwgt!c+MRN?R1LzG#9RL7PvLzKTSomE4 O0000