Cherrypicks 3 (#382)

* Mobs burn to ashes on excessive heat damage (#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

* fix burning to ash not working on all mobs (#27158)

* add ghostnado button to warp menu (#27556)

* add ghostnado button to warp menu

* translator ops

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>

* Make arguments and parameters wrap to one variable per line (#27766)

* Fix ghosts getting spawned in nullspace (#27617)

* Add tests for ghost spawn position

* Make ghosts spawn immediately

* Format mind system

* Move ghost spawning to GhostSystem

* Spawn ghost on grid or map

This fixes the ghosts being attached the parent entity instead of the grid.

* Move logging out of the ghost system

* Make round start observer spawn using GhostSystem

* Move GameTicker ghost spawning to GhostSystem

Moved the more robust character name selection code over.
Moved the TimeOfDeath code over.
Added canReturn logic.

* Add overrides and default for ghost spawn coordinates

* Add warning log to ghost spawn fail

* Clean up test

* Dont spawn ghost on map delete

* Minor changes to the role test

* Fix role test failing to spawn ghost

It was failing the map check due to using Nullspace

* Fix ghost tests when running in parallel

Not sure what happened, but it seems to be because they were running simultaneously and overwriting values.

* Clean up ghost tests

* Test that map deletion does not spawn ghosts

* Spawn ghost on the next available map

* Disallow spawning on deleted maps

* Fix map deletion ghost test

* Cleanup

---------

Co-authored-by: Whisper <121047731+QuietlyWhisper@users.noreply.github.com>
Co-authored-by: deltanedas <39013340+deltanedas@users.noreply.github.com>
Co-authored-by: ShadowCommander <shadowjjt@gmail.com>
This commit is contained in:
Aviu00
2024-06-25 21:39:44 +00:00
committed by GitHub
parent b6201631ae
commit 2fefca5f70
18 changed files with 460 additions and 131 deletions

View File

@@ -1,3 +1,4 @@
#nullable enable
using System.Linq;
using Content.Server.GameTicking;
using Content.Shared.Ghost;
@@ -77,7 +78,7 @@ public sealed partial class MindTests
await using var pair = await SetupPair(dirty: true);
var server = pair.Server;
var testMap = await pair.CreateTestMap();
var coordinates = testMap.GridCoords;
var testMap2 = await pair.CreateTestMap();
var entMan = server.ResolveDependency<IServerEntityManager>();
var mapManager = server.ResolveDependency<IMapManager>();
@@ -91,7 +92,7 @@ public sealed partial class MindTests
MindComponent mind = default!;
await server.WaitAssertion(() =>
{
playerEnt = entMan.SpawnEntity(null, coordinates);
playerEnt = entMan.SpawnEntity(null, testMap.GridCoords);
mindId = player.ContentData()!.Mind!.Value;
mind = entMan.GetComponent<MindComponent>(mindId);
mindSystem.TransferTo(mindId, playerEnt);
@@ -100,14 +101,20 @@ public sealed partial class MindTests
});
await pair.RunTicksSync(5);
await server.WaitPost(() => mapManager.DeleteMap(testMap.MapId));
await server.WaitAssertion(() => mapManager.DeleteMap(testMap.MapId));
await pair.RunTicksSync(5);
await server.WaitAssertion(() =>
{
#pragma warning disable NUnit2045 // Interdependent assertions.
Assert.That(entMan.EntityExists(mind.CurrentEntity), Is.True);
Assert.That(mind.CurrentEntity, Is.Not.EqualTo(playerEnt));
// Spawn ghost on the second map
var attachedEntity = player.AttachedEntity;
Assert.That(entMan.EntityExists(attachedEntity), Is.True);
Assert.That(attachedEntity, Is.Not.EqualTo(playerEnt));
Assert.That(entMan.HasComponent<GhostComponent>(attachedEntity));
var transform = entMan.GetComponent<TransformComponent>(attachedEntity.Value);
Assert.That(transform.MapID, Is.Not.EqualTo(MapId.Nullspace));
Assert.That(transform.MapID, Is.Not.EqualTo(testMap.MapId));
#pragma warning restore NUnit2045
});