-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Тюрьма (#150) * Prison Init * Новая карта для планетарных тюрем * Готовая планетарная тюрьма * Незначительное изменение тайлов --------- Co-authored-by: Vigers Ray <[email protected]> * Космическая тюрьма и всё остальное говно * фиксы * фикс PrisonlDoctor * фикс PrisonDoctor * день длится 20 минут --------- Co-authored-by: SplikZerys <[email protected]>
- Loading branch information
1 parent
501bb8c
commit ffd3e3d
Showing
241 changed files
with
367,217 additions
and
99 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using Robust.Shared.Audio; | ||
|
||
namespace Content.Server._Sunrise.Fugitive | ||
{ | ||
[RegisterComponent] | ||
public sealed partial class FugitiveComponent : Component | ||
{ | ||
[DataField("spawnSound")] | ||
public SoundSpecifier SpawnSoundPath = new SoundPathSpecifier("/Audio/Effects/clang.ogg"); | ||
|
||
[DataField("firstMindAdded")] | ||
public bool FirstMindAdded = false; | ||
|
||
[DataField("roundStart")] | ||
public bool RoundStart = false; | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Content.Server/_Sunrise/Fugitive/FugitiveCountdownComponent.cs
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,11 @@ | ||
namespace Content.Server._Sunrise.Fugitive | ||
{ | ||
[RegisterComponent] | ||
public sealed partial class FugitiveCountdownComponent : Component | ||
{ | ||
public TimeSpan? AnnounceTime = null; | ||
|
||
[DataField("AnnounceCD")] | ||
public TimeSpan AnnounceCD = TimeSpan.FromMinutes(5); | ||
} | ||
} |
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,9 @@ | ||
using Content.Shared.Roles; | ||
|
||
namespace Content.Server._Sunrise.Fugitive; | ||
|
||
[RegisterComponent] | ||
public sealed partial class FugitiveRoleComponent : AntagonistRoleComponent | ||
{ | ||
|
||
} |
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._Sunrise.Fugitive; | ||
|
||
[RegisterComponent, Access(typeof(FugitiveSystem))] | ||
public sealed partial class FugitiveRuleComponent : Component | ||
{ | ||
public List<(EntityUid, string)> FugitiveMinds = new(); | ||
} |
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,101 @@ | ||
using Content.Server.Mind; | ||
using Content.Server.Popups; | ||
using Content.Server.Store.Systems; | ||
using Content.Server.Stunnable; | ||
using Content.Shared.Examine; | ||
using Content.Shared.FixedPoint; | ||
using Content.Shared.Implants; | ||
using Content.Shared.Implants.Components; | ||
using Content.Shared.Maps; | ||
using Content.Shared.Store.Components; | ||
using Content.Shared.Tag; | ||
using Robust.Server.Audio; | ||
using Robust.Shared.Audio; | ||
using Robust.Shared.Containers; | ||
using Robust.Shared.Map; | ||
using Robust.Shared.Player; | ||
using Robust.Shared.Random; | ||
using Robust.Shared.Timing; | ||
using static Content.Shared.Examine.ExamineSystemShared; | ||
|
||
namespace Content.Server._Sunrise.Fugitive | ||
{ | ||
public sealed class FugitiveSpawnerSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly IGameTiming _timing = default!; | ||
[Dependency] private readonly PopupSystem _popupSystem = default!; | ||
[Dependency] private readonly AudioSystem _audioSystem = default!; | ||
[Dependency] private readonly StunSystem _stun = default!; | ||
[Dependency] private readonly IMapManager _mapManager = default!; | ||
[Dependency] private readonly TileSystem _tile = default!; | ||
[Dependency] private readonly MindSystem _mindSystem = default!; | ||
[Dependency] private readonly StoreSystem _store = default!; | ||
[Dependency] private readonly TagSystem _tagSystem = default!; | ||
[Dependency] private readonly IRobustRandom _random = default!; | ||
[Dependency] private readonly SharedSubdermalImplantSystem _subdermalImplant = default!; | ||
[Dependency] private readonly ExamineSystemShared _examine = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
SubscribeLocalEvent<FugitiveSpawnerComponent, PlayerAttachedEvent>(OnPlayerAttached); | ||
} | ||
|
||
private void OnPlayerAttached(EntityUid uid, FugitiveSpawnerComponent component, PlayerAttachedEvent args) | ||
{ | ||
var xform = Transform(uid); | ||
var fugitive = Spawn(component.Prototype, xform.Coordinates); | ||
|
||
if (TryComp<_Sunrise.Fugitive.FugitiveCountdownComponent>(fugitive, out var cd)) | ||
cd.AnnounceTime = _timing.CurTime + cd.AnnounceCD; | ||
|
||
_popupSystem.PopupEntity(Loc.GetString("fugitive-spawn", ("name", fugitive)), fugitive, | ||
Filter.Pvs(fugitive).RemoveWhereAttachedEntity(entity => !_examine.InRangeUnOccluded( | ||
fugitive, entity, ExamineRange, null)), true, | ||
Shared.Popups.PopupType.LargeCaution); | ||
|
||
_stun.TryParalyze(fugitive, TimeSpan.FromSeconds(2), false); | ||
_audioSystem.PlayPvs(component.SpawnSoundPath, uid, AudioParams.Default.WithVolume(-6f)); | ||
|
||
if (!_mapManager.TryGetGrid(xform.GridUid, out var map)) | ||
return; | ||
var currentTile = map.GetTileRef(xform.Coordinates); | ||
_tile.PryTile(currentTile); | ||
|
||
if (!_mindSystem.TryGetMind(args.Player.UserId, out var mindId, out var mind)) | ||
return; | ||
|
||
_mindSystem.TransferTo(mindId.Value, fugitive, ghostCheckOverride: true); | ||
|
||
_popupSystem.PopupEntity(Loc.GetString("fugitive-spawn", ("name", uid)), uid, | ||
Filter.Pvs(uid).RemoveWhereAttachedEntity(entity => !_examine.InRangeUnOccluded(uid, entity, ExamineRange, null)), true, Shared.Popups.PopupType.LargeCaution); | ||
|
||
foreach (var implantId in component.Implants) | ||
{ | ||
var implantEnt = Spawn(implantId, xform.Coordinates); | ||
|
||
if (!TryComp<SubdermalImplantComponent>(implantEnt, out var implantComp)) | ||
return; | ||
|
||
_subdermalImplant.ForceImplant(fugitive, implantEnt, implantComp); | ||
} | ||
|
||
if (TryComp<ContainerManagerComponent>(fugitive, out var containerManagerComponent)) | ||
{ | ||
if (containerManagerComponent.Containers.TryGetValue("implant", out var container)) | ||
{ | ||
foreach (var containedEntity in container.ContainedEntities) | ||
{ | ||
if (!TryComp<StoreComponent>(containedEntity, out var storeComponent)) | ||
continue; | ||
_tagSystem.AddTag(containedEntity, "FugitiveUplink"); | ||
_store.TryAddCurrency(new Dictionary<string, FixedPoint2> | ||
{ {"Telecrystal", _random.Next(5, 10)} }, containedEntity, storeComponent); | ||
} | ||
} | ||
} | ||
|
||
Del(uid); | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
Content.Server/_Sunrise/Fugitive/FugitiveSpawnerComponent.cs
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,19 @@ | ||
using Robust.Shared.Audio; | ||
using Robust.Shared.Prototypes; | ||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; | ||
|
||
namespace Content.Server._Sunrise.Fugitive | ||
{ | ||
[RegisterComponent] | ||
public sealed partial class FugitiveSpawnerComponent : Component | ||
{ | ||
[DataField("spawnSound")] | ||
public SoundSpecifier SpawnSoundPath = new SoundPathSpecifier("/Audio/Effects/clang.ogg"); | ||
|
||
[ViewVariables(VVAccess.ReadWrite), | ||
DataField("prototype", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))] | ||
public string Prototype = "MobHumanFugitive"; | ||
|
||
public List<string> Implants = new() { "UplinkImplant", "FreedomImplant"}; | ||
} | ||
} |
Oops, something went wrong.