From 3f70d8600c9e576dc504419d89287d2afc7c786d Mon Sep 17 00:00:00 2001 From: Ed <96445749+TheShuEd@users.noreply.github.com> Date: Fri, 31 Jan 2025 18:24:54 +0300 Subject: [PATCH] Fixes (#824) * delete round seed * delete worldEdge locale * Update CP14BiomeSpawnerSystem.cs * nails to 50 max stack * wood planks stack increase * flora material stack edit * Update EntityTest.cs * Update EntityTest.cs --- Content.IntegrationTests/Tests/EntityTest.cs | 5 ++ .../EntitySystems/CP14BiomeSpawnerSystem.cs | 26 +++++-- .../_CP14/RoundSeed/CP14RoundSeedComponent.cs | 21 ------ .../_CP14/RoundSeed/CP14RoundSeedSystem.cs | 53 -------------- .../en-US/_CP14/worldEdge/world-edge.ftl | 2 - .../ru-RU/_CP14/worldEdge/world-edge.ftl | 2 - .../Prototypes/_CP14/Catalog/Fills/crates.yml | 2 +- .../Entities/Objects/Materials/simple.yml | 66 ++++++++++-------- .../Prototypes/_CP14/GameRules/roundstart.yml | 1 - .../_CP14/Recipes/Workbench/Anvil/misc.yml | 4 +- .../Prototypes/_CP14/Stacks/materials.yml | 10 +-- .../Materials/flora.rsi/grass_material2.png | Bin 672 -> 1074 bytes .../Materials/flora.rsi/grass_material3.png | Bin 610 -> 1336 bytes Resources/migration.yml | 3 +- 14 files changed, 71 insertions(+), 124 deletions(-) delete mode 100644 Content.Server/_CP14/RoundSeed/CP14RoundSeedComponent.cs delete mode 100644 Content.Server/_CP14/RoundSeed/CP14RoundSeedSystem.cs delete mode 100644 Resources/Locale/en-US/_CP14/worldEdge/world-edge.ftl delete mode 100644 Resources/Locale/ru-RU/_CP14/worldEdge/world-edge.ftl diff --git a/Content.IntegrationTests/Tests/EntityTest.cs b/Content.IntegrationTests/Tests/EntityTest.cs index 5dba8ac658..44cf1be93e 100644 --- a/Content.IntegrationTests/Tests/EntityTest.cs +++ b/Content.IntegrationTests/Tests/EntityTest.cs @@ -39,6 +39,7 @@ namespace Content.IntegrationTests.Tests .Where(p => !p.Abstract) .Where(p => !pair.IsTestPrototype(p)) .Where(p => !p.Components.ContainsKey("MapGrid")) // This will smash stuff otherwise. + .Where(p => !p.Components.ContainsKey("RoomFill")) // CP14 Boilerplate - TODO: Remove it after wizden fix .Select(p => p.ID) .ToList(); @@ -101,6 +102,7 @@ namespace Content.IntegrationTests.Tests .Where(p => !p.Abstract) .Where(p => !pair.IsTestPrototype(p)) .Where(p => !p.Components.ContainsKey("MapGrid")) // This will smash stuff otherwise. + .Where(p => !p.Components.ContainsKey("RoomFill")) // CP14 Boilerplate - TODO: Remove it after wizden fix .Select(p => p.ID) .ToList(); foreach (var protoId in protoIds) @@ -161,6 +163,7 @@ namespace Content.IntegrationTests.Tests .Where(p => !p.Abstract) .Where(p => !pair.IsTestPrototype(p)) .Where(p => !p.Components.ContainsKey("MapGrid")) // This will smash stuff otherwise. + .Where(p => !p.Components.ContainsKey("RoomFill")) // CP14 Boilerplate - TODO: Remove it after wizden fix .Select(p => p.ID) .ToList(); @@ -235,6 +238,7 @@ namespace Content.IntegrationTests.Tests var excluded = new[] { "MapGrid", + "RoomFill", // CP14 Boilerplate - TODO: Remove it after wizden fix "StationEvent", "TimedDespawn", @@ -341,6 +345,7 @@ namespace Content.IntegrationTests.Tests "DebugExceptionInitialize", "DebugExceptionStartup", "GridFill", + "RoomFill", // CP14 Boilerplate - TODO: Remove it after wizden fix "Map", // We aren't testing a map entity in this test "MapGrid", "Broadphase", diff --git a/Content.Server/_CP14/BiomeSpawner/EntitySystems/CP14BiomeSpawnerSystem.cs b/Content.Server/_CP14/BiomeSpawner/EntitySystems/CP14BiomeSpawnerSystem.cs index 9673da74f0..c6338ce8ef 100644 --- a/Content.Server/_CP14/BiomeSpawner/EntitySystems/CP14BiomeSpawnerSystem.cs +++ b/Content.Server/_CP14/BiomeSpawner/EntitySystems/CP14BiomeSpawnerSystem.cs @@ -5,7 +5,6 @@ using System.Linq; using Content.Server._CP14.BiomeSpawner.Components; -using Content.Server._CP14.RoundSeed; using Content.Server.Decals; using Content.Server.Parallax; using Content.Shared.Whitelist; @@ -13,6 +12,7 @@ using Robust.Server.GameObjects; using Robust.Shared.Map; using Robust.Shared.Map.Components; using Robust.Shared.Prototypes; +using Robust.Shared.Random; namespace Content.Server._CP14.BiomeSpawner.EntitySystems; @@ -24,12 +24,21 @@ public sealed class CP14BiomeSpawnerSystem : EntitySystem [Dependency] private readonly SharedMapSystem _maps = default!; [Dependency] private readonly DecalSystem _decals = default!; [Dependency] private readonly EntityLookupSystem _lookup = default!; - [Dependency] private readonly CP14RoundSeedSystem _roundSeed = default!; [Dependency] private readonly EntityWhitelistSystem _whitelist = default!; + [Dependency] private readonly IRobustRandom _random = default!; + private int _globalSeed = 0; public override void Initialize() { SubscribeLocalEvent(OnMapInit); + SubscribeLocalEvent(OnRoundEnd); + + UpdateSeed(); + } + + private void OnRoundEnd(Shared.GameTicking.RoundEndMessageEvent ev) + { + UpdateSeed(); } private void OnMapInit(Entity ent, ref MapInitEvent args) @@ -38,6 +47,11 @@ public sealed class CP14BiomeSpawnerSystem : EntitySystem QueueDel(ent); } + private void UpdateSeed() + { + _globalSeed = _random.Next(int.MinValue, int.MaxValue); + } + private void SpawnBiome(Entity ent) { var biome = _proto.Index(ent.Comp.Biome); @@ -50,11 +64,9 @@ public sealed class CP14BiomeSpawnerSystem : EntitySystem if (!TryComp(gridUid, out var map)) return; - var seed = _roundSeed.GetSeed(); - var vec = _transform.GetGridOrMapTilePosition(ent); - if (!_biome.TryGetTile(vec, biome.Layers, seed, map, out var tile)) + if (!_biome.TryGetTile(vec, biome.Layers, _globalSeed, map, out var tile)) return; // Set new tile @@ -70,7 +82,7 @@ public sealed class CP14BiomeSpawnerSystem : EntitySystem } //Add decals - if (_biome.TryGetDecals(vec, biome.Layers, seed, map, out var decals)) + if (_biome.TryGetDecals(vec, biome.Layers, _globalSeed, map, out var decals)) { foreach (var decal in decals) { @@ -87,7 +99,7 @@ public sealed class CP14BiomeSpawnerSystem : EntitySystem QueueDel(entToRemove); } - if (_biome.TryGetEntity(vec, biome.Layers, tile.Value, seed, map, out var entityProto)) + if (_biome.TryGetEntity(vec, biome.Layers, tile.Value, _globalSeed, map, out var entityProto)) Spawn(entityProto, new EntityCoordinates(gridUid, tileCenterVec)); } } diff --git a/Content.Server/_CP14/RoundSeed/CP14RoundSeedComponent.cs b/Content.Server/_CP14/RoundSeed/CP14RoundSeedComponent.cs deleted file mode 100644 index fcc8ec7000..0000000000 --- a/Content.Server/_CP14/RoundSeed/CP14RoundSeedComponent.cs +++ /dev/null @@ -1,21 +0,0 @@ -/* - * All right reserved to CrystallEdge. - * - * BUT this file is sublicensed under MIT License - * - */ - -namespace Content.Server._CP14.RoundSeed; - -/// -/// This is used for round seed -/// -[RegisterComponent, Access(typeof(CP14RoundSeedSystem))] -public sealed partial class CP14RoundSeedComponent : Component -{ - [ViewVariables] - public static int MaxValue = 10000; - - [ViewVariables] - public int Seed; -} diff --git a/Content.Server/_CP14/RoundSeed/CP14RoundSeedSystem.cs b/Content.Server/_CP14/RoundSeed/CP14RoundSeedSystem.cs deleted file mode 100644 index 3d61e74629..0000000000 --- a/Content.Server/_CP14/RoundSeed/CP14RoundSeedSystem.cs +++ /dev/null @@ -1,53 +0,0 @@ -/* - * All right reserved to CrystallEdge. - * - * BUT this file is sublicensed under MIT License - * - */ - -using System.Diagnostics.CodeAnalysis; -using JetBrains.Annotations; -using Robust.Shared.Map; -using Robust.Shared.Random; - -namespace Content.Server._CP14.RoundSeed; - -/// -/// Provides a round seed for another systems -/// -public sealed class CP14RoundSeedSystem : EntitySystem -{ - [Dependency] private readonly IRobustRandom _random = default!; - - public override void Initialize() - { - SubscribeLocalEvent(OnComponentStartup); - } - - private void OnComponentStartup(Entity ent, ref ComponentStartup args) - { - ent.Comp.Seed = _random.Next(CP14RoundSeedComponent.MaxValue); - } - - private int SetupSeed() - { - return AddComp(Spawn(null, MapCoordinates.Nullspace)).Seed; - } - - /// - /// Returns the round seed if assigned, otherwise assigns the round seed itself. - /// - /// seed of the round - public int GetSeed() - { - var query = EntityQuery(); - foreach (var comp in query) - { - return comp.Seed; - } - - var seed = SetupSeed(); - Log.Warning($"Missing RoundSeed. Seed set to {seed}"); - return seed; - } -} diff --git a/Resources/Locale/en-US/_CP14/worldEdge/world-edge.ftl b/Resources/Locale/en-US/_CP14/worldEdge/world-edge.ftl deleted file mode 100644 index 1f5165df6a..0000000000 --- a/Resources/Locale/en-US/_CP14/worldEdge/world-edge.ftl +++ /dev/null @@ -1,2 +0,0 @@ -cp14-world-edge-pre-remove-message = [color=red]CAUTION![/color] You are leaving the game zone! If you do not return within [color=red]{$second}[/color] seconds, you will be permanently removed from the round! -cp14-world-edge-cancel-removing-message = The exit round has been canceled. \ No newline at end of file diff --git a/Resources/Locale/ru-RU/_CP14/worldEdge/world-edge.ftl b/Resources/Locale/ru-RU/_CP14/worldEdge/world-edge.ftl deleted file mode 100644 index 9d8d0676a7..0000000000 --- a/Resources/Locale/ru-RU/_CP14/worldEdge/world-edge.ftl +++ /dev/null @@ -1,2 +0,0 @@ -cp14-world-edge-pre-remove-message = [color=red]ВНИМАНИЕ![/color] Вы покидаете игровую зону! Если вы не вернетесь назад в течении [color=red]{$second}[/color] секунд, вы будете окончательно удалены из раунда! -cp14-world-edge-cancel-removing-message = Выход из раунда отменен. \ No newline at end of file diff --git a/Resources/Prototypes/_CP14/Catalog/Fills/crates.yml b/Resources/Prototypes/_CP14/Catalog/Fills/crates.yml index 97d1a93241..56f4c6eb0c 100644 --- a/Resources/Prototypes/_CP14/Catalog/Fills/crates.yml +++ b/Resources/Prototypes/_CP14/Catalog/Fills/crates.yml @@ -75,7 +75,7 @@ - id: CP14CrystalLampBlueEmpty - id: CP14CrystalLampOrangeEmpty - id: CP14Rope - - id: CP14Nail10 + - id: CP14Nail20 - id: CP14EnergyCrystalSmall - id: CP14CopperCoin5 weight: 0.5 diff --git a/Resources/Prototypes/_CP14/Entities/Objects/Materials/simple.yml b/Resources/Prototypes/_CP14/Entities/Objects/Materials/simple.yml index 666ca8be85..960ac2c711 100644 --- a/Resources/Prototypes/_CP14/Entities/Objects/Materials/simple.yml +++ b/Resources/Prototypes/_CP14/Entities/Objects/Materials/simple.yml @@ -214,6 +214,14 @@ - type: Stack count: 10 +- type: entity + id: CP14WoodenPlanks20 + parent: CP14WoodenPlanks1 + suffix: 20 + components: + - type: Stack + count: 20 + - type: entity id: CP14LucensWoodLog parent: CP14WoodLog @@ -270,6 +278,14 @@ - type: Stack count: 10 +- type: entity + id: CP14LucensWoodenPlanks20 + parent: CP14LucensWoodenPlanks1 + suffix: 20 + components: + - type: Stack + count: 20 + - type: entity id: CP14Nail1 parent: BaseItem @@ -331,12 +347,20 @@ launchForwardsMultiplier: 0 - type: entity - id: CP14Nail10 + id: CP14Nail20 parent: CP14Nail1 - suffix: 10 + suffix: 20 components: - type: Stack - count: 10 + count: 20 + +- type: entity + id: CP14Nail50 + parent: CP14Nail1 + suffix: 50 + components: + - type: Stack + count: 50 - type: entity id: CP14FloraMaterial1 @@ -347,45 +371,29 @@ categories: [ ForkFiltered ] components: - type: Item - size: Tiny + size: Normal - type: Stack stackType: CP14FloraMaterial count: 1 + baseLayer: base + layerStates: + - grass_material1 + - grass_material2 + - grass_material3 - type: Sprite sprite: _CP14/Objects/Materials/flora.rsi layers: - state: grass_material1 - map: ["random"] - - type: RandomSprite - available: - - random: - grass_material1: "" - grass_material2: "" - grass_material3: "" - - type: Tag - tags: - - CP14FireplaceFuel - - type: Flammable - fireSpread: false - canResistFire: false - alwaysCombustible: true - canExtinguish: true - cP14FireplaceFuel: 5 - damage: - types: - Heat: 1 + map: ["base"] - type: Material - - type: PhysicalComposition # точно ли это нужно? - materialComposition: - CP14FloraMaterial: 100 - type: entity - id: CP14FloraMaterial2 + id: CP14FloraMaterial10 parent: CP14FloraMaterial1 - suffix: 2 + suffix: 10 components: - type: Stack - count: 2 + count: 10 - type: entity id: CP14String diff --git a/Resources/Prototypes/_CP14/GameRules/roundstart.yml b/Resources/Prototypes/_CP14/GameRules/roundstart.yml index d1a5429a57..fe1b2518e0 100644 --- a/Resources/Prototypes/_CP14/GameRules/roundstart.yml +++ b/Resources/Prototypes/_CP14/GameRules/roundstart.yml @@ -5,7 +5,6 @@ components: - type: GameRule cP14Allowed: true - - type: CP14RoundSeed - type: entity id: CP14RoundObjectivesRule diff --git a/Resources/Prototypes/_CP14/Recipes/Workbench/Anvil/misc.yml b/Resources/Prototypes/_CP14/Recipes/Workbench/Anvil/misc.yml index a4ec7804b5..dc13b14567 100644 --- a/Resources/Prototypes/_CP14/Recipes/Workbench/Anvil/misc.yml +++ b/Resources/Prototypes/_CP14/Recipes/Workbench/Anvil/misc.yml @@ -98,7 +98,7 @@ result: CP14ClothingOuterClothingCuirassLeg - type: CP14Recipe - id: CP14Nail10 + id: CP14Nail20 tag: CP14RecipeAnvil craftTime: 4 requirements: @@ -107,7 +107,7 @@ count: 2 - !type:KnowledgeRequired knowledge: MetallForging - result: CP14Nail10 + result: CP14Nail20 - type: CP14Recipe id: CP14CrystalLampBlueEmpty diff --git a/Resources/Prototypes/_CP14/Stacks/materials.yml b/Resources/Prototypes/_CP14/Stacks/materials.yml index 3153e0591b..38027742dd 100644 --- a/Resources/Prototypes/_CP14/Stacks/materials.yml +++ b/Resources/Prototypes/_CP14/Stacks/materials.yml @@ -17,14 +17,14 @@ name: cp14-stack-wood-planks spawn: CP14WoodenPlanks1 icon: { sprite: _CP14/Objects/Materials/wood.rsi, state: planks_2 } - maxCount: 10 + maxCount: 20 - type: stack id: CP14Nail name: cp14-stack-nails spawn: CP14Nail1 icon: { sprite: _CP14/Objects/Materials/nails.rsi, state: nail_2 } - maxCount: 10 + maxCount: 50 - type: stack id: CP14Cloth @@ -66,7 +66,7 @@ name: cp14-material-lucens-planks spawn: CP14LucensWoodenPlanks1 icon: { sprite: _CP14/Objects/Materials/lucens_wood.rsi, state: planks_2 } - maxCount: 10 + maxCount: 20 - type: stack id: CP14GlassSheet @@ -80,11 +80,11 @@ name: cp14-stack-flora icon: { sprite: "_CP14/Objects/Materials/flora.rsi", state: grass_material1 } spawn: CP14FloraMaterial1 - maxCount: 2 + maxCount: 10 - type: stack id: CP14Ash name: cp14-stack-ash-pile icon: { sprite: "_CP14/Objects/Materials/ash.rsi", state: ash_1 } spawn: CP14Ash1 - maxCount: 3 + maxCount: 10 diff --git a/Resources/Textures/_CP14/Objects/Materials/flora.rsi/grass_material2.png b/Resources/Textures/_CP14/Objects/Materials/flora.rsi/grass_material2.png index 944bb93f13c3190cab73821a60d28cc9513759d7..17e7765a16a76fb6321295486548e502c70ee15e 100644 GIT binary patch delta 1041 zcmV+s1n&Ew1+oZ`Fn8p35-n*3xIdu_VDZP8rgk`QlUn^T*aS0CK8bO_~Cc|D5>fDw?wH>1Hc!wu`v6j z&c3O$(TO1ekQ{cCf20AB4%-NM?Zl#nS$5yJo@HxnYFNDTq7yTy85p3uLjdsM`(Igc z9nCTY*v{yztbZNTRXimUkWr6x@_=vOX$1xtPs(Ud2Sg+wv*)!_D%9`=ZFF}C`ukig zE>{3pm|Z(pu-*L8b+zZCySLpuD+)@58rq2<9CpzCTaEHb740=Qey@YOx80~(m26fJ zi%KL0WEPhzyj(S0y)@)N!^U<-C$m%I+aD@a^%{>p|9}2Mw$B}oO%02i*9~IQTY}Cl z9e~7pUQ!!6+Zp3tJ<=_ku0Kuzhy-M`L7B5mHnyU125gN9s7D6vtDC1*D{@7Z#pMd4 z15QF-J0Y)~c-%uzxQ(808wZC5#p$q7c`PbfEf`PA+x7lQRjCFMn5g_-VatMkj`Z-0rlNQm&}ty5S`j zmH26?RChL>lu2#q>^(jt5|H`PTO}U%0DtX+?7nn41CuieVNz%=9Yv{dt!yV(RN3t{ z)Dn+-C>3fJE1@@CtZo|0@TZNcCqC$8;fn*3!){hLPp#sbCNMdZ5N6=*jBX9owX)p` zVt@Ae+0F@I$T1R-0ni4G>)FJ#K^aA<)V1K83{CigHdfY-QIrZHubrN78*;moTu}v# z9Z@ROh(#r)?_41s_psaRAXika|8#eVIw_Y5HG0Br%*~I8=O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