From bf46e6b5e8ea96f31c99ef43d6faa4ce6a460d69 Mon Sep 17 00:00:00 2001 From: Nim <128169402+Nimfar11@users.noreply.github.com> Date: Wed, 5 Feb 2025 16:44:34 +0200 Subject: [PATCH] Smoking pipe new (#823) * pipe * fix delayed smoke ignition * sage --------- Co-authored-by: Ed <96445749+TheShuEd@users.noreply.github.com> Co-authored-by: Ed --- .../SmokingSystem.SmokingPipe.cs | 2 +- .../_CP14/Temperature/CP14FireSpreadSystem.cs | 25 ++++++- .../Consumable/Smokeables/Pipes/pipe.yml | 64 +++++++++++++++++ .../Objects/Specific/Farming/leaves.yml | 45 ++++++++++++ .../_CP14/Entities/Objects/Tools/torch.yml | 3 +- .../_CP14/Loadouts/Jobs/general.yml | 6 ++ .../Smokeables/Pipes/pipe.rsi/burnt-icon.png | Bin 0 -> 352 bytes .../Smokeables/Pipes/pipe.rsi/inhand-left.png | Bin 0 -> 498 bytes .../Pipes/pipe.rsi/inhand-right.png | Bin 0 -> 492 bytes .../Pipes/pipe.rsi/lit-equipped-MASK.png | Bin 0 -> 1352 bytes .../Smokeables/Pipes/pipe.rsi/lit-icon.png | Bin 0 -> 573 bytes .../Smokeables/Pipes/pipe.rsi/meta.json | 68 ++++++++++++++++++ .../Pipes/pipe.rsi/unlit-equipped-MASK.png | Bin 0 -> 503 bytes .../Smokeables/Pipes/pipe.rsi/unlit-icon.png | Bin 0 -> 352 bytes .../Misc/reagent_fillings.rsi/meta.json | 17 +++++ .../Misc/reagent_fillings.rsi/sage_powder.png | Bin 0 -> 331 bytes .../reagent_fillings.rsi/tobacco_small.png | Bin 0 -> 381 bytes 17 files changed, 226 insertions(+), 4 deletions(-) create mode 100644 Resources/Prototypes/_CP14/Entities/Objects/Consumable/Smokeables/Pipes/pipe.yml create mode 100644 Resources/Prototypes/_CP14/Entities/Objects/Specific/Farming/leaves.yml create mode 100644 Resources/Textures/_CP14/Objects/Consumable/Smokeables/Pipes/pipe.rsi/burnt-icon.png create mode 100644 Resources/Textures/_CP14/Objects/Consumable/Smokeables/Pipes/pipe.rsi/inhand-left.png create mode 100644 Resources/Textures/_CP14/Objects/Consumable/Smokeables/Pipes/pipe.rsi/inhand-right.png create mode 100644 Resources/Textures/_CP14/Objects/Consumable/Smokeables/Pipes/pipe.rsi/lit-equipped-MASK.png create mode 100644 Resources/Textures/_CP14/Objects/Consumable/Smokeables/Pipes/pipe.rsi/lit-icon.png create mode 100644 Resources/Textures/_CP14/Objects/Consumable/Smokeables/Pipes/pipe.rsi/meta.json create mode 100644 Resources/Textures/_CP14/Objects/Consumable/Smokeables/Pipes/pipe.rsi/unlit-equipped-MASK.png create mode 100644 Resources/Textures/_CP14/Objects/Consumable/Smokeables/Pipes/pipe.rsi/unlit-icon.png create mode 100644 Resources/Textures/_CP14/Objects/Misc/reagent_fillings.rsi/meta.json create mode 100644 Resources/Textures/_CP14/Objects/Misc/reagent_fillings.rsi/sage_powder.png create mode 100644 Resources/Textures/_CP14/Objects/Misc/reagent_fillings.rsi/tobacco_small.png diff --git a/Content.Server/Nutrition/EntitySystems/SmokingSystem.SmokingPipe.cs b/Content.Server/Nutrition/EntitySystems/SmokingSystem.SmokingPipe.cs index 26d86acd54..b0a9c16cac 100644 --- a/Content.Server/Nutrition/EntitySystems/SmokingSystem.SmokingPipe.cs +++ b/Content.Server/Nutrition/EntitySystems/SmokingSystem.SmokingPipe.cs @@ -74,7 +74,7 @@ namespace Content.Server.Nutrition.EntitySystems } // Convert smokable item into reagents to be smoked - private bool TryTransferReagents(Entity entity, Entity smokable) + public bool TryTransferReagents(Entity entity, Entity smokable) //CP14 make it public { if (entity.Comp.BowlSlot.Item == null) return false; diff --git a/Content.Server/_CP14/Temperature/CP14FireSpreadSystem.cs b/Content.Server/_CP14/Temperature/CP14FireSpreadSystem.cs index 631ffa4df0..9143aa8d0d 100644 --- a/Content.Server/_CP14/Temperature/CP14FireSpreadSystem.cs +++ b/Content.Server/_CP14/Temperature/CP14FireSpreadSystem.cs @@ -2,10 +2,12 @@ using System.Linq; using System.Numerics; using Content.Server.Atmos.Components; using Content.Server.Atmos.EntitySystems; -using Content.Server.DoAfter; +using Content.Server.Nutrition.Components; +using Content.Server.Nutrition.EntitySystems; using Content.Shared._CP14.Temperature; -using Content.Shared.Interaction; using Content.Shared.Maps; +using Content.Shared.Nutrition.Components; +using Content.Shared.Smoking; using Content.Shared.Weapons.Melee.Events; using Robust.Shared.Map; using Robust.Shared.Map.Components; @@ -25,6 +27,7 @@ public sealed partial class CP14FireSpreadSystem : CP14SharedFireSpreadSystem [Dependency] private readonly SharedMapSystem _mapSystem = default!; [Dependency] private readonly TileSystem _tile = default!; [Dependency] private readonly ITileDefinitionManager _tileDef = default!; + [Dependency] private readonly SmokingSystem _smoking = default!; private readonly EntProtoId _fireProto = "CP14Fire"; @@ -35,6 +38,8 @@ public sealed partial class CP14FireSpreadSystem : CP14SharedFireSpreadSystem base.Initialize(); SubscribeLocalEvent(OnFlammableIgnited); + SubscribeLocalEvent(OnDelayedIgnite); + SubscribeLocalEvent(OnDelayedPipeIgnite); SubscribeLocalEvent(OnFlammableMeleeHit); } @@ -59,6 +64,22 @@ public sealed partial class CP14FireSpreadSystem : CP14SharedFireSpreadSystem args.Handled = true; } + //For smokable cigars + private void OnDelayedIgnite(Entity ent, ref CP14IgnitionDoAfter args) + { + _smoking.SetSmokableState(ent, SmokableState.Lit, ent.Comp); + } + + //For smokable pipes + private void OnDelayedPipeIgnite(Entity pipe, ref CP14IgnitionDoAfter args) + { + if (!TryComp(pipe, out var smokable)) + return; + + if (_smoking.TryTransferReagents(pipe, (pipe.Owner, smokable))) + _smoking.SetSmokableState(pipe, SmokableState.Lit, smokable); + } + public override void Update(float frameTime) { base.Update(frameTime); diff --git a/Resources/Prototypes/_CP14/Entities/Objects/Consumable/Smokeables/Pipes/pipe.yml b/Resources/Prototypes/_CP14/Entities/Objects/Consumable/Smokeables/Pipes/pipe.yml new file mode 100644 index 0000000000..0070306e24 --- /dev/null +++ b/Resources/Prototypes/_CP14/Entities/Objects/Consumable/Smokeables/Pipes/pipe.yml @@ -0,0 +1,64 @@ +- type: entity + id: CP14SmokingPipe + parent: BaseSmokingPipe + name: pipe + description: A comfortable and practical smoking pipe, the latest fashion in the Empire. + categories: [ ForkFiltered ] + components: + - type: Sprite + sprite: _CP14/Objects/Consumable/Smokeables/Pipes/pipe.rsi + state: unlit-icon + - type: Clothing + sprite: _CP14/Objects/Consumable/Smokeables/Pipes/pipe.rsi + slots: [ mask ] + equippedPrefix: unlit + - type: Item + size: Tiny + sprite: _CP14/Objects/Consumable/Smokeables/Pipes/pipe.rsi + - type: Appearance + - type: BurnStateVisuals + unlitIcon: unlit-icon + +- type: entity + id: CP14SmokingPipeFilledTobacco + parent: CP14SmokingPipe + suffix: Tobacco + categories: [ ForkFiltered ] + components: + - type: ContainerContainer + containers: + bowl_slot: !type:ContainerSlot + - type: ItemSlots + - type: SmokingPipe + bowl_slot: + name: smoking-pipe-slot-component-slot-name-bowl + startingItem: CP14GroundTobacco + whitelist: + tags: + - Smokable + insertSound: + path: /Audio/Weapons/Guns/Empty/empty.ogg + ejectSound: + path: /Audio/Weapons/Guns/Empty/empty.ogg + +- type: entity + id: CP14SmokingPipeFilledSage + parent: CP14SmokingPipe + suffix: Sage + categories: [ ForkFiltered ] + components: + - type: ContainerContainer + containers: + bowl_slot: !type:ContainerSlot + - type: ItemSlots + - type: SmokingPipe + bowl_slot: + name: smoking-pipe-slot-component-slot-name-bowl + startingItem: CP14GroundSage + whitelist: + tags: + - Smokable + insertSound: + path: /Audio/Weapons/Guns/Empty/empty.ogg + ejectSound: + path: /Audio/Weapons/Guns/Empty/empty.ogg diff --git a/Resources/Prototypes/_CP14/Entities/Objects/Specific/Farming/leaves.yml b/Resources/Prototypes/_CP14/Entities/Objects/Specific/Farming/leaves.yml new file mode 100644 index 0000000000..eaca8882f8 --- /dev/null +++ b/Resources/Prototypes/_CP14/Entities/Objects/Specific/Farming/leaves.yml @@ -0,0 +1,45 @@ +- type: entity + name: ground tobacco + parent: BaseItem + id: CP14GroundTobacco + description: Grinded and dried tabac leaves, some like it is a cur. + categories: [ ForkFiltered ] + components: + - type: Item + size: Tiny + - type: SolutionContainerManager + solutions: + food: + reagents: + - ReagentId: Nicotine + Quantity: 10 + - type: Sprite + sprite: _CP14/Objects/Misc/reagent_fillings.rsi + state: tobacco_small + - type: Tag + tags: + - Smokable + +- type: entity + name: ground sage + parent: BaseItem + id: CP14GroundSage + description: Ground and dried sage root as it turns out is an excellent substitute for tobacco. + categories: [ ForkFiltered ] + components: + - type: Item + size: Tiny + - type: SolutionContainerManager + solutions: + food: + reagents: + - ReagentId: THC + Quantity: 8 + - ReagentId: Happiness + Quantity: 2 + - type: Sprite + sprite: _CP14/Objects/Misc/reagent_fillings.rsi + state: sage_powder + - type: Tag + tags: + - Smokable diff --git a/Resources/Prototypes/_CP14/Entities/Objects/Tools/torch.yml b/Resources/Prototypes/_CP14/Entities/Objects/Tools/torch.yml index 96a0a32c86..3aca82ae56 100644 --- a/Resources/Prototypes/_CP14/Entities/Objects/Tools/torch.yml +++ b/Resources/Prototypes/_CP14/Entities/Objects/Tools/torch.yml @@ -94,5 +94,6 @@ - type: entity parent: CP14Torch id: CP14TorchIgnited + suffix: Ignited components: - - type: CP14AutoIgnite \ No newline at end of file + - type: CP14AutoIgnite diff --git a/Resources/Prototypes/_CP14/Loadouts/Jobs/general.yml b/Resources/Prototypes/_CP14/Loadouts/Jobs/general.yml index 12e663dac0..55cdca7728 100644 --- a/Resources/Prototypes/_CP14/Loadouts/Jobs/general.yml +++ b/Resources/Prototypes/_CP14/Loadouts/Jobs/general.yml @@ -497,6 +497,12 @@ back: - CP14Torch +- type: loadout + id: CP14Pipe + storage: + back: + - CP14SmokingPipeFilledTobacco + - type: loadout id: CP14LyraInstrument storage: diff --git a/Resources/Textures/_CP14/Objects/Consumable/Smokeables/Pipes/pipe.rsi/burnt-icon.png b/Resources/Textures/_CP14/Objects/Consumable/Smokeables/Pipes/pipe.rsi/burnt-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..eb86369c96ea029d3a41a411019c565085c24e66 GIT binary patch literal 352 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^TEDn4#?y*WRVR3T?5^eDuCdV!Qvrk>u&38X>$KMZ%j{HI)4mp9bFVa8$Ke<|- zM||G?^bZ%OrwBZHoVFr%)AR*DSwsaMGfa4DP-@^V@VI({T$k(uE&c!UPm%?06n(Uu zp?0lkk_^LVRhGb0^^h73G0{ssFX-KVsRktTfUX!l*klI2C?%7_v3bb z7Rx!exj$awOo;1&LVvG4%GOO8;mtCP-AohCJ2HsqE>W}E?qKx-l|Zh#KPn>Yx9PSQyLRewadyL)qh}*_{sc-KPf#uKXtOv5>sCX0j4DN zrlY4g#9h`|%&9!C^Lri7o!i^*R~KuRRR{gJtX=cpi6O_~A&Ui5t9XOFV;_V2f&wO) z#zWi(>KTC?29F1yO6KIrEz{GzEzNiN}cdc!W-9Ck7 zw#&ts4qR4<>SnmmviS98#*4yEzmu6MVGFd_`nL-HtIOVHe&BP6#NNuQBufu!A7ssA= zo8Nq!zb-nUIkR}7QZ~b^n#-v?f7hOUrYL_<&;3C1+Beb(tqu%fO*{9WXL~Yl!BuSY5)KL literal 0 HcmV?d00001 diff --git a/Resources/Textures/_CP14/Objects/Consumable/Smokeables/Pipes/pipe.rsi/inhand-right.png b/Resources/Textures/_CP14/Objects/Consumable/Smokeables/Pipes/pipe.rsi/inhand-right.png new file mode 100644 index 0000000000000000000000000000000000000000..f282c149c9526024fd0e663eb8d32b830dc7132b GIT binary patch literal 492 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=jKx9jP7LeL$-D%zmwCE4hE&A8 zowd=6IZ(h=y;b3*3kM5RW|DN!vW=Vkr|bRTuWOhpKcQa0dUry$s?({AALG^^_11=T6 z2JHzI3_pO(0@i;D1*R{aKR$WI#j7N2>ZcEzrhNY?Gp{oJ;fDLC(@*>Fw0VEx>s{qL z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3nOwM2?SIkDoTozSzI~fj_ls;m5@@G#vogwJd8>h4nxqfF>-<3bZ$@Y11@!0ANFveoKl73qj@nwgB*xI@YZ$ zc@9w+fa=+kNs()}8i3N-lLWxDagVCmm+k-=!|n82;Su0P@mtt0jqTM1e5PRkybO1? zEq#7ic(VG^2L0x7eJSTW);^(BeSyW9Q5YWVhpmHC>GPWb@OuV>>Ps7Rb-?eR5ftaf zIRvWoy)NT0`qBXYCX`Ah9ZVe8(N&dwQWfvj9bxr_0dUH^wU={gXL@pkc{;wdq4v=r zEqrYy?=)f)Ob=fIRr*2zP^{u~Lpqy<(%A{*Gf8-UeP?D62=%3h`ti&>JlqtS*4%in zGJRnHXrNRmK*IO}OdeBD3=P0oyoZ_EJG>A&tJx*z^}RcQ`u#0T#SCToLZk~cZ*V{?swy>)|Ubh zWPYQ*M+1m@Le&0r2T&7^`uVy8qMi`7KivV;grk1G?trK#MD6bzB1`@u7amWh00000 LNkvXXu0mjf={x@u literal 0 HcmV?d00001 diff --git a/Resources/Textures/_CP14/Objects/Consumable/Smokeables/Pipes/pipe.rsi/meta.json b/Resources/Textures/_CP14/Objects/Consumable/Smokeables/Pipes/pipe.rsi/meta.json new file mode 100644 index 0000000000..6e27344b17 --- /dev/null +++ b/Resources/Textures/_CP14/Objects/Consumable/Smokeables/Pipes/pipe.rsi/meta.json @@ -0,0 +1,68 @@ +{ + "version": 1, + "license": "All right reserved", + "copyright": "Created by Max Gab", + "size": { + "x": 32, + "y": 32 + }, + "states": [ + { + "name": "unlit-equipped-MASK", + "directions": 4 + }, + { + "name": "lit-equipped-MASK", + "directions": 4, + "delays": [ + [ + 0.1, + 0.1, + 0.1, + 0.1 + ], + [ + 0.1, + 0.1, + 0.1, + 0.1 + ], + [ + 0.1, + 0.1, + 0.1, + 0.1 + ], + [ + 0.1, + 0.1, + 0.1, + 0.1 + ] + ] + }, + { + "name": "burnt-icon" + }, + { + "name": "unlit-icon" + }, + { + "name": "lit-icon", + "delays": [ + [ + 0.1, + 0.1 + ] + ] + }, + { + "name": "inhand-left", + "directions": 4 + }, + { + "name": "inhand-right", + "directions": 4 + } + ] +} diff --git a/Resources/Textures/_CP14/Objects/Consumable/Smokeables/Pipes/pipe.rsi/unlit-equipped-MASK.png b/Resources/Textures/_CP14/Objects/Consumable/Smokeables/Pipes/pipe.rsi/unlit-equipped-MASK.png new file mode 100644 index 0000000000000000000000000000000000000000..8f53754e0a05f8f50ebd2e4447c3a87422f664f0 GIT binary patch literal 503 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=jKx9jP7LeL$-D%zH+s4_hE&A8 zowYH`$x*=dxRS!lOB_uJi(OYma4FUcTv~e8{)zXW_L`<2?1~eNJd+=0uW4zxvDEY9 zq1p`!E5pjtXOzBQ9dc)H`MWu_XZ`%O>Z_(+*XLo2gX#%ofohg{^3UET z{k+F&Cfk4e_w2;&CV#|s_iz92D)_--{#Nv7^czD;Su*HJ|4G`R}Lg>_`4w2aJzt-dn`!A^366G{%Z| zeXZs~2@^M^^9nuKX)SioqrvsmJX4Q`=kFpalo`b|tFI|A&fA^*u$Lub$(zV#7Q7lx zyD{WVD6IUoEpOA?pY{wfmmil&`LEmAlCoK1PJ?31%xu{-Ha=mASlVv)<@9|b%MTF>t^oy63jsGBUN?~tLwo{$>i-OiYy z8hvV?%7Q6=nLkw+qfSoSq|d3bG&su6vmtEL(l_2rUN5Ii^A}n$HAnOJq=q1?rB63k bG5urcj*4-tjB45mj7bJhS3j3^P6EDn4#?y*WRVR3T?5^eDuCdV!Qvrk>u&38X>$KMZ%j{HI)4mp9bFVa8$Ke<|- zM||G?^bZ%OrwBZHoVFr%)AR*DSwsaMGfa4DP-@^V@VI({T$k(uE&c!UPm%?06n(Uu zp?0lkk_^LVRhGb0^^h73G0{ssFX-KVsRktTfUX!l*klI2C?%7_v3bb z7Rx!exj$awOo;1&LVvG4%GOO8;mtCP-AohCJ2HsqE>W}EEDn4#?y*WRVR3T?6Ah09R&*5p%g@m|Eih|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