diff --git a/Content.Server/GameObjects/Components/Damage/DestructibleComponent.cs b/Content.Server/GameObjects/Components/Damage/DestructibleComponent.cs index b808bc6c76..1d62b1670e 100644 --- a/Content.Server/GameObjects/Components/Damage/DestructibleComponent.cs +++ b/Content.Server/GameObjects/Components/Damage/DestructibleComponent.cs @@ -20,9 +20,7 @@ namespace Content.Server.GameObjects.Components.Damage [Dependency] private readonly IEntitySystemManager _entitySystemManager; #pragma warning restore 649 - protected ActSystem _actSystem; - - protected string _spawnOnDestroy; + protected ActSystem ActSystem; /// public override string Name => "Destructible"; @@ -30,26 +28,26 @@ namespace Content.Server.GameObjects.Components.Damage /// /// Entity spawned upon destruction. /// - public string SpawnOnDestroy => _spawnOnDestroy; + public string SpawnOnDestroy { get; set; } void IDestroyAct.OnDestroy(DestructionEventArgs eventArgs) { - if (!string.IsNullOrWhiteSpace(_spawnOnDestroy) && eventArgs.IsSpawnWreck) + if (!string.IsNullOrWhiteSpace(SpawnOnDestroy) && eventArgs.IsSpawnWreck) { - Owner.EntityManager.SpawnEntity(_spawnOnDestroy, Owner.Transform.GridPosition); + Owner.EntityManager.SpawnEntity(SpawnOnDestroy, Owner.Transform.GridPosition); } } public override void ExposeData(ObjectSerializer serializer) { base.ExposeData(serializer); - serializer.DataField(ref _spawnOnDestroy, "spawnondestroy", string.Empty); + serializer.DataField(this, d => d.SpawnOnDestroy, "spawnondestroy", string.Empty); } public override void Initialize() { base.Initialize(); - _actSystem = _entitySystemManager.GetEntitySystem(); + ActSystem = _entitySystemManager.GetEntitySystem(); } @@ -58,7 +56,7 @@ namespace Content.Server.GameObjects.Components.Damage if (!Owner.Deleted) { var pos = Owner.Transform.GridPosition; - _actSystem.HandleDestruction(Owner, + ActSystem.HandleDestruction(Owner, true); //This will call IDestroyAct.OnDestroy on this component (and all other components on this entity) if (DestroySound != string.Empty) { diff --git a/Content.Server/GameObjects/Components/Damage/RuinableComponent.cs b/Content.Server/GameObjects/Components/Damage/RuinableComponent.cs index 7137171f34..4d94d29f1a 100644 --- a/Content.Server/GameObjects/Components/Damage/RuinableComponent.cs +++ b/Content.Server/GameObjects/Components/Damage/RuinableComponent.cs @@ -5,6 +5,7 @@ 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 { @@ -21,6 +22,7 @@ namespace Content.Server.GameObjects.Components.Damage /// How much HP this component can sustain before triggering /// . /// + [ViewVariables(VVAccess.ReadWrite)] public int MaxHp { get; private set; } /// diff --git a/Resources/Prototypes/Entities/Constructible/Walls/walls.yml b/Resources/Prototypes/Entities/Constructible/Walls/walls.yml index 9e8d69252f..a33763fa3d 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: 100 + maxHP: 500 spawnOnDestroy: Girder - type: Occluder sizeX: 32 @@ -49,7 +49,7 @@ - type: Icon sprite: Constructible/Structures/Walls/brick.rsi - type: Destructible - health: 100 + maxHP: 300 spawnOnDestroy: Girder - type: IconSmooth key: walls @@ -65,7 +65,7 @@ - type: Icon sprite: Constructible/Structures/Walls/clock.rsi - type: Destructible - health: 100 + maxHP: 300 spawnOnDestroy: Girder - type: IconSmooth key: walls @@ -81,7 +81,7 @@ - type: Icon sprite: Constructible/Structures/Walls/clown.rsi - type: Destructible - health: 100 + maxHP: 300 spawnOnDestroy: Girder - type: IconSmooth key: walls @@ -98,7 +98,7 @@ - type: Icon sprite: Constructible/Structures/Walls/cult.rsi - type: Destructible - health: 100 + maxHP: 300 spawnOnDestroy: Girder - type: IconSmooth key: walls @@ -114,7 +114,7 @@ - type: Icon sprite: Constructible/Structures/Walls/debug.rsi - type: Destructible - health: 100 + maxHP: 300 spawnOnDestroy: Girder - type: IconSmooth key: walls @@ -130,7 +130,7 @@ - type: Icon sprite: Constructible/Structures/Walls/diamond.rsi - type: Destructible - health: 100 + maxHP: 300 spawnOnDestroy: Girder - type: IconSmooth key: walls @@ -147,7 +147,7 @@ - type: Icon sprite: Constructible/Structures/Walls/gold.rsi - type: Destructible - health: 100 + maxHP: 300 spawnOnDestroy: Girder - type: IconSmooth key: walls @@ -163,7 +163,7 @@ - type: Icon sprite: Constructible/Structures/Walls/ice.rsi - type: Destructible - health: 100 + maxHP: 300 spawnOnDestroy: Girder - type: IconSmooth key: walls @@ -179,7 +179,7 @@ - type: Icon sprite: Constructible/Structures/Walls/metal.rsi - type: Destructible - health: 100 + maxHP: 300 spawnOnDestroy: Girder - type: IconSmooth key: walls @@ -195,7 +195,7 @@ - type: Icon sprite: Constructible/Structures/Walls/plasma.rsi - type: Destructible - health: 100 + maxHP: 300 spawnOnDestroy: Girder - type: IconSmooth key: walls @@ -211,7 +211,7 @@ - type: Icon sprite: Constructible/Structures/Walls/plastic.rsi - type: Destructible - health: 100 + maxHP: 300 spawnOnDestroy: Girder - type: IconSmooth key: walls @@ -229,7 +229,7 @@ sprite: Constructible/Structures/Walls/solid.rsi state: rgeneric - type: Destructible - health: 300 + maxHP: 600 spawnOnDestroy: Girder - type: ReinforcedWall key: walls @@ -247,7 +247,7 @@ - type: Icon sprite: Constructible/Structures/Walls/riveted.rsi - type: Destructible - health: 100 + maxHP: 1000 spawnOnDestroy: Girder - type: IconSmooth key: walls @@ -263,7 +263,7 @@ - type: Icon sprite: Constructible/Structures/Walls/sandstone.rsi - type: Destructible - health: 100 + maxHP: 300 spawnOnDestroy: Girder - type: IconSmooth key: walls @@ -279,7 +279,7 @@ - type: Icon sprite: Constructible/Structures/Walls/silver.rsi - type: Destructible - health: 100 + maxHP: 300 spawnOnDestroy: Girder - type: IconSmooth key: walls @@ -296,9 +296,9 @@ - type: Icon sprite: Constructible/Structures/Walls/solid.rsi - type: Destructible - health: 100 + maxHP: 300 spawnOnDestroy: Girder - destroySound: /Audio/effects/metalbreak.ogg + destroySound: /Audio/Effects/metalbreak.ogg - type: IconSmooth key: walls base: solid @@ -313,7 +313,7 @@ - type: Icon sprite: Constructible/Structures/Walls/uranium.rsi - type: Destructible - health: 100 + maxHP: 300 spawnOnDestroy: Girder - type: IconSmooth key: walls @@ -329,7 +329,7 @@ - type: Icon sprite: Constructible/Structures/Walls/wood.rsi - type: Destructible - health: 100 + maxHP: 300 spawnOnDestroy: Girder - type: IconSmooth key: walls