Fixes cigarette animations and matches now have lit/unlit inhand sprites (#4480)

This commit is contained in:
Swept
2021-08-17 16:26:35 -07:00
committed by GitHub
parent 73849a5f52
commit ff44b83fd6
15 changed files with 267 additions and 201 deletions

View File

@@ -4,6 +4,7 @@ using Content.Shared.Interaction;
using Content.Shared.Smoking; using Content.Shared.Smoking;
using Content.Shared.Sound; using Content.Shared.Sound;
using Content.Shared.Temperature; using Content.Shared.Temperature;
using Content.Server.Items;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;
using Robust.Shared.Audio; using Robust.Shared.Audio;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
@@ -55,6 +56,19 @@ namespace Content.Server.Light.Components
_pointLightComponent.Enabled = _currentState == SharedBurningStates.Lit; _pointLightComponent.Enabled = _currentState == SharedBurningStates.Lit;
} }
if (Owner.TryGetComponent(out ItemComponent? item))
{
switch (_currentState)
{
case SharedBurningStates.Lit:
item.EquippedPrefix = "lit";
break;
default:
item.EquippedPrefix = "unlit";
break;
}
}
if (Owner.TryGetComponent(out AppearanceComponent? appearance)) if (Owner.TryGetComponent(out AppearanceComponent? appearance))
{ {
appearance.SetData(SmokingVisuals.Smoking, _currentState); appearance.SetData(SmokingVisuals.Smoking, _currentState);

View File

@@ -2,20 +2,20 @@
id: Rollie id: Rollie
parent: BaseSmokeable parent: BaseSmokeable
name: blunt name: blunt
description: "A roll of dried plant matter wrapped in thin paper." description: A roll of dried plant matter wrapped in thin paper.
components: components:
- type: Sprite - type: Sprite
sprite: Objects/Consumable/Smokeables/Cigarettes/blunt.rsi sprite: Objects/Consumable/Smokeables/Cigarettes/blunt.rsi
netsync: false netsync: false
state: unlit-icon state: unlit-icon
- type: Tag - type: Tag
tags: tags:
- Cigarette - Cigarette
- type: Clothing - type: Clothing
sprite: Objects/Consumable/Smokeables/Cigarettes/blunt.rsi sprite: Objects/Consumable/Smokeables/Cigarettes/blunt.rsi
Slots: [ mask ] Slots: [ mask ]
HeldPrefix: unlit HeldPrefix: unlit
size: 1 size: 1
- type: Construction - type: Construction
graph: smokeableRollie graph: smokeableRollie
node: rollie node: rollie

View File

@@ -4,70 +4,70 @@
name: Spessman's Smokes carton name: Spessman's Smokes carton
description: "A carton containing 6 packets of Spessman's Smokes." description: "A carton containing 6 packets of Spessman's Smokes."
components: components:
- type: Sprite - type: Sprite
sprite: Objects/Consumable/Smokeables/Cigarettes/Cartons/green.rsi sprite: Objects/Consumable/Smokeables/Cigarettes/Cartons/green.rsi
layers: layers:
- state: closed - state: closed
- type: Storage - type: Storage
capacity: 36 capacity: 36
- type: Item - type: Item
sprite: Objects/Consumable/Smokeables/Cigarettes/Cartons/green.rsi sprite: Objects/Consumable/Smokeables/Cigarettes/Cartons/green.rsi
- type: StorageFill - type: StorageFill
contents: contents:
- id: CigPackGreen - id: CigPackGreen
amount: 6 amount: 6
- type: Appearance - type: Appearance
visuals: visuals:
- type: BagOpenCloseVisualizer - type: BagOpenCloseVisualizer
openIcon: open openIcon: open
- type: entity - type: entity
id: CigCartonRed id: CigCartonRed
parent: CigCartonGreen parent: CigCartonGreen
name: Dromedaryco carton name: Dromedaryco carton
description: "A carton containing 6 packets of Dromedarycos." description: A carton containing 6 packets of Dromedarycos.
components: components:
- type: Sprite - type: Sprite
sprite: Objects/Consumable/Smokeables/Cigarettes/Cartons/red.rsi sprite: Objects/Consumable/Smokeables/Cigarettes/Cartons/red.rsi
layers: layers:
- state: closed - state: closed
- type: Item - type: Item
sprite: Objects/Consumable/Smokeables/Cigarettes/Cartons/red.rsi sprite: Objects/Consumable/Smokeables/Cigarettes/Cartons/red.rsi
- type: StorageFill - type: StorageFill
contents: contents:
- id: CigPackRed - id: CigPackRed
amount: 6 amount: 6
- type: entity - type: entity
id: CigCartonBlue id: CigCartonBlue
parent: CigCartonGreen parent: CigCartonGreen
name: AcmeCo carton name: AcmeCo carton
description: "A carton containing 6 packets of AcmeCo." description: A carton containing 6 packets of AcmeCo.
components: components:
- type: Sprite - type: Sprite
sprite: Objects/Consumable/Smokeables/Cigarettes/Cartons/blue.rsi sprite: Objects/Consumable/Smokeables/Cigarettes/Cartons/blue.rsi
layers: layers:
- state: closed - state: closed
- type: Item - type: Item
sprite: Objects/Consumable/Smokeables/Cigarettes/Cartons/blue.rsi sprite: Objects/Consumable/Smokeables/Cigarettes/Cartons/blue.rsi
- type: StorageFill - type: StorageFill
contents: contents:
- id: CigPackBlue - id: CigPackBlue
amount: 6 amount: 6
- type: entity - type: entity
id: CigCartonBlack id: CigCartonBlack
parent: CigCartonGreen parent: CigCartonGreen
name: Nomads carton name: Nomads carton
description: "A carton containing 6 packets of Nomads." description: A carton containing 6 packets of Nomads.
components: components:
- type: Sprite - type: Sprite
sprite: Objects/Consumable/Smokeables/Cigarettes/Cartons/black.rsi sprite: Objects/Consumable/Smokeables/Cigarettes/Cartons/black.rsi
layers: layers:
- state: closed - state: closed
- type: Item - type: Item
sprite: Objects/Consumable/Smokeables/Cigarettes/Cartons/black.rsi sprite: Objects/Consumable/Smokeables/Cigarettes/Cartons/black.rsi
- type: StorageFill - type: StorageFill
contents: contents:
- id: CigPackBlack - id: CigPackBlack
amount: 6 amount: 6

View File

@@ -5,21 +5,20 @@
id: Cigarette id: Cigarette
parent: BaseSmokeable parent: BaseSmokeable
name: cigarette name: cigarette
description: "A roll of tobacco and nicotine." description: A roll of tobacco and nicotine.
components: components:
- type: Sprite - type: Sprite
sprite: Objects/Consumable/Smokeables/Cigarettes/cigarette.rsi sprite: Objects/Consumable/Smokeables/Cigarettes/cigarette.rsi
netsync: false netsync: false
state: unlit-icon state: unlit-icon
- type: Tag - type: Tag
tags: tags:
- Cigarette - Cigarette
- type: Clothing - type: Clothing
netsync: false sprite: Objects/Consumable/Smokeables/Cigarettes/cigarette.rsi
sprite: Objects/Consumable/Smokeables/Cigarettes/cigarette.rsi Slots: [ mask ]
Slots: [ mask ] HeldPrefix: unlit
HeldPrefix: unlit size: 1
size: 1 - type: Construction
- type: Construction graph: smokeableCigarette
graph: smokeableCigarette node: cigarette
node: cigarette

View File

@@ -2,7 +2,7 @@
parent: BaseItem parent: BaseItem
name: pack of rolling paper name: pack of rolling paper
id: PackPaperRolling id: PackPaperRolling
description: "A pack of thin pieces of paper used to make fine smokeables." description: A pack of thin pieces of paper used to make fine smokeables.
components: components:
- type: Storage - type: Storage
whitelist: whitelist:
@@ -22,35 +22,35 @@
- type: entity - type: entity
id: PaperRolling id: PaperRolling
name: rolling paper name: rolling paper
description: "A thin piece of paper used to make fine smokeables." description: A thin piece of paper used to make fine smokeables.
parent: BaseItem parent: BaseItem
components: components:
- type: Stack - type: Stack
stackType: PaperRolling stackType: PaperRolling
max: 5 max: 5
count: 1 count: 1
- type: Sprite - type: Sprite
sprite: Objects/Consumable/Smokeables/Cigarettes/paper.rsi sprite: Objects/Consumable/Smokeables/Cigarettes/paper.rsi
state: cigpaper state: cigpaper
- type: Item - type: Item
sprite: Objects/Consumable/Smokeables/Cigarettes/paper.rsi sprite: Objects/Consumable/Smokeables/Cigarettes/paper.rsi
size: 2 size: 2
- type: Tag - type: Tag
tags: tags:
- RollingPaper - RollingPaper
- type: entity - type: entity
id: CigaretteFilter id: CigaretteFilter
name: cigarette filter name: cigarette filter
description: "A strip of firm paper used as a filter for handmade cigarettes." description: A strip of firm paper used as a filter for handmade cigarettes.
parent: BaseItem parent: BaseItem
components: components:
- type: Stack - type: Stack
stackType: CigaretteFilter stackType: CigaretteFilter
max: 5 max: 5
count: 1 count: 1
- type: Sprite - type: Sprite
sprite: Objects/Consumable/Smokeables/Cigarettes/paper.rsi sprite: Objects/Consumable/Smokeables/Cigarettes/paper.rsi
state: cigfilter state: cigfilter
- type: Item - type: Item
sprite: Objects/Consumable/Smokeables/Cigarettes/paper.rsi sprite: Objects/Consumable/Smokeables/Cigarettes/paper.rsi

View File

@@ -2,39 +2,39 @@
id: CigarCase id: CigarCase
parent: BaseItem parent: BaseItem
name: cigar case name: cigar case
description: "A case for holding your cigars when you are not smoking them." description: A case for holding your cigars when you are not smoking them.
components: components:
- type: Sprite - type: Sprite
netsync: false netsync: false
sprite: Objects/Consumable/Smokeables/Cigars/case.rsi sprite: Objects/Consumable/Smokeables/Cigars/case.rsi
layers: layers:
- state: closed - state: closed
- type: Storage - type: Storage
capacity: 8 capacity: 8
- type: Item - type: Item
sprite: Objects/Consumable/Smokeables/Cigars/case.rsi sprite: Objects/Consumable/Smokeables/Cigars/case.rsi
size: 8 size: 8
- type: StorageFill - type: StorageFill
contents: contents:
- id: Cigar - id: Cigar
amount: 8 amount: 8
- type: StorageCounter - type: StorageCounter
countTag: Cigar countTag: Cigar
- type: Appearance - type: Appearance
visuals: visuals:
- type: BagOpenCloseVisualizer - type: BagOpenCloseVisualizer
openIcon: open openIcon: open
- type: StackVisualizer - type: StackVisualizer
composite: true composite: true
stackLayers: stackLayers:
- cigar1 - cigar1
- cigar2 - cigar2
- cigar3 - cigar3
- cigar4 - cigar4
- cigar5 - cigar5
- cigar6 - cigar6
- cigar7 - cigar7
- cigar8 - cigar8
- type: entity - type: entity
id: CigarGoldCase id: CigarGoldCase
@@ -42,7 +42,7 @@
name: premium cigar case name: premium cigar case
description: "A case of premium Havanian cigars. You'll only see heads with these." description: "A case of premium Havanian cigars. You'll only see heads with these."
components: components:
- type: StorageFill - type: StorageFill
contents: contents:
- id: CigarGold - id: CigarGold
amount: 8 amount: 8

View File

@@ -26,7 +26,7 @@
id: CigarGold id: CigarGold
parent: Cigar parent: Cigar
name: premium Havanian cigar name: premium Havanian cigar
description: "A cigar fit for only the best of the best." description: A cigar fit for only the best of the best.
components: components:
- type: Sprite - type: Sprite
sprite: Objects/Consumable/Smokeables/Cigars/cigar-gold.rsi sprite: Objects/Consumable/Smokeables/Cigars/cigar-gold.rsi

View File

@@ -4,8 +4,8 @@
parent: BaseItem parent: BaseItem
abstract: true abstract: true
components: components:
- type: Smoking - type: Smoking
duration: 50 duration: 50
- type: Appearance - type: Appearance
visuals: visuals:
- type: BurnStateVisualizer - type: BurnStateVisualizer

View File

@@ -4,14 +4,14 @@
name: smoking pipe name: smoking pipe
description: "A pipe, for smoking. Probably made of meershaum or something." description: "A pipe, for smoking. Probably made of meershaum or something."
components: components:
- type: Smoking - type: Smoking
duration: 70 duration: 70
- type: Sprite - type: Sprite
sprite: Objects/Consumable/Smokeables/Pipes/pipe.rsi sprite: Objects/Consumable/Smokeables/Pipes/pipe.rsi
netsync: false netsync: false
state: unlit-icon state: unlit-icon
- type: Clothing - type: Clothing
sprite: Objects/Consumable/Smokeables/Pipes/pipe.rsi sprite: Objects/Consumable/Smokeables/Pipes/pipe.rsi
Slots: [ mask ] Slots: [ mask ]
HeldPrefix: unlit HeldPrefix: unlit
size: 1 size: 1

View File

@@ -3,52 +3,53 @@
parent: BaseItem parent: BaseItem
abstract: true abstract: true
components: components:
- type: Storage - type: Storage
capacity: 10 capacity: 10
- type: Item - type: Item
size: 6 size: 6
- type: entity - type: entity
name: match stick name: match stick
parent: BaseItem parent: BaseItem
id: Matchstick id: Matchstick
description: "A simple match stick, used for lighting fine smokables." description: A simple match stick, used for lighting fine smokables.
components: components:
- type: Sprite - type: Sprite
netsync: false netsync: false
sprite: Objects/Tools/matches.rsi sprite: Objects/Tools/matches.rsi
layers: layers:
- state: match_unlit - state: match_unlit
- type: Item - type: Item
size: 1 sprite: Objects/Tools/matches.rsi
sprite: Objects/Tools/matches.rsi HeldPrefix: unlit
- type: Matchstick size: 1
duration: 10 - type: Matchstick
igniteSound: duration: 10
path: /Audio/Items/match_strike.ogg igniteSound:
- type: PointLight path: /Audio/Items/match_strike.ogg
enabled: false - type: PointLight
radius: 1.1 enabled: false
color: darkorange radius: 1.1
- type: Appearance color: darkorange
visuals: - type: Appearance
- type: BurnStateVisualizer visuals:
unlitIcon: match_unlit - type: BurnStateVisualizer
litIcon: match_lit unlitIcon: match_unlit
burntIcon: match_burnt litIcon: match_lit
burntIcon: match_burnt
- type: entity - type: entity
name: match box name: match box
parent: SmallboxItem parent: SmallboxItem
id: Matchbox id: Matchbox
description: "A small box of Almost But Not Quite Plasma Premium Matches." description: A small box of Almost But Not Quite Plasma Premium Matches.
components: components:
- type: Matchbox - type: Matchbox
- type: Sprite - type: Sprite
sprite: Objects/Tools/matches.rsi sprite: Objects/Tools/matches.rsi
layers: layers:
- state: matchbox - state: matchbox
- type: StorageFill - type: StorageFill
contents: contents:
- id: Matchstick - id: Matchstick
amount: 6 amount: 6

Binary file not shown.

After

Width:  |  Height:  |  Size: 560 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B

View File

@@ -36,12 +36,64 @@
"name": "matchbox_e" "name": "matchbox_e"
}, },
{ {
"name": "inhand-left", "name": "unlit-inhand-left",
"directions": "4" "directions": 4
}, },
{ {
"name": "inhand-right", "name": "unlit-inhand-right",
"directions": "4" "directions": 4
},
{
"name": "lit-inhand-left",
"directions": 4,
"delays": [
[
0.2,
0.2,
0.2
],
[
0.2,
0.2,
0.2
],
[
0.2,
0.2,
0.2
],
[
0.2,
0.2,
0.2
]
]
},
{
"name": "lit-inhand-right",
"directions": 4,
"delays": [
[
0.2,
0.2,
0.2
],
[
0.2,
0.2,
0.2
],
[
0.2,
0.2,
0.2
],
[
0.2,
0.2,
0.2
]
]
} }
] ]
} }

View File

Before

Width:  |  Height:  |  Size: 220 B

After

Width:  |  Height:  |  Size: 220 B

View File

Before

Width:  |  Height:  |  Size: 265 B

After

Width:  |  Height:  |  Size: 265 B