forked from space-wizards/space-station-14
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mobs burn to ashes on excessive heat damage (space-wizards#26971)
* mobs burn to ashes on excessive heat damage * remove comment, remove random lines I didn't mean to add * combine code into behavior * clean unused * fix namespace * drop next to * fix spawn entities behavior spawning entities outside container
- Loading branch information
1 parent
3d0fc10
commit 4a6cf48
Showing
4 changed files
with
58 additions
and
3 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
Content.Server/Destructible/Thresholds/Behaviors/BurnBodyBehavior.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using Content.Shared.Body.Components; | ||
using Content.Shared.Inventory; | ||
using Content.Shared.Popups; | ||
using JetBrains.Annotations; | ||
using Robust.Server.GameObjects; | ||
|
||
namespace Content.Server.Destructible.Thresholds.Behaviors; | ||
|
||
[UsedImplicitly] | ||
[DataDefinition] | ||
public sealed partial class BurnBodyBehavior : IThresholdBehavior | ||
{ | ||
|
||
public void Execute(EntityUid bodyId, DestructibleSystem system, EntityUid? cause = null) | ||
{ | ||
var transformSystem = system.EntityManager.System<TransformSystem>(); | ||
var inventorySystem = system.EntityManager.System<InventorySystem>(); | ||
var sharedPopupSystem = system.EntityManager.System<SharedPopupSystem>(); | ||
|
||
if (!system.EntityManager.TryGetComponent<InventoryComponent>(bodyId, out var comp)) | ||
return; | ||
|
||
foreach (var item in inventorySystem.GetHandOrInventoryEntities(bodyId)) | ||
{ | ||
transformSystem.DropNextTo(item, bodyId); | ||
} | ||
|
||
sharedPopupSystem.PopupCoordinates(Loc.GetString("bodyburn-text-others", ("name", bodyId)), transformSystem.GetMoverCoordinates(bodyId), PopupType.LargeCaution); | ||
|
||
system.EntityManager.QueueDeleteEntity(bodyId); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
bodyburn-text-others = {$name}'s body burns to ash! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters