update random stuff
This commit is contained in:
parent
9021fed64a
commit
caae5f4d06
|
|
@ -826,8 +826,8 @@ namespace Content.Server.Administration.Systems
|
|||
bwoinkText = $"{(message.AdminOnly ? Loc.GetString("bwoink-message-admin-only") : !message.PlaySound ? Loc.GetString("bwoink-message-silent") : "")} {bwoinkText}: {escapedText}";
|
||||
|
||||
// If it's not an admin / admin chooses to keep the sound and message is not an admin only message, then play it.
|
||||
var playSound = (!senderAHelpAdmin || message.PlaySound) && !message.AdminOnly;
|
||||
var msg = new BwoinkTextMessage(message.UserId, senderSession.UserId, bwoinkText, playSound: playSound, adminOnly: message.AdminOnly);
|
||||
var playSound = (senderAdmin == null || message.PlaySound) && !message.AdminOnly;
|
||||
var msg = new BwoinkTextMessage(message.UserId, senderId, bwoinkText, playSound: playSound, adminOnly: message.AdminOnly);
|
||||
|
||||
LogBwoink(msg);
|
||||
|
||||
|
|
|
|||
|
|
@ -341,9 +341,8 @@ namespace Content.Server.Psionics.Glimmer
|
|||
_lightning.ShootRandomLightnings(uid, 10, 2, "SuperchargedLightning", 2, false);
|
||||
|
||||
// Check if the parent of the user is alive, which will be the case if the user is an item and is being held.
|
||||
var zapTarget = _transform.GetParentUid(args.User);
|
||||
if (TryComp<MindContainerComponent>(zapTarget, out _))
|
||||
_electrocutionSystem.TryDoElectrocution(zapTarget, uid, 5, TimeSpan.FromSeconds(3), true,
|
||||
if (args.User is {} user && HasComp<MindContainerComponent>(args.User))
|
||||
_electrocutionSystem.TryDoElectrocution(user, uid, 5, TimeSpan.FromSeconds(3), true,
|
||||
ignoreInsulation: true);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -46,11 +46,12 @@ public sealed partial class SalvageSystem
|
|||
}
|
||||
|
||||
var index = args.Index;
|
||||
var user = args.Actor; // DeltaV
|
||||
async void TryTakeMagnetOffer()
|
||||
{
|
||||
try
|
||||
{
|
||||
await TakeMagnetOffer((station.Value, dataComp), index, (uid, component), args.Actor); // DeltaV: pass the user entity
|
||||
await TakeMagnetOffer((station.Value, dataComp), index, (uid, component), user); // DeltaV: pass the user
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ using Content.Server.Humanoid;
|
|||
using Content.Server.IdentityManagement;
|
||||
using Content.Server.Mind.Commands;
|
||||
using Content.Server.PDA;
|
||||
using Content.Server.Spawners.Components; // DeltaV
|
||||
using Content.Server.Station.Components;
|
||||
using Content.Shared.Access.Components;
|
||||
using Content.Shared.Access.Systems;
|
||||
|
|
|
|||
|
|
@ -2,10 +2,11 @@ using Content.Server.Atmos.EntitySystems;
|
|||
using Content.Server.Parallax;
|
||||
using Content.Shared._DV.Planet;
|
||||
using Content.Shared.Parallax.Biomes;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.EntitySerialization.Systems;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Map.Components;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Server._DV.Planet;
|
||||
|
||||
|
|
@ -14,9 +15,9 @@ public sealed class PlanetSystem : EntitySystem
|
|||
[Dependency] private readonly AtmosphereSystem _atmos = default!;
|
||||
[Dependency] private readonly BiomeSystem _biome = default!;
|
||||
[Dependency] private readonly IPrototypeManager _proto = default!;
|
||||
[Dependency] private readonly MapSystem _map = default!;
|
||||
[Dependency] private readonly MapLoaderSystem _mapLoader = default!;
|
||||
[Dependency] private readonly MetaDataSystem _meta = default!;
|
||||
[Dependency] private readonly SharedMapSystem _map = default!;
|
||||
|
||||
private readonly List<(Vector2i, Tile)> _setTiles = new();
|
||||
|
||||
|
|
@ -51,11 +52,11 @@ public sealed class PlanetSystem : EntitySystem
|
|||
/// Spawns an initialized planet map from a planet prototype and loads a grid onto it.
|
||||
/// Returns the map entity if loading succeeded.
|
||||
/// </summary>
|
||||
public EntityUid? LoadPlanet(ProtoId<PlanetPrototype> id, string path)
|
||||
public EntityUid? LoadPlanet(ProtoId<PlanetPrototype> id, ResPath path)
|
||||
{
|
||||
var map = SpawnPlanet(id, runMapInit: false);
|
||||
var mapId = Comp<MapComponent>(map).MapId;
|
||||
if (!_mapLoader.TryLoad(mapId, path, out var grids))
|
||||
if (!_mapLoader.TryLoadMapWithId(mapId, path, out _, out var grids))
|
||||
{
|
||||
Log.Error($"Failed to load planet grid {path} for planet {id}!");
|
||||
Del(map);
|
||||
|
|
|
|||
|
|
@ -4,8 +4,10 @@ using Content.Server.Station.Components;
|
|||
using Content.Server.Station.Systems;
|
||||
using Content.Shared._DV.CCVars;
|
||||
using Content.Shared.Tag;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.EntitySerialization.Systems;
|
||||
using Robust.Shared.Configuration;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Server.Shipyard;
|
||||
|
||||
|
|
@ -16,13 +18,12 @@ public sealed class ShipyardSystem : EntitySystem
|
|||
{
|
||||
[Dependency] private readonly IConfigurationManager _config = default!;
|
||||
[Dependency] private readonly MapDeleterShuttleSystem _mapDeleterShuttle = default!;
|
||||
[Dependency] private readonly MapSystem _map = default!;
|
||||
[Dependency] private readonly MapLoaderSystem _mapLoader = default!;
|
||||
[Dependency] private readonly SharedMapSystem _map = default!;
|
||||
[Dependency] private readonly ShuttleSystem _shuttle = default!;
|
||||
[Dependency] private readonly StationSystem _station = default!;
|
||||
|
||||
[ValidatePrototypeId<TagPrototype>]
|
||||
public string DockTag = "DockShipyard";
|
||||
public ProtoId<TagPrototype> DockTag = "DockShipyard";
|
||||
|
||||
public bool Enabled;
|
||||
|
||||
|
|
@ -41,24 +42,15 @@ public sealed class ShipyardSystem : EntitySystem
|
|||
if (!Enabled)
|
||||
return null;
|
||||
|
||||
if (!_mapLoader.TryLoad(mapId, path, out var map, out var grids))
|
||||
var map = _map.CreateMap(out var mapId);
|
||||
if (!_mapLoader.TryLoadGrid(mapId, path, out var grid))
|
||||
{
|
||||
Log.Error($"Failed to load shuttle {path}");
|
||||
Del(map);
|
||||
return null;
|
||||
}
|
||||
|
||||
// only 1 grid is supported, no tramshuttle
|
||||
if (grids.Count != 1)
|
||||
{
|
||||
var error = grids.Count < 1 ? "less" : "more";
|
||||
Log.Error($"Shuttle {path} had {error} than 1 grid, which is not supported.");
|
||||
Del(map);
|
||||
return null;
|
||||
}
|
||||
|
||||
var uid = grids[0];
|
||||
if (!TryComp<ShuttleComponent>(uid, out var comp))
|
||||
if (!TryComp<ShuttleComponent>(grid, out var comp))
|
||||
{
|
||||
Log.Error($"Shuttle {path}'s grid was missing ShuttleComponent");
|
||||
Del(map);
|
||||
|
|
@ -66,8 +58,8 @@ public sealed class ShipyardSystem : EntitySystem
|
|||
}
|
||||
|
||||
_map.SetPaused(map, false);
|
||||
_mapDeleterShuttle.Enable(uid);
|
||||
return (uid, comp);
|
||||
_mapDeleterShuttle.Enable(grid.Value);
|
||||
return (grid.Value, comp);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ public sealed class StationPlanetSpawnerSystem : EntitySystem
|
|||
if (ent.Comp.GridPath is not {} path)
|
||||
return;
|
||||
|
||||
ent.Comp.Map = _planet.LoadPlanet(ent.Comp.Planet, path.ToString());
|
||||
ent.Comp.Map = _planet.LoadPlanet(ent.Comp.Planet, path);
|
||||
}
|
||||
|
||||
private void OnShutdown(Entity<StationPlanetSpawnerComponent> ent, ref ComponentShutdown args)
|
||||
|
|
|
|||
|
|
@ -9,9 +9,8 @@ using Content.Server.Station.Components;
|
|||
using Content.Server.StationEvents.Components;
|
||||
using Content.Shared.CCVar;
|
||||
using Content.Shared.Salvage;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Server.Maps;
|
||||
using Robust.Shared.Configuration;
|
||||
using Robust.Shared.EntitySerialization.Systems;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Map.Components;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
|
@ -58,14 +57,8 @@ public sealed class DebrisSpawnerRule : StationEventSystem<DebrisSpawnerRuleComp
|
|||
|
||||
var offset = RobustRandom.NextVector2(dist, dist * 2.5f);
|
||||
var randomer = RobustRandom.NextVector2(dist, dist * 5f); //Second random vector to ensure the outpost isn't perfectly centered in the debris field
|
||||
var options = new MapLoadOptions
|
||||
{
|
||||
Offset = aabb.Center + offset + randomer,
|
||||
LoadMap = false,
|
||||
};
|
||||
|
||||
var salvage = RobustRandom.PickAndTake(salvageMaps);
|
||||
_mapLoader.Load(args.Map, salvage.MapPath.ToString(), options);
|
||||
_mapLoader.TryLoadGrid(args.Map, salvage.MapPath, out _, offset: aabb.Center + offset + randomer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@ using Content.Server.GameTicking.Rules;
|
|||
using Content.Server.Station.Components;
|
||||
using Content.Server.StationEvents.Components;
|
||||
using Content.Shared.GameTicking.Components;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Server.Maps;
|
||||
using Robust.Shared.EntitySerialization.Systems;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Map.Components;
|
||||
using Robust.Shared.Random;
|
||||
|
|
@ -41,8 +40,8 @@ public sealed class LoadFarGridRule : StationEventSystem<LoadFarGridRuleComponen
|
|||
if (map == MapId.Nullspace)
|
||||
map = Transform(gridId).MapID;
|
||||
|
||||
var grid = Comp<MapGridComponent>(gridId);
|
||||
var gridAabb = Transform(gridId).WorldMatrix.TransformBox(grid.LocalAABB);
|
||||
var gridComp = Comp<MapGridComponent>(gridId);
|
||||
var gridAabb = Transform(gridId).WorldMatrix.TransformBox(gridComp.LocalAABB);
|
||||
aabb = aabb.Union(gridAabb);
|
||||
}
|
||||
|
||||
|
|
@ -50,23 +49,16 @@ public sealed class LoadFarGridRule : StationEventSystem<LoadFarGridRuleComponen
|
|||
var modifier = comp.DistanceModifier * scale;
|
||||
var dist = MathF.Max(aabb.Height / 2f, aabb.Width / 2f) * modifier;
|
||||
var offset = RobustRandom.NextVector2(dist, dist * 2.5f);
|
||||
var options = new MapLoadOptions
|
||||
{
|
||||
Offset = aabb.Center + offset,
|
||||
LoadMap = false
|
||||
};
|
||||
|
||||
var path = comp.Path.ToString();
|
||||
Log.Debug($"Loading far grid {path} at {options.Offset}");
|
||||
if (!_mapLoader.TryLoad(map, path, out var grids, options))
|
||||
if (!_mapLoader.TryLoadGrid(map, comp.Path, out var grid, offset: aabb.Center + offset))
|
||||
{
|
||||
Log.Error($"{ToPrettyString(uid):rule} failed to load grid {path}!");
|
||||
Log.Error($"{ToPrettyString(uid):rule} failed to load grid {comp.Path}!");
|
||||
ForceEndSelf(uid, rule);
|
||||
return;
|
||||
}
|
||||
|
||||
// let other systems do stuff
|
||||
var ev = new RuleLoadedGridsEvent(map, grids);
|
||||
var ev = new RuleLoadedGridsEvent(map, [grid.Value]);
|
||||
RaiseLocalEvent(uid, ref ev);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
using Content.Shared.Forensics;
|
||||
using Content.Shared.Forensics.Components;
|
||||
using Content.Shared.Inventory;
|
||||
|
||||
namespace Content.Server.Forensics;
|
||||
namespace Content.Shared._DV.Forensics;
|
||||
|
||||
public sealed class FingerprintMaskSystem : EntitySystem
|
||||
{
|
||||
|
|
@ -12,9 +13,9 @@ public sealed class FingerprintMaskSystem : EntitySystem
|
|||
SubscribeLocalEvent<FingerprintMaskComponent, InventoryRelayedEvent<TryAccessFingerprintEvent>>(OnTryAccessFingerprint);
|
||||
}
|
||||
|
||||
private void OnTryAccessFingerprint(EntityUid uid, FingerprintMaskComponent comp, ref InventoryRelayedEvent<TryAccessFingerprintEvent> args)
|
||||
private void OnTryAccessFingerprint(Entity<FingerprintMaskComponent> ent, ref InventoryRelayedEvent<TryAccessFingerprintEvent> args)
|
||||
{
|
||||
args.Args.Blocker = uid;
|
||||
args.Args.Blocker = ent;
|
||||
args.Args.Cancel();
|
||||
}
|
||||
}
|
||||
|
|
@ -44,10 +44,10 @@ public sealed partial class ShopVendorComponent : Component
|
|||
[DataField]
|
||||
public TimeSpan EjectDelay = TimeSpan.FromSeconds(1.2);
|
||||
|
||||
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
|
||||
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoPausedField]
|
||||
public TimeSpan NextDeny;
|
||||
|
||||
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
|
||||
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoPausedField]
|
||||
public TimeSpan NextEject;
|
||||
|
||||
[DataField]
|
||||
|
|
|
|||
Loading…
Reference in New Issue