Logs + fireplace fix + Trees (#158)

* add wooden log stacks

* setup wood material

* update trees

* fix fireplaces

* stack now properly works in fireplace system

* bonfire fix

* Update materials.yml

* Update base.yml
This commit is contained in:
Ed
2024-05-19 15:40:28 +03:00
committed by GitHub
parent 13d104c0de
commit 1ce32bd1c7
22 changed files with 359 additions and 53 deletions

View File

@@ -459,7 +459,7 @@ namespace Content.Server.Atmos.EntitySystems
_damageableSystem.TryChangeDamage(uid, flammable.Damage * flammable.FireStacks * ev.Multiplier, interruptsDoAfters: false);
AdjustFireStacks(uid, flammable.FirestackFade * (flammable.Resisting ? 10f : 1f), flammable);
AdjustFireStacks(uid, flammable.FirestackFade * (flammable.Resisting ? 10f : 1f), flammable, flammable.OnFire);
}
else
{

View File

@@ -1,8 +1,10 @@
using Content.Server.Atmos.Components;
using Content.Server.Atmos.EntitySystems;
using Content.Server.Popups;
using Content.Server.Stack;
using Content.Shared._CP14.Temperature;
using Content.Shared.Interaction;
using Content.Shared.Stacks;
using Content.Shared.Throwing;
using Robust.Server.Audio;
using Robust.Server.Containers;
@@ -18,8 +20,7 @@ public sealed partial class CP14FireplaceSystem : EntitySystem
[Dependency] private readonly AudioSystem _audio = default!;
[Dependency] private readonly ContainerSystem _containerSystem = default!;
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly FlammableSystem _flammable = default!;
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly StackSystem _stackSystem = default!;
public override void Initialize()
{
@@ -67,7 +68,14 @@ public sealed partial class CP14FireplaceSystem : EntitySystem
if (flammable.OnFire)
_audio.PlayPvs(component.InsertFuelSound, uid);
QueueDel(fuel);
if (TryComp<StackComponent>(fuel, out var stack))
{
_stackSystem.SetCount(fuel, stack.Count - 1);
}
else
{
QueueDel(fuel);
}
}
public override void Update(float frameTime)

View File

@@ -0,0 +1 @@
cp14-material-wood-log = wooden log

View File

@@ -0,0 +1 @@
cp14-material-wood-log = деревянное бревно

View File

@@ -278,6 +278,7 @@
- type: entity
parent: BaseTree
noSpawn: true
id: FloraTree01
name: tree
components:
@@ -286,6 +287,7 @@
- type: entity
parent: BaseTree
noSpawn: true
id: FloraTree02
name: tree
components:
@@ -294,6 +296,7 @@
- type: entity
parent: BaseTree
noSpawn: true
id: FloraTree03
name: tree
components:
@@ -302,6 +305,7 @@
- type: entity
parent: BaseTree
noSpawn: true
id: FloraTree04
name: tree
components:
@@ -310,6 +314,7 @@
- type: entity
parent: BaseTree
noSpawn: true
id: FloraTree05
name: tree
components:
@@ -318,6 +323,7 @@
- type: entity
parent: BaseTree
noSpawn: true
id: FloraTree06
name: tree
components:
@@ -383,6 +389,7 @@
- type: entity
parent: BaseTreeLarge
id: FloraTreeLarge01
noSpawn: true
name: large tree
components:
- type: Sprite
@@ -391,6 +398,7 @@
- type: entity
parent: BaseTreeLarge
id: FloraTreeLarge02
noSpawn: true
name: large tree
components:
- type: Sprite
@@ -399,6 +407,7 @@
- type: entity
parent: BaseTreeLarge
id: FloraTreeLarge03
noSpawn: true
name: large tree
components:
- type: Sprite
@@ -407,6 +416,7 @@
- type: entity
parent: BaseTreeLarge
id: FloraTreeLarge04
noSpawn: true
name: large tree
components:
- type: Sprite
@@ -415,6 +425,7 @@
- type: entity
parent: BaseTreeLarge
id: FloraTreeLarge05
noSpawn: true
name: large tree
components:
- type: Sprite
@@ -423,6 +434,7 @@
- type: entity
parent: BaseTreeLarge
id: FloraTreeLarge06
noSpawn: true
name: large tree
components:
- type: Sprite

View File

@@ -5,6 +5,6 @@
components:
- type: RandomSpawner
prototypes:
- CP14DirtBlock
- CP14DirtBlock1
chance: 1
deleteSpawnerAfterSpawn: false

View File

@@ -1,5 +1,5 @@
- type: entity
id: CP14DirtBlock
id: CP14DirtBlock1
parent: BaseItem
name: dirt block
description: A block of excellent black soil.
@@ -20,6 +20,7 @@
volume: 2
outputs:
- CP14FloorDirt
- type: Appearance
- type: Stack
stackType: CP14Dirt
count: 1
@@ -28,5 +29,61 @@
- dirt
- dirt_2
- dirt_3
# TODO material
- type: entity
id: CP14DirtBlock10
parent: CP14DirtBlock1
suffix: 10
components:
- type: Stack
count: 10
- type: entity
id: CP14WoodLog1
parent:
- BaseItem
- CP14BaseWooden
name: wooden log
description: A piece of unprocessed wood. Good material for building, or starting a fire.
components:
- type: Item
size: Normal
- type: Sprite
sprite: _CP14/Objects/Materials/logs.rsi
layers:
- state: log
map: ["base"]
- type: Appearance
# TODO material
- type: Stack
stackType: CP14WoodLog
count: 1
baseLayer: base
layerStates:
- log
- log_2
- log_3
- type: Material
- type: PhysicalComposition # точно ли это нужно?
materialComposition:
CP14WoodLog: 100
- type: Tag
tags:
- CP14FireplaceFuel
- Wooden
- type: Flammable
fireSpread: false
canResistFire: false
alwaysCombustible: true
canExtinguish: true
damage:
types:
Heat: 1
- type: entity
id: CP14WoodLog10
parent: CP14WoodLog1
suffix: 10
components:
- type: Stack
count: 10

View File

@@ -1,7 +0,0 @@
- type: entity
id: CP14Paper
parent: Paper
components:
- type: Tag
tags:
- CP14FireplaceFuel

View File

@@ -0,0 +1,186 @@
- type: entity
id: CP14BaseTree
abstract: true
name: tree
description: Decades of life and growth, saturating the surrounding nature with fresh air.
components:
- type: SpriteFade
- type: Clickable
- type: Sprite
noRot: true
sprite: Objects/Decoration/Flora/flora_trees.rsi
drawdepth: Overdoors
offset: 0,0.9
- type: Physics
bodyType: Static
- type: Fixtures
fixtures:
fix1:
shape:
!type:PhysShapeAabb
bounds: "-0.35,-0.4,0.35,0.4"
density: 1000
layer:
- WallLayer
- type: Damageable
damageContainer: Inorganic
damageModifierSet: Wood
- type: MeleeSound
soundGroups:
Brute:
path: /Audio/Effects/chop.ogg
params:
variation: 0.05
- type: Destructible
thresholds:
- trigger:
!type:DamageTrigger
damage: 400
behaviors:
- !type:DoActsBehavior
acts: [ "Destruction" ]
- trigger:
!type:DamageTrigger
damage: 200
behaviors:
- !type:PlaySoundBehavior
sound:
path: /Audio/Effects/tree_fell.ogg
params:
volume: 5
variation: 0.05
- !type:DoActsBehavior
acts: [ "Destruction" ]
- !type:SpawnEntitiesBehavior
spawn:
CP14WoodLog1:
min: 1
max: 3
- type: entity
parent: CP14BaseTree
id: CP14BaseTreeLarge
name: large tree
abstract: true
components:
- type: Sprite
sprite: Objects/Decoration/Flora/flora_treeslarge.rsi
offset: 0,1.55
- type: Fixtures
fixtures:
fix1:
shape:
!type:PhysShapeAabb
bounds: "-0.18,-0.35,0.18,0.35"
density: 2000
layer:
- WallLayer
- type: Destructible
thresholds:
- trigger:
!type:DamageTrigger
damage: 600
behaviors:
- !type:DoActsBehavior
acts: [ "Destruction" ]
- trigger:
!type:DamageTrigger
damage: 400
behaviors:
- !type:PlaySoundBehavior
sound:
path: /Audio/Effects/tree_fell.ogg
params:
volume: 5
variation: 0.05
- !type:DoActsBehavior
acts: [ "Destruction" ]
- !type:SpawnEntitiesBehavior
spawn:
CP14WoodLog1:
min: 3
max: 6
- type: entity
parent: CP14BaseTree
id: CP14FloraTree01
components:
- type: Sprite
state: tree01
- type: entity
parent: CP14BaseTree
id: CP14FloraTree02
components:
- type: Sprite
state: tree02
- type: entity
parent: CP14BaseTree
id: CP14FloraTree03
components:
- type: Sprite
state: tree03
- type: entity
parent: CP14BaseTree
id: CP14FloraTree04
components:
- type: Sprite
state: tree04
- type: entity
parent: CP14BaseTree
id: CP14FloraTree05
components:
- type: Sprite
state: tree05
- type: entity
parent: CP14BaseTree
id: CP14FloraTree06
components:
- type: Sprite
state: tree06
- type: entity
parent: CP14BaseTreeLarge
id: CP14FloraTreeLarge01
components:
- type: Sprite
state: treelarge01
- type: entity
parent: CP14BaseTreeLarge
id: CP14FloraTreeLarge02
components:
- type: Sprite
state: treelarge02
- type: entity
parent: CP14BaseTreeLarge
id: CP14FloraTreeLarge03
components:
- type: Sprite
state: treelarge03
- type: entity
parent: CP14BaseTreeLarge
id: CP14FloraTreeLarge04
components:
- type: Sprite
state: treelarge04
- type: entity
parent: CP14BaseTreeLarge
id: CP14FloraTreeLarge05
components:
- type: Sprite
state: treelarge05
- type: entity
parent: CP14BaseTreeLarge
id: CP14FloraTreeLarge06
components:
- type: Sprite
state: treelarge06

View File

@@ -30,7 +30,7 @@
Flammable: [ Touch ]
Extinguish: [ Touch ]
- type: Flammable
fireSpread: true
fireSpread: false
canResistFire: false
alwaysCombustible: true
canExtinguish: true

View File

@@ -88,21 +88,19 @@
frequency: 2
allowedTiles:
- CP14FloorGrass
entities: #TODO - own CP14 trees
- FloraTree01
- FloraTree02
- FloraTree03
- FloraTree04
- FloraTree05
- FloraTree06
- FloraTreeLarge01
- FloraTreeLarge02
- FloraTreeLarge03
- FloraTreeLarge04
- FloraTreeLarge05
- FloraTreeLarge06
- FloraTreeStump
- FloraTreeStump
entities:
- CP14FloraTree01
- CP14FloraTree02
- CP14FloraTree03
- CP14FloraTree04
- CP14FloraTree05
- CP14FloraTree06
- CP14FloraTreeLarge01
- CP14FloraTreeLarge02
- CP14FloraTreeLarge03
- CP14FloraTreeLarge04
- CP14FloraTreeLarge05
- CP14FloraTreeLarge06
- !type:BiomeEntityLayer # Rare Bloodgrass
threshold: 0.8
noise:
@@ -140,21 +138,19 @@
frequency: 2
allowedTiles:
- CP14FloorGrass
entities: #TODO - own CP14 trees
- FloraTree01
- FloraTree02
- FloraTree03
- FloraTree04
- FloraTree05
- FloraTree06
- FloraTreeLarge01
- FloraTreeLarge02
- FloraTreeLarge03
- FloraTreeLarge04
- FloraTreeLarge05
- FloraTreeLarge06
- FloraTreeStump
- FloraTreeStump
entities:
- CP14FloraTree01
- CP14FloraTree02
- CP14FloraTree03
- CP14FloraTree04
- CP14FloraTree05
- CP14FloraTree06
- CP14FloraTreeLarge01
- CP14FloraTreeLarge02
- CP14FloraTreeLarge03
- CP14FloraTreeLarge04
- CP14FloraTreeLarge05
- CP14FloraTreeLarge06
- type: biomeTemplate
id: CP14GrasslandHills # Холмы

View File

@@ -0,0 +1,8 @@
- type: material
id: CP14WoodLog
stackEntity: CP14WoodLog1
name: cp14-material-wood-log
unit: materials-unit-piece
icon: { sprite: _CP14/Objects/Materials/logs.rsi, state: log_2 }
color: "#874d3a"
price: 0 #?

View File

@@ -62,8 +62,8 @@
targetNode: CP14WallmountTorch
category: construction-category-furniture
icon:
sprite: _CP14/Structures/Furniture/wallmount_torch.rsi
state: fire
sprite: _CP14/Structures/wallmount_32icon.rsi
state: torch
objectType: Structure
placementMode: SnapgridCenter
canBuildInImpassable: false

View File

@@ -1,6 +0,0 @@
- type: stack
id: CP14Dirt
name: dirt block
spawn: CP14DirtBlock
maxCount: 10
itemSize: 5

View File

@@ -0,0 +1,15 @@
- type: stack
id: CP14Dirt
name: dirt block
spawn: CP14DirtBlock1
icon: { sprite: _CP14/Objects/Materials/dirt_block.rsi, state: dirt_2 }
maxCount: 10
itemSize: 5
- type: stack
id: CP14WoodLog
name: wooden log
spawn: CP14WoodLog1
icon: { sprite: _CP14/Objects/Materials/logs.rsi, state: log_2 }
maxCount: 10
itemSize: 5

View File

@@ -30,6 +30,7 @@
- 1.0
- 1.0
- 1.0
- 1.0
baseTurf: CP14FloorBase #Recursivle indestructible
isSubfloor: true
footstepSounds:

Binary file not shown.

After

Width:  |  Height:  |  Size: 359 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 556 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 710 B

View File

@@ -0,0 +1,20 @@
{
"version": 1,
"size": {
"x": 32,
"y": 32
},
"license": "CC-BY-SA-3.0",
"copyright": "Created by TheShuEd (Github) for CrystallPunk14",
"states": [
{
"name": "log"
},
{
"name": "log_2"
},
{
"name": "log_3"
}
]
}

View File

@@ -0,0 +1,14 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "Created by TheShuEd (Github) for CrystallPunk 14",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "torch"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B