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 0000000000..eb86369c96 Binary files /dev/null and b/Resources/Textures/_CP14/Objects/Consumable/Smokeables/Pipes/pipe.rsi/burnt-icon.png differ diff --git a/Resources/Textures/_CP14/Objects/Consumable/Smokeables/Pipes/pipe.rsi/inhand-left.png b/Resources/Textures/_CP14/Objects/Consumable/Smokeables/Pipes/pipe.rsi/inhand-left.png new file mode 100644 index 0000000000..f4ee7a8f2c Binary files /dev/null and b/Resources/Textures/_CP14/Objects/Consumable/Smokeables/Pipes/pipe.rsi/inhand-left.png differ 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 0000000000..f282c149c9 Binary files /dev/null and b/Resources/Textures/_CP14/Objects/Consumable/Smokeables/Pipes/pipe.rsi/inhand-right.png differ diff --git a/Resources/Textures/_CP14/Objects/Consumable/Smokeables/Pipes/pipe.rsi/lit-equipped-MASK.png b/Resources/Textures/_CP14/Objects/Consumable/Smokeables/Pipes/pipe.rsi/lit-equipped-MASK.png new file mode 100644 index 0000000000..cf8067c198 Binary files /dev/null and b/Resources/Textures/_CP14/Objects/Consumable/Smokeables/Pipes/pipe.rsi/lit-equipped-MASK.png differ diff --git a/Resources/Textures/_CP14/Objects/Consumable/Smokeables/Pipes/pipe.rsi/lit-icon.png b/Resources/Textures/_CP14/Objects/Consumable/Smokeables/Pipes/pipe.rsi/lit-icon.png new file mode 100644 index 0000000000..45eab7df96 Binary files /dev/null and b/Resources/Textures/_CP14/Objects/Consumable/Smokeables/Pipes/pipe.rsi/lit-icon.png differ 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 0000000000..8f53754e0a Binary files /dev/null and b/Resources/Textures/_CP14/Objects/Consumable/Smokeables/Pipes/pipe.rsi/unlit-equipped-MASK.png differ diff --git a/Resources/Textures/_CP14/Objects/Consumable/Smokeables/Pipes/pipe.rsi/unlit-icon.png b/Resources/Textures/_CP14/Objects/Consumable/Smokeables/Pipes/pipe.rsi/unlit-icon.png new file mode 100644 index 0000000000..eb86369c96 Binary files /dev/null and b/Resources/Textures/_CP14/Objects/Consumable/Smokeables/Pipes/pipe.rsi/unlit-icon.png differ diff --git a/Resources/Textures/_CP14/Objects/Misc/reagent_fillings.rsi/meta.json b/Resources/Textures/_CP14/Objects/Misc/reagent_fillings.rsi/meta.json new file mode 100644 index 0000000000..1d5bbb9bd0 --- /dev/null +++ b/Resources/Textures/_CP14/Objects/Misc/reagent_fillings.rsi/meta.json @@ -0,0 +1,17 @@ +{ + "version": 1, + "size": { + "x": 32, + "y": 32 + }, + "license": "All right reserved", + "copyright": "Created by Prazat", + "states": [ + { + "name": "tobacco_small" + }, + { + "name": "sage_powder" + } + ] +} diff --git a/Resources/Textures/_CP14/Objects/Misc/reagent_fillings.rsi/sage_powder.png b/Resources/Textures/_CP14/Objects/Misc/reagent_fillings.rsi/sage_powder.png new file mode 100644 index 0000000000..f4ab765f96 Binary files /dev/null and b/Resources/Textures/_CP14/Objects/Misc/reagent_fillings.rsi/sage_powder.png differ diff --git a/Resources/Textures/_CP14/Objects/Misc/reagent_fillings.rsi/tobacco_small.png b/Resources/Textures/_CP14/Objects/Misc/reagent_fillings.rsi/tobacco_small.png new file mode 100644 index 0000000000..010cb08f53 Binary files /dev/null and b/Resources/Textures/_CP14/Objects/Misc/reagent_fillings.rsi/tobacco_small.png differ