diff --git a/Content.Server/_CP14/Temperature/CPFireSpreadComponent.cs b/Content.Server/_CP14/Temperature/CPFireSpreadComponent.cs new file mode 100644 index 0000000000..c3c193dd17 --- /dev/null +++ b/Content.Server/_CP14/Temperature/CPFireSpreadComponent.cs @@ -0,0 +1,39 @@ +namespace Content.Server._CP14.Temperature; + +/// +/// A component that allows fire to spread to nearby objects. The basic mechanics of a spreading fire +/// + +[RegisterComponent, Access(typeof(CPFireSpreadSystem))] +public sealed partial class CPFireSpreadComponent : Component +{ + /// + /// radius of ignition of neighboring objects + /// + [DataField] + public float Radius = 1f; + + /// + /// chance of spreading to neighboring properties + /// + [DataField] + public float Prob = 0.5f; + + /// + /// how often objects will try to set the neighbors on fire. In Seconds + /// + [DataField] + public float SpreadCooldownMin = 3f; + + /// + /// how often objects will try to set the neighbors on fire. In Seconds + /// + [DataField] + public float SpreadCooldownMax = 7f; + + /// + /// the time of the next fire spread + /// + [DataField] + public TimeSpan NextSpreadTime { get; set; } = TimeSpan.Zero; +} diff --git a/Content.Server/_CP14/Temperature/CPFireSpreadSystem.cs b/Content.Server/_CP14/Temperature/CPFireSpreadSystem.cs new file mode 100644 index 0000000000..9ab1027612 --- /dev/null +++ b/Content.Server/_CP14/Temperature/CPFireSpreadSystem.cs @@ -0,0 +1,60 @@ +using Content.Server.Atmos.Components; +using Content.Server.Atmos.EntitySystems; +using Content.Server.CrystallPunk.Temperature; +using Robust.Shared.Random; +using Robust.Shared.Timing; + +namespace Content.Server._CP14.Temperature; + +public sealed partial class CPFireSpreadSystem : EntitySystem +{ + + [Dependency] private readonly FlammableSystem _flammable = default!; + [Dependency] private readonly IGameTiming _gameTiming = default!; + [Dependency] private readonly EntityLookupSystem _lookup = default!; + [Dependency] private readonly SharedTransformSystem _transform = default!; + [Dependency] private readonly IRobustRandom _random = default!; + + + public override void Initialize() + { + SubscribeLocalEvent (OnCompInit); + } + + private void OnCompInit(Entity ent, ref OnFireChangedEvent args) + { + if (!args.OnFire) + return; + + var cooldown = _random.NextFloat(ent.Comp.SpreadCooldownMin, ent.Comp.SpreadCooldownMax); + ent.Comp.NextSpreadTime = _gameTiming.CurTime + TimeSpan.FromSeconds(cooldown); + } + + public override void Update(float frameTime) + { + base.Update(frameTime); + + var query = EntityQueryEnumerator(); + while (query.MoveNext(out var uid, out var spread, out var flammable)) + { + if (!flammable.OnFire) + continue; + + if (spread.NextSpreadTime < _gameTiming.CurTime) // Spread + { + var targets = _lookup.GetEntitiesInRange(_transform.GetMapCoordinates(uid), spread.Radius); + + foreach (var target in targets) + { + if (!_random.Prob(spread.Prob)) + continue; + + _flammable.Ignite(target, uid); + + var cooldown = _random.NextFloat(spread.SpreadCooldownMin, spread.SpreadCooldownMax); + spread.NextSpreadTime = _gameTiming.CurTime + TimeSpan.FromSeconds(cooldown); + } + } + } + } +} diff --git a/Content.Shared/_CP14/DayCycle/DayCycleComponent.cs b/Content.Shared/_CP14/DayCycle/DayCycleComponent.cs index c48b9af9bf..8203f24bee 100644 --- a/Content.Shared/_CP14/DayCycle/DayCycleComponent.cs +++ b/Content.Shared/_CP14/DayCycle/DayCycleComponent.cs @@ -1,7 +1,7 @@ using Robust.Shared.Serialization; -namespace Content.Shared.CrystallPunk.DayCycle; +namespace Content.Shared._CP14.DayCycle; /// /// Stores all the necessary data for the day and night cycle system to work diff --git a/Content.Shared/_CP14/DayCycle/DayCycleSystem.cs b/Content.Shared/_CP14/DayCycle/DayCycleSystem.cs index 31d8002dd3..f1ca774d8a 100644 --- a/Content.Shared/_CP14/DayCycle/DayCycleSystem.cs +++ b/Content.Shared/_CP14/DayCycle/DayCycleSystem.cs @@ -1,7 +1,7 @@ using Robust.Shared.Map.Components; using Robust.Shared.Timing; -namespace Content.Shared.CrystallPunk.DayCycle; +namespace Content.Shared._CP14.DayCycle; public sealed partial class DayCycleSystem : EntitySystem { @@ -26,7 +26,8 @@ public sealed partial class DayCycleSystem : EntitySystem private void OnMapInitDayCycle(Entity dayCycle, ref MapInitEvent args) { - if (dayCycle.Comp.TimeEntries == null || dayCycle.Comp.TimeEntries.Count == 0) return; + if (dayCycle.Comp.TimeEntries.Count == 0) + return; var currentEntry = dayCycle.Comp.TimeEntries[0]; @@ -41,7 +42,8 @@ public sealed partial class DayCycleSystem : EntitySystem var dayCycleQuery = EntityQueryEnumerator(); while (dayCycleQuery.MoveNext(out var uid, out var dayCycle, out var mapLight)) { - if (dayCycle.TimeEntries.Count <= 1) continue; + if (dayCycle.TimeEntries.Count <= 1) + continue; var curEntry = dayCycle.CurrentTimeEntry; var nextEntry = (curEntry + 1 >= dayCycle.TimeEntries.Count) ? 0 : (curEntry + 1); @@ -62,7 +64,7 @@ public sealed partial class DayCycleSystem : EntitySystem { dayCycle.CurrentTimeEntry = nextEntry; dayCycle.EntryStartTime = dayCycle.EntryEndTime; - dayCycle.EntryEndTime = dayCycle.EntryEndTime + dayCycle.TimeEntries[nextEntry].Duration; + dayCycle.EntryEndTime += dayCycle.TimeEntries[nextEntry].Duration; if (dayCycle.IsNight && !dayCycle.TimeEntries[curEntry].IsNight) // Day started { @@ -82,14 +84,12 @@ public sealed partial class DayCycleSystem : EntitySystem public static float GetLerpValue(float start, float end, float current) { - if (start == end) + if (Math.Abs(start - end) < 0.05f) return 0f; - else - { - float distanceFromStart = current - start; - float totalDistance = end - start; - return MathHelper.Clamp01(distanceFromStart / totalDistance); - } + var distanceFromStart = current - start; + var totalDistance = end - start; + + return MathHelper.Clamp01(distanceFromStart / totalDistance); } } diff --git a/Resources/Prototypes/Entities/Objects/Misc/tiles.yml b/Resources/Prototypes/Entities/Objects/Misc/tiles.yml index 3b2e4cd8f1..59fc95d61c 100644 --- a/Resources/Prototypes/Entities/Objects/Misc/tiles.yml +++ b/Resources/Prototypes/Entities/Objects/Misc/tiles.yml @@ -45,6 +45,7 @@ name: steel tile parent: FloorTileItemBase id: FloorTileItemSteel + noSpawn: true components: - type: Sprite state: steel @@ -64,6 +65,7 @@ name: steel dark checker tile parent: FloorTileItemSteel id: FloorTileItemSteelCheckerDark + noSpawn: true components: - type: Sprite state: checker-dark @@ -76,6 +78,7 @@ name: steel light checker tile parent: FloorTileItemSteel id: FloorTileItemSteelCheckerLight + noSpawn: true components: - type: Sprite state: checker-light @@ -88,6 +91,7 @@ name: steel tile parent: FloorTileItemBase id: FloorTileItemMetalDiamond + noSpawn: true components: - type: Sprite state: metaldiamond @@ -107,6 +111,7 @@ name: wood floor parent: FloorTileItemBase id: FloorTileItemWood + noSpawn: true components: - type: Sprite state: wood @@ -126,6 +131,7 @@ name: white tile parent: FloorTileItemBase id: FloorTileItemWhite + noSpawn: true components: - type: Sprite state: white @@ -145,6 +151,7 @@ name: dark tile parent: FloorTileItemBase id: FloorTileItemDark + noSpawn: true components: - type: Sprite state: dark @@ -164,6 +171,7 @@ name: techmaint floor parent: FloorTileItemBase id: FloorTileItemTechmaint + noSpawn: true components: - type: Sprite state: techfloor @@ -180,6 +188,7 @@ name: reinforced tile parent: FloorTileItemBase id: FloorTileItemReinforced + noSpawn: true components: - type: Sprite state: reinforced @@ -198,6 +207,7 @@ name: mono tile parent: FloorTileItemBase id: FloorTileItemMono + noSpawn: true components: - type: Sprite state: monofloor @@ -214,6 +224,7 @@ name: linoleum floor parent: FloorTileItemBase id: FloorTileItemLino + noSpawn: true components: - type: Sprite state: lino @@ -230,6 +241,7 @@ name: filled brass plate parent: FloorTileItemBase id: FloorTileItemBrassFilled + noSpawn: true components: - type: Sprite state: brass-filled @@ -249,6 +261,7 @@ name: smooth brass plate parent: FloorTileItemBase id: FloorTileItemBrassReebe + noSpawn: true components: - type: Sprite state: reebe @@ -268,6 +281,7 @@ name: dirty tile parent: FloorTileItemBase id: FloorTileItemDirty + noSpawn: true components: - type: Sprite state: dirty @@ -284,6 +298,7 @@ name: elevator shaft tile parent: FloorTileItemBase id: FloorTileItemElevatorShaft + noSpawn: true components: - type: Sprite state: dark @@ -300,6 +315,7 @@ name: rock vault tile parent: FloorTileItemBase id: FloorTileItemRockVault + noSpawn: true components: - type: Sprite state: rockvault @@ -316,6 +332,7 @@ name: blue tile parent: FloorTileItemBase id: FloorTileItemBlue + noSpawn: true components: - type: Sprite state: blue @@ -332,6 +349,7 @@ name: lime tile parent: FloorTileItemBase id: FloorTileItemLime + noSpawn: true components: - type: Sprite state: lime @@ -348,6 +366,7 @@ name: mining tile parent: FloorTileItemBase id: FloorTileItemMining + noSpawn: true components: - type: Sprite state: mining @@ -364,6 +383,7 @@ name: dark mining tile parent: FloorTileItemBase id: FloorTileItemMiningDark + noSpawn: true components: - type: Sprite state: miningdark @@ -380,6 +400,7 @@ name: light mining tile parent: FloorTileItemBase id: FloorTileItemMiningLight + noSpawn: true components: - type: Sprite state: mininglight @@ -397,6 +418,7 @@ name: freezer tile parent: FloorTileItemBase id: FloorTileItemFreezer + noSpawn: true components: - type: Sprite state: showroom @@ -413,6 +435,7 @@ name: showroom tile parent: FloorTileItemBase id: FloorTileItemShowroom + noSpawn: true components: - type: Sprite state: showroom @@ -429,6 +452,7 @@ name: hydro tile parent: FloorTileItemBase id: FloorTileItemHydro + noSpawn: true components: - type: Sprite state: hydro @@ -445,6 +469,7 @@ name: bar tile parent: FloorTileItemBase id: FloorTileItemBar + noSpawn: true components: - type: Sprite state: bar @@ -461,6 +486,7 @@ name: clown tile parent: FloorTileItemBase id: FloorTileItemClown + noSpawn: true components: - type: Sprite state: clown @@ -477,6 +503,7 @@ name: mime tile parent: FloorTileItemBase id: FloorTileItemMime + noSpawn: true components: - type: Sprite state: mime @@ -493,6 +520,7 @@ name: kitchen tile parent: FloorTileItemBase id: FloorTileItemKitchen + noSpawn: true components: - type: Sprite state: kitchen @@ -509,6 +537,7 @@ name: laundry tile parent: FloorTileItemBase id: FloorTileItemLaundry + noSpawn: true components: - type: Sprite state: laundry @@ -525,6 +554,7 @@ - type: entity parent: FloorTileItemBase id: FloorTileItemConcrete + noSpawn: true name: concrete tile components: - type: Sprite @@ -542,6 +572,7 @@ parent: FloorTileItemBase id: FloorTileItemGrayConcrete name: gray concrete tile + noSpawn: true components: - type: Sprite state: grayconcrete @@ -558,6 +589,7 @@ parent: FloorTileItemBase id: FloorTileItemOldConcrete name: old concrete tile + noSpawn: true components: - type: Sprite state: oldconcrete @@ -575,6 +607,7 @@ name: blue arcade floor parent: FloorTileItemBase id: FloorTileItemArcadeBlue + noSpawn: true components: - type: Sprite state: arcadeblue @@ -591,6 +624,7 @@ name: blue arcade floor parent: FloorTileItemBase id: FloorTileItemArcadeBlue2 + noSpawn: true components: - type: Sprite state: arcadeblue2 @@ -607,6 +641,7 @@ name: red arcade floor parent: FloorTileItemBase id: FloorTileItemArcadeRed + noSpawn: true components: - type: Sprite state: arcadered @@ -623,6 +658,7 @@ name: eighties floor parent: FloorTileItemBase id: FloorTileItemEighties + noSpawn: true components: - type: Sprite state: eighties @@ -639,6 +675,7 @@ name: clown carpet floor parent: FloorTileItemBase id: FloorTileItemCarpetClown + noSpawn: true components: - type: Sprite state: carpetclown @@ -655,6 +692,7 @@ name: office carpet floor parent: FloorTileItemBase id: FloorTileItemCarpetOffice + noSpawn: true components: - type: Sprite state: carpetoffice @@ -671,6 +709,7 @@ name: boxing ring floor parent: FloorTileItemBase id: FloorTileItemBoxing + noSpawn: true components: - type: Sprite state: boxing @@ -687,6 +726,7 @@ name: gym floor parent: FloorTileItemBase id: FloorTileItemGym + noSpawn: true components: - type: Sprite state: gym @@ -704,6 +744,7 @@ name: white shuttle floor parent: FloorTileItemBase id: FloorTileItemShuttleWhite + noSpawn: true components: - type: Sprite state: shuttlewhite @@ -720,6 +761,7 @@ name: blue shuttle floor parent: FloorTileItemBase id: FloorTileItemShuttleBlue + noSpawn: true components: - type: Sprite state: shuttleblue @@ -736,6 +778,7 @@ name: orange shuttle floor parent: FloorTileItemBase id: FloorTileItemShuttleOrange + noSpawn: true components: - type: Sprite state: shuttleorange @@ -752,6 +795,7 @@ name: purple shuttle floor parent: FloorTileItemBase id: FloorTileItemShuttlePurple + noSpawn: true components: - type: Sprite state: shuttlepurple @@ -768,6 +812,7 @@ name: red shuttle floor parent: FloorTileItemBase id: FloorTileItemShuttleRed + noSpawn: true components: - type: Sprite state: shuttlered @@ -784,6 +829,7 @@ name: grey shuttle floor parent: FloorTileItemBase id: FloorTileItemShuttleGrey + noSpawn: true components: - type: Sprite state: shuttlegrey @@ -800,6 +846,7 @@ name: black shuttle floor parent: FloorTileItemBase id: FloorTileItemShuttleBlack + noSpawn: true components: - type: Sprite state: shuttleblack @@ -817,6 +864,7 @@ name: gold floor parent: FloorTileItemBase id: FloorTileItemGold + noSpawn: true components: - type: Sprite state: gold @@ -833,6 +881,7 @@ name: silver tile parent: FloorTileItemBase id: FloorTileItemSilver + noSpawn: true components: - type: Sprite state: silver @@ -850,6 +899,7 @@ name: green circuit floor parent: FloorTileItemBase id: FloorTileItemGCircuit + noSpawn: true components: - type: Sprite state: gcircuit @@ -866,6 +916,7 @@ name: blue circuit floor parent: FloorTileItemBase id: FloorTileItemBCircuit + noSpawn: true components: - type: Sprite state: bcircuit @@ -883,6 +934,7 @@ - type: entity parent: FloorTileItemGCircuit id: FloorTileItemGCircuit4 + noSpawn: true suffix: 4 components: - type: Stack @@ -891,6 +943,7 @@ - type: entity parent: FloorTileItemBCircuit id: FloorTileItemBCircuit4 + noSpawn: true suffix: 4 components: - type: Stack @@ -901,6 +954,7 @@ name: grass tile parent: FloorTileItemBase id: FloorTileItemGrass + noSpawn: true components: - type: Sprite state: grass @@ -917,6 +971,7 @@ name: jungle grass tile parent: FloorTileItemBase id: FloorTileItemGrassJungle + noSpawn: true components: - type: Sprite state: grassjungle @@ -933,6 +988,7 @@ name: snow tile parent: FloorTileItemBase id: FloorTileItemSnow + noSpawn: true components: - type: Sprite state: snow @@ -949,6 +1005,7 @@ name: wood pattern floor parent: FloorTileItemBase id: FloorTileItemWoodPattern + noSpawn: true components: - type: Sprite state: woodpatternfloor @@ -965,6 +1022,7 @@ id: FloorTileItemFlesh parent: FloorTileItemBase name: flesh floor + noSpawn: true components: - type: Sprite state: meat @@ -984,6 +1042,7 @@ name: steel maint floor parent: FloorTileItemBase id: FloorTileItemSteelMaint + noSpawn: true components: - type: Sprite state: steelmaintfloor @@ -1000,6 +1059,7 @@ name: grating maint floor parent: FloorTileItemBase id: FloorTileItemGratingMaint + noSpawn: true components: - type: Sprite state: gratingmaintfloor @@ -1016,6 +1076,7 @@ name: web tile parent: FloorTileItemBase id: FloorTileItemWeb + noSpawn: true components: - type: Sprite sprite: Objects/Tiles/web.rsi @@ -1036,6 +1097,7 @@ parent: FloorTileItemBase name: astro-grass description: Fake grass that covers up wires and even comes with realistic NanoTrimmings! + noSpawn: true components: - type: Sprite state: astrograss @@ -1053,6 +1115,7 @@ parent: FloorTileItemBase name: mowed astro-grass description: Fake grass that covers up wires and even comes with realistic NanoTrimmings! + noSpawn: true components: - type: Sprite state: grass @@ -1070,6 +1133,7 @@ parent: FloorTileItemBase name: jungle astro-grass description: Fake grass that covers up wires and even comes with realistic NanoTrimmings! + noSpawn: true components: - type: Sprite state: grassjungle @@ -1087,6 +1151,7 @@ parent: FloorTileItemBase name: astro-ice description: Fake ice that's as slippery as the real thing, while being easily removable! + noSpawn: true components: - type: Sprite state: astroice @@ -1104,6 +1169,7 @@ parent: FloorTileItemBase name: astro-snow description: Fake snow that's as fluffy as the real thing, while being easily removable! + noSpawn: true components: - type: Sprite state: snow diff --git a/Resources/Prototypes/_CP14/Entities/Structures/Floors/floors.yml b/Resources/Prototypes/_CP14/Entities/Structures/Floors/floors.yml new file mode 100644 index 0000000000..91f3264354 --- /dev/null +++ b/Resources/Prototypes/_CP14/Entities/Structures/Floors/floors.yml @@ -0,0 +1,115 @@ +- type: entity + id: CPFloorBase + abstract: true + parent: BaseStructure + components: + - type: PlacementReplacement + key: CPfloor + - type: Sprite + drawdepth: FloorTiles + - type: Physics + - type: Transform + anchored: true + noRot: true + - type: BlockWeather + - type: Damageable + damageContainer: Inorganic + - type: Tag + tags: + - HideContextMenu + - type: Destructible + thresholds: + - trigger: + !type:DamageTrigger + damage: 10 + behaviors: + - !type:DoActsBehavior + acts: [ "Destruction" ] + - type: Fixtures + fixtures: + fix1: + shape: + !type:PhysShapeAabb + bounds: "-0.45,-0.45,0.45,0.45" + density: 60 + mask: + - MachineMask + layer: + - MidImpassable + - LowImpassable + hard: false + +- type: entity + id: CPFloorWood + parent: + - CPFloorBase + - CPBaseWooden + name: wooden floor + description: simple, flammable boards. + components: + - type: Sprite + sprite: _CP14/Structures/Floors/wood.rsi + layers: + - state: wood_1 + map: ["random"] + - type: RandomSprite + available: + - random: + wood_1: "" + wood_2: "" + wood_3: "" + wood_4: "" + - type: FootstepModifier + footstepSoundCollection: + collection: FootstepFloor + params: + volume: 8 + - type: Damageable + damageContainer: Inorganic + damageModifierSet: Wood + - type: Destructible + thresholds: + - trigger: + !type:DamageTypeTrigger + damageType: Heat + damage: 10 + behaviors: + - !type:DoActsBehavior + acts: ["Destruction"] + - !type:PlaySoundBehavior + sound: + collection: WoodDestroy + - trigger: + !type:DamageTrigger + damage: 15 + behaviors: + - !type:DoActsBehavior + acts: ["Destruction"] + - !type:PlaySoundBehavior + sound: + collection: WoodDestroy + - !type:SpawnEntitiesBehavior + spawn: + MaterialWoodPlank: + min: 0 + max: 1 + - type: FireVisuals + sprite: _CP14/Effects/fire.rsi + normalState: full + +- type: entity + parent: CPFloorWood + id: CPFloorWoodBig + components: + - type: Sprite + sprite: _CP14/Structures/Floors/wood_big.rsi + layers: + - state: wood_big_1 + map: ["random"] + - type: RandomSprite + available: + - random: + wood_big_1: "" + wood_big_2: "" + wood_big_3: "" + wood_big_4: "" \ No newline at end of file diff --git a/Resources/Prototypes/_CP14/Entities/Structures/Furniture/chairs.yml b/Resources/Prototypes/_CP14/Entities/Structures/Furniture/chairs.yml index adf52b7a04..79e6a4931d 100644 --- a/Resources/Prototypes/_CP14/Entities/Structures/Furniture/chairs.yml +++ b/Resources/Prototypes/_CP14/Entities/Structures/Furniture/chairs.yml @@ -2,21 +2,34 @@ name: wooden chair description: Made of the most common planks. Simple and effective! id: CPChairWooden - parent: UnanchoredChairBase + parent: + - UnanchoredChairBase + - CPBaseWooden components: + - type: Damageable + damageContainer: Inorganic + damageModifierSet: Wood - type: Sprite sprite: _CP14/Structures/Furniture/chairs.rsi state: wooden - type: Construction graph: CPSeat node: CPChairWooden - - type: Damageable - damageModifierSet: Wood - type: Destructible thresholds: + - trigger: + !type:DamageTypeTrigger + damageType: Heat + damage: 20 + behaviors: + - !type:DoActsBehavior + acts: ["Destruction"] + - !type:PlaySoundBehavior + sound: + collection: WoodDestroy - trigger: !type:DamageTrigger - damage: 25 + damage: 30 behaviors: - !type:DoActsBehavior acts: ["Destruction"] @@ -27,7 +40,4 @@ spawn: MaterialWoodPlank: min: 1 - max: 1 - - type: Tag - tags: - - Wooden \ No newline at end of file + max: 1 \ No newline at end of file diff --git a/Resources/Prototypes/_CP14/Entities/Structures/Furniture/tables.yml b/Resources/Prototypes/_CP14/Entities/Structures/Furniture/tables.yml index 5c95275f56..1c0b0e8ea8 100644 --- a/Resources/Prototypes/_CP14/Entities/Structures/Furniture/tables.yml +++ b/Resources/Prototypes/_CP14/Entities/Structures/Furniture/tables.yml @@ -1,33 +1,41 @@ - type: entity - parent: TableBase + parent: + - TableBase + - CPBaseWooden id: CPTableWooden name: wooden table description: A simple table made of boards. components: - type: Sprite sprite: _CP14/Structures/Furniture/Tables/wood.rsi + state: full - type: Icon sprite: _CP14/Structures/Furniture/Tables/wood.rsi + state: full - type: Construction graph: CPTable node: CPTableWooden - type: Damageable + damageContainer: Inorganic damageModifierSet: Wood - type: Destructible thresholds: - trigger: - !type:DamageTrigger - damage: 100 - behaviors: #excess damage (nuke?). avoid computational cost of spawning entities. + !type:DamageTypeTrigger + damageType: Heat + damage: 40 + behaviors: - !type:DoActsBehavior - acts: [ "Destruction" ] + acts: ["Destruction"] - !type:PlaySoundBehavior sound: - collection: GlassBreak + collection: WoodDestroy - trigger: !type:DamageTrigger - damage: 15 + damage: 60 behaviors: + - !type:DoActsBehavior + acts: ["Destruction"] - !type:PlaySoundBehavior sound: collection: WoodDestroy @@ -36,14 +44,12 @@ MaterialWoodPlank: min: 1 max: 1 - - !type:DoActsBehavior - acts: [ "Destruction" ] - - type: Tag - tags: - - Wooden - type: FootstepModifier footstepSoundCollection: collection: FootstepWood - type: IconSmooth key: state - base: state \ No newline at end of file + base: state + - type: FireVisuals + sprite: _CP14/Effects/fire.rsi + normalState: full \ No newline at end of file diff --git a/Resources/Prototypes/_CP14/Entities/Structures/Storage/Crates/chests.yml b/Resources/Prototypes/_CP14/Entities/Structures/Storage/Crates/chests.yml index 36b2fcc13d..f26c6995c9 100644 --- a/Resources/Prototypes/_CP14/Entities/Structures/Storage/Crates/chests.yml +++ b/Resources/Prototypes/_CP14/Entities/Structures/Storage/Crates/chests.yml @@ -1,11 +1,14 @@ - type: entity - parent: CPChestGeneric + parent: + - CPChestGeneric + - CPBaseWooden id: CPWoodenChest name: wooden chest description: Good wooden chest. components: - type: Icon sprite: _CP14/Structures/Storage/Crates/woodenchest.rsi + state: icon - type: Sprite sprite: _CP14/Structures/Storage/Crates/woodenchest.rsi layers: @@ -14,9 +17,20 @@ - state: closed map: ["enum.StorageVisualLayers.Door"] - type: Damageable - damageModifierSet: Web + damageContainer: Inorganic + damageModifierSet: Wood - type: Destructible thresholds: + - trigger: + !type:DamageTypeTrigger + damageType: Heat + damage: 100 + behaviors: + - !type:DoActsBehavior + acts: ["Destruction"] + - !type:PlaySoundBehavior + sound: + collection: WoodDestroy - trigger: !type:DamageTrigger damage: 150 diff --git a/Resources/Prototypes/_CP14/Entities/Structures/Walls/walls.yml b/Resources/Prototypes/_CP14/Entities/Structures/Walls/walls.yml index b1b113bb6c..aaf0678f9a 100644 --- a/Resources/Prototypes/_CP14/Entities/Structures/Walls/walls.yml +++ b/Resources/Prototypes/_CP14/Entities/Structures/Walls/walls.yml @@ -42,16 +42,51 @@ - type: entity id: CPWoodFullWall name: wooden wall - parent: CPBaseWall + parent: + - CPBaseWall + - CPBaseWooden description: Board to board, and together they form protection and comfort. components: - type: Sprite sprite: _CP14/Structures/Walls/wood_full.rsi - type: Icon sprite: _CP14/Structures/Walls/wood_full.rsi + state: full - type: IconSmooth key: CPwallswood base: wood + - type: Damageable + damageContainer: Inorganic + damageModifierSet: Wood + - type: Destructible + thresholds: + - trigger: + !type:DamageTypeTrigger + damageType: Heat + damage: 150 + behaviors: + - !type:DoActsBehavior + acts: ["Destruction"] + - !type:PlaySoundBehavior + sound: + collection: WoodDestroy + - trigger: + !type:DamageTrigger + damage: 200 + behaviors: + - !type:DoActsBehavior + acts: ["Destruction"] + - !type:PlaySoundBehavior + sound: + collection: WoodDestroy + - !type:SpawnEntitiesBehavior + spawn: + MaterialWoodPlank: + min: 2 + max: 3 + - type: FireVisuals + sprite: _CP14/Effects/fire.rsi + normalState: full - type: entity id: CPCaveStoneWall diff --git a/Resources/Prototypes/_CP14/Entities/base.yml b/Resources/Prototypes/_CP14/Entities/base.yml new file mode 100644 index 0000000000..f80ee3118a --- /dev/null +++ b/Resources/Prototypes/_CP14/Entities/base.yml @@ -0,0 +1,38 @@ +- type: entity + id: CPBaseWooden + abstract: true + components: + - type: Damageable + damageContainer: Inorganic + damageModifierSet: Wood + - type: Tag + tags: + - Wooden + - type: CPFlammableAmbientSound + - type: AmbientSound + enabled: false + volume: -5 + range: 5 + sound: + path: /Audio/Ambience/Objects/fireplace.ogg #TODO replace + - type: Appearance + - type: Reactive + groups: + Flammable: [ Touch ] + Extinguish: [ Touch ] + - type: Flammable + fireSpread: true + canResistFire: false + alwaysCombustible: true + canExtinguish: true + firestacksOnIgnite: 0.5 + firestackFade: 0.3 + firestackFadeOnIgnite: 0.3 + firestackFadeFade: -0.2 + damage: + types: + Heat: 0.5 + - type: FireVisuals + sprite: _CP14/Effects/fire.rsi + normalState: small + - type: CPFireSpread \ No newline at end of file diff --git a/Resources/Textures/_CP14/Effects/fire.rsi/full.png b/Resources/Textures/_CP14/Effects/fire.rsi/full.png new file mode 100644 index 0000000000..db214c44de Binary files /dev/null and b/Resources/Textures/_CP14/Effects/fire.rsi/full.png differ diff --git a/Resources/Textures/_CP14/Effects/fire.rsi/meta.json b/Resources/Textures/_CP14/Effects/fire.rsi/meta.json new file mode 100644 index 0000000000..5bdafa8a07 --- /dev/null +++ b/Resources/Textures/_CP14/Effects/fire.rsi/meta.json @@ -0,0 +1,32 @@ +{ + "version": 1, + "license": "CC-BY-SA-3.0", + "copyright": "Created by TheShuEd for CrystallPunk14", + "size": { + "x": 32, + "y": 32 + }, + "states": [ + { + "name": "full", + "delays": [ + [ + 0.3, + 0.3, + 0.3, + 0.3 + ] + ] + }, + { + "name": "small", + "delays": [ + [ + 0.3, + 0.3, + 0.3 + ] + ] + } + ] +} \ No newline at end of file diff --git a/Resources/Textures/_CP14/Effects/fire.rsi/small.png b/Resources/Textures/_CP14/Effects/fire.rsi/small.png new file mode 100644 index 0000000000..0a233ca036 Binary files /dev/null and b/Resources/Textures/_CP14/Effects/fire.rsi/small.png differ diff --git a/Resources/Textures/_CP14/Structures/Floors/wood.rsi/wood_1.png b/Resources/Textures/_CP14/Structures/Floors/wood.rsi/wood_1.png index f28adb738d..bc641e68c0 100644 Binary files a/Resources/Textures/_CP14/Structures/Floors/wood.rsi/wood_1.png and b/Resources/Textures/_CP14/Structures/Floors/wood.rsi/wood_1.png differ diff --git a/Resources/Textures/_CP14/Structures/Floors/wood.rsi/wood_2.png b/Resources/Textures/_CP14/Structures/Floors/wood.rsi/wood_2.png index 5e27c3be6f..03bdae67c7 100644 Binary files a/Resources/Textures/_CP14/Structures/Floors/wood.rsi/wood_2.png and b/Resources/Textures/_CP14/Structures/Floors/wood.rsi/wood_2.png differ diff --git a/Resources/Textures/_CP14/Structures/Floors/wood.rsi/wood_3.png b/Resources/Textures/_CP14/Structures/Floors/wood.rsi/wood_3.png index e9769c9391..d4e0399569 100644 Binary files a/Resources/Textures/_CP14/Structures/Floors/wood.rsi/wood_3.png and b/Resources/Textures/_CP14/Structures/Floors/wood.rsi/wood_3.png differ diff --git a/Resources/Textures/_CP14/Structures/Floors/wood.rsi/wood_4.png b/Resources/Textures/_CP14/Structures/Floors/wood.rsi/wood_4.png index 2529eaa5ab..fa5985ad8a 100644 Binary files a/Resources/Textures/_CP14/Structures/Floors/wood.rsi/wood_4.png and b/Resources/Textures/_CP14/Structures/Floors/wood.rsi/wood_4.png differ diff --git a/Resources/Textures/_CP14/Structures/Floors/wood_big.rsi/wood_big_1.png b/Resources/Textures/_CP14/Structures/Floors/wood_big.rsi/wood_big_1.png index bcb7d680f5..6249ffa80f 100644 Binary files a/Resources/Textures/_CP14/Structures/Floors/wood_big.rsi/wood_big_1.png and b/Resources/Textures/_CP14/Structures/Floors/wood_big.rsi/wood_big_1.png differ diff --git a/Resources/Textures/_CP14/Structures/Floors/wood_big.rsi/wood_big_2.png b/Resources/Textures/_CP14/Structures/Floors/wood_big.rsi/wood_big_2.png index bcb7d680f5..6249ffa80f 100644 Binary files a/Resources/Textures/_CP14/Structures/Floors/wood_big.rsi/wood_big_2.png and b/Resources/Textures/_CP14/Structures/Floors/wood_big.rsi/wood_big_2.png differ diff --git a/Resources/Textures/_CP14/Structures/Floors/wood_big.rsi/wood_big_3.png b/Resources/Textures/_CP14/Structures/Floors/wood_big.rsi/wood_big_3.png index bcb7d680f5..6249ffa80f 100644 Binary files a/Resources/Textures/_CP14/Structures/Floors/wood_big.rsi/wood_big_3.png and b/Resources/Textures/_CP14/Structures/Floors/wood_big.rsi/wood_big_3.png differ diff --git a/Resources/Textures/_CP14/Structures/Floors/wood_big.rsi/wood_big_4.png b/Resources/Textures/_CP14/Structures/Floors/wood_big.rsi/wood_big_4.png index bcb7d680f5..6249ffa80f 100644 Binary files a/Resources/Textures/_CP14/Structures/Floors/wood_big.rsi/wood_big_4.png and b/Resources/Textures/_CP14/Structures/Floors/wood_big.rsi/wood_big_4.png differ