From f033282797d9796bed8776ba97a5b3ecb2c5e109 Mon Sep 17 00:00:00 2001 From: Cheackraze <71046427+Cheackraze@users.noreply.github.com> Date: Wed, 12 Jul 2023 00:56:23 -0400 Subject: [PATCH] expeditions go nyooom --- .../Salvage/SalvageSystem.Expeditions.cs | 5 + .../Salvage/SpawnSalvageMissionJob.cs | 28 +- .../_NF/GameRule/NfAdventureRuleSystem.cs | 28 +- Content.Shared/CCVar/CCVars.cs | 2 +- Resources/Maps/Shuttles/courserx.yml | 288 ++++++++++-------- 5 files changed, 210 insertions(+), 141 deletions(-) diff --git a/Content.Server/Salvage/SalvageSystem.Expeditions.cs b/Content.Server/Salvage/SalvageSystem.Expeditions.cs index 24b2b22196c..4c553f6e9f8 100644 --- a/Content.Server/Salvage/SalvageSystem.Expeditions.cs +++ b/Content.Server/Salvage/SalvageSystem.Expeditions.cs @@ -9,6 +9,8 @@ using Robust.Shared.CPUJob.JobQueues.Queues; using System.Linq; using System.Threading; +using Content.Server.Shuttles.Systems; +using Content.Server.Station.Systems; using Content.Shared.Salvage.Expeditions; using Robust.Shared.GameStates; @@ -21,6 +23,7 @@ public sealed partial class SalvageSystem */ [Dependency] private readonly CargoSystem _cargo = default!; + [Dependency] private readonly StationSystem _stationSystem = default!; private const int MissionLimit = 5; @@ -272,6 +275,8 @@ private void SpawnMission(SalvageMissionParams missionParams, EntityUid station) _tileDefManager, _biome, _dungeon, + _shuttle, + _stationSystem, this, station, missionParams, diff --git a/Content.Server/Salvage/SpawnSalvageMissionJob.cs b/Content.Server/Salvage/SpawnSalvageMissionJob.cs index 897c01d0346..90578d8f76e 100644 --- a/Content.Server/Salvage/SpawnSalvageMissionJob.cs +++ b/Content.Server/Salvage/SpawnSalvageMissionJob.cs @@ -10,6 +10,10 @@ using Content.Server.Procedural; using Content.Server.Salvage.Expeditions; using Content.Server.Salvage.Expeditions.Structure; +using Content.Server.Shuttles.Components; +using Content.Server.Shuttles.Systems; +using Content.Server.Station.Components; +using Content.Server.Station.Systems; using Content.Shared.Atmos; using Content.Shared.Dataset; using Content.Shared.Gravity; @@ -43,7 +47,8 @@ public sealed class SpawnSalvageMissionJob : Job private readonly BiomeSystem _biome; private readonly DungeonSystem _dungeon; private readonly SalvageSystem _salvage; - + private readonly ShuttleSystem _shuttle; + private readonly StationSystem _stationSystem; public readonly EntityUid Station; private readonly SalvageMissionParams _missionParams; @@ -56,6 +61,8 @@ public SpawnSalvageMissionJob( ITileDefinitionManager tileDefManager, BiomeSystem biome, DungeonSystem dungeon, + ShuttleSystem shuttle, + StationSystem stationSystem, SalvageSystem salvage, EntityUid station, SalvageMissionParams missionParams, @@ -68,6 +75,8 @@ public SpawnSalvageMissionJob( _tileDefManager = tileDefManager; _biome = biome; _dungeon = dungeon; + _shuttle = shuttle; + _stationSystem = stationSystem; _salvage = salvage; Station = station; _missionParams = missionParams; @@ -138,12 +147,21 @@ protected override async Task Process() expedition.Difficulty = _missionParams.Difficulty; expedition.Rewards = mission.Rewards; - // Don't want consoles to have the incorrect name until refreshed. - var ftlUid = _entManager.CreateEntityUninitialized("FTLPoint", new EntityCoordinates(mapUid, Vector2.Zero)); + // On Frontier, we cant share our locations it breaks ftl in a bad bad way + /*var ftlUid = _entManager.CreateEntityUninitialized("FTLPoint", new EntityCoordinates(mapUid, Vector2.Zero)); _entManager.GetComponent(ftlUid).EntityName = SharedSalvageSystem.GetFTLName(_prototypeManager.Index("names_borer"), _missionParams.Seed); - _entManager.InitializeAndStartEntity(ftlUid); + _entManager.InitializeAndStartEntity(ftlUid);*/ + + // so we just gunna yeet them there instead why not. they chose this life. + var stationData = _entManager.GetComponent(Station); + var shuttleUid = _stationSystem.GetLargestGrid(stationData); + if (shuttleUid is { Valid : true } vesselUid) + { + var shuttle = _entManager.GetComponent(vesselUid); + _shuttle.FTLTravel(vesselUid, shuttle, new EntityCoordinates(mapUid, Vector2.Zero), 8f, 50f); + } - var landingPadRadius = 24; + var landingPadRadius = 38; //we go a liiitle bigger for the shipses var minDungeonOffset = landingPadRadius + 4; // We'll use the dungeon rotation as the spawn angle diff --git a/Content.Server/_NF/GameRule/NfAdventureRuleSystem.cs b/Content.Server/_NF/GameRule/NfAdventureRuleSystem.cs index 5c03127f7b4..1fdee11fdf3 100644 --- a/Content.Server/_NF/GameRule/NfAdventureRuleSystem.cs +++ b/Content.Server/_NF/GameRule/NfAdventureRuleSystem.cs @@ -80,9 +80,9 @@ private void OnPlayerSpawningEvent(PlayerSpawnCompleteEvent ev) private void OnStartup(RoundStartingEvent ev) { var depotMap = "/Maps/cargodepot.yml"; - var mapId = GameTicker.DefaultMap; - var depotOffset = _random.NextVector2(1500f, 3000f); var depotColor = new Color(55, 200, 55); + var mapId = GameTicker.DefaultMap; + var depotOffset = _random.NextVector2(1500f, 2400f); if (_map.TryLoad(mapId, depotMap, out var depotUids, new MapLoadOptions { Offset = depotOffset @@ -105,7 +105,29 @@ private void OnStartup(RoundStartingEvent ev) } ; + depotOffset = _random.NextVector2(2300f, 3400f); + if (_map.TryLoad(mapId, depotMap, out var depotUid3s, new MapLoadOptions + { + Offset = depotOffset + })) + { + var meta = EnsureComp(depotUid3s[0]); + meta.EntityName = "NT Cargo Depot C NF14"; + _shuttle.SetIFFColor(depotUid3s[0], depotColor); + } + + ; + if (_map.TryLoad(mapId, depotMap, out var depotUid4s, new MapLoadOptions + { + Offset = -depotOffset + })) + { + var meta = EnsureComp(depotUid4s[0]); + meta.EntityName = "NT Cargo Depot D NF14"; + _shuttle.SetIFFColor(depotUid4s[0], depotColor); + } + ; var dungenTypes = _prototypeManager.EnumeratePrototypes(); foreach (var dunGen in dungenTypes) @@ -151,7 +173,7 @@ private void OnStartup(RoundStartingEvent ev) //pls fit the grid I beg, this is so hacky //its better now but i think i need to do a normalization pass on the dungeon configs - //because they are all offset + //because they are all offset. confirmed good size grid, just need to fix all the offsets. _dunGen.GenerateDungeon(dunGen, grids[0], mapGrid, (Vector2i) offset, seed); } } diff --git a/Content.Shared/CCVar/CCVars.cs b/Content.Shared/CCVar/CCVars.cs index 38640f8f6bc..481041948af 100644 --- a/Content.Shared/CCVar/CCVars.cs +++ b/Content.Shared/CCVar/CCVars.cs @@ -28,7 +28,7 @@ public sealed class CCVars : CVars /// A loc string for what should be displayed as the title on the Rules window. /// public static readonly CVarDef RulesHeader = - CVarDef.Create("server.rules_header", "ui-rules-header", CVar.REPLICATED | CVar.SERVER); + CVarDef.Create("server.rules_header", "Frontier Server Rules", CVar.REPLICATED | CVar.SERVER); /* * Ambience diff --git a/Resources/Maps/Shuttles/courserx.yml b/Resources/Maps/Shuttles/courserx.yml index 6eea1005e13..85886faafd2 100644 --- a/Resources/Maps/Shuttles/courserx.yml +++ b/Resources/Maps/Shuttles/courserx.yml @@ -63,254 +63,254 @@ entities: color: '#FFFFFFFF' id: Arrows decals: - 170: -2,-13 - 171: 1,-13 + 131: -2,-13 + 132: 1,-13 - node: color: '#FFFFFFFF' id: Arrows decals: - 126: -2,11 - 127: 1,11 + 94: -2,11 + 95: 1,11 - node: angle: 1.5707963267948966 rad color: '#FFFFFFFF' id: Arrows decals: - 134: 5,4 - 135: 5,2 - 136: 5,-4 - 137: 5,-6 + 100: 5,4 + 101: 5,2 + 102: 5,-4 + 103: 5,-6 - node: angle: 4.71238898038469 rad color: '#FFFFFFFF' id: Arrows decals: - 130: -6,-4 - 131: -6,-6 - 132: -6,4 - 133: -6,2 + 96: -6,-4 + 97: -6,-6 + 98: -6,4 + 99: -6,2 - node: color: '#FFFFFFFF' id: Bot decals: 0: -4,-4 - 5: -4,3 - 7: -2,4 - 8: -1,4 - 9: 0,4 - 10: 1,4 - 15: 3,3 - 19: -1,13 - 20: 0,13 - 23: 3,-4 - 38: 2,-14 - 39: 2,-15 - 40: -3,-15 - 41: -3,-14 - 163: -5,8 - 164: 4,8 - 166: -5,8 + 1: -4,3 + 2: -2,4 + 3: -1,4 + 4: 0,4 + 5: 1,4 + 6: 3,3 + 7: -1,13 + 8: 0,13 + 9: 3,-4 + 10: 2,-14 + 11: 2,-15 + 12: -3,-15 + 13: -3,-14 + 128: -5,8 + 129: 4,8 + 130: -5,8 - node: color: '#FFFFFFFF' id: BrickTileDarkCornerNe decals: - 62: 1,7 - 155: 2,-1 + 32: 1,7 + 121: 2,-1 - node: color: '#FFFFFFFF' id: BrickTileDarkCornerNw decals: - 63: -2,7 - 154: -3,-1 + 33: -2,7 + 120: -3,-1 - node: color: '#FFFFFFFF' id: BrickTileDarkLineE decals: - 42: -4,-6 - 45: -4,5 - 66: 1,6 - 67: 1,5 - 156: 2,-2 + 14: -4,-6 + 17: -4,5 + 36: 1,6 + 37: 1,5 + 122: 2,-2 - node: color: '#FFFFFFFF' id: BrickTileDarkLineN decals: - 48: -2,9 - 49: 1,9 - 50: -2,14 - 51: -1,14 - 52: 0,14 - 53: 1,14 - 68: -2,-5 - 69: -1,-5 - 70: 0,-5 - 71: 1,-5 - 158: -2,-1 - 159: -1,-1 - 160: 0,-1 - 161: 1,-1 + 18: -2,9 + 19: 1,9 + 20: -2,14 + 21: -1,14 + 22: 0,14 + 23: 1,14 + 38: -2,-5 + 39: -1,-5 + 40: 0,-5 + 41: 1,-5 + 124: -2,-1 + 125: -1,-1 + 126: 0,-1 + 127: 1,-1 - node: color: '#FFFFFFFF' id: BrickTileDarkLineS decals: - 54: -4,11 - 55: -3,11 - 56: -2,11 - 57: -1,11 - 58: 0,11 - 59: 1,11 - 60: 2,11 - 61: 3,11 - 72: -2,-7 - 73: -1,-7 - 74: 0,-7 - 75: 1,-7 - 76: -2,-16 - 77: -1,-16 - 78: 0,-16 - 79: 1,-16 + 24: -4,11 + 25: -3,11 + 26: -2,11 + 27: -1,11 + 28: 0,11 + 29: 1,11 + 30: 2,11 + 31: 3,11 + 42: -2,-7 + 43: -1,-7 + 44: 0,-7 + 45: 1,-7 + 46: -2,-16 + 47: -1,-16 + 48: 0,-16 + 49: 1,-16 - node: color: '#FFFFFFFF' id: BrickTileDarkLineW decals: - 43: 3,-6 - 44: 3,5 - 64: -2,6 - 65: -2,5 - 157: -3,-2 + 15: 3,-6 + 16: 3,5 + 34: -2,6 + 35: -2,5 + 123: -3,-2 - node: color: '#DE3A3A96' id: BrickTileWhiteCornerNe decals: - 87: 1,7 + 57: 1,7 - node: color: '#DE3A3A96' id: BrickTileWhiteCornerNw decals: - 86: -2,7 + 56: -2,7 - node: color: '#52B4E996' id: BrickTileWhiteLineE decals: - 112: -4,-6 + 82: -4,-6 - node: color: '#DE3A3A96' id: BrickTileWhiteLineE decals: - 80: -4,5 - 84: 1,6 - 85: 1,5 + 50: -4,5 + 54: 1,6 + 55: 1,5 - node: color: '#334E6DC8' id: BrickTileWhiteLineN decals: - 90: -2,9 - 91: 1,9 - 100: -2,14 - 101: -1,14 - 102: 0,14 - 103: 1,14 + 60: -2,9 + 61: 1,9 + 70: -2,14 + 71: -1,14 + 72: 0,14 + 73: 1,14 - node: color: '#52B4E996' id: BrickTileWhiteLineN decals: - 104: -2,-5 - 105: -1,-5 - 106: 0,-5 - 107: 1,-5 + 74: -2,-5 + 75: -1,-5 + 76: 0,-5 + 77: 1,-5 - node: color: '#DE3A3A96' id: BrickTileWhiteLineN decals: - 88: -1,7 - 89: 0,7 + 58: -1,7 + 59: 0,7 - node: color: '#334E6DC8' id: BrickTileWhiteLineS decals: - 92: -4,11 - 93: -3,11 - 94: -2,11 - 95: -1,11 - 96: 0,11 - 97: 1,11 - 98: 2,11 - 99: 3,11 + 62: -4,11 + 63: -3,11 + 64: -2,11 + 65: -1,11 + 66: 0,11 + 67: 1,11 + 68: 2,11 + 69: 3,11 - node: color: '#52B4E996' id: BrickTileWhiteLineS decals: - 108: -2,-7 - 109: -1,-7 - 110: 0,-7 - 111: 1,-7 + 78: -2,-7 + 79: -1,-7 + 80: 0,-7 + 81: 1,-7 - node: color: '#EFB34196' id: BrickTileWhiteLineS decals: - 116: -2,-16 - 117: -1,-16 - 118: 0,-16 - 119: 1,-16 + 84: -2,-16 + 85: -1,-16 + 86: 0,-16 + 87: 1,-16 - node: color: '#52B4E996' id: BrickTileWhiteLineW decals: - 113: 3,-6 + 83: 3,-6 - node: color: '#DE3A3A96' id: BrickTileWhiteLineW decals: - 81: 3,5 - 82: -2,5 - 83: -2,6 + 51: 3,5 + 52: -2,5 + 53: -2,6 - node: angle: 1.5707963267948966 rad color: '#79150096' id: DiagonalCheckerAOverlay decals: - 138: -3,-1 - 139: -2,-1 - 140: -1,-1 - 141: 0,-1 - 142: 1,-1 - 143: 2,-1 - 144: 2,-2 - 145: 1,-2 - 146: 0,-2 - 147: -1,-2 - 148: -2,-2 - 149: -2,-3 - 150: -1,-3 - 151: 0,-3 - 152: 1,-3 - 153: -3,-2 + 104: -3,-1 + 105: -2,-1 + 106: -1,-1 + 107: 0,-1 + 108: 1,-1 + 109: 2,-1 + 110: 2,-2 + 111: 1,-2 + 112: 0,-2 + 113: -1,-2 + 114: -2,-2 + 115: -2,-3 + 116: -1,-3 + 117: 0,-3 + 118: 1,-3 + 119: -3,-2 - node: color: '#52B4E996' id: FullTileOverlayGreyscale decals: - 120: -1,-6 - 121: 0,-6 + 88: -1,-6 + 89: 0,-6 - node: color: '#52B4E996' id: QuarterTileOverlayGreyscale decals: - 122: 0,-7 + 90: 0,-7 - node: color: '#52B4E996' id: QuarterTileOverlayGreyscale180 decals: - 125: -1,-5 + 93: -1,-5 - node: color: '#52B4E996' id: QuarterTileOverlayGreyscale270 decals: - 124: 0,-5 + 92: 0,-5 - node: color: '#52B4E996' id: QuarterTileOverlayGreyscale90 decals: - 123: -1,-7 + 91: -1,-7 type: DecalGrid - version: 2 data: @@ -365,6 +365,7 @@ entities: 1: 4096 -1,3: 0: 61439 + 2: 4096 0,0: 0: 65535 0,1: @@ -373,6 +374,7 @@ entities: 0: 65535 0,3: 0: 32767 + 2: 32768 1,0: 0: 30583 1,1: @@ -416,6 +418,21 @@ entities: - 0 - 0 - 0 + - volume: 2500 + temperature: 293.15 + moles: + - 0 + - 0 + - 0 + - 0 + - 0 + - 0 + - 0 + - 0 + - 0 + - 0 + - 0 + - 0 chunkSize: 4 type: GridAtmosphere - type: RadiationGridResistance @@ -1992,6 +2009,13 @@ entities: pos: -4.5,-9.5 parent: 656 type: Transform +- proto: ComputerSalvageExpedition + entities: + - uid: 233 + components: + - pos: 0.5,14.5 + parent: 656 + type: Transform - proto: ComputerShuttle entities: - uid: 232