From bb923aa230f163acfd54cd23ae72526e76a3d9f2 Mon Sep 17 00:00:00 2001 From: DrSmugleaf Date: Sat, 22 Aug 2020 13:40:22 +0200 Subject: [PATCH] As discussed on the Discord, xenos are not humans (#1840) * As discussed on the Discord, xenos are not humans * Add living component for living beings without a defined body * Merge LivingDamageable and Damageable components * Fix ruinable and state manager inconsistencies * Fix ruinable exposedata * Fix new destructibles yamls * Fix healing not healing * Fix alive not being a valid state * Fix valid state checking --- .../Components/Body/BodyManagerComponent.cs | 7 -- .../Components/Damage/BreakableComponent.cs | 2 - .../Components/Damage/RuinableComponent.cs | 31 ++----- .../Components/Mobs/MobStateManager.cs | 15 ++- .../Body/SharedBodyManagerComponent.cs | 10 -- .../Components/Damage/DamageableComponent.cs | 91 ++++++++++++++++++- .../Constructible/Doors/airlock_base.yml | 2 +- .../Constructible/Ground/furniture.yml | 8 +- .../Constructible/Ground/instruments.yml | 4 +- .../Constructible/Ground/pilot_chair.yml | 2 +- .../Entities/Constructible/Ground/table.yml | 4 +- .../Constructible/Power/gravity_generator.yml | 2 +- .../Constructible/Power/medical_scanner.yml | 2 +- .../Entities/Constructible/Power/power.yml | 4 +- .../Constructible/Power/vending_machines.yml | 2 +- .../Constructible/Storage/Closets/closet.yml | 2 +- .../Storage/StorageTanks/storage_tank.yml | 2 +- .../Constructible/Storage/crate_base.yml | 2 +- .../Entities/Constructible/Walls/asteroid.yml | 2 +- .../Entities/Constructible/Walls/girder.yml | 2 +- .../Entities/Constructible/Walls/lighting.yml | 4 +- .../Entities/Constructible/Walls/low_wall.yml | 2 +- .../Entities/Constructible/Walls/walls.yml | 38 ++++---- .../Entities/Constructible/Walls/windows.yml | 2 +- .../Prototypes/Entities/Mobs/NPCs/animals.yml | 6 +- .../Prototypes/Entities/Mobs/NPCs/carp.yml | 6 +- .../Prototypes/Entities/Mobs/NPCs/mimic.yml | 6 +- .../Prototypes/Entities/Mobs/NPCs/pets.yml | 6 +- .../Prototypes/Entities/Mobs/NPCs/xeno.yml | 6 +- .../Entities/Mobs/Species/human.yml | 4 + .../Weapons/Guns/Explosives/grenades.yml | 6 +- SpaceStation14.sln.DotSettings | 1 + 32 files changed, 175 insertions(+), 108 deletions(-) diff --git a/Content.Server/GameObjects/Components/Body/BodyManagerComponent.cs b/Content.Server/GameObjects/Components/Body/BodyManagerComponent.cs index 5c14e4da0c..aad68a5e9b 100644 --- a/Content.Server/GameObjects/Components/Body/BodyManagerComponent.cs +++ b/Content.Server/GameObjects/Components/Body/BodyManagerComponent.cs @@ -18,14 +18,12 @@ using Content.Shared.Body.Template; using Content.Shared.GameObjects.Components.Body; using Content.Shared.GameObjects.Components.Damage; using Content.Shared.GameObjects.Components.Movement; -using Robust.Server.GameObjects; using Robust.Server.Interfaces.Player; using Robust.Shared.GameObjects; using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.Interfaces.Reflection; using Robust.Shared.IoC; using Robust.Shared.Log; -using Robust.Shared.Maths; using Robust.Shared.Players; using Robust.Shared.Prototypes; using Robust.Shared.Serialization; @@ -138,11 +136,6 @@ namespace Content.Server.GameObjects.Components.Body base.Initialize(); LoadBodyPreset(Preset); - - foreach (var behavior in Owner.GetAllComponents()) - { - HealthChangedEvent += behavior.OnHealthChanged; - } } protected override void Startup() diff --git a/Content.Server/GameObjects/Components/Damage/BreakableComponent.cs b/Content.Server/GameObjects/Components/Damage/BreakableComponent.cs index 15ad3e8a35..5ea60a7fab 100644 --- a/Content.Server/GameObjects/Components/Damage/BreakableComponent.cs +++ b/Content.Server/GameObjects/Components/Damage/BreakableComponent.cs @@ -41,8 +41,6 @@ namespace Content.Server.GameObjects.Components.Damage switch (eventArgs.Severity) { case ExplosionSeverity.Destruction: - PerformDestruction(); - break; case ExplosionSeverity.Heavy: PerformDestruction(); break; diff --git a/Content.Server/GameObjects/Components/Damage/RuinableComponent.cs b/Content.Server/GameObjects/Components/Damage/RuinableComponent.cs index 4d94d29f1a..713448fd1a 100644 --- a/Content.Server/GameObjects/Components/Damage/RuinableComponent.cs +++ b/Content.Server/GameObjects/Components/Damage/RuinableComponent.cs @@ -5,7 +5,6 @@ using Robust.Shared.GameObjects; using Robust.Shared.GameObjects.Systems; using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.Serialization; -using Robust.Shared.ViewVariables; namespace Content.Server.GameObjects.Components.Damage { @@ -18,13 +17,6 @@ namespace Content.Server.GameObjects.Components.Damage { private DamageState _currentDamageState; - /// - /// How much HP this component can sustain before triggering - /// . - /// - [ViewVariables(VVAccess.ReadWrite)] - public int MaxHp { get; private set; } - /// /// Sound played upon destruction. /// @@ -35,29 +27,24 @@ namespace Content.Server.GameObjects.Components.Damage public override DamageState CurrentDamageState => _currentDamageState; - public override void Initialize() - { - base.Initialize(); - HealthChangedEvent += OnHealthChanged; - } - public override void ExposeData(ObjectSerializer serializer) { base.ExposeData(serializer); - serializer.DataField(this, ruinable => ruinable.MaxHp, "maxHP", 100); + serializer.DataReadWriteFunction( + "deadThreshold", + 100, + t => DeadThreshold = t , + () => DeadThreshold ?? -1); + serializer.DataField(this, ruinable => ruinable.DestroySound, "destroySound", string.Empty); } - public override void OnRemove() + protected override void EnterState(DamageState state) { - base.OnRemove(); - HealthChangedEvent -= OnHealthChanged; - } + base.EnterState(state); - private void OnHealthChanged(HealthChangedEventArgs e) - { - if (CurrentDamageState != DamageState.Dead && TotalDamage >= MaxHp) + if (state == DamageState.Dead) { PerformDestruction(); } diff --git a/Content.Server/GameObjects/Components/Mobs/MobStateManager.cs b/Content.Server/GameObjects/Components/Mobs/MobStateManager.cs index acb501a1ea..d1e01e208c 100644 --- a/Content.Server/GameObjects/Components/Mobs/MobStateManager.cs +++ b/Content.Server/GameObjects/Components/Mobs/MobStateManager.cs @@ -187,7 +187,12 @@ namespace Content.Server.GameObjects.Components.Mobs { case RuinableComponent ruinable: { - var modifier = (int) (ruinable.TotalDamage / (ruinable.MaxHp / 7f)); + if (ruinable.DeadThreshold == null) + { + break; + } + + var modifier = (int) (ruinable.TotalDamage / (ruinable.DeadThreshold / 7f)); status.ChangeStatusEffectIcon(StatusEffect.Health, "/Textures/Interface/StatusEffects/Human/human" + modifier + ".png"); @@ -196,8 +201,12 @@ namespace Content.Server.GameObjects.Components.Mobs } case BodyManagerComponent body: { - // TODO: Declare body max normal damage (currently 100) - var modifier = (int) (body.TotalDamage / (100f / 7f)); + if (body.CriticalThreshold == null) + { + return; + } + + var modifier = (int) (body.TotalDamage / (body.CriticalThreshold / 7f)); status.ChangeStatusEffectIcon(StatusEffect.Health, "/Textures/Interface/StatusEffects/Human/human" + modifier + ".png"); diff --git a/Content.Shared/GameObjects/Components/Body/SharedBodyManagerComponent.cs b/Content.Shared/GameObjects/Components/Body/SharedBodyManagerComponent.cs index dcc3ae7dc5..d78b93320f 100644 --- a/Content.Shared/GameObjects/Components/Body/SharedBodyManagerComponent.cs +++ b/Content.Shared/GameObjects/Components/Body/SharedBodyManagerComponent.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using Content.Shared.GameObjects.Components.Damage; using Robust.Shared.GameObjects; using Robust.Shared.Serialization; @@ -11,15 +10,6 @@ namespace Content.Shared.GameObjects.Components.Body public override string Name => "BodyManager"; public override uint? NetID => ContentNetIDs.BODY_MANAGER; - - public override List SupportedDamageStates => new List {DamageState.Alive, DamageState.Critical, DamageState.Dead}; - - public override DamageState CurrentDamageState => - CurrentDamageState = TotalDamage > 200 - ? DamageState.Dead - : TotalDamage > 100 - ? DamageState.Critical - : DamageState.Alive; } [Serializable, NetSerializable] diff --git a/Content.Shared/GameObjects/Components/Damage/DamageableComponent.cs b/Content.Shared/GameObjects/Components/Damage/DamageableComponent.cs index 2d31eeb42b..f621c3f636 100644 --- a/Content.Shared/GameObjects/Components/Damage/DamageableComponent.cs +++ b/Content.Shared/GameObjects/Components/Damage/DamageableComponent.cs @@ -27,15 +27,62 @@ namespace Content.Shared.GameObjects.Components.Damage public override string Name => "Damageable"; - public event Action HealthChangedEvent = default!; + private DamageState _currentDamageState; + + public event Action? HealthChangedEvent; + + /// + /// The threshold of damage, if any, above which the entity enters crit. + /// -1 means that this entity cannot go into crit. + /// + [ViewVariables(VVAccess.ReadWrite)] + public int? CriticalThreshold { get; set; } + + /// + /// The threshold of damage, if any, above which the entity dies. + /// -1 means that this entity cannot die. + /// + [ViewVariables(VVAccess.ReadWrite)] + public int? DeadThreshold { get; set; } [ViewVariables] private ResistanceSet Resistance { get; set; } = default!; [ViewVariables] private DamageContainer Damage { get; set; } = default!; - public virtual List SupportedDamageStates => new List {DamageState.Alive}; + public virtual List SupportedDamageStates + { + get + { + var states = new List {DamageState.Alive}; - public virtual DamageState CurrentDamageState { get; protected set; } = DamageState.Alive; + if (CriticalThreshold != null) + { + states.Add(DamageState.Critical); + } + + if (DeadThreshold != null) + { + states.Add(DamageState.Dead); + } + + return states; + } + } + + public virtual DamageState CurrentDamageState + { + get => _currentDamageState; + set + { + var old = _currentDamageState; + _currentDamageState = value; + + if (old != value) + { + EnterState(value); + } + } + } [ViewVariables] public int TotalDamage => Damage.TotalDamage; @@ -47,6 +94,18 @@ namespace Content.Shared.GameObjects.Components.Damage { base.ExposeData(serializer); + serializer.DataReadWriteFunction( + "criticalThreshold", + -1, + t => CriticalThreshold = t == -1 ? (int?) null : t, + () => CriticalThreshold ?? -1); + + serializer.DataReadWriteFunction( + "deadThreshold", + -1, + t => DeadThreshold = t == -1 ? (int?) null : t, + () => DeadThreshold ?? -1); + if (serializer.Reading) { // Doesn't write to file, TODO? @@ -75,6 +134,16 @@ namespace Content.Shared.GameObjects.Components.Damage } } + public override void Initialize() + { + base.Initialize(); + + foreach (var behavior in Owner.GetAllComponents()) + { + HealthChangedEvent += behavior.OnHealthChanged; + } + } + public bool TryGetDamage(DamageType type, out int damage) { return Damage.TryGetDamageValue(type, out damage); @@ -218,10 +287,26 @@ namespace Content.Shared.GameObjects.Components.Damage OnHealthChanged(args); } + protected virtual void EnterState(DamageState state) { } + protected virtual void OnHealthChanged(HealthChangedEventArgs e) { + if (DeadThreshold != -1 && TotalDamage > DeadThreshold) + { + CurrentDamageState = DamageState.Dead; + } + else if (CriticalThreshold != -1 && TotalDamage > CriticalThreshold) + { + CurrentDamageState = DamageState.Critical; + } + else + { + CurrentDamageState = DamageState.Alive; + } + Owner.EntityManager.EventBus.RaiseEvent(EventSource.Local, e); HealthChangedEvent?.Invoke(e); + Dirty(); } } diff --git a/Resources/Prototypes/Entities/Constructible/Doors/airlock_base.yml b/Resources/Prototypes/Entities/Constructible/Doors/airlock_base.yml index 292eb737df..931791379e 100644 --- a/Resources/Prototypes/Entities/Constructible/Doors/airlock_base.yml +++ b/Resources/Prototypes/Entities/Constructible/Doors/airlock_base.yml @@ -59,7 +59,7 @@ - type: SnapGrid offset: Center - type: Destructible - maxHP: 500 + deadThreshold: 500 placement: mode: SnapgridCenter diff --git a/Resources/Prototypes/Entities/Constructible/Ground/furniture.yml b/Resources/Prototypes/Entities/Constructible/Ground/furniture.yml index 39799efae4..a46c09b640 100644 --- a/Resources/Prototypes/Entities/Constructible/Ground/furniture.yml +++ b/Resources/Prototypes/Entities/Constructible/Ground/furniture.yml @@ -18,7 +18,7 @@ - type: Anchorable - type: Pullable - type: Destructible - maxHP: 50 + deadThreshold: 50 - type: entity name: bar stool @@ -51,7 +51,7 @@ - type: Anchorable - type: Pullable - type: Destructible - maxHP: 50 + deadThreshold: 50 - type: entity name: dark office chair @@ -86,7 +86,7 @@ - type: Anchorable - type: Pullable - type: Destructible - maxHP: 50 + deadThreshold: 50 - type: entity parent: Chair @@ -134,6 +134,6 @@ position: Down rotation: -90 - type: Destructible - maxHP: 75 + deadThreshold: 75 placement: mode: SnapgridCenter diff --git a/Resources/Prototypes/Entities/Constructible/Ground/instruments.yml b/Resources/Prototypes/Entities/Constructible/Ground/instruments.yml index 2d4fb5b564..0d6f8fd52b 100644 --- a/Resources/Prototypes/Entities/Constructible/Ground/instruments.yml +++ b/Resources/Prototypes/Entities/Constructible/Ground/instruments.yml @@ -18,7 +18,7 @@ - type: SnapGrid offset: Center - type: Destructible - maxHP: 50 + deadThreshold: 50 - type: UserInterface interfaces: - key: enum.InstrumentUiKey.Key @@ -43,7 +43,7 @@ name: minimoog parent: BasePlaceableInstrument id: MinimoogInstrument - description: 'This is a minimoog, like a space piano, but more spacey!' + description: 'This is a minimoog, like a space piano, but more spacey!' components: - type: Instrument program: 81 diff --git a/Resources/Prototypes/Entities/Constructible/Ground/pilot_chair.yml b/Resources/Prototypes/Entities/Constructible/Ground/pilot_chair.yml index f986636ee2..e0e94ba172 100644 --- a/Resources/Prototypes/Entities/Constructible/Ground/pilot_chair.yml +++ b/Resources/Prototypes/Entities/Constructible/Ground/pilot_chair.yml @@ -14,7 +14,7 @@ - type: Clickable - type: InteractionOutline - type: Destructible - maxHP: 100 + deadThreshold: 100 - type: Physics - type: ShuttleController - type: Strap diff --git a/Resources/Prototypes/Entities/Constructible/Ground/table.yml b/Resources/Prototypes/Entities/Constructible/Ground/table.yml index 1dd92f308e..dbf64465ec 100644 --- a/Resources/Prototypes/Entities/Constructible/Ground/table.yml +++ b/Resources/Prototypes/Entities/Constructible/Ground/table.yml @@ -24,7 +24,7 @@ base: solid_ - type: Climbable - type: Destructible - maxHP: 50 + deadThreshold: 50 spawnOnDestroy: SteelSheet1 # TODO: drop wood instead of steel when destroyed when that's added @@ -40,5 +40,5 @@ key: wood base: wood_ - type: Destructible - maxHP: 50 + deadThreshold: 50 spawnOnDestroy: SteelSheet1 diff --git a/Resources/Prototypes/Entities/Constructible/Power/gravity_generator.yml b/Resources/Prototypes/Entities/Constructible/Power/gravity_generator.yml index 4163f5dfdd..d783129f87 100644 --- a/Resources/Prototypes/Entities/Constructible/Power/gravity_generator.yml +++ b/Resources/Prototypes/Entities/Constructible/Power/gravity_generator.yml @@ -29,7 +29,7 @@ - type: Clickable - type: InteractionOutline - type: Breakable - maxHP: 150 + deadThreshold: 150 - type: GravityGenerator - type: UserInterface interfaces: diff --git a/Resources/Prototypes/Entities/Constructible/Power/medical_scanner.yml b/Resources/Prototypes/Entities/Constructible/Power/medical_scanner.yml index 390cdca4d0..221b93b43c 100644 --- a/Resources/Prototypes/Entities/Constructible/Power/medical_scanner.yml +++ b/Resources/Prototypes/Entities/Constructible/Power/medical_scanner.yml @@ -35,7 +35,7 @@ offset: Center - type: MedicalScanner - type: Destructible - maxHP: 100 + deadThreshold: 100 - type: Appearance visuals: - type: MedicalScannerVisualizer diff --git a/Resources/Prototypes/Entities/Constructible/Power/power.yml b/Resources/Prototypes/Entities/Constructible/Power/power.yml index 3c7b740fbd..70c472224d 100644 --- a/Resources/Prototypes/Entities/Constructible/Power/power.yml +++ b/Resources/Prototypes/Entities/Constructible/Power/power.yml @@ -51,7 +51,7 @@ - type: PowerConsumer drawRate: 50 - type: Breakable - maxHP: 100 + deadThreshold: 100 - type: Anchorable - type: entity @@ -290,7 +290,7 @@ - type: SnapGrid offset: Center - type: Breakable - maxHP: 100 + deadThreshold: 100 #Depriciated, to be removed from maps diff --git a/Resources/Prototypes/Entities/Constructible/Power/vending_machines.yml b/Resources/Prototypes/Entities/Constructible/Power/vending_machines.yml index 3042c86ce9..c4b616b3e3 100644 --- a/Resources/Prototypes/Entities/Constructible/Power/vending_machines.yml +++ b/Resources/Prototypes/Entities/Constructible/Power/vending_machines.yml @@ -31,7 +31,7 @@ - type: SnapGrid offset: Center - type: Breakable - maxHP: 50 + deadThreshold: 50 - type: UserInterface interfaces: - key: enum.VendingMachineUiKey.Key diff --git a/Resources/Prototypes/Entities/Constructible/Storage/Closets/closet.yml b/Resources/Prototypes/Entities/Constructible/Storage/Closets/closet.yml index 21f2f49e97..020f99c236 100644 --- a/Resources/Prototypes/Entities/Constructible/Storage/Closets/closet.yml +++ b/Resources/Prototypes/Entities/Constructible/Storage/Closets/closet.yml @@ -42,7 +42,7 @@ - type: EntityStorage - type: PlaceableSurface - type: Destructible - maxHP: 100 + deadThreshold: 100 - type: Appearance visuals: - type: StorageVisualizer diff --git a/Resources/Prototypes/Entities/Constructible/Storage/StorageTanks/storage_tank.yml b/Resources/Prototypes/Entities/Constructible/Storage/StorageTanks/storage_tank.yml index 44f8c3180f..f13e61dbe2 100644 --- a/Resources/Prototypes/Entities/Constructible/Storage/StorageTanks/storage_tank.yml +++ b/Resources/Prototypes/Entities/Constructible/Storage/StorageTanks/storage_tank.yml @@ -26,7 +26,7 @@ mass: 15 Anchored: false - type: Destructible - maxHP: 10 + deadThreshold: 10 - type: Solution maxVol: 1500 caps: 2 diff --git a/Resources/Prototypes/Entities/Constructible/Storage/crate_base.yml b/Resources/Prototypes/Entities/Constructible/Storage/crate_base.yml index 6c4047f99c..77aa013b3c 100644 --- a/Resources/Prototypes/Entities/Constructible/Storage/crate_base.yml +++ b/Resources/Prototypes/Entities/Constructible/Storage/crate_base.yml @@ -37,7 +37,7 @@ CanWeldShut: false - type: PlaceableSurface - type: Destructible - maxHP: 100 + deadThreshold: 100 - type: Appearance visuals: - type: StorageVisualizer diff --git a/Resources/Prototypes/Entities/Constructible/Walls/asteroid.yml b/Resources/Prototypes/Entities/Constructible/Walls/asteroid.yml index 73437dc525..03226aa632 100644 --- a/Resources/Prototypes/Entities/Constructible/Walls/asteroid.yml +++ b/Resources/Prototypes/Entities/Constructible/Walls/asteroid.yml @@ -17,7 +17,7 @@ - !type:PhysShapeAabb layer: [MobMask] - type: Destructible - maxHP: 100 + deadThreshold: 100 - type: Occluder sizeX: 32 sizeY: 32 diff --git a/Resources/Prototypes/Entities/Constructible/Walls/girder.yml b/Resources/Prototypes/Entities/Constructible/Walls/girder.yml index 50a4dfa3f2..730451a73a 100644 --- a/Resources/Prototypes/Entities/Constructible/Walls/girder.yml +++ b/Resources/Prototypes/Entities/Constructible/Walls/girder.yml @@ -15,7 +15,7 @@ - !type:PhysShapeAabb layer: [MobMask, Opaque] - type: Destructible - maxHP: 50 + deadThreshold: 50 spawnOnDestroy: SteelSheet1 - type: SnapGrid offset: Edge diff --git a/Resources/Prototypes/Entities/Constructible/Walls/lighting.yml b/Resources/Prototypes/Entities/Constructible/Walls/lighting.yml index 28e87a8d7a..06ee76322b 100644 --- a/Resources/Prototypes/Entities/Constructible/Walls/lighting.yml +++ b/Resources/Prototypes/Entities/Constructible/Walls/lighting.yml @@ -46,7 +46,7 @@ bulb: Tube - type: PowerReceiver - type: Destructible - maxHP: 50 + deadThreshold: 50 - type: entity name: small light @@ -69,4 +69,4 @@ bulb: Bulb - type: PowerReceiver - type: Destructible - maxHP: 25 + deadThreshold: 25 diff --git a/Resources/Prototypes/Entities/Constructible/Walls/low_wall.yml b/Resources/Prototypes/Entities/Constructible/Walls/low_wall.yml index 7c1bb1e5a4..2a391add8c 100644 --- a/Resources/Prototypes/Entities/Constructible/Walls/low_wall.yml +++ b/Resources/Prototypes/Entities/Constructible/Walls/low_wall.yml @@ -25,7 +25,7 @@ - VaultImpassable - SmallImpassable - type: Destructible - maxHP: 100 + deadThreshold: 100 - type: SnapGrid offset: Center - type: LowWall diff --git a/Resources/Prototypes/Entities/Constructible/Walls/walls.yml b/Resources/Prototypes/Entities/Constructible/Walls/walls.yml index a33763fa3d..f1b40df43d 100644 --- a/Resources/Prototypes/Entities/Constructible/Walls/walls.yml +++ b/Resources/Prototypes/Entities/Constructible/Walls/walls.yml @@ -26,7 +26,7 @@ - VaultImpassable - SmallImpassable - type: Destructible - maxHP: 500 + deadThreshold: 500 spawnOnDestroy: Girder - type: Occluder sizeX: 32 @@ -49,7 +49,7 @@ - type: Icon sprite: Constructible/Structures/Walls/brick.rsi - type: Destructible - maxHP: 300 + deadThreshold: 300 spawnOnDestroy: Girder - type: IconSmooth key: walls @@ -65,7 +65,7 @@ - type: Icon sprite: Constructible/Structures/Walls/clock.rsi - type: Destructible - maxHP: 300 + deadThreshold: 300 spawnOnDestroy: Girder - type: IconSmooth key: walls @@ -81,7 +81,7 @@ - type: Icon sprite: Constructible/Structures/Walls/clown.rsi - type: Destructible - maxHP: 300 + deadThreshold: 300 spawnOnDestroy: Girder - type: IconSmooth key: walls @@ -98,7 +98,7 @@ - type: Icon sprite: Constructible/Structures/Walls/cult.rsi - type: Destructible - maxHP: 300 + deadThreshold: 300 spawnOnDestroy: Girder - type: IconSmooth key: walls @@ -114,7 +114,7 @@ - type: Icon sprite: Constructible/Structures/Walls/debug.rsi - type: Destructible - maxHP: 300 + deadThreshold: 300 spawnOnDestroy: Girder - type: IconSmooth key: walls @@ -130,7 +130,7 @@ - type: Icon sprite: Constructible/Structures/Walls/diamond.rsi - type: Destructible - maxHP: 300 + deadThreshold: 300 spawnOnDestroy: Girder - type: IconSmooth key: walls @@ -147,7 +147,7 @@ - type: Icon sprite: Constructible/Structures/Walls/gold.rsi - type: Destructible - maxHP: 300 + deadThreshold: 300 spawnOnDestroy: Girder - type: IconSmooth key: walls @@ -163,7 +163,7 @@ - type: Icon sprite: Constructible/Structures/Walls/ice.rsi - type: Destructible - maxHP: 300 + deadThreshold: 300 spawnOnDestroy: Girder - type: IconSmooth key: walls @@ -179,7 +179,7 @@ - type: Icon sprite: Constructible/Structures/Walls/metal.rsi - type: Destructible - maxHP: 300 + deadThreshold: 300 spawnOnDestroy: Girder - type: IconSmooth key: walls @@ -195,7 +195,7 @@ - type: Icon sprite: Constructible/Structures/Walls/plasma.rsi - type: Destructible - maxHP: 300 + deadThreshold: 300 spawnOnDestroy: Girder - type: IconSmooth key: walls @@ -211,7 +211,7 @@ - type: Icon sprite: Constructible/Structures/Walls/plastic.rsi - type: Destructible - maxHP: 300 + deadThreshold: 300 spawnOnDestroy: Girder - type: IconSmooth key: walls @@ -229,7 +229,7 @@ sprite: Constructible/Structures/Walls/solid.rsi state: rgeneric - type: Destructible - maxHP: 600 + deadThreshold: 600 spawnOnDestroy: Girder - type: ReinforcedWall key: walls @@ -247,7 +247,7 @@ - type: Icon sprite: Constructible/Structures/Walls/riveted.rsi - type: Destructible - maxHP: 1000 + deadThreshold: 1000 spawnOnDestroy: Girder - type: IconSmooth key: walls @@ -263,7 +263,7 @@ - type: Icon sprite: Constructible/Structures/Walls/sandstone.rsi - type: Destructible - maxHP: 300 + deadThreshold: 300 spawnOnDestroy: Girder - type: IconSmooth key: walls @@ -279,7 +279,7 @@ - type: Icon sprite: Constructible/Structures/Walls/silver.rsi - type: Destructible - maxHP: 300 + deadThreshold: 300 spawnOnDestroy: Girder - type: IconSmooth key: walls @@ -296,7 +296,7 @@ - type: Icon sprite: Constructible/Structures/Walls/solid.rsi - type: Destructible - maxHP: 300 + deadThreshold: 300 spawnOnDestroy: Girder destroySound: /Audio/Effects/metalbreak.ogg - type: IconSmooth @@ -313,7 +313,7 @@ - type: Icon sprite: Constructible/Structures/Walls/uranium.rsi - type: Destructible - maxHP: 300 + deadThreshold: 300 spawnOnDestroy: Girder - type: IconSmooth key: walls @@ -329,7 +329,7 @@ - type: Icon sprite: Constructible/Structures/Walls/wood.rsi - type: Destructible - maxHP: 300 + deadThreshold: 300 spawnOnDestroy: Girder - type: IconSmooth key: walls diff --git a/Resources/Prototypes/Entities/Constructible/Walls/windows.yml b/Resources/Prototypes/Entities/Constructible/Walls/windows.yml index e0f231f161..773e41a95a 100644 --- a/Resources/Prototypes/Entities/Constructible/Walls/windows.yml +++ b/Resources/Prototypes/Entities/Constructible/Walls/windows.yml @@ -28,7 +28,7 @@ - VaultImpassable - SmallImpassable - type: Destructible - maxHP: 100 + deadThreshold: 100 - type: SnapGrid offset: Center - type: Airtight diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml b/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml index 9ab31e8bcb..2e60662acc 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml @@ -39,9 +39,9 @@ layer: - Opaque - MobImpassable - - type: BodyManager - BaseTemplate: bodyTemplate.Humanoid - BasePreset: bodyPreset.BasicHuman + - type: Damageable + criticalThreshold: 50 + deadThreshold: 100 - type: HeatResistance - type: CombatMode - type: Teleportable diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/carp.yml b/Resources/Prototypes/Entities/Mobs/NPCs/carp.yml index 00d7371892..3ba27aad56 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/carp.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/carp.yml @@ -34,9 +34,9 @@ layer: - Opaque - MobImpassable - - type: BodyManager - BaseTemplate: bodyTemplate.Humanoid - BasePreset: bodyPreset.BasicHuman + - type: Damageable + criticalThreshold: 50 + deadThreshold: 100 - type: HeatResistance - type: CombatMode - type: Teleportable diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/mimic.yml b/Resources/Prototypes/Entities/Mobs/NPCs/mimic.yml index 9f34c6b0a8..9ac97a7d3a 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/mimic.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/mimic.yml @@ -34,9 +34,9 @@ layer: - Opaque - MobImpassable - - type: BodyManager - baseTemplate: bodyTemplate.Humanoid - basePreset: bodyPreset.BasicHuman + - type: Damageable + criticalThreshold: 100 + deadThreshold: 200 - type: MobStateManager - type: HeatResistance - type: CombatMode diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/pets.yml b/Resources/Prototypes/Entities/Mobs/NPCs/pets.yml index fc01a43eb8..06943ffcf5 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/pets.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/pets.yml @@ -31,9 +31,9 @@ layer: - Opaque - MobImpassable - - type: BodyManager - BaseTemplate: bodyTemplate.Humanoid - BasePreset: bodyPreset.BasicHuman + - type: Damageable + criticalThreshold: 50 + deadThreshold: 100 - type: HeatResistance - type: CombatMode - type: Teleportable diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/xeno.yml b/Resources/Prototypes/Entities/Mobs/NPCs/xeno.yml index ada753f860..a6214337cd 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/xeno.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/xeno.yml @@ -36,9 +36,9 @@ layer: - Opaque - MobImpassable - - type: BodyManager - baseTemplate: bodyTemplate.Humanoid - basePreset: bodyPreset.BasicHuman + - type: Damageable + criticalThreshold: 150 + deadThreshold: 200 - type: Metabolism - type: MobStateManager - type: HeatResistance diff --git a/Resources/Prototypes/Entities/Mobs/Species/human.yml b/Resources/Prototypes/Entities/Mobs/Species/human.yml index 5e1d1ebb69..aabc6022cc 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/human.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/human.yml @@ -126,6 +126,8 @@ - Opaque - MobImpassable - type: BodyManager + criticalThreshold: 100 + deadThreshold: 200 baseTemplate: bodyTemplate.Humanoid basePreset: bodyPreset.BasicHuman - type: Metabolism @@ -256,6 +258,8 @@ layer: - MobImpassable - type: BodyManager + criticalThreshold: 100 + deadThreshold: 200 baseTemplate: bodyTemplate.Humanoid basePreset: bodyPreset.BasicHuman - type: MobStateManager diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Explosives/grenades.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Explosives/grenades.yml index ffe5c80017..9bc3144e0f 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Explosives/grenades.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Explosives/grenades.yml @@ -22,7 +22,7 @@ lightImpactRange: 4 flashRange: 7 - type: Destructible - maxHP: 10 + deadThreshold: 10 - type: Appearance visuals: - type: TimerTriggerVisualizer @@ -48,7 +48,7 @@ delay: 3.5 - type: FlashExplosive - type: Destructible - maxHP: 10 + deadThreshold: 10 - type: Appearance visuals: - type: TimerTriggerVisualizer @@ -78,7 +78,7 @@ lightImpactRange: 7 flashRange: 10 - type: Destructible - maxHP: 10 + deadThreshold: 10 - type: Appearance visuals: - type: TimerTriggerVisualizer diff --git a/SpaceStation14.sln.DotSettings b/SpaceStation14.sln.DotSettings index 37428eb88e..e802b4285f 100644 --- a/SpaceStation14.sln.DotSettings +++ b/SpaceStation14.sln.DotSettings @@ -65,6 +65,7 @@ <data><IncludeFilters /><ExcludeFilters><Filter ModuleMask="Lidgren.Network" ModuleVersionMask="*" ClassMask="*" FunctionMask="*" IsEnabled="True" /></ExcludeFilters></data> True True + True True True True