Make smoking cool again. (#6046)
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Linq;
|
||||
using Content.Server.Body.Components;
|
||||
using Content.Server.Body.Systems;
|
||||
using Content.Server.Chemistry.EntitySystems;
|
||||
using Content.Server.Clothing.Components;
|
||||
using Content.Server.Nutrition.Components;
|
||||
using Content.Shared.Chemistry;
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
@@ -38,14 +39,22 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
InitializeCigars();
|
||||
}
|
||||
|
||||
public void SetSmokableState(EntityUid uid, SmokableState state, SmokableComponent? smokable = null, AppearanceComponent? appearance = null)
|
||||
public void SetSmokableState(EntityUid uid, SmokableState state, SmokableComponent? smokable = null,
|
||||
AppearanceComponent? appearance = null, ClothingComponent? clothing = null)
|
||||
{
|
||||
if (!Resolve(uid, ref smokable, ref appearance))
|
||||
if (!Resolve(uid, ref smokable, ref appearance, ref clothing))
|
||||
return;
|
||||
|
||||
smokable.State = state;
|
||||
appearance.SetData(SmokingVisuals.Smoking, state);
|
||||
|
||||
clothing.EquippedPrefix = state switch
|
||||
{
|
||||
SmokableState.Lit => smokable.LitPrefix,
|
||||
SmokableState.Burnt => smokable.BurntPrefix,
|
||||
_ => smokable.UnlitPrefix
|
||||
};
|
||||
|
||||
if (state == SmokableState.Lit)
|
||||
_active.Add(uid);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user