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 944bb93f13..17e7765a16 100644 Binary files a/Resources/Textures/_CP14/Objects/Materials/flora.rsi/grass_material2.png and b/Resources/Textures/_CP14/Objects/Materials/flora.rsi/grass_material2.png differ diff --git a/Resources/Textures/_CP14/Objects/Materials/flora.rsi/grass_material3.png b/Resources/Textures/_CP14/Objects/Materials/flora.rsi/grass_material3.png index a5d1000b34..e16e0c6a9b 100644 Binary files a/Resources/Textures/_CP14/Objects/Materials/flora.rsi/grass_material3.png and b/Resources/Textures/_CP14/Objects/Materials/flora.rsi/grass_material3.png differ diff --git a/Resources/migration.yml b/Resources/migration.yml index 6d2d5fedfc..b0363c331c 100644 --- a/Resources/migration.yml +++ b/Resources/migration.yml @@ -3,7 +3,7 @@ # 2024-08-24 CP14DungeonEntrance: CP14LaddersDownStoneAutoLink CP14DungeonExit: CP14LaddersUpStoneAutoLink -CP14Nail110: CP14Nail10 +CP14Nail110: CP14Nail20 # 2024-09-09 CP14AlchemyFurnaceDebug: CP14AlchemyFurnace @@ -239,6 +239,7 @@ CP14OreCopper: CP14OreCopper1 CP14OreIron: CP14OreIron1 CP14OreGold: CP14OreGold1 CP14OreMithril: CP14OreMithril1 +CP14Nail10: CP14Nail20 # <---> CrystallEdge migration zone end