Adds more splat and tweaks PuddleComponent.cs (#3942)

Co-authored-by: Paul Ritter <ritter.paul1@googlemail.com>
This commit is contained in:
Swept
2021-05-21 00:19:18 +00:00
committed by GitHub
parent 7523ec82dc
commit 74d044a4a9
11 changed files with 158 additions and 6 deletions

View File

@@ -104,6 +104,9 @@ namespace Content.Server.GameObjects.Components.Fluids
[DataField("recolor")] [DataField("recolor")]
private bool _recolor = default; private bool _recolor = default;
[DataField("state")]
private string _spriteState = "puddle";
private bool Slippery => Owner.TryGetComponent(out SlipperyComponent? slippery) && slippery.Slippery; private bool Slippery => Owner.TryGetComponent(out SlipperyComponent? slippery) && slippery.Slippery;
public override void Initialize() public override void Initialize()
@@ -122,10 +125,7 @@ namespace Content.Server.GameObjects.Components.Fluids
if (_spriteComponent.BaseRSIPath != null) if (_spriteComponent.BaseRSIPath != null)
{ {
var baseName = new ResourcePath(_spriteComponent.BaseRSIPath).FilenameWithoutExtension; _spriteComponent.LayerSetState(0, $"{_spriteState}-{randomVariant}");
_spriteComponent.LayerSetState(0, $"{baseName}-{randomVariant}"); // TODO: Remove hardcode
} }
// UpdateAppearance should get called soon after this so shouldn't need to call Dirty() here // UpdateAppearance should get called soon after this so shouldn't need to call Dirty() here

View File

@@ -41,6 +41,7 @@
state: gibblet-0 state: gibblet-0
- type: Puddle - type: Puddle
variants: 5 variants: 5
state: gibblet
- type: entity - type: entity
name: puddle name: puddle
@@ -53,6 +54,7 @@
state: smear-0 state: smear-0
- type: Puddle - type: Puddle
variants: 7 variants: 7
state: smear
- type: entity - type: entity
name: puddle name: puddle
@@ -65,6 +67,7 @@
state: splatter-0 state: splatter-0
- type: Puddle - type: Puddle
variants: 6 variants: 6
state: splatter
- type: entity - type: entity
name: vomit name: vomit
@@ -79,6 +82,7 @@
variants: 4 variants: 4
recolor: false recolor: false
evaporate_threshold: -1 evaporate_threshold: -1
state: vomit
- type: entity - type: entity
name: toxins vomit name: toxins vomit
@@ -92,6 +96,7 @@
- type: Puddle - type: Puddle
variants: 4 variants: 4
recolor: false recolor: false
state: vomit_toxin
- type: entity - type: entity
name: writing name: writing
@@ -104,3 +109,4 @@
state: writing-0 state: writing-0
- type: Puddle - type: Puddle
variants: 5 variants: 5
state: writing

View File

@@ -65,6 +65,7 @@
state: egg-0 state: egg-0
- type: Puddle - type: Puddle
variants: 4 variants: 4
state: egg
- type: entity - type: entity
name: eggshells name: eggshells
@@ -79,6 +80,12 @@
netsync: false netsync: false
- type: Item - type: Item
size: 1 size: 1
- type: SolutionContainer
maxVol: 1
contents:
reagents:
- ReagentId: Egg
Quantity: 1
# Egg # Egg

View File

@@ -1,5 +1,20 @@
# Lots of misc stuff in here, hard to parent it. # Lots of misc stuff in here, hard to parent it.
# Powder (For when you throw stuff like flour and it explodes)
- type: entity
name: flour
id: PuddleFlour
parent: PuddleBase
description: Call the janitor.
components:
- type: Sprite
sprite: Objects/Consumable/Food/ingredients.rsi
state: powder-0
color: white
- type: Puddle
state: powder
# Reagent Containers # Reagent Containers
- type: entity - type: entity
@@ -31,6 +46,26 @@
reagents: reagents:
- ReagentId: Flour - ReagentId: Flour
Quantity: 50 Quantity: 50
- type: DamageOnLand
amount: 1
- type: DamageOtherOnHit
amount: 1
- type: Damageable
- type: Destructible
thresholds:
- trigger:
!type:DamageTrigger
damage: 2
behaviors:
- !type:PlaySoundCollectionBehavior
soundCollection: desecration
- !type:SpawnEntitiesBehavior
spawn:
PuddleFlour:
min: 1
max: 1
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: entity - type: entity
parent: ReagentContainerBase parent: ReagentContainerBase
@@ -46,6 +81,26 @@
reagents: reagents:
- ReagentId: Flour - ReagentId: Flour
Quantity: 20 Quantity: 20
- type: DamageOnLand
amount: 1
- type: DamageOtherOnHit
amount: 1
- type: Damageable
- type: Destructible
thresholds:
- trigger:
!type:DamageTrigger
damage: 2
behaviors:
- !type:PlaySoundCollectionBehavior
soundCollection: desecration
- !type:SpawnEntitiesBehavior
spawn:
PuddleFlour:
min: 1
max: 1
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: entity - type: entity
parent: ReagentContainerBase parent: ReagentContainerBase

View File

@@ -243,6 +243,38 @@
reagents: reagents:
- ReagentId: JuiceTomato - ReagentId: JuiceTomato
Quantity: 10 Quantity: 10
- type: DamageOnLand
amount: 1
- type: DamageOtherOnHit
amount: 1
- type: Damageable
- type: Destructible
thresholds:
- trigger:
!type:DamageTrigger
damage: 1
behaviors:
- !type:PlaySoundCollectionBehavior
soundCollection: desecration
- !type:SpawnEntitiesBehavior
spawn:
PuddleTomato:
min: 1
max: 1
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: entity
name: tomato
id: PuddleTomato
parent: PuddleBase
description: Splat.
components:
- type: Sprite
sprite: Objects/Specific/Hydroponics/tomato.rsi
state: puddle-0
- type: Puddle
variants: 3
- type: entity - type: entity
name: eggplant name: eggplant

View File

@@ -64,6 +64,9 @@
{ {
"name": "pizzabread" "name": "pizzabread"
}, },
{
"name": "powder-0"
},
{ {
"name": "rice-big" "name": "rice-big"
}, },

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -1 +1,50 @@
{"version": 1, "size": {"x": 32, "y": 32}, "license": "CC-BY-SA-3.0", "copyright": "Taken from https://github.com/vgstation-coders/vgstation13 at 1dbcf389b0ec6b2c51b002df5fef8dd1519f8068", "states": [{"name": "dead", "delays": [[1.0]]}, {"name": "harvest", "delays": [[1.0]]}, {"name": "produce", "delays": [[1.0]]}, {"name": "seed", "delays": [[1.0]]}, {"name": "stage-1", "delays": [[1.0]]}, {"name": "stage-2", "delays": [[1.0]]}, {"name": "stage-3", "delays": [[1.0]]}, {"name": "stage-4", "delays": [[1.0]]}, {"name": "stage-5", "delays": [[1.0]]}, {"name": "stage-6", "delays": [[1.0]]}]} {
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "Taken from https://github.com/vgstation-coders/vgstation13 at 1dbcf389b0ec6b2c51b002df5fef8dd1519f8068",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "dead"
},
{
"name": "harvest"
},
{
"name": "produce"
},
{
"name": "seed"
},
{
"name": "puddle-0"
},
{
"name": "puddle-1"
},
{
"name": "puddle-2"
},
{
"name": "stage-1"
},
{
"name": "stage-2"
},
{
"name": "stage-3"
},
{
"name": "stage-4"
},
{
"name": "stage-5"
},
{
"name": "stage-6"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB