From 786bb79ebc50ca79d76186068cf204c2271e6ea1 Mon Sep 17 00:00:00 2001 From: Ed <96445749+TheShuEd@users.noreply.github.com> Date: Tue, 14 Nov 2023 02:55:47 +0300 Subject: [PATCH] Pet Carrier (Zookeeper gameplay?) (#21545) * add visual * fix item + entityStorage problem, add generation in maints * make pet carrier two-handed * added to cargo * add resistlocker component --- .../SharedEntityStorageComponent.cs | 8 ++- .../SharedEntityStorageSystem.cs | 5 +- .../Catalog/Cargo/cargo_service.yml | 10 +++ .../Markers/Spawners/Random/maintenance.yml | 1 + .../Entities/Objects/Misc/pet_carrier.yml | 66 ++++++++++++++++++ .../Objects/Storage/petcarrier.rsi/icon.png | Bin 0 -> 982 bytes .../Storage/petcarrier.rsi/inhand-left.png | Bin 0 -> 659 bytes .../Storage/petcarrier.rsi/inhand-right.png | Bin 0 -> 659 bytes .../Objects/Storage/petcarrier.rsi/meta.json | 34 +++++++++ .../petcarrier.rsi/pet_carrier_base.png | Bin 0 -> 847 bytes .../petcarrier.rsi/pet_carrier_door.png | Bin 0 -> 254 bytes .../petcarrier.rsi/pet_carrier_open.png | Bin 0 -> 279 bytes .../Objects/Storage/petcarrier.rsi/welded.png | Bin 0 -> 331 bytes 13 files changed, 122 insertions(+), 2 deletions(-) create mode 100644 Resources/Prototypes/Entities/Objects/Misc/pet_carrier.yml create mode 100644 Resources/Textures/Objects/Storage/petcarrier.rsi/icon.png create mode 100644 Resources/Textures/Objects/Storage/petcarrier.rsi/inhand-left.png create mode 100644 Resources/Textures/Objects/Storage/petcarrier.rsi/inhand-right.png create mode 100644 Resources/Textures/Objects/Storage/petcarrier.rsi/meta.json create mode 100644 Resources/Textures/Objects/Storage/petcarrier.rsi/pet_carrier_base.png create mode 100644 Resources/Textures/Objects/Storage/petcarrier.rsi/pet_carrier_door.png create mode 100644 Resources/Textures/Objects/Storage/petcarrier.rsi/pet_carrier_open.png create mode 100644 Resources/Textures/Objects/Storage/petcarrier.rsi/welded.png diff --git a/Content.Shared/Storage/Components/SharedEntityStorageComponent.cs b/Content.Shared/Storage/Components/SharedEntityStorageComponent.cs index 80f38188ea..b4cd18f4d5 100644 --- a/Content.Shared/Storage/Components/SharedEntityStorageComponent.cs +++ b/Content.Shared/Storage/Components/SharedEntityStorageComponent.cs @@ -1,4 +1,4 @@ -using System.Numerics; +using System.Numerics; using Content.Shared.Physics; using Content.Shared.Whitelist; using Robust.Shared.Audio; @@ -64,6 +64,12 @@ public abstract partial class SharedEntityStorageComponent : Component [DataField, ViewVariables(VVAccess.ReadWrite)] public float EnteringRange = 0.18f; + /// + /// If true, there may be mobs inside the container, even if the container is an Item + /// + [DataField] + public bool ItemCanStoreMobs = false; + /// /// Whether or not to show the contents when the storage is closed /// diff --git a/Content.Shared/Storage/EntitySystems/SharedEntityStorageSystem.cs b/Content.Shared/Storage/EntitySystems/SharedEntityStorageSystem.cs index 31803c394f..f84a65398d 100644 --- a/Content.Shared/Storage/EntitySystems/SharedEntityStorageSystem.cs +++ b/Content.Shared/Storage/EntitySystems/SharedEntityStorageSystem.cs @@ -1,4 +1,4 @@ -using System.Diagnostics.CodeAnalysis; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Numerics; using Content.Shared.Body.Components; @@ -413,6 +413,9 @@ public abstract class SharedEntityStorageSystem : EntitySystem var storeEv = new StoreMobInItemContainerAttemptEvent(); RaiseLocalEvent(container, ref storeEv); allowedToEat = storeEv is { Handled: true, Cancelled: false }; + + if (component.ItemCanStoreMobs) + allowedToEat = true; } } diff --git a/Resources/Prototypes/Catalog/Cargo/cargo_service.yml b/Resources/Prototypes/Catalog/Cargo/cargo_service.yml index 0ddf41a464..f010f1ef2f 100644 --- a/Resources/Prototypes/Catalog/Cargo/cargo_service.yml +++ b/Resources/Prototypes/Catalog/Cargo/cargo_service.yml @@ -137,3 +137,13 @@ cost: 2000 category: Service group: market + +- type: cargoProduct + id: ServiceAnimalCarrier + icon: + sprite: Objects/Storage/petcarrier.rsi + state: icon + product: PetCarrier + cost: 500 + category: Service + group: market \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Markers/Spawners/Random/maintenance.yml b/Resources/Prototypes/Entities/Markers/Spawners/Random/maintenance.yml index a2d8f4b381..9aa1271044 100644 --- a/Resources/Prototypes/Entities/Markers/Spawners/Random/maintenance.yml +++ b/Resources/Prototypes/Entities/Markers/Spawners/Random/maintenance.yml @@ -184,6 +184,7 @@ - CableHVStack10 - CableMVStack10 - CableApcStack10 + - PetCarrier chance: 0.6 offset: 0.0 diff --git a/Resources/Prototypes/Entities/Objects/Misc/pet_carrier.yml b/Resources/Prototypes/Entities/Objects/Misc/pet_carrier.yml new file mode 100644 index 0000000000..2e19d0ba19 --- /dev/null +++ b/Resources/Prototypes/Entities/Objects/Misc/pet_carrier.yml @@ -0,0 +1,66 @@ +- type: entity + id: PetCarrier + name: big pet carrier + description: Allows large animals to be carried comfortably. + parent: BaseStructureDynamic + components: + - type: Sprite + noRot: true + drawdepth: Objects + sprite: Objects/Storage/petcarrier.rsi + layers: + - state: pet_carrier_base + map: ["enum.StorageVisualLayers.Base"] + - state: pet_carrier_door + map: ["enum.StorageVisualLayers.Door"] + - state: welded + visible: false + map: ["enum.WeldableLayers.BaseWelded"] + - type: Icon + sprite: Objects/Storage/petcarrier.rsi + state: icon + - type: InteractionOutline + - type: Physics + - type: MultiHandedItem + - type: Fixtures + fixtures: + fix1: + shape: + !type:PhysShapeCircle + radius: 0.45 + density: 25 + mask: + - SmallMobMask + layer: + - MachineLayer + - type: EntityStorage + capacity: 1 + airtight: false + itemCanStoreMobs: true + - type: Weldable + - type: ResistLocker + - type: PlaceableSurface + isPlaceable: false + - type: Damageable + damageContainer: Inorganic + damageModifierSet: Wood + - type: Destructible + thresholds: + - trigger: + !type:DamageTrigger + damage: 50 + behaviors: + - !type:DoActsBehavior + acts: ["Destruction"] + - type: Appearance + - type: EntityStorageVisuals + stateDoorOpen: pet_carrier_open + stateDoorClosed: pet_carrier_door + - type: ContainerContainer + containers: + entity_storage: !type:Container + paper_label: !type:ContainerSlot + - type: ItemSlots + - type: Item + size: Ginormous + sprite: Objects/Storage/petcarrier.rsi \ No newline at end of file diff --git a/Resources/Textures/Objects/Storage/petcarrier.rsi/icon.png b/Resources/Textures/Objects/Storage/petcarrier.rsi/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..a4a3b9f90e97391cf24da5b55b457392df787d0f GIT binary patch literal 982 zcmV;{11bE8P)^L*+)>8MkXn4tX zznz`;=9}-$o7oydp%9#>8Q`2v6#<9cju?gkaw!=?h+dIsRJpSn0!1bh9XypvW!v`m z_Mo(^Ec=|;*@25CCD~`Q*-ZVCM@Nbz6bac!ZPbbPmb`AJ^e&9GxQ~@F{At7bNkN78ccjbnVClCm5z;Xf6cY3{Ev;qY4 z;}o!dA61}W0zN;R#p`QpS-gX5Ud)7cTYY`jKOxaq6#>DP78l`DI1JzC=IC={QF$Oqi$zUn2?BU8$3LR4On95kz2{?*V3~MY2;|s$Y!yaF$3Sm1g4^w;ZM%sCw6?T} zV$z2k@f{tvp|V<81xW%3rB60u3pfQt-l^$n`dn96Cy8fq3VvZCgh2XaEQCPjNS&LV zg^`gFFc%ep79%NnJv0oRot;osSy?~|5Dz@hQxYDJhc?N{o{O(yr34(s6R0RJr|~oq z*k2fj)z~$dn3#b0<|f@v$+@651<7O*uD7<*w$)e+$NPrSEiDQlc<}BJ1|4Ov5s!mb zBgzp4E|r$jIE?lxAP#BSTy1UiUPubk#)DKzOB0|az{4)y#pdVdX$l$|8sO{XB>mj7 zl4CX+rCsy!Oe8{6(C%_&V)5D+Vesi4#`}B}anJ}oh998Q>1ewV?*&3>nlS#u7oEc7 zB5UErb{jAo3pAcK1=67?dr!{h<7{ruVxowEn;j0(KCmS(zbt{Y3L(_>xgNUoL9pBH zFgY~^W|I*t)*6ULBeY*WCTSvH&_gF)VB(9ivsX|6vTFfl>X_^eCnsqv-19NwGyN5E zuZlph&&zlRf@t_k2MogYsfutqoub%<7hl(y0hrAt>VGBzY2#@cmzS4;$>bAZB#Tiy z2xWX`0>Qq!ScQ-1<<@0TYYZ$=zkfnNAOZi$&i&uP)Px%O-V#SRCt{2+A(O`Ko|w!ccn`gXXsJ_%G4oCI%Y8m1}`1Dq~NJjb_bH|jZ=9t zh9*!?T{>mTRPc~RP*SpVF*Fc5Wb%P<2*yOR@pv6v1Pl+_>Xr*=Pl45XYsQ@dzSdh~=}1;1KuW2s zgY$^?!&d7pNGVmVRzsuFh@FC3BVc9!yH?|-&n%*Cy%8|%BJpZA>?VC8w(ZHWElLfg zPRpULiGD9p+uBngvw+f=)%HXA3HxcZ2tEbcBU==960NT4$Cu3h0|aeP)+q`*N+*wq zh=_=Yh=_=Yh{)9cbOyknFJ|A*w?}6Hq?D@Tx}jUImX~2!Rwm!)XPr&3EK3A^NL#o5 z*4P7tcZ2r7;D29U;?DE1l*{4H^RSW6k9KwqUxJiU4Sav*y_Mb5sXfCajJC$w$0c-J z7l*bD0B{`VKK*%dfsX4YK3Os@DtG`G_&(alrL@%pFnj^l!8rh+SS(JZOSxRAj7j~b zWuh2Ofq>&Uc)zt3N`seSLiBsF2O~tkXEX)O)_~h<0IwrQfVjO*-$9*o35MJDMpHmF zD`LHRhK+n4KzI#!v$lry>KRnCl6nzT&5DQ&aM(4fA29tH3@Ul|N&WixHk4-?{AB%j t@iLs5LGVCEYXC3`c&-+CLWPK)tiRZd8)p=8W03#=002ovPDHLkV1mkCHrfCH literal 0 HcmV?d00001 diff --git a/Resources/Textures/Objects/Storage/petcarrier.rsi/inhand-right.png b/Resources/Textures/Objects/Storage/petcarrier.rsi/inhand-right.png new file mode 100644 index 0000000000000000000000000000000000000000..d633c112256dce7f80557ec03bee24b19ebe008e GIT binary patch literal 659 zcmV;E0&M+>P)Px%O-V#SRCt{2+A(O`Ko|w!ccn`gXXsJ_%G4oCI%Y8m1}`1Dq~NJjb_bH|jZ=9t zh9*!?T{>mTRPc~RP*SpVF*Fc5Wb%P<2*yOR@pv6v1Pl+_>Xr*=Pl45XYsQ@dzSdh~=}1;1KuW2s zgY$^?!&d7pNGVmVRzsuFh@FC3BVc9!yH?|-&n%*Cy%8|%BJpZA>?VC8w(ZHWElLfg zPRpULiGD9p+uBngvw+f=)%HXA3HxcZ2tEbcBU==960NT4$Cu3h0|aeP)+q`*N+*wq zh=_=Yh=_=Yh{)9cbOyknFJ|A*w?}6Hq?D@Tx}jUImX~2!Rwm!)XPr&3EK3A^NL#o5 z*4P7tcZ2r7;D29U;?DE1l*{4H^RSW6k9KwqUxJiU4Sav*y_Mb5sXfCajJC$w$0c-J z7l*bD0B{`VKK*%dfsX4YK3Os@DtG`G_&(alrL@%pFnj^l!8rh+SS(JZOSxRAj7j~b zWuh2Ofq>&Uc)zt3N`seSLiBsF2O~tkXEX)O)_~h<0IwrQfVjO*-$9*o35MJDMpHmF zD`LHRhK+n4KzI#!v$lry>KRnCl6nzT&5DQ&aM(4fA29tH3@Ul|N&WixHk4-?{AB%j t@iLs5LGVCEYXC3`c&-+CLWPK)tiRZd8)p=8W03#=002ovPDHLkV1mkCHrfCH literal 0 HcmV?d00001 diff --git a/Resources/Textures/Objects/Storage/petcarrier.rsi/meta.json b/Resources/Textures/Objects/Storage/petcarrier.rsi/meta.json new file mode 100644 index 0000000000..0843ad299c --- /dev/null +++ b/Resources/Textures/Objects/Storage/petcarrier.rsi/meta.json @@ -0,0 +1,34 @@ +{ + "version": 1, + "license": "CC0-1.0", + "copyright": "Taken from TGstation at https://github.com/tgstation/tgstation/commit/8b1ffd1e49a2d30a0aab63264106a3ec0e07f415 and edited by TheShuEd", + "size": { + "x": 32, + "y": 32 + }, + "states": [ + { + "name": "inhand-left", + "directions": 4 + }, + { + "name": "inhand-right", + "directions": 4 + }, + { + "name": "pet_carrier_base" + }, + { + "name": "pet_carrier_door" + }, + { + "name": "pet_carrier_open" + }, + { + "name": "icon" + }, + { + "name": "welded" + } + ] +} diff --git a/Resources/Textures/Objects/Storage/petcarrier.rsi/pet_carrier_base.png b/Resources/Textures/Objects/Storage/petcarrier.rsi/pet_carrier_base.png new file mode 100644 index 0000000000000000000000000000000000000000..1b4e86d740b11bbddb827a3edc141f08fb9bc1e0 GIT binary patch literal 847 zcmV-V1F-ywP)Px&2}wjjR9J=WS36G|K@k4-o=7283(~m9rO)S*e}FJZ zDO^#6hB7iu3S0+MUcXsZ8e;rKp^6czv zY5s0wgBW9AOenqtA_5WN*Tuz>a6X?G$}3?8S2T?nV;GG_vv>Vo4~b-QHh<`L@oIH- zHrI6>E1E{X$Kz1OQkcNgs28253N@q(H6)Tr^n1NPJwF6yKvz{t8-~zWs!&6tn8R8& zD&OjbaY(_kJQ(s0r6i(?rE8!^mW?ead~a5O@YkB@>oq3D?qwfkrWh zMlmN`w=4^#l9+sC0+osd(`O50S;ks6E35(lFw13BDq`}B2rR>rId^_{dpmpXcDq7( z@BQ2L^_l*Ik8C6Y912|W4Z<72dK z8~v;EcmzO%FDJui2ICNL2Y2nnuL1%vPn#r3Gow))&z~{1SSL98kPKkyED+})#^5;qHSN~Cd-_4ad+#Bz7u1VejCHQDKl}hr1XYn2O6>Vi z6&aieM~|Ceoom#KTcID65!x{a2+&lo3WB53R0SAJ^&%kBui4h#k9ao`fO_#$q+hfD Z_yY}_n$>D_vl;*Z002ovPDHLkV1hJ-c)0)o literal 0 HcmV?d00001 diff --git a/Resources/Textures/Objects/Storage/petcarrier.rsi/pet_carrier_door.png b/Resources/Textures/Objects/Storage/petcarrier.rsi/pet_carrier_door.png new file mode 100644 index 0000000000000000000000000000000000000000..4208bb961fb338f950208b15724890ab741dfee7 GIT binary patch literal 254 zcmVPx#xJg7oR9J=W)J+P5Fc1ac*A}IKqOpp_Ey zLl@$FtG7@Y-xvYL7-MWJh{(p|P{;hy@*F}gx(|ar6$PrY1OU9|*_)r!giG57Jv-Qb zSD=-$z3!HQsuN$i~*b%;%=r@Ct5y zpFI6z9E0BeucsjE1T5|IM`VnF5CU2$oATwm`x*0j1Aqps!o2*k>i_@%07*qoM6N<$ Eg4-c*4gdfE literal 0 HcmV?d00001 diff --git a/Resources/Textures/Objects/Storage/petcarrier.rsi/pet_carrier_open.png b/Resources/Textures/Objects/Storage/petcarrier.rsi/pet_carrier_open.png new file mode 100644 index 0000000000000000000000000000000000000000..3bc200bded5944271b66bf5ef24ff3eaada60ff2 GIT binary patch literal 279 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}7d>4ZLn2z= zPB|#pqQK*NSgc`hMB`o$RuL!Gh2q*9#4{ACPx-Y;vWtl6SBl$MJo_ljyg;LCk%pJD z;6x>*y=nqZ3SyE!@1CDKU0G@AoOUl0&Vqw?Ee}7}=u~6W(`gMlr~K+V>l5G8D$4`~ zJKHCm4|=EBAAKQuN92Q5tb!BEp7;1X(Pt`plqzJ?(!JI8>+k3bzs>L5Vm9hL8pWY_ z;R;KNkdC2hqmZA{Q=WUjE3F@9$$ts(ePGdd|MQBk+AEK#vobK8`>evyP#Sx7Tkhf3 bWuIBUB{t+IFE8^3dXB-<)z4*}Q$iB}i=k@* literal 0 HcmV?d00001 diff --git a/Resources/Textures/Objects/Storage/petcarrier.rsi/welded.png b/Resources/Textures/Objects/Storage/petcarrier.rsi/welded.png new file mode 100644 index 0000000000000000000000000000000000000000..93b9c1dbc8a507d616faae479186d8d9daeed50e GIT binary patch literal 331 zcmV-R0kr;!P)Px$1xZ9fR9J=WmCccZFbstsTY+w*15$=cP#318O&2afWrPm!%^i48&XVkaWgwHo z`nxem^0TZTpwVbF8vmWH)cEu-u^JU#f-83@rQoU2FU6y0TG?I3vv-zvrzl?=J}pCBJjI<=MesM%5@m3 d)^X$G`~X@jXKP|A2qypl002ovPDHLkV1k~xlMVm? literal 0 HcmV?d00001 -- 2.51.2