Fire spreading (#92)
* fire update * add flammable to more ent, add floors * add cool fire sprites, noSpawn tiles * fix floor collider * floor resprite * Update floors.yml * fixes * Update tables.yml
39
Content.Server/_CP14/Temperature/CPFireSpreadComponent.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
namespace Content.Server._CP14.Temperature;
|
||||
|
||||
/// <summary>
|
||||
/// A component that allows fire to spread to nearby objects. The basic mechanics of a spreading fire
|
||||
/// </summary>
|
||||
|
||||
[RegisterComponent, Access(typeof(CPFireSpreadSystem))]
|
||||
public sealed partial class CPFireSpreadComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// radius of ignition of neighboring objects
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public float Radius = 1f;
|
||||
|
||||
/// <summary>
|
||||
/// chance of spreading to neighboring properties
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public float Prob = 0.5f;
|
||||
|
||||
/// <summary>
|
||||
/// how often objects will try to set the neighbors on fire. In Seconds
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public float SpreadCooldownMin = 3f;
|
||||
|
||||
/// <summary>
|
||||
/// how often objects will try to set the neighbors on fire. In Seconds
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public float SpreadCooldownMax = 7f;
|
||||
|
||||
/// <summary>
|
||||
/// the time of the next fire spread
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public TimeSpan NextSpreadTime { get; set; } = TimeSpan.Zero;
|
||||
}
|
||||
60
Content.Server/_CP14/Temperature/CPFireSpreadSystem.cs
Normal file
@@ -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 <CPFireSpreadComponent, OnFireChangedEvent>(OnCompInit);
|
||||
}
|
||||
|
||||
private void OnCompInit(Entity<CPFireSpreadComponent> 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<CPFireSpreadComponent, FlammableComponent>();
|
||||
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<FlammableComponent>(_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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.CrystallPunk.DayCycle;
|
||||
namespace Content.Shared._CP14.DayCycle;
|
||||
|
||||
/// <summary>
|
||||
/// Stores all the necessary data for the day and night cycle system to work
|
||||
|
||||
@@ -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<DayCycleComponent> 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<DayCycleComponent, MapLightComponent>();
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
115
Resources/Prototypes/_CP14/Entities/Structures/Floors/floors.yml
Normal file
@@ -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: ""
|
||||
@@ -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
|
||||
max: 1
|
||||
@@ -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
|
||||
base: state
|
||||
- type: FireVisuals
|
||||
sprite: _CP14/Effects/fire.rsi
|
||||
normalState: full
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
38
Resources/Prototypes/_CP14/Entities/base.yml
Normal file
@@ -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
|
||||
BIN
Resources/Textures/_CP14/Effects/fire.rsi/full.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
32
Resources/Textures/_CP14/Effects/fire.rsi/meta.json
Normal file
@@ -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
|
||||
]
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
BIN
Resources/Textures/_CP14/Effects/fire.rsi/small.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 945 B After Width: | Height: | Size: 935 B |
|
Before Width: | Height: | Size: 945 B After Width: | Height: | Size: 935 B |
|
Before Width: | Height: | Size: 945 B After Width: | Height: | Size: 935 B |
|
Before Width: | Height: | Size: 945 B After Width: | Height: | Size: 935 B |