Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New music (Теперь работает!) #58

Closed
wants to merge 89 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
a23c122
added space cruiser track
saga3152 Aug 15, 2024
1f62232
Cog update (#31129)
Spessmann Aug 17, 2024
ad4d36f
Replace obsolete map functions in disposals code (#31133)
Mervill Aug 17, 2024
9c9bfda
Fix botany bugs (#27210)
Crotalus Aug 18, 2024
16e1c23
Update Credits (#31141)
github-actions[bot] Aug 18, 2024
f09dd46
Cog update (#31148)
Spessmann Aug 18, 2024
1545fd5
fix(fland): Connect the Cell Window Shutters remote signaler to the C…
Brandon-Huu Aug 18, 2024
047a7a4
fix some salvage spawner oversights (#31114)
EmoGarbage404 Aug 18, 2024
77a60bd
bagel update (#31150)
Emisse Aug 18, 2024
517f7ad
Fixed IP bans preventing non-banned players from connecting to SQLite…
TGRCdev Aug 18, 2024
031ddc0
Guidebook typo fixes (#31159)
iztokbajcar Aug 18, 2024
0d969f6
Automatic changelog update
PJBot Aug 18, 2024
7d48cc5
Add atmos directional sign (#31155)
SlamBamActionman Aug 18, 2024
7333141
Coughing and coughing changes (#30893)
Unkn0wnGh0st333 Aug 18, 2024
d673bdf
Automatic changelog update
PJBot Aug 18, 2024
a540b88
Goliath mob (#30839)
EmoGarbage404 Aug 18, 2024
0c078f6
Automatic changelog update
PJBot Aug 18, 2024
f7fd991
Cog updates (#31169)
Spessmann Aug 18, 2024
529f4da
bagel update (#31172)
Emisse Aug 18, 2024
78b3e32
Cutting food now moves the food a little bit. (#31166)
beck-thompson Aug 18, 2024
d38d497
Automatic changelog update
PJBot Aug 18, 2024
c636b3b
Update Oasis (#31174)
IProduceWidgets Aug 18, 2024
d0bd26d
pizza and pizza box tweaks (#31171)
lzk228 Aug 18, 2024
8830e26
small figurines voicelines update (#31167)
lzk228 Aug 18, 2024
2dfcd5c
Automatic changelog update
PJBot Aug 18, 2024
878384d
Sharks Go RAWR! (#31142)
Deatherd Aug 18, 2024
b4ef1e9
Automatic changelog update
PJBot Aug 18, 2024
4fcbb99
Fix collidable held entities blocking themselves while being dropped …
DrSmugleaf Aug 18, 2024
86b358b
Fix raditation collectors gaslighting you (#31175)
slarticodefast Aug 18, 2024
900e57c
Added LV power cables to Marathon library (#31131)
thetolbean Aug 18, 2024
7f5c11a
Automatic changelog update
PJBot Aug 18, 2024
1952618
Tea Plant and Blue Pumpkin (#25092)
potato1234x Aug 18, 2024
6cda6c8
Automatic changelog update
PJBot Aug 18, 2024
ad69193
add memory cell and rework logic construction (#24983)
deltanedas Aug 18, 2024
3cb67a3
Automatic changelog update
PJBot Aug 18, 2024
c48a96a
Trim punctuation marks in the chat emote system (#28612)
geraeumig Aug 18, 2024
9a68cf0
Re-add improved random sentience event (#29123)
Psychpsyo Aug 18, 2024
03f5bf4
Automatic changelog update
PJBot Aug 18, 2024
d9e0681
make ore indestructible (#31182)
EmoGarbage404 Aug 19, 2024
c9854c3
Automatic changelog update
PJBot Aug 19, 2024
3dcfe0d
fix mice and revs being able to toggle suit pieces (#31152)
slarticodefast Aug 19, 2024
7e3b9fb
Allow a specific hand to be passed into TrySpawnVirtualItemInHand (#3…
DrSmugleaf Aug 19, 2024
0754a0f
Automatic changelog update
PJBot Aug 19, 2024
864956c
Pancakes Fix (#31123)
Goldminermac Aug 19, 2024
45b0543
Automatic changelog update
PJBot Aug 19, 2024
68d6506
Made hydroponics alert light more orange (#31088)
tosatur Aug 19, 2024
a2c762d
Automatic changelog update
PJBot Aug 19, 2024
9240786
Fix news management console access checks (#31160)
redmushie Aug 19, 2024
19b0ce3
Automatic changelog update
PJBot Aug 19, 2024
91e2fdc
Fix news management console publish timeout activating when nothing w…
redmushie Aug 19, 2024
529e4b7
Added a pitcher for the chef to use in serving beverages (#31105)
Moomoobeef Aug 19, 2024
db427dc
Fix cooking sizzle noise (#31096)
themias Aug 19, 2024
3e15e00
fix admin pda health analyzer popup (#31097)
MilonPL Aug 19, 2024
edc9162
fix selfunremoveable component being bypassed by hand pickup verb (#3…
EmoGarbage404 Aug 19, 2024
da3c3b5
Automatic changelog update
PJBot Aug 19, 2024
0a05ee9
add space carp and sharkminnow teeth (#31070)
EmoGarbage404 Aug 19, 2024
171884d
Tweaking things that restrict freedom (#31095)
chavonadelal Aug 19, 2024
ebf62aa
Automatic changelog update
PJBot Aug 19, 2024
ed3e107
New Projectile Effect:Temperature Change (#31004)
Boaz1111 Aug 19, 2024
f272097
Device-list limiting (#30997)
Magicalus Aug 19, 2024
e2ecd80
Automatic changelog update
PJBot Aug 19, 2024
2577eb1
Guidebook updates for Antagonist entries (#31075)
UBlueberry Aug 19, 2024
9b8e30a
Automatic changelog update
PJBot Aug 19, 2024
1c29310
ERT chaplains can now use bibles (#30993)
TheWaffleJesus Aug 19, 2024
1ba508a
Automatic changelog update
PJBot Aug 19, 2024
802d478
Security Helmet Reshape (#30961)
DieselMohawk Aug 19, 2024
dd36c85
add(AdminGhost): Add a multitool to the admin ghost backpack (#31002)
Brandon-Huu Aug 19, 2024
d11a4ba
Automatic changelog update
PJBot Aug 19, 2024
18c146c
increase material prices (#30869)
EmoGarbage404 Aug 19, 2024
7ba049b
Convert bookshelves from StorageFill to EntityTables (#30895)
Plykiya Aug 19, 2024
1a3dc66
Automatic changelog update
PJBot Aug 19, 2024
94c746a
Minor vox customization update: new hairstyles & facial hair (#30815)
Flareguy Aug 19, 2024
1fa447f
Automatic changelog update
PJBot Aug 19, 2024
476c775
Recycler Overhaul (#30802)
EmoGarbage404 Aug 19, 2024
2c98d0a
clarify what is an important role in rule 12 (#30818)
Killerqu00 Aug 19, 2024
e85ab91
Automatic changelog update
PJBot Aug 19, 2024
8486b24
Cog update (#31188)
Spessmann Aug 19, 2024
c3f4243
Cheese tweaks (#31168)
lzk228 Aug 19, 2024
61f756d
Automatic changelog update
PJBot Aug 19, 2024
d297852
Seed vend restock price increase (Fix test fails) (#31185)
beck-thompson Aug 19, 2024
972bd56
Automatic changelog update
PJBot Aug 19, 2024
d16c913
Merge branch 'master' of https://github.com/space-wizards/space-stati…
Aug 19, 2024
80323f7
Fixed, everything works now
saga3152 Aug 19, 2024
9736a32
Added Cayava from rainworld
saga3152 Aug 19, 2024
aea90bd
fix lightsaber connect
Aug 20, 2024
b556487
fix SithSpawn
Aug 20, 2024
ee5a7b3
Upstream 19.08.2024
doublechest0 Aug 20, 2024
0ce89fd
Merge branch 'new-music' of https://github.com/saga3152/space-station-14
saga3152 Aug 20, 2024
7982bfc
moved prototype and music into stories folder
saga3152 Aug 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
27 changes: 27 additions & 0 deletions Content.Client/Materials/RecyclerVisualizerSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using Content.Shared.Conveyor;
using Content.Shared.Materials;
using Robust.Client.GameObjects;

namespace Content.Client.Materials;

public sealed class RecyclerVisualizerSystem : VisualizerSystem<RecyclerVisualsComponent>
{
protected override void OnAppearanceChange(EntityUid uid, RecyclerVisualsComponent component, ref AppearanceChangeEvent args)
{
if (args.Sprite == null || !args.Sprite.LayerMapTryGet(RecyclerVisualLayers.Main, out var layer))
return;

AppearanceSystem.TryGetData<ConveyorState>(uid, ConveyorVisuals.State, out var running);
AppearanceSystem.TryGetData<bool>(uid, RecyclerVisuals.Bloody, out var bloody);
AppearanceSystem.TryGetData<bool>(uid, RecyclerVisuals.Broken, out var broken);

var activityState = running == ConveyorState.Off ? 0 : 1;
if (broken) //breakage overrides activity
activityState = 2;

var bloodyKey = bloody ? component.BloodyKey : string.Empty;

var state = $"{component.BaseKey}{activityState}{bloodyKey}";
args.Sprite.LayerSetState(layer, state);
}
}
17 changes: 17 additions & 0 deletions Content.Client/Materials/RecyclerVisualsComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
namespace Content.Client.Materials;

[RegisterComponent]
public sealed partial class RecyclerVisualsComponent : Component
{
/// <summary>
/// Key appended to state string if bloody.
/// </summary>
[DataField]
public string BloodyKey = "bld";

/// <summary>
/// Base key for the visual state.
/// </summary>
[DataField]
public string BaseKey = "grinder-o";
}
17 changes: 1 addition & 16 deletions Content.Server/Actions/ActionOnInteractSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,21 +154,6 @@ private void OnAfterInteract(EntityUid uid, ActionOnInteractComponent component,
args.Handled = true;
}

private bool ValidAction(BaseActionComponent action, bool canReach = true)
{
if (!action.Enabled)
return false;

if (action.Charges.HasValue && action.Charges <= 0)
return false;

var curTime = _timing.CurTime;
if (action.Cooldown.HasValue && action.Cooldown.Value.End > curTime)
return false;

return canReach || action is BaseTargetActionComponent { CheckCanAccess: false };
}

private List<(EntityUid Id, T Comp)> GetValidActions<T>(List<EntityUid>? actions, bool canReach = true) where T : BaseActionComponent
{
var valid = new List<(EntityUid Id, T Comp)>();
Expand All @@ -180,7 +165,7 @@ private bool ValidAction(BaseActionComponent action, bool canReach = true)
{
if (!_actions.TryGetActionData(id, out var baseAction) ||
baseAction as T is not { } action ||
!ValidAction(action, canReach))
!_actions.ValidAction(action, canReach))
{
continue;
}
Expand Down
22 changes: 20 additions & 2 deletions Content.Server/Botany/Systems/MutationSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,12 @@ private void MutateFloat(ref float val, float min, float max, int bits, int tota
if (!Random(probBitflip))
return;

if (min == max)
{
val = min;
return;
}

// Starting number of bits that are high, between 0 and bits.
// In other words, it's val mapped linearly from range [min, max] to range [0, bits], and then rounded.
int valInt = (int)MathF.Round((val - min) / (max - min) * bits);
Expand Down Expand Up @@ -186,10 +192,22 @@ private void MutateInt(ref int val, int min, int max, int bits, int totalbits, f
if (!Random(probBitflip))
return;

if (min == max)
{
val = min;
return;
}

// Starting number of bits that are high, between 0 and bits.
// In other words, it's val mapped linearly from range [min, max] to range [0, bits], and then rounded.
int valInt = (int)MathF.Round((val - min) / (max - min) * bits);
// val may be outside the range of min/max due to starting prototype values, so clamp.
valInt = Math.Clamp(valInt, 0, bits);

// Probability that the bit flip increases n.
// The higher the current value is, the lower the probability of increasing value is, and the higher the probability of decreasive it it.
// The higher the current value is, the lower the probability of increasing value is, and the higher the probability of decreasing it.
// In other words, it tends to go to the middle.
float probIncrease = 1 - (float)val / bits;
float probIncrease = 1 - (float)valInt / bits;
int valMutated;
if (Random(probIncrease))
{
Expand Down
3 changes: 1 addition & 2 deletions Content.Server/Botany/Systems/PlantHolderSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -522,10 +522,9 @@ public void Update(EntityUid uid, PlantHolderComponent? component = null)

var environment = _atmosphere.GetContainingMixture(uid, true, true) ?? GasMixture.SpaceGas;

component.MissingGas = 0;
if (component.Seed.ConsumeGasses.Count > 0)
{
component.MissingGas = 0;

foreach (var (gas, amount) in component.Seed.ConsumeGasses)
{
if (environment.GetMoles(gas) < amount)
Expand Down
22 changes: 20 additions & 2 deletions Content.Server/Chat/Systems/ChatSystem.Emote.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,32 @@ public bool TryPlayEmoteSound(EntityUid uid, EmoteSoundsPrototype? proto, string
/// <param name="textInput"></param>
private void TryEmoteChatInput(EntityUid uid, string textInput)
{
var actionLower = textInput.ToLower();
if (!_wordEmoteDict.TryGetValue(actionLower, out var emote))
var actionTrimmedLower = TrimPunctuation(textInput.ToLower());
if (!_wordEmoteDict.TryGetValue(actionTrimmedLower, out var emote))
return;

if (!AllowedToUseEmote(uid, emote))
return;

InvokeEmoteEvent(uid, emote);
return;

static string TrimPunctuation(string textInput)
{
var trimEnd = textInput.Length;
while (trimEnd > 0 && char.IsPunctuation(textInput[trimEnd - 1]))
{
trimEnd--;
}

var trimStart = 0;
while (trimStart < trimEnd && char.IsPunctuation(textInput[trimStart]))
{
trimStart++;
}

return textInput[trimStart..trimEnd];
}
}
/// <summary>
/// Checks if we can use this emote based on the emotes whitelist, blacklist, and availibility to the entity.
Expand Down
5 changes: 3 additions & 2 deletions Content.Server/Construction/Completions/PlaySound.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ public sealed partial class PlaySound : IGraphAction
public void PerformAction(EntityUid uid, EntityUid? userUid, IEntityManager entityManager)
{
var scale = (float) IoCManager.Resolve<IRobustRandom>().NextGaussian(1, Variation);
entityManager.EntitySysManager.GetEntitySystem<SharedAudioSystem>()
.PlayPvs(Sound, uid, AudioParams.WithPitchScale(scale));
if (entityManager.TryGetComponent<TransformComponent>(uid, out var xform))
entityManager.EntitySysManager.GetEntitySystem<SharedAudioSystem>()
.PlayPvs(Sound, xform.Coordinates, AudioParams.WithPitchScale(scale));
}
}
}
40 changes: 40 additions & 0 deletions Content.Server/DeviceLinking/Components/MemoryCellComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using Content.Server.DeviceLinking.Systems;
using Content.Shared.DeviceLinking;
using Robust.Shared.Prototypes;

namespace Content.Server.DeviceLinking.Components;

/// <summary>
/// Memory cell that sets the output to the input when enabled.
/// </summary>
[RegisterComponent, Access(typeof(MemoryCellSystem))]
public sealed partial class MemoryCellComponent : Component
{
/// <summary>
/// Name of the input port.
/// </summary>
[DataField]
public ProtoId<SinkPortPrototype> InputPort = "MemoryInput";

/// <summary>
/// Name of the enable port.
/// </summary>
[DataField]
public ProtoId<SinkPortPrototype> EnablePort = "MemoryEnable";

/// <summary>
/// Name of the output port.
/// </summary>
[DataField]
public ProtoId<SourcePortPrototype> OutputPort = "Output";

// State
[DataField]
public SignalState InputState = SignalState.Low;

[DataField]
public SignalState EnableState = SignalState.Low;

[DataField]
public bool LastOutput;
}
74 changes: 74 additions & 0 deletions Content.Server/DeviceLinking/Systems/MemoryCellSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
using Content.Server.DeviceLinking.Components;
using Content.Server.DeviceLinking.Events;
using Content.Server.DeviceNetwork;
using Content.Shared.DeviceLinking;

namespace Content.Server.DeviceLinking.Systems;

/// <summary>
/// Handles the control of output based on the input and enable ports.
/// </summary>
public sealed class MemoryCellSystem : EntitySystem
{
[Dependency] private readonly DeviceLinkSystem _deviceLink = default!;

public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<MemoryCellComponent, ComponentInit>(OnInit);
SubscribeLocalEvent<MemoryCellComponent, SignalReceivedEvent>(OnSignalReceived);
}

public override void Update(float deltaTime)
{
base.Update(deltaTime);

var query = EntityQueryEnumerator<MemoryCellComponent, DeviceLinkSourceComponent>();
while (query.MoveNext(out var uid, out var comp, out var source))
{
if (comp.InputState == SignalState.Momentary)
comp.InputState = SignalState.Low;
if (comp.EnableState == SignalState.Momentary)
comp.EnableState = SignalState.Low;

UpdateOutput((uid, comp, source));
}
}

private void OnInit(Entity<MemoryCellComponent> ent, ref ComponentInit args)
{
var (uid, comp) = ent;
_deviceLink.EnsureSinkPorts(uid, comp.InputPort, comp.EnablePort);
_deviceLink.EnsureSourcePorts(uid, comp.OutputPort);
}

private void OnSignalReceived(Entity<MemoryCellComponent> ent, ref SignalReceivedEvent args)
{
var state = SignalState.Momentary;
args.Data?.TryGetValue(DeviceNetworkConstants.LogicState, out state);

if (args.Port == ent.Comp.InputPort)
ent.Comp.InputState = state;
else if (args.Port == ent.Comp.EnablePort)
ent.Comp.EnableState = state;

UpdateOutput(ent);
}

private void UpdateOutput(Entity<MemoryCellComponent, DeviceLinkSourceComponent?> ent)
{
if (!Resolve(ent, ref ent.Comp2))
return;

if (ent.Comp1.EnableState == SignalState.Low)
return;

var value = ent.Comp1.InputState != SignalState.Low;
if (value == ent.Comp1.LastOutput)
return;

ent.Comp1.LastOutput = value;
_deviceLink.SendSignal(ent, ent.Comp1.OutputPort, value, ent.Comp2);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ public enum DeviceNetIdDefaults
[DataField("sendBroadcastAttemptEvent")]
public bool SendBroadcastAttemptEvent = false;

/// <summary>
/// Whether this device's address can be saved to device-lists
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField("savableAddress")]
public bool SavableAddress = true;

/// <summary>
/// A list of device-lists that this device is on.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,13 @@ private void TryAddNetworkDevice(EntityUid configuratorUid, EntityUid? targetUid
if (!targetUid.HasValue || !Resolve(targetUid.Value, ref device, false))
return;

//This checks if the device is marked as having a savable address,
//to avoid adding pdas and whatnot to air alarms. This flag is true
//by default, so this will only prevent devices from being added to
//network configurator lists if manually set to false in the prototype
if (!device.SavableAddress)
return;

var address = device.Address;
if (string.IsNullOrEmpty(address))
{
Expand Down
4 changes: 3 additions & 1 deletion Content.Server/Disposal/Tube/DisposalTubeSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public sealed class DisposalTubeSystem : EntitySystem
[Dependency] private readonly SharedContainerSystem _containerSystem = default!;
[Dependency] private readonly AtmosphereSystem _atmosSystem = default!;
[Dependency] private readonly TransformSystem _transform = default!;
[Dependency] private readonly SharedMapSystem _map = default!;

public override void Initialize()
{
base.Initialize();
Expand Down Expand Up @@ -345,7 +347,7 @@ private void UpdateAnchored(EntityUid uid, DisposalTubeComponent component, bool
return null;

var position = xform.Coordinates;
foreach (var entity in grid.GetInDir(position, nextDirection))
foreach (var entity in _map.GetInDir(xform.GridUid.Value, grid, position, nextDirection))
{
if (!TryComp(entity, out DisposalTubeComponent? tube))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public sealed class DisposalUnitSystem : SharedDisposalUnitSystem
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
[Dependency] private readonly TransformSystem _transformSystem = default!;
[Dependency] private readonly UserInterfaceSystem _ui = default!;
[Dependency] private readonly SharedMapSystem _map = default!;

public override void Initialize()
{
Expand Down Expand Up @@ -474,7 +475,7 @@ public bool TryInsert(EntityUid unitId, EntityUid toInsertId, EntityUid? userId,
var delay = insertingSelf ? unit.EntryDelay : unit.DraggedEntryDelay;

if (userId != null && !insertingSelf)
_popupSystem.PopupEntity(Loc.GetString("disposal-unit-being-inserted", ("user", Identity.Entity((EntityUid) userId, EntityManager))), toInsertId, toInsertId, PopupType.Large);
_popupSystem.PopupEntity(Loc.GetString("disposal-unit-being-inserted", ("user", Identity.Entity((EntityUid)userId, EntityManager))), toInsertId, toInsertId, PopupType.Large);

if (delay <= 0 || userId == null)
{
Expand Down Expand Up @@ -520,7 +521,7 @@ public bool TryFlush(EntityUid uid, SharedDisposalUnitComponent component)
return false;

var coords = xform.Coordinates;
var entry = grid.GetLocal(coords)
var entry = _map.GetLocal(xform.GridUid.Value, grid, coords)
.FirstOrDefault(HasComp<DisposalEntryComponent>);

if (entry == default || component is not DisposalUnitComponent sDisposals)
Expand Down
8 changes: 7 additions & 1 deletion Content.Server/IP/IPAddressExt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ public static bool IsInSubnet(this System.Net.IPAddress address, (System.Net.IPA

public static bool IsInSubnet(this System.Net.IPAddress address, System.Net.IPAddress maskAddress, int maskLength)
{
if (maskAddress.AddressFamily != address.AddressFamily)
{
// We got something like an IPV4-Address for an IPv6-Mask. This is not valid.
return false;
}

if (maskAddress.AddressFamily == AddressFamily.InterNetwork)
{
// Convert the mask address to an unsigned integer.
Expand Down Expand Up @@ -89,7 +95,7 @@ public static bool IsInSubnet(this System.Net.IPAddress address, System.Net.IPAd

if (maskAddressBits.Length != ipAddressBits.Length)
{
throw new ArgumentException("Length of IP Address and Subnet Mask do not match.");
return false;
}

// Compare the prefix bits.
Expand Down
Loading
Loading