Ух ты
This commit is contained in:
@@ -50,11 +50,18 @@ public sealed class FastAndFuriousAspect : AspectSystem<FastAndFuriousAspectComp
|
||||
|
||||
private void HandleLateJoin(PlayerSpawnCompleteEvent ev)
|
||||
{
|
||||
if (!ev.LateJoin)
|
||||
return;
|
||||
var query = EntityQueryEnumerator<FastAndFuriousAspectComponent, GameRuleComponent>();
|
||||
while (query.MoveNext(out var ruleEntity, out _, out var gameRule))
|
||||
{
|
||||
if (!GameTicker.IsGameRuleAdded(ruleEntity, gameRule))
|
||||
continue;
|
||||
|
||||
ModifySpeedIfActive(ev.Mob);
|
||||
_chatHelper.SendAspectDescription(ev.Mob, Loc.GetString("fast-and-furious-aspect-desc"));
|
||||
if (!ev.LateJoin)
|
||||
return;
|
||||
|
||||
ModifySpeedIfActive(ev.Mob);
|
||||
_chatHelper.SendAspectDescription(ev.Mob, Loc.GetString("fast-and-furious-aspect-desc"));
|
||||
}
|
||||
}
|
||||
|
||||
private void ModifySpeedIfActive(EntityUid mob)
|
||||
|
||||
@@ -12,6 +12,8 @@ public sealed partial class AspectComponent : Component
|
||||
|
||||
[DataField] public string? Requires;
|
||||
|
||||
[DataField] public string? Sender;
|
||||
|
||||
[DataField] public float Weight = 1.0f;
|
||||
|
||||
[DataField] public bool IsForbidden;
|
||||
|
||||
@@ -66,8 +66,10 @@ public abstract class AspectSystem<T> : GameRuleSystem<T> where T : Component
|
||||
|
||||
if (aspect is { Description: not null, IsHidden: false })
|
||||
{
|
||||
_chatSystem.DispatchGlobalAnnouncement(aspect.Description, playSound: false,
|
||||
colorOverride: Color.Aquamarine);
|
||||
_chatSystem.DispatchGlobalAnnouncement(aspect.Description,
|
||||
sender: aspect.Sender ??= "Центральное Командование",
|
||||
playSound: false,
|
||||
colorOverride: Color.Aquamarine);
|
||||
}
|
||||
|
||||
_audio.PlayGlobal(aspect.StartAudio, Filter.Broadcast(), true);
|
||||
@@ -105,14 +107,17 @@ public abstract class AspectSystem<T> : GameRuleSystem<T> where T : Component
|
||||
|
||||
if (aspect is { Name: not null, IsHidden: false })
|
||||
{
|
||||
_chatSystem.DispatchGlobalAnnouncement($"Именем аспекта являлось: {aspect.Name}", playSound: false,
|
||||
colorOverride: Color.Aquamarine);
|
||||
|
||||
_chatSystem.DispatchGlobalAnnouncement($"Именем аспекта являлось: {aspect.Name}",
|
||||
sender: aspect.Sender ??= "Центральное Командование",
|
||||
playSound: false,
|
||||
colorOverride: Color.Aquamarine);
|
||||
}
|
||||
|
||||
_audio.PlayGlobal(aspect.EndAudio, Filter.Broadcast(), true);
|
||||
}
|
||||
|
||||
#region Helpers
|
||||
#region Helpers
|
||||
|
||||
/// <summary>
|
||||
/// Forces this aspect to end prematurely.
|
||||
@@ -140,5 +145,5 @@ public abstract class AspectSystem<T> : GameRuleSystem<T> where T : Component
|
||||
return grids.Count > 0;
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user