diff --git a/Content.Server/Atmos/EntitySystems/FlammableSystem.cs b/Content.Server/Atmos/EntitySystems/FlammableSystem.cs index c8699476e4..390bcab463 100644 --- a/Content.Server/Atmos/EntitySystems/FlammableSystem.cs +++ b/Content.Server/Atmos/EntitySystems/FlammableSystem.cs @@ -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 { diff --git a/Content.Server/_CP14/Temperature/Fireplace/CP14FireplaceSystem.cs b/Content.Server/_CP14/Temperature/Fireplace/CP14FireplaceSystem.cs index d4f0e4a4dc..02575a7a70 100644 --- a/Content.Server/_CP14/Temperature/Fireplace/CP14FireplaceSystem.cs +++ b/Content.Server/_CP14/Temperature/Fireplace/CP14FireplaceSystem.cs @@ -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(fuel, out var stack)) + { + _stackSystem.SetCount(fuel, stack.Count - 1); + } + else + { + QueueDel(fuel); + } } public override void Update(float frameTime) diff --git a/Resources/Locale/en-US/_CP14/materials/materials.ftl b/Resources/Locale/en-US/_CP14/materials/materials.ftl new file mode 100644 index 0000000000..bf5ed260a6 --- /dev/null +++ b/Resources/Locale/en-US/_CP14/materials/materials.ftl @@ -0,0 +1 @@ +cp14-material-wood-log = wooden log diff --git a/Resources/Locale/ru-RU/_CP14/materials/materials.ftl b/Resources/Locale/ru-RU/_CP14/materials/materials.ftl new file mode 100644 index 0000000000..64bfa4c2b4 --- /dev/null +++ b/Resources/Locale/ru-RU/_CP14/materials/materials.ftl @@ -0,0 +1 @@ +cp14-material-wood-log = деревянное бревно \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Objects/Decoration/flora.yml b/Resources/Prototypes/Entities/Objects/Decoration/flora.yml index f35d222d39..377b639ead 100644 --- a/Resources/Prototypes/Entities/Objects/Decoration/flora.yml +++ b/Resources/Prototypes/Entities/Objects/Decoration/flora.yml @@ -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 diff --git a/Resources/Prototypes/_CP14/Entities/Markers/Spawners/Random/misc.yml b/Resources/Prototypes/_CP14/Entities/Markers/Spawners/Random/misc.yml index 2333d0c49b..3e9c908355 100644 --- a/Resources/Prototypes/_CP14/Entities/Markers/Spawners/Random/misc.yml +++ b/Resources/Prototypes/_CP14/Entities/Markers/Spawners/Random/misc.yml @@ -5,6 +5,6 @@ components: - type: RandomSpawner prototypes: - - CP14DirtBlock + - CP14DirtBlock1 chance: 1 deleteSpawnerAfterSpawn: false \ No newline at end of file diff --git a/Resources/Prototypes/_CP14/Entities/Objects/Materials/simple.yml b/Resources/Prototypes/_CP14/Entities/Objects/Materials/simple.yml index c819601a9b..64b919441b 100644 --- a/Resources/Prototypes/_CP14/Entities/Objects/Materials/simple.yml +++ b/Resources/Prototypes/_CP14/Entities/Objects/Materials/simple.yml @@ -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 \ No newline at end of file + - 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 \ No newline at end of file diff --git a/Resources/Prototypes/_CP14/Entities/Objects/Misc/CP14Paper.yml b/Resources/Prototypes/_CP14/Entities/Objects/Misc/CP14Paper.yml deleted file mode 100644 index 6d208da6cd..0000000000 --- a/Resources/Prototypes/_CP14/Entities/Objects/Misc/CP14Paper.yml +++ /dev/null @@ -1,7 +0,0 @@ -- type: entity - id: CP14Paper - parent: Paper - components: - - type: Tag - tags: - - CP14FireplaceFuel diff --git a/Resources/Prototypes/_CP14/Entities/Structures/Flora/trees.yml b/Resources/Prototypes/_CP14/Entities/Structures/Flora/trees.yml new file mode 100644 index 0000000000..4e82649843 --- /dev/null +++ b/Resources/Prototypes/_CP14/Entities/Structures/Flora/trees.yml @@ -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 \ No newline at end of file diff --git a/Resources/Prototypes/_CP14/Entities/Structures/Specific/Alchemy/heater.yml b/Resources/Prototypes/_CP14/Entities/Structures/Specific/Alchemy/heater.yml index e3d33957fd..79a2eb6c37 100644 --- a/Resources/Prototypes/_CP14/Entities/Structures/Specific/Alchemy/heater.yml +++ b/Resources/Prototypes/_CP14/Entities/Structures/Specific/Alchemy/heater.yml @@ -30,7 +30,7 @@ Flammable: [ Touch ] Extinguish: [ Touch ] - type: Flammable - fireSpread: true + fireSpread: false canResistFire: false alwaysCombustible: true canExtinguish: true diff --git a/Resources/Prototypes/_CP14/Procedural/biomes_template_grasslands.yml b/Resources/Prototypes/_CP14/Procedural/biomes_template_grasslands.yml index 795ca7b5a3..e9c48d5755 100644 --- a/Resources/Prototypes/_CP14/Procedural/biomes_template_grasslands.yml +++ b/Resources/Prototypes/_CP14/Procedural/biomes_template_grasslands.yml @@ -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 # Холмы diff --git a/Resources/Prototypes/_CP14/Reagents/Materials/simple.yml b/Resources/Prototypes/_CP14/Reagents/Materials/simple.yml new file mode 100644 index 0000000000..9226257d87 --- /dev/null +++ b/Resources/Prototypes/_CP14/Reagents/Materials/simple.yml @@ -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 #? \ No newline at end of file diff --git a/Resources/Prototypes/_CP14/Recipes/Construction/furniture.yml b/Resources/Prototypes/_CP14/Recipes/Construction/furniture.yml index bf4c0890bb..7a3ef15193 100644 --- a/Resources/Prototypes/_CP14/Recipes/Construction/furniture.yml +++ b/Resources/Prototypes/_CP14/Recipes/Construction/furniture.yml @@ -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 diff --git a/Resources/Prototypes/_CP14/Stacks/floor_tile_stacks.yml b/Resources/Prototypes/_CP14/Stacks/floor_tile_stacks.yml deleted file mode 100644 index 1e8ee8f876..0000000000 --- a/Resources/Prototypes/_CP14/Stacks/floor_tile_stacks.yml +++ /dev/null @@ -1,6 +0,0 @@ -- type: stack - id: CP14Dirt - name: dirt block - spawn: CP14DirtBlock - maxCount: 10 - itemSize: 5 \ No newline at end of file diff --git a/Resources/Prototypes/_CP14/Stacks/materials.yml b/Resources/Prototypes/_CP14/Stacks/materials.yml new file mode 100644 index 0000000000..9c9db6356c --- /dev/null +++ b/Resources/Prototypes/_CP14/Stacks/materials.yml @@ -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 \ No newline at end of file diff --git a/Resources/Prototypes/_CP14/Tiles/base.yml b/Resources/Prototypes/_CP14/Tiles/base.yml index 7f7ea4abbf..61a71883cb 100644 --- a/Resources/Prototypes/_CP14/Tiles/base.yml +++ b/Resources/Prototypes/_CP14/Tiles/base.yml @@ -30,6 +30,7 @@ - 1.0 - 1.0 - 1.0 + - 1.0 baseTurf: CP14FloorBase #Recursivle indestructible isSubfloor: true footstepSounds: diff --git a/Resources/Textures/_CP14/Objects/Materials/logs.rsi/log.png b/Resources/Textures/_CP14/Objects/Materials/logs.rsi/log.png new file mode 100644 index 0000000000..8c52d0e40e Binary files /dev/null and b/Resources/Textures/_CP14/Objects/Materials/logs.rsi/log.png differ diff --git a/Resources/Textures/_CP14/Objects/Materials/logs.rsi/log_2.png b/Resources/Textures/_CP14/Objects/Materials/logs.rsi/log_2.png new file mode 100644 index 0000000000..21d2201052 Binary files /dev/null and b/Resources/Textures/_CP14/Objects/Materials/logs.rsi/log_2.png differ diff --git a/Resources/Textures/_CP14/Objects/Materials/logs.rsi/log_3.png b/Resources/Textures/_CP14/Objects/Materials/logs.rsi/log_3.png new file mode 100644 index 0000000000..83a2623a08 Binary files /dev/null and b/Resources/Textures/_CP14/Objects/Materials/logs.rsi/log_3.png differ diff --git a/Resources/Textures/_CP14/Objects/Materials/logs.rsi/meta.json b/Resources/Textures/_CP14/Objects/Materials/logs.rsi/meta.json new file mode 100644 index 0000000000..ef233f258a --- /dev/null +++ b/Resources/Textures/_CP14/Objects/Materials/logs.rsi/meta.json @@ -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" + } + ] +} \ No newline at end of file diff --git a/Resources/Textures/_CP14/Structures/wallmount_32icon.rsi/meta.json b/Resources/Textures/_CP14/Structures/wallmount_32icon.rsi/meta.json new file mode 100644 index 0000000000..52b8048b47 --- /dev/null +++ b/Resources/Textures/_CP14/Structures/wallmount_32icon.rsi/meta.json @@ -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" + } + ] +} diff --git a/Resources/Textures/_CP14/Structures/wallmount_32icon.rsi/torch.png b/Resources/Textures/_CP14/Structures/wallmount_32icon.rsi/torch.png new file mode 100644 index 0000000000..542701e6cf Binary files /dev/null and b/Resources/Textures/_CP14/Structures/wallmount_32icon.rsi/torch.png differ