Merge pull request #522 from crystallpunk-14/ed-29-10-2024-guides-and-skills
Ed 29 10 2024 guides and skills
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using Content.Shared._CP14.TravelingStoreShip;
|
||||
using Content.Shared._CP14.Cargo;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.UserInterface;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Content.Shared._CP14.TravelingStoreShip;
|
||||
using Content.Shared._CP14.Cargo;
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.UserInterface;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Content.Shared._CP14.TravelingStoreShip;
|
||||
using Content.Shared._CP14.Cargo;
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.UserInterface.CustomControls;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using Content.Shared._CP14.TravelingStoreShip.Prototype;
|
||||
using Content.Shared._CP14.Cargo.Prototype;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using System.Linq;
|
||||
using Content.Server._CP14.Shuttles;
|
||||
using Content.Server.Access.Systems;
|
||||
using Content.Server.DetailExaminable;
|
||||
using Content.Server.Humanoid;
|
||||
@@ -42,7 +40,6 @@ public sealed class StationSpawningSystem : SharedStationSpawningSystem
|
||||
[Dependency] private readonly SharedAccessSystem _accessSystem = default!;
|
||||
[Dependency] private readonly ActorSystem _actors = default!;
|
||||
[Dependency] private readonly ArrivalsSystem _arrivalsSystem = default!;
|
||||
[Dependency] private readonly CP14ExpeditionSystem _CP14expedition = default!;
|
||||
[Dependency] private readonly IdCardSystem _cardSystem = default!;
|
||||
[Dependency] private readonly IConfigurationManager _configurationManager = default!;
|
||||
[Dependency] private readonly ContainerSpawnPointSystem _containerSpawnPointSystem = default!;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using System.Numerics;
|
||||
using Content.Server.Shuttles.Components;
|
||||
using Content.Server.Shuttles.Events;
|
||||
using Content.Shared._CP14.TravelingStoreShip;
|
||||
using Content.Shared._CP14.TravelingStoreShip.Prototype;
|
||||
using Content.Shared._CP14.Cargo;
|
||||
using Content.Shared._CP14.Cargo.Prototype;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Random;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using System.Text;
|
||||
using Content.Shared._CP14.TravelingStoreShip;
|
||||
using Content.Shared._CP14.Cargo;
|
||||
using Content.Shared.UserInterface;
|
||||
|
||||
namespace Content.Server._CP14.Cargo;
|
||||
|
||||
@@ -3,8 +3,8 @@ using Content.Server.Shuttles.Systems;
|
||||
using Content.Server.Station.Events;
|
||||
using Content.Server.Station.Systems;
|
||||
using Content.Shared._CP14.Currency;
|
||||
using Content.Shared._CP14.TravelingStoreShip;
|
||||
using Content.Shared._CP14.TravelingStoreShip.Prototype;
|
||||
using Content.Shared._CP14.Cargo;
|
||||
using Content.Shared._CP14.Cargo.Prototype;
|
||||
using Content.Shared.Maps;
|
||||
using Content.Shared.Paper;
|
||||
using Content.Shared.Physics;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using Content.Server._CP14.Objectives.Components;
|
||||
using Content.Server.Objectives.Components.Targets;
|
||||
using Content.Shared._CP14.TravelingStoreShip;
|
||||
using Content.Shared._CP14.Cargo;
|
||||
using Content.Shared.Objectives.Components;
|
||||
using Content.Shared.Objectives.Systems;
|
||||
using Content.Shared.Stacks;
|
||||
|
||||
@@ -1,155 +0,0 @@
|
||||
using Content.Server._CP14.Shuttles.Components;
|
||||
using Content.Server.Shuttles.Components;
|
||||
using Content.Server.Shuttles.Events;
|
||||
using Content.Server.Shuttles.Systems;
|
||||
using Content.Server.Spawners.Components;
|
||||
using Content.Server.Spawners.EntitySystems;
|
||||
using Content.Server.Station.Events;
|
||||
using Content.Server.Station.Systems;
|
||||
using Content.Shared.CCVar;
|
||||
using Content.Shared.Movement.Components;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Configuration;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Random;
|
||||
|
||||
namespace Content.Server._CP14.Shuttles;
|
||||
|
||||
public sealed class CP14ExpeditionSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IConfigurationManager _cfgManager = default!;
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
[Dependency] private readonly MapLoaderSystem _loader = default!;
|
||||
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
||||
[Dependency] private readonly ShuttleSystem _shuttles = default!;
|
||||
[Dependency] private readonly StationSpawningSystem _stationSpawning = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Flags if all players must arrive via the Arrivals system, or if they can spawn in other ways.
|
||||
/// </summary>
|
||||
public float ArrivalTime { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// If enabled then spawns players on an expedition ship.
|
||||
/// </summary>
|
||||
public bool Enabled { get; private set; }
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<CP14StationExpeditionTargetComponent, StationPostInitEvent>(OnPostInitSetupExpeditionShip);
|
||||
|
||||
SubscribeLocalEvent<CP14StationExpeditionTargetComponent, FTLCompletedEvent>(OnExpeditionShipLanded);
|
||||
|
||||
SubscribeLocalEvent<PlayerSpawningEvent>(HandlePlayerSpawning, before: new []{ typeof(SpawnPointSystem) });
|
||||
|
||||
ArrivalTime = _cfgManager.GetCVar(CCVars.CP14ExpeditionArrivalTime);
|
||||
Enabled = _cfgManager.GetCVar(CCVars.CP14ExpeditionShip);
|
||||
|
||||
_cfgManager.OnValueChanged(CCVars.CP14ExpeditionArrivalTime, time => ArrivalTime = time, true);
|
||||
_cfgManager.OnValueChanged(CCVars.CP14ExpeditionShip, value => Enabled = value, true);
|
||||
}
|
||||
|
||||
private void OnPostInitSetupExpeditionShip(Entity<CP14StationExpeditionTargetComponent> station, ref StationPostInitEvent args)
|
||||
{
|
||||
if (!Enabled)
|
||||
return;
|
||||
|
||||
if (!Deleted(station.Comp.Shuttle))
|
||||
return;
|
||||
|
||||
var dummyMap = _mapManager.CreateMap();
|
||||
|
||||
if (_loader.TryLoad(dummyMap, station.Comp.ShuttlePath.ToString(), out var shuttleUids))
|
||||
{
|
||||
var shuttle = shuttleUids[0];
|
||||
station.Comp.Shuttle = shuttle;
|
||||
var shuttleComp = Comp<ShuttleComponent>(station.Comp.Shuttle);
|
||||
var expeditionShipComp = EnsureComp<CP14ExpeditionShipComponent>(station.Comp.Shuttle);
|
||||
expeditionShipComp.Station = station;
|
||||
|
||||
var targetPoints = new List<EntityUid>();
|
||||
var targetEnumerator = EntityQueryEnumerator<CP14ExpeditionShipFTLTargetComponent, TransformComponent>();
|
||||
while (targetEnumerator.MoveNext(out var uid, out _, out _))
|
||||
{
|
||||
targetPoints.Add(uid);
|
||||
}
|
||||
var target = _random.Pick(targetPoints);
|
||||
if (!HasComp<TransformComponent>(shuttle))
|
||||
return;
|
||||
|
||||
var targetPos = _transform.GetWorldPosition(target);
|
||||
var mapUid = _transform.GetMap(target);
|
||||
if (mapUid == null)
|
||||
return;
|
||||
|
||||
_shuttles.FTLToCoordinates(shuttle, shuttleComp, new EntityCoordinates(mapUid.Value, targetPos), Angle.Zero, hyperspaceTime: ArrivalTime, startupTime: 0.5f);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnExpeditionShipLanded(Entity<CP14StationExpeditionTargetComponent> ent, ref FTLCompletedEvent args)
|
||||
{
|
||||
//Some announsement logic?
|
||||
}
|
||||
|
||||
public bool TryGetExpeditionShip(out EntityUid? uid)
|
||||
{
|
||||
uid = null;
|
||||
var arrivalsQuery = EntityQueryEnumerator<CP14ExpeditionShipComponent>();
|
||||
|
||||
while (arrivalsQuery.MoveNext(out var tempUid, out _))
|
||||
{
|
||||
uid = tempUid;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void HandlePlayerSpawning(PlayerSpawningEvent ev)
|
||||
{
|
||||
if (!Enabled)
|
||||
return;
|
||||
|
||||
if (ev.SpawnResult != null)
|
||||
return;
|
||||
|
||||
if (!HasComp<CP14StationExpeditionTargetComponent>(ev.Station))
|
||||
return;
|
||||
|
||||
TryGetExpeditionShip(out var ship);
|
||||
|
||||
if (!TryComp(ship, out TransformComponent? shipXform))
|
||||
return;
|
||||
|
||||
var gridUid = shipXform.GridUid;
|
||||
|
||||
var points = EntityQueryEnumerator<SpawnPointComponent, TransformComponent>();
|
||||
var possiblePositions = new List<EntityCoordinates>();
|
||||
while (points.MoveNext(out var uid, out var spawnPoint, out var xform))
|
||||
{
|
||||
if (ev.Job != null && spawnPoint.Job != ev.Job.Value)
|
||||
continue;
|
||||
|
||||
if (xform.GridUid != gridUid)
|
||||
continue;
|
||||
|
||||
possiblePositions.Add(xform.Coordinates);
|
||||
}
|
||||
|
||||
if (possiblePositions.Count <= 0)
|
||||
return;
|
||||
|
||||
var spawnLoc = _random.Pick(possiblePositions);
|
||||
ev.SpawnResult = _stationSpawning.SpawnPlayerMob(
|
||||
spawnLoc,
|
||||
ev.Job,
|
||||
ev.HumanoidCharacterProfile,
|
||||
ev.Station);
|
||||
|
||||
EnsureComp<PendingClockInComponent>(ev.SpawnResult.Value);
|
||||
EnsureComp<AutoOrientComponent>(ev.SpawnResult.Value);
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
namespace Content.Server._CP14.Shuttles.Components;
|
||||
|
||||
[RegisterComponent, Access(typeof(CP14ExpeditionSystem)), AutoGenerateComponentPause]
|
||||
public sealed partial class CP14ExpeditionShipComponent : Component
|
||||
{
|
||||
[DataField]
|
||||
public EntityUid Station;
|
||||
}
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
namespace Content.Server._CP14.Shuttles.Components;
|
||||
|
||||
/// <summary>
|
||||
/// One of the possible points where an elemental ship might land at the start of a round
|
||||
/// </summary>
|
||||
[RegisterComponent, Access(typeof(CP14ExpeditionSystem))]
|
||||
public sealed partial class CP14ExpeditionShipFTLTargetComponent : Component
|
||||
{
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Server._CP14.Shuttles.Components;
|
||||
|
||||
/// <summary>
|
||||
/// Added to a station to start the round with an elemental ship arriving on this map
|
||||
/// </summary>
|
||||
[RegisterComponent, Access(typeof(CP14ExpeditionSystem))]
|
||||
public sealed partial class CP14StationExpeditionTargetComponent : Component
|
||||
{
|
||||
[DataField]
|
||||
public EntityUid Shuttle;
|
||||
|
||||
[DataField] public ResPath ShuttlePath = new("/Maps/Shuttles/arrivals.yml");
|
||||
}
|
||||
@@ -10,19 +10,6 @@ namespace Content.Shared.CCVar
|
||||
[CVarDefs]
|
||||
public sealed class CCVars : CVars
|
||||
{
|
||||
#region CP14
|
||||
/// <summary>
|
||||
/// how long does it take to fly an expedition ship to an expedition point?
|
||||
/// </summary>
|
||||
public static readonly CVarDef<float> CP14ExpeditionArrivalTime =
|
||||
CVarDef.Create("cp14.arrival_time", 180f, CVar.SERVERONLY);
|
||||
|
||||
/// <summary>
|
||||
/// is the expedition ship's system enabled?
|
||||
/// </summary>
|
||||
public static readonly CVarDef<bool> CP14ExpeditionShip =
|
||||
CVarDef.Create("cp14.arrivals_ship", true, CVar.SERVERONLY);
|
||||
#endregion
|
||||
/*
|
||||
* Server
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Content.Shared._CP14.TravelingStoreShip;
|
||||
namespace Content.Shared._CP14.Cargo;
|
||||
|
||||
/// <summary>
|
||||
/// marks an entity into which trade with the city will put money when selling, or take it when buying.
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Content.Shared._CP14.TravelingStoreShip;
|
||||
namespace Content.Shared._CP14.Cargo;
|
||||
|
||||
/// <summary>
|
||||
/// Allows users to view information on city trading opportunities
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Content.Shared._CP14.TravelingStoreShip;
|
||||
namespace Content.Shared._CP14.Cargo;
|
||||
|
||||
[RegisterComponent]
|
||||
public sealed partial class CP14SellingPalettComponent : Component
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Content.Shared._CP14.TravelingStoreShip;
|
||||
namespace Content.Shared._CP14.Cargo;
|
||||
|
||||
public class CP14SharedCargoSystem : EntitySystem
|
||||
{
|
||||
@@ -1,9 +1,9 @@
|
||||
using Content.Shared._CP14.TravelingStoreShip.Prototype;
|
||||
using Content.Shared._CP14.Cargo.Prototype;
|
||||
using Content.Shared.Destructible.Thresholds;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Shared._CP14.TravelingStoreShip;
|
||||
namespace Content.Shared._CP14.Cargo;
|
||||
|
||||
/// <summary>
|
||||
/// Add to the station so that traveling store ship starts running on it
|
||||
@@ -3,7 +3,7 @@ using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Shared._CP14.TravelingStoreShip;
|
||||
namespace Content.Shared._CP14.Cargo;
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public enum CP14StoreUiKey
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.Text;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared._CP14.TravelingStoreShip.Prototype.BuyServices;
|
||||
namespace Content.Shared._CP14.Cargo.Prototype.BuyServices;
|
||||
|
||||
public sealed partial class CP14BuyItemsService : CP14StoreBuyService
|
||||
{
|
||||
@@ -3,7 +3,7 @@ using JetBrains.Annotations;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Shared._CP14.TravelingStoreShip.Prototype;
|
||||
namespace Content.Shared._CP14.Cargo.Prototype;
|
||||
|
||||
/// <summary>
|
||||
/// Stores the price and product/service pair that players can buy.
|
||||
@@ -3,7 +3,7 @@ using JetBrains.Annotations;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Shared._CP14.TravelingStoreShip;
|
||||
namespace Content.Shared._CP14.Cargo;
|
||||
|
||||
/// <summary>
|
||||
/// Stores the price and product/service pair that players can buy.
|
||||
@@ -1,7 +1,7 @@
|
||||
using Content.Shared.Stacks;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared._CP14.TravelingStoreShip.Prototype.SellServices;
|
||||
namespace Content.Shared._CP14.Cargo.Prototype.SellServices;
|
||||
|
||||
public sealed partial class CP14SellStackService : CP14StoreSellService
|
||||
{
|
||||
@@ -1,7 +1,7 @@
|
||||
using Content.Shared.Whitelist;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared._CP14.TravelingStoreShip.Prototype.SellServices;
|
||||
namespace Content.Shared._CP14.Cargo.Prototype.SellServices;
|
||||
|
||||
public sealed partial class CP14SellWhitelistService : CP14StoreSellService
|
||||
{
|
||||
@@ -1,7 +1,4 @@
|
||||
[cp14]
|
||||
arrivals_ship = false
|
||||
|
||||
[events]
|
||||
[events]
|
||||
# Annoying
|
||||
enabled = false
|
||||
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
[cp14]
|
||||
arrivals_ship = false
|
||||
|
||||
[game]
|
||||
[game]
|
||||
# Straight in-game baby
|
||||
lobbyenabled = false
|
||||
# Dev map for faster loading & convenience
|
||||
|
||||
@@ -77672,13 +77672,6 @@ entities:
|
||||
- type: Physics
|
||||
canCollide: False
|
||||
- type: InsideEntityStorage
|
||||
- proto: CP14ExpeditionShipTargetPoint
|
||||
entities:
|
||||
- uid: 8
|
||||
components:
|
||||
- type: Transform
|
||||
pos: -0.5,0.5
|
||||
parent: 1
|
||||
- proto: CP14FenceIronGrilleCorner
|
||||
entities:
|
||||
- uid: 5386
|
||||
|
||||
@@ -60,6 +60,10 @@
|
||||
- type: Clothing
|
||||
sprite: _CP14/Clothing/Eyes/alchemy_glasses.rsi
|
||||
- type: SolutionScanner
|
||||
- type: GuideHelp
|
||||
guides:
|
||||
- CP14_RU_Alchemy
|
||||
- CP14_EN_Alchemy
|
||||
|
||||
- type: entity
|
||||
parent: CP14ClothingEyesBase
|
||||
@@ -72,6 +76,10 @@
|
||||
- type: Clothing
|
||||
sprite: _CP14/Clothing/Eyes/alchemy_monocle.rsi
|
||||
- type: SolutionScanner
|
||||
- type: GuideHelp
|
||||
guides:
|
||||
- CP14_RU_Alchemy
|
||||
- CP14_EN_Alchemy
|
||||
|
||||
- type: entity
|
||||
parent: CP14ClothingEyesBase
|
||||
|
||||
@@ -1,14 +1,3 @@
|
||||
- type: entity
|
||||
id: CP14ExpeditionShipTargetPoint
|
||||
parent: MarkerBase
|
||||
name: Expedition ship target point
|
||||
description: One of the possible arrival points of a ship carrying players
|
||||
categories: [ ForkFiltered ]
|
||||
components:
|
||||
- type: CP14ExpeditionShipFTLTarget
|
||||
- type: Sprite
|
||||
state: pink
|
||||
|
||||
- type: entity
|
||||
id: CP14BankStorageMarker
|
||||
parent: MarkerBase
|
||||
@@ -26,4 +15,4 @@
|
||||
range: 2
|
||||
- type: CP14StealAreaAutoJobConnect
|
||||
departments:
|
||||
- CP14Bank
|
||||
- CP14Bank
|
||||
|
||||
@@ -90,6 +90,10 @@
|
||||
fuckupChance: 0.05
|
||||
requiredSkills:
|
||||
- Alchemy
|
||||
- type: GuideHelp
|
||||
guides:
|
||||
- CP14_RU_Alchemy
|
||||
- CP14_EN_Alchemy
|
||||
|
||||
- type: entity
|
||||
id: CP14Mortar
|
||||
@@ -163,6 +167,10 @@
|
||||
- type: CP14Mortar
|
||||
solution: mortar
|
||||
containerId: storagebase
|
||||
- type: GuideHelp
|
||||
guides:
|
||||
- CP14_RU_Alchemy
|
||||
- CP14_EN_Alchemy
|
||||
|
||||
- type: entity
|
||||
parent: BaseItem
|
||||
|
||||
Reference in New Issue
Block a user