diff --git a/Content.Client/_CP14/Temperature/CP14ClientFireSpreadSystem.cs b/Content.Client/_CP14/Temperature/CP14ClientFireSpreadSystem.cs new file mode 100644 index 0000000000..1ffd123e78 --- /dev/null +++ b/Content.Client/_CP14/Temperature/CP14ClientFireSpreadSystem.cs @@ -0,0 +1,7 @@ +using Content.Shared._CP14.Temperature; + +namespace Content.Client._CP14.Temperature; + +public sealed partial class CP14ClientFireSpreadSystem : CP14SharedFireSpreadSystem +{ +} diff --git a/Content.Server/Atmos/EntitySystems/FlammableSystem.cs b/Content.Server/Atmos/EntitySystems/FlammableSystem.cs index cda8528544..bd03f8831a 100644 --- a/Content.Server/Atmos/EntitySystems/FlammableSystem.cs +++ b/Content.Server/Atmos/EntitySystems/FlammableSystem.cs @@ -1,4 +1,3 @@ -using Content.Server._CP14.Temperature; using Content.Server.Administration.Logs; using Content.Server.Atmos.Components; using Content.Server.IgnitionSource; @@ -6,6 +5,7 @@ using Content.Server.Stunnable; using Content.Server.Temperature.Components; using Content.Server.Temperature.Systems; using Content.Server.Damage.Components; +using Content.Shared._CP14.Temperature; using Content.Shared.ActionBlocker; using Content.Shared.Alert; using Content.Shared.Atmos; @@ -144,15 +144,16 @@ namespace Content.Server.Atmos.EntitySystems { if (args.Handled) return; - var isHotEvent = new IsHotEvent(); RaiseLocalEvent(args.Used, isHotEvent); if (!isHotEvent.IsHot) return; + /* //CP14 disabling igniting via direact interact. Only from DelayedIgnitionSource Ignite(uid, args.Used, flammable, args.User); args.Handled = true; + */ } private void OnExtinguishActivateInWorld(EntityUid uid, ExtinguishOnInteractComponent component, ActivateInWorldEvent args) @@ -263,6 +264,13 @@ namespace Content.Server.Atmos.EntitySystems public void UpdateAppearance(EntityUid uid, FlammableComponent? flammable = null, AppearanceComponent? appearance = null) { + //CrystallEdge bonfire moment + if (!Resolve(uid, ref flammable)) + return; + var ev = new OnFireChangedEvent(flammable.OnFire); + RaiseLocalEvent(uid, ref ev); + //CrystallEdge bonfire moment end + if (!Resolve(uid, ref flammable, ref appearance)) return; @@ -316,12 +324,6 @@ namespace Content.Server.Atmos.EntitySystems _ignitionSourceSystem.SetIgnited(uid, false); - - //CrystallEdge bonfire moment - var ev = new OnFireChangedEvent(flammable.OnFire); - RaiseLocalEvent(uid, ref ev); - //CrystallEdge bonfire moment end - UpdateAppearance(uid, flammable); } @@ -343,11 +345,6 @@ namespace Content.Server.Atmos.EntitySystems else _adminLogger.Add(LogType.Flammable, $"{ToPrettyString(uid):target} set on fire by {ToPrettyString(ignitionSource):actor}"); flammable.OnFire = true; - - //CrystallEdge fireplace moment - var ev = new OnFireChangedEvent(flammable.OnFire); - RaiseLocalEvent(uid, ref ev); - //CrystallEdge fireplace moment end } UpdateAppearance(uid, flammable); diff --git a/Content.Server/Audio/AmbientSoundSystem.cs b/Content.Server/Audio/AmbientSoundSystem.cs index 2eec83c983..843659daad 100644 --- a/Content.Server/Audio/AmbientSoundSystem.cs +++ b/Content.Server/Audio/AmbientSoundSystem.cs @@ -1,6 +1,7 @@ using Content.Server._CP14.Temperature; using Content.Server.Power.Components; using Content.Server.Power.EntitySystems; +using Content.Shared._CP14.Temperature; using Content.Shared.Audio; using Content.Shared.Mobs; using Content.Shared.Power; diff --git a/Content.Server/_CP14/Temperature/CP14DespawnOnExtinguishComponent.cs b/Content.Server/_CP14/Temperature/CP14DespawnOnExtinguishComponent.cs deleted file mode 100644 index 0b101b0d42..0000000000 --- a/Content.Server/_CP14/Temperature/CP14DespawnOnExtinguishComponent.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Content.Server._CP14.Temperature; - -[RegisterComponent, Access(typeof(CP14FireSpreadSystem))] -public sealed partial class CP14DespawnOnExtinguishComponent : Component -{ -} diff --git a/Content.Server/_CP14/Temperature/CP14FireSpreadSystem.cs b/Content.Server/_CP14/Temperature/CP14FireSpreadSystem.cs index 893bc18c45..631ffa4df0 100644 --- a/Content.Server/_CP14/Temperature/CP14FireSpreadSystem.cs +++ b/Content.Server/_CP14/Temperature/CP14FireSpreadSystem.cs @@ -2,7 +2,11 @@ using System.Linq; using System.Numerics; using Content.Server.Atmos.Components; using Content.Server.Atmos.EntitySystems; +using Content.Server.DoAfter; +using Content.Shared._CP14.Temperature; +using Content.Shared.Interaction; using Content.Shared.Maps; +using Content.Shared.Weapons.Melee.Events; using Robust.Shared.Map; using Robust.Shared.Map.Components; using Robust.Shared.Prototypes; @@ -11,7 +15,7 @@ using Robust.Shared.Timing; namespace Content.Server._CP14.Temperature; -public sealed partial class CP14FireSpreadSystem : EntitySystem +public sealed partial class CP14FireSpreadSystem : CP14SharedFireSpreadSystem { [Dependency] private readonly FlammableSystem _flammable = default!; [Dependency] private readonly IGameTiming _gameTiming = default!; @@ -20,29 +24,39 @@ public sealed partial class CP14FireSpreadSystem : EntitySystem [Dependency] private readonly IRobustRandom _random = default!; [Dependency] private readonly SharedMapSystem _mapSystem = default!; [Dependency] private readonly TileSystem _tile = default!; - [Dependency] private readonly ITileDefinitionManager _tiledef = default!; + [Dependency] private readonly ITileDefinitionManager _tileDef = default!; - private EntProtoId _fireProto = "CP14Fire"; + private readonly EntProtoId _fireProto = "CP14Fire"; + + private readonly HashSet> _spreadEnts = new(); public override void Initialize() { - SubscribeLocalEvent(OnCompInit); - SubscribeLocalEvent(OnFireChanged); + base.Initialize(); + + SubscribeLocalEvent(OnFlammableIgnited); + SubscribeLocalEvent(OnFlammableMeleeHit); } - private void OnFireChanged(Entity ent, ref OnFireChangedEvent args) + private void OnFlammableMeleeHit(Entity ent, ref MeleeHitEvent args) { - if (!args.OnFire) - QueueDel(ent); - } - - private void OnCompInit(Entity ent, ref OnFireChangedEvent args) - { - if (!args.OnFire) + if (!TryComp(ent, out var flammable)) return; - var cooldown = _random.NextFloat(ent.Comp.SpreadCooldownMin, ent.Comp.SpreadCooldownMax); - ent.Comp.NextSpreadTime = _gameTiming.CurTime + TimeSpan.FromSeconds(cooldown); + if (!flammable.OnFire) + return; + + args.BonusDamage += ent.Comp.DamagePerStack * flammable.FireStacks; + } + + private void OnFlammableIgnited(Entity ent, ref CP14IgnitionDoAfter args) + { + if (args.Cancelled || args.Handled) + return; + + _flammable.AdjustFireStacks(ent, ent.Comp.FirestacksOnIgnite, ent.Comp, true); + + args.Handled = true; } public override void Update(float frameTime) @@ -76,9 +90,10 @@ public sealed partial class CP14FireSpreadSystem : EntitySystem private void UpdateFireSpread() { - List> spreadUids = new(); - var query = EntityQueryEnumerator(); - while (query.MoveNext(out var uid, out var spread, out var flammable, out var xform)) + _spreadEnts.Clear(); + + var query = EntityQueryEnumerator(); + while (query.MoveNext(out var uid, out _, out var spread, out var flammable, out var xform)) { if (!flammable.OnFire) continue; @@ -92,61 +107,57 @@ public sealed partial class CP14FireSpreadSystem : EntitySystem var cooldown = _random.NextFloat(spread.SpreadCooldownMin, spread.SpreadCooldownMax); spread.NextSpreadTime = _gameTiming.CurTime + TimeSpan.FromSeconds(cooldown); - spreadUids.Add(new Entity(uid, spread)); + _spreadEnts.Add(new Entity(uid, spread)); } - foreach (var uid in spreadUids) + foreach (var uid in _spreadEnts) { - IgniteEntities(uid, uid.Comp); - IgniteTiles(uid, uid.Comp); + IgniteEntities(uid); + IgniteTiles(uid); } } - private void IgniteEntities(EntityUid uid, CP14FireSpreadComponent spread) + private void IgniteEntities(Entity spread) { - var targets = _lookup.GetEntitiesInRange(_transform.GetMapCoordinates(uid), - spread.Radius, + var targets = _lookup.GetEntitiesInRange(_transform.GetMapCoordinates(spread), + spread.Comp.Radius, LookupFlags.Uncontained); foreach (var target in targets) { - if (!_random.Prob(spread.Prob)) + if (!_random.Prob(spread.Comp.Prob)) continue; - _flammable.Ignite(target, uid); + _flammable.Ignite(target, spread); } } - private void IgniteTiles(EntityUid uid, CP14FireSpreadComponent spread) + private void IgniteTiles(Entity spread) { - var xform = Transform(uid); - if (!TryComp(xform.GridUid, out var grid)) - return; - + var xform = Transform(spread); // Ignore items inside containers - if (!HasComp(xform.ParentUid)) + if (!TryComp(xform.ParentUid, out var grid)) return; var localPos = xform.Coordinates.Position; - var tileRefs = _mapSystem.GetLocalTilesIntersecting(grid.Owner, + var tileRefs = _mapSystem.GetLocalTilesIntersecting(xform.ParentUid, grid, new Box2( - localPos + new Vector2(-spread.Radius, -spread.Radius), - localPos + new Vector2(spread.Radius, spread.Radius))) + localPos + new Vector2(-spread.Comp.Radius, -spread.Comp.Radius), + localPos + new Vector2(spread.Comp.Radius, spread.Comp.Radius))) .ToList(); - - foreach (var tileref in tileRefs) + foreach (var tileRef in tileRefs) { - if (!_random.Prob(spread.ProbTile)) + if (!_random.Prob(spread.Comp.ProbTile)) continue; - var tile = tileref.Tile.GetContentTileDefinition(); + var tile = tileRef.Tile.GetContentTileDefinition(); if (tile.BurnedTile is null) continue; - Spawn(_fireProto, _mapSystem.ToCenterCoordinates(tileref, grid)); - _tile.ReplaceTile(tileref, (ContentTileDefinition)_tiledef[tile.BurnedTile]); + Spawn(_fireProto, _mapSystem.ToCenterCoordinates(tileRef, grid)); + _tile.ReplaceTile(tileRef, (ContentTileDefinition)_tileDef[tile.BurnedTile]); } } } diff --git a/Content.Server/_CP14/Temperature/CP14FlammableAmbientSoundComponent.cs b/Content.Server/_CP14/Temperature/CP14FlammableAmbientSoundComponent.cs index 548997f81f..bf3984068e 100644 --- a/Content.Server/_CP14/Temperature/CP14FlammableAmbientSoundComponent.cs +++ b/Content.Server/_CP14/Temperature/CP14FlammableAmbientSoundComponent.cs @@ -9,12 +9,3 @@ namespace Content.Server._CP14.Temperature; public sealed partial class CP14FlammableAmbientSoundComponent : Component { } - -/// -/// Raised whenever an FlammableComponen OnFire is Changed -/// -[ByRefEvent] -public readonly record struct OnFireChangedEvent(bool OnFire) -{ - public readonly bool OnFire = OnFire; -} diff --git a/Content.Server/_CP14/Temperature/Fireplace/CP14FireplaceSystem.cs b/Content.Server/_CP14/Temperature/Fireplace/CP14FireplaceSystem.cs index c0d24707eb..bba2430003 100644 --- a/Content.Server/_CP14/Temperature/Fireplace/CP14FireplaceSystem.cs +++ b/Content.Server/_CP14/Temperature/Fireplace/CP14FireplaceSystem.cs @@ -1,15 +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; using Robust.Server.GameObjects; -using Robust.Shared.Physics.Events; using Robust.Shared.Timing; namespace Content.Server._CP14.Temperature.Fireplace; diff --git a/Content.Shared/_CP14/Temperature/CP14ActiveFireSpreadingComponent.cs b/Content.Shared/_CP14/Temperature/CP14ActiveFireSpreadingComponent.cs new file mode 100644 index 0000000000..8164a4e5e1 --- /dev/null +++ b/Content.Shared/_CP14/Temperature/CP14ActiveFireSpreadingComponent.cs @@ -0,0 +1,6 @@ +namespace Content.Shared._CP14.Temperature; + +[RegisterComponent, Access(typeof(CP14SharedFireSpreadSystem))] +public sealed partial class CP14ActiveFireSpreadingComponent : Component +{ +} diff --git a/Content.Shared/_CP14/Temperature/CP14DelayedIgnitionSourceComponent.cs b/Content.Shared/_CP14/Temperature/CP14DelayedIgnitionSourceComponent.cs new file mode 100644 index 0000000000..4d72d27905 --- /dev/null +++ b/Content.Shared/_CP14/Temperature/CP14DelayedIgnitionSourceComponent.cs @@ -0,0 +1,16 @@ +using Robust.Shared.GameStates; + +namespace Content.Shared._CP14.Temperature; + +/// +/// Allows you to fire entities through interacting with them after a delay. +/// +[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, Access(typeof(CP14SharedFireSpreadSystem))] +public sealed partial class CP14DelayedIgnitionSourceComponent : Component +{ + [DataField, AutoNetworkedField] + public bool Enabled; + + [DataField] + public TimeSpan Delay = TimeSpan.FromSeconds(3f); +} diff --git a/Content.Shared/_CP14/Temperature/CP14DespawnOnExtinguishComponent.cs b/Content.Shared/_CP14/Temperature/CP14DespawnOnExtinguishComponent.cs new file mode 100644 index 0000000000..fcb5071a4a --- /dev/null +++ b/Content.Shared/_CP14/Temperature/CP14DespawnOnExtinguishComponent.cs @@ -0,0 +1,6 @@ +namespace Content.Shared._CP14.Temperature; + +[RegisterComponent, Access(typeof(CP14SharedFireSpreadSystem))] +public sealed partial class CP14DespawnOnExtinguishComponent : Component +{ +} diff --git a/Content.Server/_CP14/Temperature/CP14FireSpreadComponent.cs b/Content.Shared/_CP14/Temperature/CP14FireSpreadComponent.cs similarity index 79% rename from Content.Server/_CP14/Temperature/CP14FireSpreadComponent.cs rename to Content.Shared/_CP14/Temperature/CP14FireSpreadComponent.cs index 049d4d5c51..7eae565a48 100644 --- a/Content.Server/_CP14/Temperature/CP14FireSpreadComponent.cs +++ b/Content.Shared/_CP14/Temperature/CP14FireSpreadComponent.cs @@ -1,10 +1,10 @@ -namespace Content.Server._CP14.Temperature; +namespace Content.Shared._CP14.Temperature; /// /// A component that allows fire to spread to nearby objects. The basic mechanics of a spreading fire /// -[RegisterComponent, Access(typeof(CP14FireSpreadSystem))] +[RegisterComponent, Access(typeof(CP14SharedFireSpreadSystem))] public sealed partial class CP14FireSpreadComponent : Component { /// @@ -17,25 +17,25 @@ public sealed partial class CP14FireSpreadComponent : Component /// chance of spreading to neighboring properties /// [DataField] - public float Prob = 0.3f; + public float Prob = 0.1f; /// /// chance of tile spreading to neighboring properties /// [DataField] - public float ProbTile = 0.2f; + public float ProbTile = 0.1f; /// /// how often objects will try to set the neighbors on fire. In Seconds /// [DataField] - public float SpreadCooldownMin = 4f; + public float SpreadCooldownMin = 5f; /// /// how often objects will try to set the neighbors on fire. In Seconds /// [DataField] - public float SpreadCooldownMax = 14f; + public float SpreadCooldownMax = 10f; /// /// the time of the next fire spread diff --git a/Content.Shared/_CP14/Temperature/CP14FlammableDamageBonusComponent.cs b/Content.Shared/_CP14/Temperature/CP14FlammableDamageBonusComponent.cs new file mode 100644 index 0000000000..f95b1fd4de --- /dev/null +++ b/Content.Shared/_CP14/Temperature/CP14FlammableDamageBonusComponent.cs @@ -0,0 +1,19 @@ +using Content.Shared.Damage; + +namespace Content.Shared._CP14.Temperature; + +/// +/// Add bonus damage to melee attacks per flammable stack +/// +[RegisterComponent, Access(typeof(CP14SharedFireSpreadSystem))] +public sealed partial class CP14FlammableBonusDamageComponent : Component +{ + [DataField] + public DamageSpecifier DamagePerStack = new() + { + DamageDict = new() + { + {"Heat", 0.3}, + } + }; +} diff --git a/Content.Shared/_CP14/Temperature/CP14IgnitionModifierComponent.cs b/Content.Shared/_CP14/Temperature/CP14IgnitionModifierComponent.cs new file mode 100644 index 0000000000..f01a75d4a0 --- /dev/null +++ b/Content.Shared/_CP14/Temperature/CP14IgnitionModifierComponent.cs @@ -0,0 +1,14 @@ +namespace Content.Shared._CP14.Temperature; + +/// +/// Modifies the burning of this essence. +/// +[RegisterComponent, Access(typeof(CP14SharedFireSpreadSystem))] +public sealed partial class CP14IgnitionModifierComponent : Component +{ + [DataField] + public float IgnitionTimeModifier = 1f; + + [DataField] + public bool HideCaution = false; +} diff --git a/Content.Shared/_CP14/Temperature/CP14SharedFireSpreadSystem.cs b/Content.Shared/_CP14/Temperature/CP14SharedFireSpreadSystem.cs new file mode 100644 index 0000000000..0f4d53b030 --- /dev/null +++ b/Content.Shared/_CP14/Temperature/CP14SharedFireSpreadSystem.cs @@ -0,0 +1,112 @@ +using Content.Shared.DoAfter; +using Content.Shared.IdentityManagement; +using Content.Shared.Interaction; +using Content.Shared.Popups; +using Content.Shared.Weapons.Melee.Events; +using Robust.Shared.Serialization; +using Robust.Shared.Timing; + +namespace Content.Shared._CP14.Temperature; + +public abstract partial class CP14SharedFireSpreadSystem : EntitySystem +{ + [Dependency] private readonly IGameTiming _gameTiming = default!; + [Dependency] private readonly SharedDoAfterSystem _doAfter = default!; + [Dependency] private readonly SharedPopupSystem _popup = default!; + + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnFireChangedSpread); + SubscribeLocalEvent(OnFireChangedDespawn); + SubscribeLocalEvent(OnIgnitionSourceFireChanged); + SubscribeLocalEvent(OnDelayedIgniteAttempt); + } + + private void OnFireChangedDespawn(Entity ent, ref OnFireChangedEvent args) + { + if (!args.OnFire) + QueueDel(ent); + } + + private void OnFireChangedSpread(Entity ent, ref OnFireChangedEvent args) + { + if (args.OnFire) + { + EnsureComp(ent); + } + else + { + if (HasComp(ent)) + RemCompDeferred(ent); + } + + ent.Comp.NextSpreadTime = _gameTiming.CurTime + TimeSpan.FromSeconds(ent.Comp.SpreadCooldownMax); + } + + private void OnDelayedIgniteAttempt(Entity ent, ref AfterInteractEvent args) + { + if (!args.CanReach || args.Handled || args.Target == null) + return; + + if (!ent.Comp.Enabled) + return; + + var time = ent.Comp.Delay; + var caution = true; + + if (TryComp(args.Target, out var modifier)) + { + time *= modifier.IgnitionTimeModifier; + caution = !modifier.HideCaution; + } + + _doAfter.TryStartDoAfter(new DoAfterArgs(EntityManager, + args.User, + time, + new CP14IgnitionDoAfter(), + args.Target, + args.Target, + args.Used) + { + BreakOnDamage = true, + BreakOnMove = true, + BreakOnDropItem = true, + BreakOnHandChange = true, + BlockDuplicate = true, + CancelDuplicate = true + }); + + var selfMessage = Loc.GetString("cp14-attempt-ignite-caution-self", + ("target", MetaData(args.Target.Value).EntityName)); + var otherMessage = Loc.GetString("cp14-attempt-ignite-caution", + ("name", Identity.Entity(args.User, EntityManager)), + ("target", Identity.Entity(args.Target.Value, EntityManager))); + _popup.PopupPredicted(selfMessage, + otherMessage, + args.User, + args.User, + caution ? PopupType.MediumCaution : PopupType.Small); + } + + private void OnIgnitionSourceFireChanged(Entity ent, ref OnFireChangedEvent args) + { + ent.Comp.Enabled = args.OnFire; + Dirty(ent); + } +} + +/// +/// Raised whenever an FlammableComponent OnFire is Changed +/// +[ByRefEvent] +public readonly record struct OnFireChangedEvent(bool OnFire) +{ + public readonly bool OnFire = OnFire; +} + +[Serializable, NetSerializable] +public sealed partial class CP14IgnitionDoAfter : SimpleDoAfterEvent +{ +} diff --git a/Resources/Locale/en-US/_CP14/temperature/temperature.ftl b/Resources/Locale/en-US/_CP14/temperature/temperature.ftl new file mode 100644 index 0000000000..dfaf1425ef --- /dev/null +++ b/Resources/Locale/en-US/_CP14/temperature/temperature.ftl @@ -0,0 +1,2 @@ +cp14-attempt-ignite-caution-self = You start setting {$target} on fire! +cp14-attempt-ignite-caution = {$name} is starting to set {$target} on fire! \ No newline at end of file diff --git a/Resources/Locale/ru-RU/_CP14/temperature/temperature.ftl b/Resources/Locale/ru-RU/_CP14/temperature/temperature.ftl new file mode 100644 index 0000000000..e68c30ac56 --- /dev/null +++ b/Resources/Locale/ru-RU/_CP14/temperature/temperature.ftl @@ -0,0 +1,2 @@ +cp14-attempt-ignite-caution-self = Вы начинаете поджигать {$target}! +cp14-attempt-ignite-caution = {$name} начинает поджигать {$target}! \ No newline at end of file diff --git a/Resources/Prototypes/_CP14/Catalog/Fills/crates.yml b/Resources/Prototypes/_CP14/Catalog/Fills/crates.yml index e7707eaa7f..68bd2c962d 100644 --- a/Resources/Prototypes/_CP14/Catalog/Fills/crates.yml +++ b/Resources/Prototypes/_CP14/Catalog/Fills/crates.yml @@ -59,6 +59,7 @@ - id: CP14Rope - id: CP14Nail10 - id: CP14EnergyCrystalSmall + - id: CP14Lighter - id: CP14BaseSharpeningStone - !type:NestedSelector tableId: CP14RandomVials diff --git a/Resources/Prototypes/_CP14/Entities/Actions/Spells/Fire/T0_flame_creation.yml b/Resources/Prototypes/_CP14/Entities/Actions/Spells/Fire/T0_flame_creation.yml index c3088bb389..255149d943 100644 --- a/Resources/Prototypes/_CP14/Entities/Actions/Spells/Fire/T0_flame_creation.yml +++ b/Resources/Prototypes/_CP14/Entities/Actions/Spells/Fire/T0_flame_creation.yml @@ -76,7 +76,7 @@ - state: inhand-right shader: unshaded - type: TimedDespawn - lifetime: 60 # 1 min + lifetime: 120 # 2 min - type: Sprite sprite: _CP14/Objects/Misc/artificial_flame.rsi layers: @@ -84,6 +84,8 @@ shader: unshaded - type: PointLight color: "#eea911" + energy: 0.5 + radius: 2.5 - type: Fixtures fixtures: fix1: @@ -138,9 +140,8 @@ variation: 0.250 volume: -12 cPAnimationLength: 0.15 - - type: IgnitionSource - temperature: 400 - ignited: true + - type: CP14DelayedIgnitionSource + enabled: true - type: entity parent: CP14BaseSpellScrollFire diff --git a/Resources/Prototypes/_CP14/Entities/Actions/Spells/Meta/T0_mana_gift.yml b/Resources/Prototypes/_CP14/Entities/Actions/Spells/Meta/T0_mana_gift.yml index 8a5fb20cb3..101338222f 100644 --- a/Resources/Prototypes/_CP14/Entities/Actions/Spells/Meta/T0_mana_gift.yml +++ b/Resources/Prototypes/_CP14/Entities/Actions/Spells/Meta/T0_mana_gift.yml @@ -33,7 +33,7 @@ - CP14MagicEnergyCrystalSlot itemIconStyle: BigAction interactOnMiss: false - canTargetSelf: false + canTargetSelf: true sound: !type:SoundPathSpecifier path: /Audio/Magic/rumble.ogg icon: diff --git a/Resources/Prototypes/_CP14/Entities/Actions/Spells/Water/T0_water_creation.yml b/Resources/Prototypes/_CP14/Entities/Actions/Spells/Water/T0_water_creation.yml index 67e90d2807..12b2211370 100644 --- a/Resources/Prototypes/_CP14/Entities/Actions/Spells/Water/T0_water_creation.yml +++ b/Resources/Prototypes/_CP14/Entities/Actions/Spells/Water/T0_water_creation.yml @@ -46,9 +46,12 @@ - type: entity id: CP14LiquidDropWater - parent: BaseItem + parent: + - BaseItem + - ItemHeftyBase name: floating liquid drop description: A clot of liquid held in the shape of a ball by magic + suffix: Water categories: [ ForkFiltered ] components: - type: Item diff --git a/Resources/Prototypes/_CP14/Entities/Actions/Spells/Water/T1_beer_creation.yml b/Resources/Prototypes/_CP14/Entities/Actions/Spells/Water/T1_beer_creation.yml index 50be53a0cc..61717be8ea 100644 --- a/Resources/Prototypes/_CP14/Entities/Actions/Spells/Water/T1_beer_creation.yml +++ b/Resources/Prototypes/_CP14/Entities/Actions/Spells/Water/T1_beer_creation.yml @@ -54,6 +54,7 @@ id: CP14LiquidDropBeer parent: CP14LiquidDropWater categories: [ ForkFiltered ] + suffix: Beer components: - type: SolutionContainerManager solutions: diff --git a/Resources/Prototypes/_CP14/Entities/Mobs/NPC/undead.yml b/Resources/Prototypes/_CP14/Entities/Mobs/NPC/undead.yml index eda8dc58fd..f7bd47d491 100644 --- a/Resources/Prototypes/_CP14/Entities/Mobs/NPC/undead.yml +++ b/Resources/Prototypes/_CP14/Entities/Mobs/NPC/undead.yml @@ -7,7 +7,7 @@ components: - type: HTN rootTask: - task: SimpleHostileCompound + task: CP14ZombieCompound blackboard: NavClimb: !type:Bool true @@ -23,7 +23,7 @@ suffix: Zombie. Easy categories: [ HideSpawnMenu ] components: - - type: Loadout + - type: Loadout prototypes: [ CP14MobUndeadEasy1 ] - type: entity diff --git a/Resources/Prototypes/_CP14/Entities/Mobs/Species/base.yml b/Resources/Prototypes/_CP14/Entities/Mobs/Species/base.yml index 10a0c9e967..8086a03439 100644 --- a/Resources/Prototypes/_CP14/Entities/Mobs/Species/base.yml +++ b/Resources/Prototypes/_CP14/Entities/Mobs/Species/base.yml @@ -223,6 +223,8 @@ - type: CP14DemiplaneStabilizer requireAlive: true - type: CanEnterCryostorage + - type: CP14IgnitionModifier + ignitionTimeModifier: 2.5 - type: entity diff --git a/Resources/Prototypes/_CP14/Entities/Mobs/Species/zombie.yml b/Resources/Prototypes/_CP14/Entities/Mobs/Species/zombie.yml index 2a58373abc..f7765b338e 100644 --- a/Resources/Prototypes/_CP14/Entities/Mobs/Species/zombie.yml +++ b/Resources/Prototypes/_CP14/Entities/Mobs/Species/zombie.yml @@ -41,6 +41,14 @@ - map: [ "head" ] - map: [ "pocket1" ] - map: [ "pocket2" ] + - map: ["enum.HumanoidVisualLayers.Handcuffs"] + color: "#ffffff" + sprite: Objects/Misc/handcuffs.rsi + state: body-overlay-2 + visible: false + - type: Cuffable + - type: Hands + - type: ComplexInteraction - type: Icon sprite: _CP14/Mobs/Species/Zombie/parts.rsi state: full @@ -121,6 +129,8 @@ - type: Climbing - type: ReplacementAccent accent: zombie + - type: FireVisuals + alternateState: Standing #TODO - custom visuals - type: UserInterface interfaces: enum.StrippingUiKey.Key: diff --git a/Resources/Prototypes/_CP14/Entities/Objects/Tools/bucket.yml b/Resources/Prototypes/_CP14/Entities/Objects/Tools/bucket.yml index 5e60287e25..c6f412d4e1 100644 --- a/Resources/Prototypes/_CP14/Entities/Objects/Tools/bucket.yml +++ b/Resources/Prototypes/_CP14/Entities/Objects/Tools/bucket.yml @@ -8,7 +8,6 @@ - type: Drink solution: bucket ignoreEmpty: true - - type: Clickable - type: Sprite sprite: _CP14/Objects/Tools/wooden_bucket.rsi layers: diff --git a/Resources/Prototypes/_CP14/Entities/Objects/Tools/flint.yml b/Resources/Prototypes/_CP14/Entities/Objects/Tools/flint.yml new file mode 100644 index 0000000000..8d73e48a59 --- /dev/null +++ b/Resources/Prototypes/_CP14/Entities/Objects/Tools/flint.yml @@ -0,0 +1,15 @@ +- type: entity + parent: BaseItem + id: CP14Lighter + name: flint and steel + description: "Setting things on fire. Absolutely, 100% not from minecraft." # TODO: remove minecraft sprite and desc + categories: [ ForkFiltered ] + components: + - type: Item + size: Tiny + - type: Sprite + sprite: _CP14/Objects/Tools/flint.rsi + state: icon + - type: CP14DelayedIgnitionSource + enabled: true + # TODO: Damageable, Ignite attempt self damage, Ignite prob \ No newline at end of file diff --git a/Resources/Prototypes/_CP14/Entities/Objects/Tools/torch.yml b/Resources/Prototypes/_CP14/Entities/Objects/Tools/torch.yml new file mode 100644 index 0000000000..7d01108acd --- /dev/null +++ b/Resources/Prototypes/_CP14/Entities/Objects/Tools/torch.yml @@ -0,0 +1,79 @@ +- type: entity + id: CP14Torch + parent: BaseItem + name: torch + description: At its core, a stick burning on one side. Used to light up the area. + categories: [ ForkFiltered ] + components: + - type: Sprite + sprite: _CP14/Objects/Tools/torch.rsi + layers: + - state: torch-unlit + map: ["fuel"] + - type: Item + size: Small + - type: CP14FlammableAmbientSound + - type: AmbientSound + enabled: false + volume: -5 + range: 5 + sound: + path: /Audio/Ambience/Objects/fireplace.ogg + - type: Appearance + - type: Reactive + groups: + Flammable: [ Touch ] + Extinguish: [ Touch ] + - type: Flammable + fireSpread: false + canResistFire: false + alwaysCombustible: true + canExtinguish: true + firestacksOnIgnite: 0.5 + damage: + types: + Heat: 0 + - type: CP14Fireplace + maxFuelLimit: 200 + fuel: 200 + - type: FireVisuals + sprite: _CP14/Objects/Tools/torch.rsi + normalState: lit-overlay + - type: ToggleableLightVisuals + spriteLayer: null + inhandVisuals: + left: + - state: lit-inhand-left + shader: unshaded + right: + - state: lit-inhand-right + shader: unshaded + - type: GenericVisualizer + visuals: + enum.FireplaceFuelVisuals.Status: + fuel: + Empty: { state: torch-spent } + Medium: { state: torch-unlit } + Full: { state: torch-unlit } + - type: Damageable + damageContainer: Inorganic + damageModifierSet: Wood + - type: Destructible + thresholds: + - trigger: + !type:DamageTrigger + damage: 50 + behaviors: + - !type:DoActsBehavior + acts: [ "Destruction" ] + - type: CP14DelayedIgnitionSource + - type: CP14IgnitionModifier + hideCaution: true + - type: MeleeWeapon + attackRate: 1.5 + wideAnimationRotation: 225 + wideAnimation: CP14WeaponArcSlash + damage: + types: + Blunt: 4 + - type: CP14FlammableBonusDamage \ No newline at end of file diff --git a/Resources/Prototypes/_CP14/Entities/Structures/Flora/grasshighbush.yml b/Resources/Prototypes/_CP14/Entities/Structures/Flora/grasshighbush.yml index 445dae26fe..c68dbe0547 100644 --- a/Resources/Prototypes/_CP14/Entities/Structures/Flora/grasshighbush.yml +++ b/Resources/Prototypes/_CP14/Entities/Structures/Flora/grasshighbush.yml @@ -92,6 +92,9 @@ collection: CP14GrassGathering - type: TriggerOnCollide fixtureID: fix1 + - type: CP14IgnitionModifier + ignitionTimeModifier: 0.75 + hideCaution: true - type: entity id: CP14RandomBushOffsetSpawner diff --git a/Resources/Prototypes/_CP14/Entities/Structures/Furniture/wallmount.yml b/Resources/Prototypes/_CP14/Entities/Structures/Furniture/wallmount.yml index 3f6f029c7e..b7e517b9bf 100644 --- a/Resources/Prototypes/_CP14/Entities/Structures/Furniture/wallmount.yml +++ b/Resources/Prototypes/_CP14/Entities/Structures/Furniture/wallmount.yml @@ -37,13 +37,6 @@ behaviors: - !type:DoActsBehavior acts: [ "Destruction" ] - - trigger: - !type:DamageTypeTrigger - damageType: Heat - damage: 50 - behaviors: - - !type:DoActsBehavior - acts: [ "Destruction" ] - type: CP14FlammableAmbientSound - type: AmbientSound enabled: false @@ -81,6 +74,8 @@ - type: Construction graph: CP14WallmountTorch node: CP14WallmountTorch + - type: CP14IgnitionModifier + hideCaution: true - type: entity id: CP14WallmountTorchAlwaysPowered diff --git a/Resources/Prototypes/_CP14/Entities/Structures/Specific/Alchemy/heater.yml b/Resources/Prototypes/_CP14/Entities/Structures/Specific/Alchemy/heater.yml index 33bf5aaa55..59d200b6e5 100644 --- a/Resources/Prototypes/_CP14/Entities/Structures/Specific/Alchemy/heater.yml +++ b/Resources/Prototypes/_CP14/Entities/Structures/Specific/Alchemy/heater.yml @@ -53,13 +53,16 @@ maxItemSize: Normal grid: - 0,0,2,2 - blacklist: + cP14Ignorelist: components: - IgnitionSource + - CP14DelayedIgnitionSource - type: UserInterface interfaces: enum.StorageUiKey.Key: type: StorageBoundUserInterface + - type: CP14IgnitionModifier + hideCaution: true - type: entity id: CP14AlchemyFurnace diff --git a/Resources/Prototypes/_CP14/Entities/fire.yml b/Resources/Prototypes/_CP14/Entities/fire.yml index f3433b0a0c..dc3c5addea 100644 --- a/Resources/Prototypes/_CP14/Entities/fire.yml +++ b/Resources/Prototypes/_CP14/Entities/fire.yml @@ -6,6 +6,7 @@ placement: mode: SnapgridCenter components: + - type: Clickable - type: Sprite drawdepth: Effects snapCardinals: true @@ -75,9 +76,11 @@ damage: types: Heat: 0 + - type: Damageable - type: CP14Fireplace fuel: 15 - #- type: CP14AutoIgnite + - type: CP14AutoIgnite + - type: CP14ActiveFireSpreading - type: TimedDespawn lifetime: 60 - type: CP14FireSpread diff --git a/Resources/Prototypes/_CP14/Loadouts/Jobs/general.yml b/Resources/Prototypes/_CP14/Loadouts/Jobs/general.yml index 31ed3c1b89..992090b552 100644 --- a/Resources/Prototypes/_CP14/Loadouts/Jobs/general.yml +++ b/Resources/Prototypes/_CP14/Loadouts/Jobs/general.yml @@ -304,6 +304,7 @@ - CP14BaseDagger - CP14BaseSickle - CP14BasePickaxe + - CP14Lighter - type: loadout id: CP14MagicHealingStaff @@ -388,6 +389,12 @@ back: - CP14BasePickaxe +- type: loadout + id: CP14Lighter + storage: + back: + - CP14Lighter + # Spells - type: loadoutGroup diff --git a/Resources/Prototypes/_CP14/NPCs/base.yml b/Resources/Prototypes/_CP14/NPCs/base.yml new file mode 100644 index 0000000000..c7331317ed --- /dev/null +++ b/Resources/Prototypes/_CP14/NPCs/base.yml @@ -0,0 +1,40 @@ +- type: htnCompound + id: CP14MeleeWeaponlessCombatCompound + branches: + - tasks: + - !type:HTNPrimitiveTask + operator: !type:UtilityOperator + proto: NearbyMeleeTargets + - !type:HTNCompoundTask + task: CP14BeforeMeleeAttackTargetWeaponlessCompound + +- type: htnCompound + id: CP14BeforeMeleeAttackTargetWeaponlessCompound + branches: + - preconditions: + - !type:BuckledPrecondition + isBuckled: true + tasks: + - !type:HTNPrimitiveTask + operator: !type:UnbuckleOperator + shutdownState: TaskFinished + + - preconditions: + - !type:PulledPrecondition + isPulled: true + tasks: + - !type:HTNPrimitiveTask + operator: !type:UnPullOperator + shutdownState: TaskFinished + + - preconditions: + - !type:InContainerPrecondition + isInContainer: true + tasks: + - !type:HTNCompoundTask + task: EscapeCompound + + # Melee combat (unarmed or otherwise) + - tasks: + - !type:HTNCompoundTask + task: MeleeAttackTargetCompound \ No newline at end of file diff --git a/Resources/Prototypes/_CP14/NPCs/zombie.yml b/Resources/Prototypes/_CP14/NPCs/zombie.yml new file mode 100644 index 0000000000..ca6434749a --- /dev/null +++ b/Resources/Prototypes/_CP14/NPCs/zombie.yml @@ -0,0 +1,9 @@ +- type: htnCompound + id: CP14ZombieCompound + branches: + - tasks: + - !type:HTNCompoundTask + task: CP14MeleeWeaponlessCombatCompound + - tasks: + - !type:HTNCompoundTask + task: IdleCompound \ No newline at end of file diff --git a/Resources/Textures/_CP14/Objects/Tools/flint.rsi/icon.png b/Resources/Textures/_CP14/Objects/Tools/flint.rsi/icon.png new file mode 100644 index 0000000000..f3b04643fa Binary files /dev/null and b/Resources/Textures/_CP14/Objects/Tools/flint.rsi/icon.png differ diff --git a/Resources/Textures/_CP14/Objects/Tools/flint.rsi/meta.json b/Resources/Textures/_CP14/Objects/Tools/flint.rsi/meta.json new file mode 100644 index 0000000000..2565c4ac54 --- /dev/null +++ b/Resources/Textures/_CP14/Objects/Tools/flint.rsi/meta.json @@ -0,0 +1,14 @@ +{ + "version": 1, + "license": "CLA", + "copyright": "Created by TheShuEd (Discord)", + "size": { + "x": 32, + "y": 32 + }, + "states": [ + { + "name": "icon" + } + ] +} diff --git a/Resources/Textures/_CP14/Objects/Tools/torch.rsi/icon.png b/Resources/Textures/_CP14/Objects/Tools/torch.rsi/icon.png new file mode 100644 index 0000000000..b9e09b4249 Binary files /dev/null and b/Resources/Textures/_CP14/Objects/Tools/torch.rsi/icon.png differ diff --git a/Resources/Textures/_CP14/Objects/Tools/torch.rsi/inhand-left.png b/Resources/Textures/_CP14/Objects/Tools/torch.rsi/inhand-left.png new file mode 100644 index 0000000000..a8b07a415a Binary files /dev/null and b/Resources/Textures/_CP14/Objects/Tools/torch.rsi/inhand-left.png differ diff --git a/Resources/Textures/_CP14/Objects/Tools/torch.rsi/inhand-right.png b/Resources/Textures/_CP14/Objects/Tools/torch.rsi/inhand-right.png new file mode 100644 index 0000000000..b5689d2b4c Binary files /dev/null and b/Resources/Textures/_CP14/Objects/Tools/torch.rsi/inhand-right.png differ diff --git a/Resources/Textures/_CP14/Objects/Tools/torch.rsi/lit-inhand-left.png b/Resources/Textures/_CP14/Objects/Tools/torch.rsi/lit-inhand-left.png new file mode 100644 index 0000000000..b93d6b471d Binary files /dev/null and b/Resources/Textures/_CP14/Objects/Tools/torch.rsi/lit-inhand-left.png differ diff --git a/Resources/Textures/_CP14/Objects/Tools/torch.rsi/lit-inhand-right.png b/Resources/Textures/_CP14/Objects/Tools/torch.rsi/lit-inhand-right.png new file mode 100644 index 0000000000..b1fcbf08ee Binary files /dev/null and b/Resources/Textures/_CP14/Objects/Tools/torch.rsi/lit-inhand-right.png differ diff --git a/Resources/Textures/_CP14/Objects/Tools/torch.rsi/lit-overlay.png b/Resources/Textures/_CP14/Objects/Tools/torch.rsi/lit-overlay.png new file mode 100644 index 0000000000..5105dd8c43 Binary files /dev/null and b/Resources/Textures/_CP14/Objects/Tools/torch.rsi/lit-overlay.png differ diff --git a/Resources/Textures/_CP14/Objects/Tools/torch.rsi/meta.json b/Resources/Textures/_CP14/Objects/Tools/torch.rsi/meta.json new file mode 100644 index 0000000000..3a9cc6ca7b --- /dev/null +++ b/Resources/Textures/_CP14/Objects/Tools/torch.rsi/meta.json @@ -0,0 +1,96 @@ +{ + "version": 1, + "size": { + "x": 32, + "y": 32 + }, + "license": "CLA", + "copyright": "Created by Prazat", + "states": [ + { + "name": "icon" + }, + { + "name": "lit-overlay", + "delays": [ + [ + 0.2, + 0.2, + 0.2 + ] + ] + }, + { + "name": "lit-inhand-left", + "directions": 4, + "delays": [ + [ + 0.2, + 0.2, + 0.2 + ], + [ + 0.2, + 0.2, + 0.2 + ], + [ + 0.2, + 0.2, + 0.2 + ], + [ + 0.2, + 0.2, + 0.2 + ] + ] + }, + { + "name": "lit-inhand-right", + "directions": 4, + "delays": [ + [ + 0.2, + 0.2, + 0.2 + ], + [ + 0.2, + 0.2, + 0.2 + ], + [ + 0.2, + 0.2, + 0.2 + ], + [ + 0.2, + 0.2, + 0.2 + ] + ] + }, + { + "name": "inhand-left", + "directions": 4 + }, + { + "name": "inhand-right", + "directions": 4 + }, + { + "name": "torch-spent" + }, + { + "name": "torch-unlit" + }, + { + "name": "unlit-inhand-left" + }, + { + "name": "unlit-inhand-right" + } + ] +} diff --git a/Resources/Textures/_CP14/Objects/Tools/torch.rsi/torch-spent.png b/Resources/Textures/_CP14/Objects/Tools/torch.rsi/torch-spent.png new file mode 100644 index 0000000000..5d438db5d0 Binary files /dev/null and b/Resources/Textures/_CP14/Objects/Tools/torch.rsi/torch-spent.png differ diff --git a/Resources/Textures/_CP14/Objects/Tools/torch.rsi/torch-unlit.png b/Resources/Textures/_CP14/Objects/Tools/torch.rsi/torch-unlit.png new file mode 100644 index 0000000000..cab1ac9665 Binary files /dev/null and b/Resources/Textures/_CP14/Objects/Tools/torch.rsi/torch-unlit.png differ diff --git a/Resources/Textures/_CP14/Objects/Tools/torch.rsi/unlit-inhand-left.png b/Resources/Textures/_CP14/Objects/Tools/torch.rsi/unlit-inhand-left.png new file mode 100644 index 0000000000..c03edb2a3c Binary files /dev/null and b/Resources/Textures/_CP14/Objects/Tools/torch.rsi/unlit-inhand-left.png differ diff --git a/Resources/Textures/_CP14/Objects/Tools/torch.rsi/unlit-inhand-right.png b/Resources/Textures/_CP14/Objects/Tools/torch.rsi/unlit-inhand-right.png new file mode 100644 index 0000000000..3802583eb8 Binary files /dev/null and b/Resources/Textures/_CP14/Objects/Tools/torch.rsi/unlit-inhand-right.png differ diff --git a/Resources/migration.yml b/Resources/migration.yml index 74e6a49605..0870b3453f 100644 --- a/Resources/migration.yml +++ b/Resources/migration.yml @@ -149,7 +149,7 @@ CP14KeyBankSafe6: CP14KeyBankSafe #2024-19-11 CP14ClothingRingManaGift: CP14ManaOperationGlove CP14ClothingRingIceDagger: CP14ManaOperationGlove -CP14ClothingRingFlameCreation: null +CP14ClothingRingFlameCreation: CP14Lighter CP14ClothingRingShadowGrab: null CP14ClothingRingEarthWall: null CP14ClothingRingSphereOfLight: null