* fix #1428

* CodTenAlt review

* fix map tests

* real this time

* fix #1429

* add wheat and cotton into victorian gardens trade faction

* Update PostMapInitTest.cs
This commit is contained in:
Red
2025-06-15 21:25:58 +03:00
committed by GitHub
parent 4dfaf6a16e
commit b24ec5bc80
20 changed files with 53 additions and 42 deletions

View File

@@ -27,7 +27,4 @@ public enum SpawnPointType
LateJoin,
Job,
Observer,
//CP14
Always, //Always use only these spawn point, and latejoin, and roundstart
//CP14 end
}

View File

@@ -33,7 +33,7 @@ public sealed class SpawnPointSystem : EntitySystem
continue;
//CP14 always spawn gods on gods spawnpoints
if (spawnPoint.SpawnType == SpawnPointType.Always && (args.Job == null || spawnPoint.Job == args.Job))
if (spawnPoint.SpawnType == SpawnPointType.Unset && (args.Job == null || spawnPoint.Job == args.Job))
{
possiblePositions.Clear();
possiblePositions.Add(xform.Coordinates);

View File

@@ -83,26 +83,13 @@ public sealed partial class CP14DemiplaneSystem
while (query.MoveNext(out var uid, out var stabilizer, out var xform))
{
if (!stabilizer.Enabled)
continue;
if (TryTeleportOutDemiplane(demiplane, uid))
{
if (!safe)
{
var ev = new CP14DemiplaneUnsafeExit();
RaiseLocalEvent(uid, ev);
_body.GibBody(uid);
}
}
}
QueueDel(demiplane);
}
}
public sealed class CP14DemiplaneUnsafeExit : EntityEventArgs
{
}

View File

@@ -117,6 +117,8 @@ public sealed partial class CP14DemiplaneTravelingSystem : EntitySystem
{
if (HasComp<GhostComponent>(ent))
continue;
if (HasComp<CP14ReligionEntityComponent>(ent)) //TODO: make some generic way to whitelist entities from teleporting
continue;
if (!_mind.TryGetMind(ent, out var mindId, out var mind))
continue;

View File

@@ -25,6 +25,9 @@ public sealed partial class CP14PassportSystem : EntitySystem
private void OnPlayerSpawning(PlayerSpawnCompleteEvent ev)
{
if (!TryComp<InventoryComponent>(ev.Mob, out var inventory))
return;
var passport = Spawn(PassportProto, Transform(ev.Mob).Coordinates);
if (!TryComp<PaperComponent>(passport, out var paper))
@@ -39,7 +42,7 @@ public sealed partial class CP14PassportSystem : EntitySystem
StampedName = Loc.GetString("cp14-passport-stamp")
},
"");
_inventory.TryEquip(ev.Mob, passport, "pocket1");
_inventory.TryEquip(ev.Mob, passport, "pocket1", inventory: inventory);
}
private string GeneratePassportText(PlayerSpawnCompleteEvent ev)

View File

@@ -16,7 +16,7 @@ public sealed partial class CP14StationRandomJobsComponent : Component
public sealed partial class CP14RandomJobEntry
{
[DataField(required: true)]
public List<ProtoId<JobPrototype>> Jobs = default!;
public List<ProtoId<JobPrototype>> Jobs = new();
[DataField(required: true)]
public MinMax Count = new(1, 1);

View File

@@ -25,16 +25,12 @@ public sealed partial class CP14ReligionGodSystem
if (TryComp<CP14ReligionAltarComponent>(target, out var altar))
{
if (altar.Religion == ent.Comp.Religion)
{
canTeleport = true;
}
}
else if (TryComp<CP14ReligionFollowerComponent>(target, out var follower))
{
if (follower.Religion == ent.Comp.Religion)
{
canTeleport = true;
}
}
if (!canTeleport)

View File

@@ -25,6 +25,12 @@ public sealed partial class CP14ReligionGodSystem : CP14SharedReligionGodSystem
[Dependency] private readonly SharedTransformSystem _transform = default!;
[Dependency] private readonly IGameTiming _gameTiming = default!;
/// <summary>
/// If ReligionObserver receives a radius higher than this value, this entity will automatically be placed in PvsOverride for the god in order to function correctly outside of the player's PVS.
/// </summary>
/// <remarks> Maybe there is a variable for the distance outside the screen in PVS, I don't know. This number works best</remarks>
private const float ObservationOverrideRadius = 6.5f;
public override void Initialize()
{
base.Initialize();
@@ -197,7 +203,7 @@ public sealed partial class CP14ReligionGodSystem : CP14SharedReligionGodSystem
if (!observer.Observation.ContainsKey(ent.Comp.Religion.Value))
continue;
if (observer.Observation[ent.Comp.Religion.Value] <= 6.5f) //Maybe there is a variable for the distance outside the screen in PVS, I don't know. This number works best
if (observer.Observation[ent.Comp.Religion.Value] <= ObservationOverrideRadius)
continue;
ent.Comp.PvsOverridedObservers.Add(uid);