Merge branch 'master' into ed-25-08-2025-upstream-sync

This commit is contained in:
Ed
2025-09-08 11:31:28 +03:00
177 changed files with 2400 additions and 896 deletions

View File

@@ -284,7 +284,7 @@ namespace Content.Server.GameTicking
var jobName = _jobs.MindTryGetJobName(newMind);
_admin.UpdatePlayerList(player);
if (lateJoin && !silent)
if (lateJoin && !silent && false) //CP14 disable arrival snnouncement
{
if (jobPrototype.JoinNotifyCrew)
{
@@ -301,7 +301,7 @@ namespace Content.Server.GameTicking
else
{
_chatSystem.DispatchStationAnnouncement(station,
Loc.GetString("cp14-latejoin-arrival-announcement",//CrystallEdge
Loc.GetString("latejoin-arrival-announcement",
("character", MetaData(mob).EntityName),
("gender", character.Gender), // CrystallEdge-LastnameGender
("entity", mob),

View File

@@ -90,6 +90,16 @@ public sealed class IdentitySystem : SharedIdentitySystem
var representation = GetIdentityRepresentation(uid);
var name = GetIdentityName(uid, representation);
//CP14 override character name
if (TryComp<HumanoidAppearanceComponent>(uid, out var humanoid))
{
var species = _humanoid.GetSpeciesRepresentation(humanoid.Species).ToLower();
var age = _humanoid.GetAgeRepresentation(humanoid.Species, humanoid.Age);
name = age + " " + species;
}
//CP14 end
// Clone the old entity's grammar to the identity entity, for loc purposes.
if (TryComp<GrammarComponent>(uid, out var grammar))
{

View File

@@ -0,0 +1,43 @@
using Content.Server.Instruments;
using Content.Shared._CP14.Actions;
using Content.Shared._CP14.Actions.Components;
using Content.Shared.Actions.Events;
using Content.Shared.Instruments;
namespace Content.Server._CP14.Actions;
public sealed partial class CP14ActionSystem : CP14SharedActionSystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<CP14ActionRequiredMusicToolComponent, ActionAttemptEvent>(OnActionMusicAttempt);
}
private void OnActionMusicAttempt(Entity<CP14ActionRequiredMusicToolComponent> ent, ref ActionAttemptEvent args)
{
if (args.Cancelled)
return;
var passed = false;
var query = EntityQueryEnumerator<ActiveInstrumentComponent, InstrumentComponent>();
while (query.MoveNext(out var uid, out var active, out var instrument))
{
if (!instrument.Playing)
continue;
if (Transform(uid).ParentUid != args.User)
continue;
passed = true;
break;
}
if (passed)
return;
Popup.PopupClient(Loc.GetString("cp14-magic-music-aspect"), args.User, args.User);
args.Cancelled = true;
}
}

View File

@@ -0,0 +1,7 @@
using Content.Shared._CP14.IdentityRecognition;
namespace Content.Server._CP14.IdentityRecognition;
public sealed class CP14IdentityRecognitionSystem : CP14SharedIdentityRecognitionSystem
{
}

View File

@@ -5,7 +5,7 @@ using Robust.Shared.Timing;
namespace Content.Server._CP14.MagicEnergy;
public sealed partial class CP14MagicEnergySystem : SharedCP14MagicEnergySystem
public sealed partial class CP14MagicEnergySystem : CP14SharedMagicEnergySystem
{
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly CP14MagicEnergyCrystalSlotSystem _magicSlot = default!;

View File

@@ -2,6 +2,7 @@ using Content.Server._CP14.MagicEnergy;
using Content.Server.Atmos.Components;
using Content.Server.Chat.Systems;
using Content.Server.Instruments;
using Content.Shared._CP14.Actions.Components;
using Content.Shared._CP14.MagicEnergy.Components;
using Content.Shared._CP14.MagicSpell;
using Content.Shared._CP14.MagicSpell.Components;
@@ -40,12 +41,10 @@ public sealed class CP14MagicSystem : CP14SharedMagicSystem
SubscribeLocalEvent<CP14SpellEffectOnHitComponent, ThrowDoHitEvent>(OnProjectileHit);
SubscribeLocalEvent<CP14SpellEffectOnCollideComponent, StartCollideEvent>(OnStartCollide);
SubscribeLocalEvent<CP14MagicEffectVerbalAspectComponent, CP14SpellSpeechEvent>(OnSpellSpoken);
SubscribeLocalEvent<CP14ActionSpeakingComponent, CP14ActionSpeechEvent>(OnSpellSpoken);
SubscribeLocalEvent<CP14MagicEffectCastingVisualComponent, CP14StartCastMagicEffectEvent>(OnSpawnMagicVisualEffect);
SubscribeLocalEvent<CP14MagicEffectCastingVisualComponent, CP14EndCastMagicEffectEvent>(OnDespawnMagicVisualEffect);
SubscribeLocalEvent<CP14MagicEffectRequiredMusicToolComponent, CP14CastMagicEffectAttemptEvent>(OnMusicCheck);
}
private void OnStartCollide(Entity<CP14SpellEffectOnCollideComponent> ent, ref StartCollideEvent args)
@@ -121,7 +120,7 @@ public sealed class CP14MagicSystem : CP14SharedMagicSystem
}
}
private void OnSpellSpoken(Entity<CP14MagicEffectVerbalAspectComponent> ent, ref CP14SpellSpeechEvent args)
private void OnSpellSpoken(Entity<CP14ActionSpeakingComponent> ent, ref CP14ActionSpeechEvent args)
{
if (args.Performer is not null && args.Speech is not null)
_chat.TrySendInGameICMessage(args.Performer.Value, args.Speech, args.Emote ? InGameICChatType.Emote : InGameICChatType.Speak, true);
@@ -139,27 +138,4 @@ public sealed class CP14MagicSystem : CP14SharedMagicSystem
QueueDel(ent.Comp.SpawnedEntity);
ent.Comp.SpawnedEntity = null;
}
private void OnMusicCheck(Entity<CP14MagicEffectRequiredMusicToolComponent> ent, ref CP14CastMagicEffectAttemptEvent args)
{
var passed = false;
var query = EntityQueryEnumerator<ActiveInstrumentComponent, InstrumentComponent>();
while (query.MoveNext(out var uid, out var active, out var instrument))
{
if (!instrument.Playing)
continue;
if (Transform(uid).ParentUid != args.Performer)
continue;
passed = true;
break;
}
if (passed)
return;
args.PushReason(Loc.GetString("cp14-magic-music-aspect"));
args.Cancel();
}
}

View File

@@ -9,9 +9,6 @@ namespace Content.Server._CP14.ModularCraft.Modifiers;
public sealed partial class EditManacostModify : CP14ModularCraftModifier
{
[DataField]
public Dictionary<ProtoId<CP14MagicTypePrototype>, FixedPoint2> Modifiers = new();
[DataField]
public FixedPoint2 GlobalModifier = 1f;
@@ -20,21 +17,6 @@ public sealed partial class EditManacostModify : CP14ModularCraftModifier
if (!entManager.TryGetComponent<CP14MagicManacostModifyComponent>(start, out var manacostModifyComp))
return;
foreach (var (magicType, modifier) in Modifiers)
{
if (manacostModifyComp.Modifiers.ContainsKey(magicType))
{
if (modifier >= 1f)
manacostModifyComp.Modifiers[magicType] += modifier - 1f;
else
manacostModifyComp.Modifiers[magicType] -= 1f - modifier;
}
else
{
manacostModifyComp.Modifiers[magicType] = modifier;
}
}
manacostModifyComp.GlobalModifier += GlobalModifier;
}
}

View File

@@ -1,6 +1,5 @@
using Content.Server.GameTicking;
using Content.Shared.CCVar;
using Robust.Server;
using Robust.Shared.Audio;
using Robust.Shared.Console;
@@ -10,7 +9,6 @@ public sealed partial class CP14RoundEndSystem
{
[Dependency] private readonly IConsoleHost _consoleHost = default!;
[Dependency] private readonly GameTicker _ticker = default!;
[Dependency] private readonly IBaseServer _baseServer = default!;
private TimeSpan _nextUpdateTime = TimeSpan.Zero;
private readonly TimeSpan _updateFrequency = TimeSpan.FromSeconds(60f);
@@ -114,7 +112,7 @@ public sealed partial class CP14RoundEndSystem
{
var ruDays = now.DayOfWeek is DayOfWeek.Tuesday || now.DayOfWeek is DayOfWeek.Thursday || now.DayOfWeek is DayOfWeek.Saturday;
var timeMap = new (int Hour, int Minute, Action Action)[]
var timeMap = new (int Hour, int Minute, System.Action Action)[]
{
(21, 45, () =>
{

View File

@@ -135,19 +135,16 @@ public sealed class CP14RoundLeaveSystem : EntitySystem
_stationRecords.RemoveRecord(key, stationRecords);
}
_chatSystem.DispatchStationAnnouncement(station.Value,
Loc.GetString(
_mobState.IsAlive(uid) ? "cp14-earlyleave-ship-announcement" : "cp14-earlyleave-ship-announcement-dead",
("character", name),
("job", CultureInfo.CurrentCulture.TextInfo.ToTitleCase(jobName))
),
Loc.GetString("cp14-ship-sender"),
playDefaultSound: false
);
//_chatSystem.DispatchStationAnnouncement(station.Value,
// Loc.GetString(
// _mobState.IsAlive(uid) ? "cp14-earlyleave-ship-announcement" : "cp14-earlyleave-ship-announcement-dead",
// ("character", name),
// ("job", CultureInfo.CurrentCulture.TextInfo.ToTitleCase(jobName))
// ),
// Loc.GetString("cp14-ship-sender"),
// playDefaultSound: false
//);
QueueDel(uid);
//if (mind is not null && mind.Value.Comp.Session is not null)
// _gameTicker.Respawn(mind.Value.Comp.Session);
}
}