From 08f1aa9fa193867254488809cf6660fa45ba65b8 Mon Sep 17 00:00:00 2001 From: Ed <96445749+TheShuEd@users.noreply.github.com> Date: Wed, 24 Jul 2024 20:52:05 +0300 Subject: [PATCH] Crew goals update (#355) * randomization goals support * maps update --- .../Rules/CP14ExpeditionObjectivesRule.cs | 38 ++++++++++++- .../CP14ExpeditionObjectivesRuleComponent.cs | 7 ++- Resources/Maps/_CP14/alchemy_test.yml | 57 +++++++++++-------- Resources/Maps/_CP14/battle_royale.yml | 19 ++++--- Resources/Maps/_CP14/meteor-arena.yml | 22 ++++--- .../_CP14/Entities/Markers/Spawners/jobs.yml | 14 +++++ .../Prototypes/_CP14/GameRules/roundstart.yml | 11 ++-- Resources/Prototypes/_CP14/Maps/arenas.yml | 4 +- .../Objectives/expedition_objectives.yml | 9 ++- .../_CP14/Objectives/personal_objectives.yml | 11 +++- 10 files changed, 141 insertions(+), 51 deletions(-) diff --git a/Content.Server/_CP14/GameTicking/Rules/CP14ExpeditionObjectivesRule.cs b/Content.Server/_CP14/GameTicking/Rules/CP14ExpeditionObjectivesRule.cs index 9d8bc646d0..b20b213c21 100644 --- a/Content.Server/_CP14/GameTicking/Rules/CP14ExpeditionObjectivesRule.cs +++ b/Content.Server/_CP14/GameTicking/Rules/CP14ExpeditionObjectivesRule.cs @@ -1,11 +1,16 @@ using Content.Server._CP14.GameTicking.Rules.Components; using Content.Server.Mind; +using Content.Shared.Random.Helpers; +using Robust.Shared.Prototypes; +using Robust.Shared.Random; namespace Content.Server.GameTicking.Rules; public sealed class CP14ExpeditionObjectivesRule : GameRuleSystem { [Dependency] private readonly MindSystem _mind = default!; + [Dependency] private readonly IPrototypeManager _proto = default!; + [Dependency] private readonly IRobustRandom _random = default!; public override void Initialize() { @@ -25,9 +30,38 @@ public sealed class CP14ExpeditionObjectivesRule : GameRuleSystem Objectives = new(); + public Dictionary, List>> RoleObjectives = new(); + + [DataField] + public Dictionary, List>> DepartmentObjectives = new(); } diff --git a/Resources/Maps/_CP14/alchemy_test.yml b/Resources/Maps/_CP14/alchemy_test.yml index 6835fde09a..5924e8f4a2 100644 --- a/Resources/Maps/_CP14/alchemy_test.yml +++ b/Resources/Maps/_CP14/alchemy_test.yml @@ -7,13 +7,13 @@ tilemap: 2: CP14FloorDirt 3: CP14FloorFoundation 4: CP14FloorGrass + 10: CP14FloorOakWoodPlanks + 11: CP14FloorOakWoodPlanksBig 5: CP14FloorSand 6: CP14FloorStonebricks 7: CP14FloorStonebricksSmallCarved1 8: CP14FloorStonebricksSmallCarved2 9: CP14FloorStonebricksSquareCarved - 10: CP14FloorWoodPlanks - 11: CP14FloorWoodPlanksBig entities: - proto: "" entities: @@ -2187,6 +2187,13 @@ entities: rot: -1.5707963267948966 rad pos: 4.5,16.5 parent: 2 +- proto: CP14BaseShovel + entities: + - uid: 234 + components: + - type: Transform + pos: 7.4584475,-2.61353 + parent: 2 - proto: CP14BaseSickle entities: - uid: 227 @@ -44799,6 +44806,22 @@ entities: - type: Physics canCollide: False - type: InsideEntityStorage +- proto: CP14ClothingShirtCottonBlack + entities: + - uid: 9832 + components: + - type: Transform + parent: 9819 + - type: Physics + canCollide: False + - type: InsideEntityStorage + - uid: 9835 + components: + - type: Transform + parent: 9819 + - type: Physics + canCollide: False + - type: InsideEntityStorage - proto: CP14ClothingShirtCottonBlue entities: - uid: 9836 @@ -44815,22 +44838,6 @@ entities: - type: Physics canCollide: False - type: InsideEntityStorage -- proto: CP14ClothingShirtCottonBlueDark - entities: - - uid: 9832 - components: - - type: Transform - parent: 9819 - - type: Physics - canCollide: False - - type: InsideEntityStorage - - uid: 9835 - components: - - type: Transform - parent: 9819 - - type: Physics - canCollide: False - - type: InsideEntityStorage - proto: CP14ClothingShirtCottonPurple entities: - uid: 9837 @@ -46194,13 +46201,6 @@ entities: - type: Transform pos: 9.299216,-3.5921 parent: 2 -- proto: CP14Shovel - entities: - - uid: 234 - components: - - type: Transform - pos: 7.4584475,-2.61353 - parent: 2 - proto: CP14SpawnPointAdventurer entities: - uid: 647 @@ -46285,6 +46285,13 @@ entities: - type: Transform pos: 1.5,0.5 parent: 2 +- proto: CP14SpawnPointCaptain + entities: + - uid: 779 + components: + - type: Transform + pos: 6.5,2.5 + parent: 2 - proto: CP14TableWooden entities: - uid: 85 diff --git a/Resources/Maps/_CP14/battle_royale.yml b/Resources/Maps/_CP14/battle_royale.yml index 1f388f20bb..e7b2920e59 100644 --- a/Resources/Maps/_CP14/battle_royale.yml +++ b/Resources/Maps/_CP14/battle_royale.yml @@ -46776,6 +46776,13 @@ entities: rot: -1.5707963267948966 rad pos: -37.5,-19.5 parent: 2 +- proto: CP14SpawnPointCaptain + entities: + - uid: 751 + components: + - type: Transform + pos: 8.5,-0.5 + parent: 2 - proto: CP14TableWooden entities: - uid: 65 @@ -51488,6 +51495,11 @@ entities: - type: Transform pos: -17.5,45.5 parent: 2 + - uid: 2210 + components: + - type: Transform + pos: -20.5,32.5 + parent: 2 - uid: 2260 components: - type: Transform @@ -51503,13 +51515,6 @@ entities: - type: Transform pos: -20.5,39.5 parent: 2 -- proto: CP14WallStoneSilverOre - entities: - - uid: 2210 - components: - - type: Transform - pos: -20.5,32.5 - parent: 2 - proto: CP14WallWhitebrick entities: - uid: 7061 diff --git a/Resources/Maps/_CP14/meteor-arena.yml b/Resources/Maps/_CP14/meteor-arena.yml index a0d895e740..b858fad3be 100644 --- a/Resources/Maps/_CP14/meteor-arena.yml +++ b/Resources/Maps/_CP14/meteor-arena.yml @@ -22,6 +22,7 @@ entities: - type: MetaData - type: Transform - type: Map + mapPaused: True - type: PhysicsMap - type: GridTree - type: MovedGrids @@ -341,6 +342,20 @@ entities: chunkSize: 4 - type: GasTileOverlay - type: RadiationGridResistance +- proto: CP14SpawnPointAdventurer + entities: + - uid: 99 + components: + - type: Transform + pos: -0.5,-0.5 + parent: 2 +- proto: CP14SpawnPointCaptain + entities: + - uid: 241 + components: + - type: Transform + pos: -1.5,-0.5 + parent: 2 - proto: FenceMetalBroken entities: - uid: 217 @@ -984,13 +999,6 @@ entities: - type: Transform pos: -0.5,-0.5 parent: 2 -- proto: CP14SpawnPointAdventurer - entities: - - uid: 99 - components: - - type: Transform - pos: -0.5,-0.5 - parent: 2 - proto: WallPlastitaniumIndestructible entities: - uid: 51 diff --git a/Resources/Prototypes/_CP14/Entities/Markers/Spawners/jobs.yml b/Resources/Prototypes/_CP14/Entities/Markers/Spawners/jobs.yml index 65a0ce66eb..9797b6611d 100644 --- a/Resources/Prototypes/_CP14/Entities/Markers/Spawners/jobs.yml +++ b/Resources/Prototypes/_CP14/Entities/Markers/Spawners/jobs.yml @@ -21,6 +21,20 @@ components: - type: SpawnPoint job_id: CP14Alchemist + - type: Sprite + layers: + - state: green + - state: zookeeper #TODO Replace + +- type: entity + id: CP14SpawnPointCaptain + parent: SpawnPointJobBase + name: captain + categories: + - Spawner + components: + - type: SpawnPoint + job_id: CP14Captain - type: Sprite layers: - state: green diff --git a/Resources/Prototypes/_CP14/GameRules/roundstart.yml b/Resources/Prototypes/_CP14/GameRules/roundstart.yml index c4b42538f0..c3d63c6126 100644 --- a/Resources/Prototypes/_CP14/GameRules/roundstart.yml +++ b/Resources/Prototypes/_CP14/GameRules/roundstart.yml @@ -12,10 +12,9 @@ noSpawn: true components: - type: CP14ExpeditionObjectivesRule - objectives: - #- CP14ExpeditionCollectGoldObjective - - CP14PersonalCurrencyCollectObjectiveMedium - # Expedition random objectives - # main objective + sub objective? - # motivations + departmentObjectives: + CP14Command: + - CP14ExpeditionCollectObjectiveGroup + CP14Mercenary: + - CP14PersonalCurrencyCollectObjectiveGroup # antags \ No newline at end of file diff --git a/Resources/Prototypes/_CP14/Maps/arenas.yml b/Resources/Prototypes/_CP14/Maps/arenas.yml index 47b1dedc8c..319fae04e1 100644 --- a/Resources/Prototypes/_CP14/Maps/arenas.yml +++ b/Resources/Prototypes/_CP14/Maps/arenas.yml @@ -11,7 +11,7 @@ mapNameTemplate: "Meteor Arena" - type: StationJobs availableJobs: - CP14Adventurer: [ -1, -1 ] #CrystallPunk Dev replacement + CP14Captain: [ -1, -1 ] - type: gameMap id: AlchemyTest @@ -33,6 +33,7 @@ availableJobs: CP14Adventurer: [ -1, -1 ] CP14Alchemist: [ -1, -1 ] + CP14Captain: [1, 1] - type: gameMap id: BattleRoyale @@ -51,6 +52,7 @@ availableJobs: CP14Adventurer: [ -1, -1 ] CP14Alchemist: [ -1, -1 ] + CP14Captain: [1, 1] - type: StationBiome biome: CP14GrassFill - type: CP14StationExpeditionTarget diff --git a/Resources/Prototypes/_CP14/Objectives/expedition_objectives.yml b/Resources/Prototypes/_CP14/Objectives/expedition_objectives.yml index 1b713d52a0..8884ea0cf3 100644 --- a/Resources/Prototypes/_CP14/Objectives/expedition_objectives.yml +++ b/Resources/Prototypes/_CP14/Objectives/expedition_objectives.yml @@ -6,6 +6,8 @@ - type: Objective issuer: cp14-objective-issuer-expedition + +# Collect group - type: entity abstract: true parent: CP14BaseExpeditionObjective @@ -27,4 +29,9 @@ verifyMapExistence: false collectGroup: CP14Gold - type: Objective - difficulty: 1 \ No newline at end of file + difficulty: 1 + +- type: weightedRandom + id: CP14ExpeditionCollectObjectiveGroup + weights: + CP14ExpeditionCollectGoldObjective: 1 \ No newline at end of file diff --git a/Resources/Prototypes/_CP14/Objectives/personal_objectives.yml b/Resources/Prototypes/_CP14/Objectives/personal_objectives.yml index d9b425932d..ea356f22e3 100644 --- a/Resources/Prototypes/_CP14/Objectives/personal_objectives.yml +++ b/Resources/Prototypes/_CP14/Objectives/personal_objectives.yml @@ -23,6 +23,8 @@ sprite: /Textures/_CP14/Objects/Economy/gp_coin.rsi state: coin10 +# Collect currency group + - type: entity parent: CP14BasePersonalCurrencyCollectObjective id: CP14PersonalCurrencyCollectObjectiveSmall @@ -48,4 +50,11 @@ - type: Objective difficulty: 3 - type: CP14CurrencyCollectCondition - currency: 3000 \ No newline at end of file + currency: 3000 + +- type: weightedRandom + id: CP14PersonalCurrencyCollectObjectiveGroup + weights: + CP14PersonalCurrencyCollectObjectiveSmall: 2 + CP14PersonalCurrencyCollectObjectiveMedium: 1 + CP14PersonalCurrencyCollectObjectiveBig: 0.3