-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* new SAIShip * miss maps * upd * fix * fix * Update bargevsship.yml --------- Co-authored-by: Kirillcas <[email protected]>
- Loading branch information
Showing
35 changed files
with
43,082 additions
and
26 deletions.
There are no files selected for viewing
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
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
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,24 @@ | ||
using Content.Server.GameTicking; | ||
using Content.Server.Ghost.Roles; | ||
using Content.Server.Ghost.Roles.Components; | ||
using Robust.Shared.Console; | ||
|
||
namespace Content.Server.Backmen.Arrivals; | ||
|
||
public sealed class AutoRespawnSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly GameTicker _ticker = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<BkmRespawnerComponent, TakeGhostRoleEvent>(OnRequestRespawn, before: new []{ typeof(GhostRoleSystem) }); | ||
} | ||
|
||
private void OnRequestRespawn(Entity<BkmRespawnerComponent> ent, ref TakeGhostRoleEvent args) | ||
{ | ||
args.TookRole = true; | ||
_ticker.Respawn(args.Player); | ||
} | ||
} |
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,7 @@ | ||
namespace Content.Server.Backmen.Arrivals; | ||
|
||
[RegisterComponent] | ||
public sealed partial class BkmRespawnerComponent : Component | ||
{ | ||
|
||
} |
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,78 @@ | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Content.Server.Backmen.StationAI.Systems; | ||
using Content.Server.SurveillanceCamera; | ||
using Content.Shared.Backmen.StationAI; | ||
using Robust.Shared.CPUJob.JobQueues; | ||
using Robust.Shared.Map; | ||
using Robust.Shared.Timing; | ||
|
||
namespace Content.Server.Backmen.StationAI; | ||
|
||
public sealed class AiEyeMover : Job<object> | ||
{ | ||
private readonly AICameraSystem _cameraSystem; | ||
private readonly EntityLookupSystem _lookup; | ||
private readonly SharedTransformSystem _transform; | ||
private readonly EntityManager _entityManager; | ||
|
||
public AiEyeMover(EntityManager entityManager, AICameraSystem cameraSystem, EntityLookupSystem lookup, SharedTransformSystem transform, double maxTime, CancellationToken cancellation = default) : base(maxTime, cancellation) | ||
{ | ||
_cameraSystem = cameraSystem; | ||
_lookup = lookup; | ||
_transform = transform; | ||
_entityManager = entityManager; | ||
} | ||
|
||
public AiEyeMover(EntityManager entityManager, AICameraSystem cameraSystem, EntityLookupSystem lookup, SharedTransformSystem transform, double maxTime, IStopwatch stopwatch, CancellationToken cancellation = default) : base(maxTime, stopwatch, cancellation) | ||
{ | ||
_cameraSystem = cameraSystem; | ||
_lookup = lookup; | ||
_transform = transform; | ||
_entityManager = entityManager; | ||
} | ||
|
||
public Entity<AIEyeComponent> Eye { get; set; } | ||
public EntityCoordinates NewPosition { get; set; } | ||
|
||
|
||
private readonly HashSet<Entity<SurveillanceCameraComponent>> _cameraComponents = new(); | ||
|
||
protected override async Task<object?> Process() | ||
{ | ||
try | ||
{ | ||
if (!Eye.Comp.AiCore.HasValue) | ||
{ | ||
_entityManager.QueueDeleteEntity(Eye); | ||
return null; | ||
} | ||
|
||
var core = Eye.Comp.AiCore.Value; | ||
|
||
var gridUid = NewPosition.GetGridUid(_entityManager); | ||
|
||
if (gridUid == null || _transform.GetMoverCoordinates(core).GetGridUid(_entityManager) != gridUid) | ||
{ | ||
_entityManager.QueueDeleteEntity(Eye); | ||
return null; | ||
} | ||
|
||
// cache | ||
if (_cameraSystem.IsCameraActive(Eye)) | ||
return null; | ||
|
||
var mapPos = NewPosition.ToMap(_entityManager, _transform); | ||
|
||
await WaitAsyncTask(Task.Run(() => | ||
_lookup.GetEntitiesInRange(mapPos, AICameraSystem.CameraEyeRange, _cameraComponents, LookupFlags.Sensors))); | ||
|
||
_cameraSystem.HandleMove(Eye, _cameraComponents); | ||
} | ||
finally | ||
{ | ||
Eye.Comp.IsProcessingMoveEvent = false; | ||
} | ||
return null; | ||
} | ||
} |
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
Oops, something went wrong.