From 468f026076b0f19054349bf10efcc85db2ba8650 Mon Sep 17 00:00:00 2001 From: Dvir Date: Mon, 8 Jan 2024 05:18:29 +0200 Subject: [PATCH 1/8] Dont forget the fuel --- Resources/Maps/_NF/Shuttles/mccargo.yml | 181 ++++++++++-------- .../Power/Generation/portable_generator.yml | 58 ++++++ 2 files changed, 161 insertions(+), 78 deletions(-) create mode 100644 Resources/Prototypes/_NF/Entities/Structures/Power/Generation/portable_generator.yml diff --git a/Resources/Maps/_NF/Shuttles/mccargo.yml b/Resources/Maps/_NF/Shuttles/mccargo.yml index 66f0f231d06..d034fd0edcf 100644 --- a/Resources/Maps/_NF/Shuttles/mccargo.yml +++ b/Resources/Maps/_NF/Shuttles/mccargo.yml @@ -70,36 +70,36 @@ entities: color: '#FFFFFFFF' id: Box decals: - 337: -9,14 - 338: -9,13 - 339: -9,12 - 340: -8,12 - 341: -8,13 - 342: -8,14 - 343: -7,14 - 344: -7,13 - 345: -7,12 + 333: -9,14 + 334: -9,13 + 335: -9,12 + 336: -8,12 + 337: -8,13 + 338: -8,14 + 339: -7,14 + 340: -7,13 + 341: -7,12 - node: color: '#A4610696' id: CheckerNWSE decals: - 289: 6,9 - 290: 7,9 - 291: 9,9 - 292: 6,8 - 293: 7,8 - 294: 6,7 - 295: 7,7 - 296: 9,7 - 297: 6,6 - 298: 7,6 - 299: 6,5 - 300: 7,5 - 301: 9,5 - 302: 8,5 - 303: 7,4 - 304: 8,7 - 305: 8,9 + 287: 6,9 + 288: 7,9 + 289: 9,9 + 290: 6,8 + 291: 7,8 + 292: 6,7 + 293: 7,7 + 294: 9,7 + 295: 6,6 + 296: 7,6 + 297: 6,5 + 298: 7,5 + 299: 9,5 + 300: 8,5 + 301: 7,4 + 302: 8,7 + 303: 8,9 - node: cleanable: True color: '#FFFFFFFF' @@ -115,11 +115,11 @@ entities: 225: -2,12 226: 0,12 236: -5,15 - 286: 7,14 - 287: 6,11 - 288: -1,10 - 330: -5,3 - 331: -7,3 + 284: 7,14 + 285: 6,11 + 286: -1,10 + 328: -5,3 + 329: -7,3 - node: cleanable: True color: '#FFFFFFFF' @@ -134,9 +134,9 @@ entities: 232: -3,14 239: 0,15 240: 0,13 - 282: 6,12 - 327: -5,4 - 329: -8,5 + 280: 6,12 + 325: -5,4 + 327: -8,5 - node: cleanable: True color: '#FFFFFFFF' @@ -152,8 +152,8 @@ entities: 231: -2,14 233: -4,14 237: -1,15 - 332: -6,3 - 333: -5,4 + 330: -6,3 + 331: -5,4 - node: cleanable: True color: '#FFFFFFFF' @@ -172,11 +172,11 @@ entities: 234: -5,14 235: -4,15 238: -2,15 - 283: 6,14 - 284: 6,13 - 285: 7,11 - 328: -8,4 - 334: -5,5 + 281: 6,14 + 282: 6,13 + 283: 7,11 + 326: -8,4 + 332: -5,5 - node: color: '#A46106FF' id: MiniTileWhiteCornerNe @@ -315,22 +315,22 @@ entities: color: '#D381C996' id: WarnCornerGreyscaleNE decals: - 277: 7,14 + 275: 7,14 - node: color: '#D381C996' id: WarnCornerGreyscaleNW decals: - 276: 6,14 + 274: 6,14 - node: color: '#D381C996' id: WarnCornerGreyscaleSE decals: - 274: 7,11 + 272: 7,11 - node: color: '#D381C996' id: WarnCornerGreyscaleSW decals: - 275: 6,11 + 273: 6,11 - node: color: '#A4610696' id: WarnCornerNE @@ -359,19 +359,19 @@ entities: color: '#9FED5896' id: WarnCornerSmallNE decals: - 324: -8,4 + 322: -8,4 - node: color: '#A4610696' id: WarnCornerSmallNE decals: 126: -5,10 127: -5,12 - 326: -5,5 + 324: -5,5 - node: color: '#9FED5896' id: WarnCornerSmallNW decals: - 325: -5,4 + 323: -5,4 - node: color: '#A4610696' id: WarnCornerSmallNW @@ -404,7 +404,7 @@ entities: color: '#9FED5896' id: WarnLineE decals: - 321: -8,5 + 319: -8,5 - node: color: '#A4610696' id: WarnLineE @@ -443,29 +443,29 @@ entities: 67: 8,3 68: 5,14 69: 1,14 - 309: 8,5 - 310: 8,7 - 311: 8,9 - 315: -11,-3 + 307: 8,5 + 308: 8,7 + 309: 8,9 + 313: -11,-3 - node: color: '#D381C996' id: WarnLineGreyscaleE decals: - 278: 7,13 - 279: 7,12 + 276: 7,13 + 277: 7,12 - node: color: '#D381C996' id: WarnLineGreyscaleW decals: - 280: 6,12 - 281: 6,13 + 278: 6,12 + 279: 6,13 - node: color: '#9FED5896' id: WarnLineN decals: 141: -6,3 - 317: -7,3 - 319: -5,3 + 315: -7,3 + 317: -5,3 - node: color: '#A4610696' id: WarnLineN @@ -504,14 +504,14 @@ entities: 63: 7,-9 64: 8,-9 70: -1,9 - 313: 7,4 + 311: 7,4 - node: color: '#9FED5896' id: WarnLineS decals: - 320: -5,5 - 322: -8,5 - 323: -8,4 + 318: -5,5 + 320: -8,5 + 321: -8,4 - node: color: '#A4610696' id: WarnLineS @@ -550,16 +550,16 @@ entities: 44: 8,3 45: 1,14 46: 5,14 - 306: 8,9 - 307: 8,7 - 308: 8,5 - 314: -11,-3 + 304: 8,9 + 305: 8,7 + 306: 8,5 + 312: -11,-3 - node: color: '#9FED5896' id: WarnLineW decals: - 316: -6,4 - 318: -7,4 + 314: -6,4 + 316: -7,4 - node: color: '#A4610696' id: WarnLineW @@ -599,29 +599,29 @@ entities: 57: -7,-9 58: -6,-9 71: -1,9 - 312: 7,4 + 310: 7,4 - node: angle: -1.5707963267948966 rad color: '#A4610696' id: food decals: - 352: -12,-1 - 353: -12,-3 + 348: -12,-1 + 349: -12,-3 - node: color: '#A4610696' id: food decals: - 346: 6,-8 - 347: 8,-8 - 350: -8,-8 - 351: -6,-8 + 342: 6,-8 + 343: 8,-8 + 346: -8,-8 + 347: -6,-8 - node: angle: 1.5707963267948966 rad color: '#A4610696' id: food decals: - 348: 12,-1 - 349: 12,-3 + 344: 12,-1 + 345: 12,-3 type: DecalGrid - version: 2 data: @@ -4717,6 +4717,24 @@ entities: type: Transform - stampedName: Unknown type: Stamp +- proto: PortableGeneratorPacmanOn + entities: + - uid: 1040 + components: + - anchored: True + pos: -8.5,-1.5 + parent: 1 + type: Transform + - on: False + type: FuelGenerator + - storage: + Plasma: 3000 + type: MaterialStorage + - bodyType: Static + type: Physics + - endTime: 0 + type: InsertingMaterialStorage + - type: ItemCooldown - proto: PortableScrubber entities: - uid: 9 @@ -7493,4 +7511,11 @@ entities: pos: -6.5,13.5 parent: 1 type: Transform +- proto: Wrench + entities: + - uid: 1041 + components: + - pos: -6.8533325,-0.31925178 + parent: 1 + type: Transform ... diff --git a/Resources/Prototypes/_NF/Entities/Structures/Power/Generation/portable_generator.yml b/Resources/Prototypes/_NF/Entities/Structures/Power/Generation/portable_generator.yml new file mode 100644 index 00000000000..e3daf56bd07 --- /dev/null +++ b/Resources/Prototypes/_NF/Entities/Structures/Power/Generation/portable_generator.yml @@ -0,0 +1,58 @@ +# +# You can use this Desmos sheet to calculate fuel burn rate values: +# https://www.desmos.com/calculator/qcektq5dqs +# + +- type: entity + parent: PortableGeneratorPacman + id: PortableGeneratorPacmanOn + suffix: Plasma, 15 kW, On + components: + - type: FuelGenerator + on: true + minTargetPower: 1000 + maxTargetPower: 25000 + targetPower: 15000 + optimalPower: 15000 + # 45 minutes at max output + optimalBurnRate: 0.011111 + # a decent curve + fuelEfficiencyConstant: 0.95 + - type: Transform + anchored: true + +- type: entity + parent: PortableGeneratorSuperPacman + id: PortableGeneratorSuperPacmanOn + suffix: Uranium, 30 kW, On + components: + - type: FuelGenerator + on: true + minTargetPower: 5000 + maxTargetPower: 50000 + targetPower: 30000 + optimalPower: 30000 + # 45 minutes at full power + optimalBurnRate: 0.0111111 + # still decent power curve + fuelEfficiencyConstant: 0.75 + - type: Transform + anchored: true + +- type: entity + parent: PortableGeneratorJrPacman + id: PortableGeneratorJrPacmanOn + suffix: Welding Fuel, 5 kW, On + components: + - type: FuelGenerator + on: true + targetPower: 2000 + minTargetPower: 1000 + optimalPower: 5000 + maxTargetPower: 15000 + # 7.5 minutes at full tank. + optimalBurnRate: 0.11111111 + # Shallow curve + fuelEfficiencyConstant: 0.5 + - type: Transform + anchored: true From 67f1a659ffc8e116c2d4c01a4e762f9df84f362e Mon Sep 17 00:00:00 2001 From: Dvir Date: Mon, 8 Jan 2024 14:14:53 +0200 Subject: [PATCH 2/8] Generator --- .../Generator/PortableGeneratorSystem.cs | 12 ++++++- .../Power/Generator/FuelGeneratorComponent.cs | 2 +- .../SharedPortableGeneratorComponent.cs | 8 ++++- .../Power/Generation/portable_generator.yml | 35 +++++++++++++++---- 4 files changed, 48 insertions(+), 9 deletions(-) diff --git a/Content.Server/Power/Generator/PortableGeneratorSystem.cs b/Content.Server/Power/Generator/PortableGeneratorSystem.cs index 1180665ad12..103390beda2 100644 --- a/Content.Server/Power/Generator/PortableGeneratorSystem.cs +++ b/Content.Server/Power/Generator/PortableGeneratorSystem.cs @@ -1,4 +1,4 @@ -using Content.Server.DoAfter; +using Content.Server.DoAfter; using Content.Server.Popups; using Content.Shared.DoAfter; using Content.Shared.Power.Generator; @@ -38,6 +38,16 @@ public override void Initialize() SubscribeLocalEvent(GeneratorSwitchOutputMessage); SubscribeLocalEvent(OnSwitchPowerCheck); + + SubscribeLocalEvent(GeneratorMapInit); + } + + private void GeneratorMapInit(EntityUid uid, PortableGeneratorComponent component, MapInitEvent args) + { + if (component.StartOnMapInit) + { + _generator.SetFuelGeneratorOn(uid, true); + } } private void GeneratorSwitchOutputMessage(EntityUid uid, PortableGeneratorComponent component, PortableGeneratorSwitchOutputMessage args) diff --git a/Content.Shared/Power/Generator/FuelGeneratorComponent.cs b/Content.Shared/Power/Generator/FuelGeneratorComponent.cs index cdf97fb0859..4f245060382 100644 --- a/Content.Shared/Power/Generator/FuelGeneratorComponent.cs +++ b/Content.Shared/Power/Generator/FuelGeneratorComponent.cs @@ -1,4 +1,4 @@ -using Robust.Shared.GameStates; +using Robust.Shared.GameStates; namespace Content.Shared.Power.Generator; diff --git a/Content.Shared/Power/Generator/SharedPortableGeneratorComponent.cs b/Content.Shared/Power/Generator/SharedPortableGeneratorComponent.cs index 5b83ff1a906..34cd12845af 100644 --- a/Content.Shared/Power/Generator/SharedPortableGeneratorComponent.cs +++ b/Content.Shared/Power/Generator/SharedPortableGeneratorComponent.cs @@ -1,4 +1,4 @@ -using Robust.Shared.Audio; +using Robust.Shared.Audio; using Robust.Shared.Serialization; namespace Content.Shared.Power.Generator; @@ -42,6 +42,12 @@ public sealed partial class PortableGeneratorComponent : Component [DataField("startSoundEmpty")] [ViewVariables(VVAccess.ReadWrite)] public SoundSpecifier? StartSoundEmpty { get; set; } + + /// + /// Frontier - Start the generator with the server. + /// + [DataField("startOnMapInit")] + public bool StartOnMapInit { get; set; } = false; } /// diff --git a/Resources/Prototypes/_NF/Entities/Structures/Power/Generation/portable_generator.yml b/Resources/Prototypes/_NF/Entities/Structures/Power/Generation/portable_generator.yml index e3daf56bd07..8e88eb8257d 100644 --- a/Resources/Prototypes/_NF/Entities/Structures/Power/Generation/portable_generator.yml +++ b/Resources/Prototypes/_NF/Entities/Structures/Power/Generation/portable_generator.yml @@ -5,8 +5,8 @@ - type: entity parent: PortableGeneratorPacman - id: PortableGeneratorPacmanOn - suffix: Plasma, 15 kW, On + id: PortableGeneratorPacmanShuttle + suffix: Plasma, 15 kW, Ship components: - type: FuelGenerator on: true @@ -20,11 +20,18 @@ fuelEfficiencyConstant: 0.95 - type: Transform anchored: true + - type: MaterialStorage + storageLimit: 3000 + materialWhiteList: [Plasma] + storage: + Plasma: 3000 + - type: PortableGenerator + startOnMapInit: true - type: entity parent: PortableGeneratorSuperPacman - id: PortableGeneratorSuperPacmanOn - suffix: Uranium, 30 kW, On + id: PortableGeneratorSuperPacmanShuttle + suffix: Uranium, 30 kW, Ship components: - type: FuelGenerator on: true @@ -38,11 +45,18 @@ fuelEfficiencyConstant: 0.75 - type: Transform anchored: true + - type: MaterialStorage + storageLimit: 3000 + materialWhiteList: [Uranium] + - type: PortableGenerator + storage: + Uranium: 3000 + startOnMapInit: true - type: entity parent: PortableGeneratorJrPacman - id: PortableGeneratorJrPacmanOn - suffix: Welding Fuel, 5 kW, On + id: PortableGeneratorJrPacmanShuttle + suffix: Welding Fuel, 5 kW, Ship components: - type: FuelGenerator on: true @@ -56,3 +70,12 @@ fuelEfficiencyConstant: 0.5 - type: Transform anchored: true + - type: SolutionContainerManager + solutions: + tank: + maxVol: 50 + reagents: + - ReagentId: WeldingFuel + Quantity: 50 + - type: PortableGenerator + startOnMapInit: true From f4ec096ef467240da3ccb69b773f4a05b04dfc5a Mon Sep 17 00:00:00 2001 From: Dvir Date: Mon, 8 Jan 2024 14:29:03 +0200 Subject: [PATCH 3/8] Generator --- Content.Server/Power/Generator/PortableGeneratorSystem.cs | 6 ++---- .../Power/Generator/SharedPortableGeneratorComponent.cs | 2 +- .../Structures/Power/Generation/portable_generator.yml | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Content.Server/Power/Generator/PortableGeneratorSystem.cs b/Content.Server/Power/Generator/PortableGeneratorSystem.cs index 103390beda2..8eb756133a2 100644 --- a/Content.Server/Power/Generator/PortableGeneratorSystem.cs +++ b/Content.Server/Power/Generator/PortableGeneratorSystem.cs @@ -39,15 +39,13 @@ public override void Initialize() SubscribeLocalEvent(OnSwitchPowerCheck); - SubscribeLocalEvent(GeneratorMapInit); + SubscribeLocalEvent(GeneratorMapInit); // Frontier } - private void GeneratorMapInit(EntityUid uid, PortableGeneratorComponent component, MapInitEvent args) + private void GeneratorMapInit(EntityUid uid, PortableGeneratorComponent component, MapInitEvent args) // Frontier - Init on map generator { if (component.StartOnMapInit) - { _generator.SetFuelGeneratorOn(uid, true); - } } private void GeneratorSwitchOutputMessage(EntityUid uid, PortableGeneratorComponent component, PortableGeneratorSwitchOutputMessage args) diff --git a/Content.Shared/Power/Generator/SharedPortableGeneratorComponent.cs b/Content.Shared/Power/Generator/SharedPortableGeneratorComponent.cs index 34cd12845af..d8a2b5fdeb8 100644 --- a/Content.Shared/Power/Generator/SharedPortableGeneratorComponent.cs +++ b/Content.Shared/Power/Generator/SharedPortableGeneratorComponent.cs @@ -44,7 +44,7 @@ public sealed partial class PortableGeneratorComponent : Component public SoundSpecifier? StartSoundEmpty { get; set; } /// - /// Frontier - Start the generator with the server. + /// Frontier - Start the generator with the map. /// [DataField("startOnMapInit")] public bool StartOnMapInit { get; set; } = false; diff --git a/Resources/Prototypes/_NF/Entities/Structures/Power/Generation/portable_generator.yml b/Resources/Prototypes/_NF/Entities/Structures/Power/Generation/portable_generator.yml index 8e88eb8257d..ce051b598de 100644 --- a/Resources/Prototypes/_NF/Entities/Structures/Power/Generation/portable_generator.yml +++ b/Resources/Prototypes/_NF/Entities/Structures/Power/Generation/portable_generator.yml @@ -48,9 +48,9 @@ - type: MaterialStorage storageLimit: 3000 materialWhiteList: [Uranium] - - type: PortableGenerator storage: Uranium: 3000 + - type: PortableGenerator startOnMapInit: true - type: entity From 243c2af3a798394a15d23e7c35bbd7ec7f0592a4 Mon Sep 17 00:00:00 2001 From: Dvir Date: Mon, 8 Jan 2024 14:31:20 +0200 Subject: [PATCH 4/8] Update mccargo.yml --- Resources/Maps/_NF/Shuttles/mccargo.yml | 181 ++++++++++-------------- 1 file changed, 78 insertions(+), 103 deletions(-) diff --git a/Resources/Maps/_NF/Shuttles/mccargo.yml b/Resources/Maps/_NF/Shuttles/mccargo.yml index d034fd0edcf..66f0f231d06 100644 --- a/Resources/Maps/_NF/Shuttles/mccargo.yml +++ b/Resources/Maps/_NF/Shuttles/mccargo.yml @@ -70,36 +70,36 @@ entities: color: '#FFFFFFFF' id: Box decals: - 333: -9,14 - 334: -9,13 - 335: -9,12 - 336: -8,12 - 337: -8,13 - 338: -8,14 - 339: -7,14 - 340: -7,13 - 341: -7,12 + 337: -9,14 + 338: -9,13 + 339: -9,12 + 340: -8,12 + 341: -8,13 + 342: -8,14 + 343: -7,14 + 344: -7,13 + 345: -7,12 - node: color: '#A4610696' id: CheckerNWSE decals: - 287: 6,9 - 288: 7,9 - 289: 9,9 - 290: 6,8 - 291: 7,8 - 292: 6,7 - 293: 7,7 - 294: 9,7 - 295: 6,6 - 296: 7,6 - 297: 6,5 - 298: 7,5 - 299: 9,5 - 300: 8,5 - 301: 7,4 - 302: 8,7 - 303: 8,9 + 289: 6,9 + 290: 7,9 + 291: 9,9 + 292: 6,8 + 293: 7,8 + 294: 6,7 + 295: 7,7 + 296: 9,7 + 297: 6,6 + 298: 7,6 + 299: 6,5 + 300: 7,5 + 301: 9,5 + 302: 8,5 + 303: 7,4 + 304: 8,7 + 305: 8,9 - node: cleanable: True color: '#FFFFFFFF' @@ -115,11 +115,11 @@ entities: 225: -2,12 226: 0,12 236: -5,15 - 284: 7,14 - 285: 6,11 - 286: -1,10 - 328: -5,3 - 329: -7,3 + 286: 7,14 + 287: 6,11 + 288: -1,10 + 330: -5,3 + 331: -7,3 - node: cleanable: True color: '#FFFFFFFF' @@ -134,9 +134,9 @@ entities: 232: -3,14 239: 0,15 240: 0,13 - 280: 6,12 - 325: -5,4 - 327: -8,5 + 282: 6,12 + 327: -5,4 + 329: -8,5 - node: cleanable: True color: '#FFFFFFFF' @@ -152,8 +152,8 @@ entities: 231: -2,14 233: -4,14 237: -1,15 - 330: -6,3 - 331: -5,4 + 332: -6,3 + 333: -5,4 - node: cleanable: True color: '#FFFFFFFF' @@ -172,11 +172,11 @@ entities: 234: -5,14 235: -4,15 238: -2,15 - 281: 6,14 - 282: 6,13 - 283: 7,11 - 326: -8,4 - 332: -5,5 + 283: 6,14 + 284: 6,13 + 285: 7,11 + 328: -8,4 + 334: -5,5 - node: color: '#A46106FF' id: MiniTileWhiteCornerNe @@ -315,22 +315,22 @@ entities: color: '#D381C996' id: WarnCornerGreyscaleNE decals: - 275: 7,14 + 277: 7,14 - node: color: '#D381C996' id: WarnCornerGreyscaleNW decals: - 274: 6,14 + 276: 6,14 - node: color: '#D381C996' id: WarnCornerGreyscaleSE decals: - 272: 7,11 + 274: 7,11 - node: color: '#D381C996' id: WarnCornerGreyscaleSW decals: - 273: 6,11 + 275: 6,11 - node: color: '#A4610696' id: WarnCornerNE @@ -359,19 +359,19 @@ entities: color: '#9FED5896' id: WarnCornerSmallNE decals: - 322: -8,4 + 324: -8,4 - node: color: '#A4610696' id: WarnCornerSmallNE decals: 126: -5,10 127: -5,12 - 324: -5,5 + 326: -5,5 - node: color: '#9FED5896' id: WarnCornerSmallNW decals: - 323: -5,4 + 325: -5,4 - node: color: '#A4610696' id: WarnCornerSmallNW @@ -404,7 +404,7 @@ entities: color: '#9FED5896' id: WarnLineE decals: - 319: -8,5 + 321: -8,5 - node: color: '#A4610696' id: WarnLineE @@ -443,29 +443,29 @@ entities: 67: 8,3 68: 5,14 69: 1,14 - 307: 8,5 - 308: 8,7 - 309: 8,9 - 313: -11,-3 + 309: 8,5 + 310: 8,7 + 311: 8,9 + 315: -11,-3 - node: color: '#D381C996' id: WarnLineGreyscaleE decals: - 276: 7,13 - 277: 7,12 + 278: 7,13 + 279: 7,12 - node: color: '#D381C996' id: WarnLineGreyscaleW decals: - 278: 6,12 - 279: 6,13 + 280: 6,12 + 281: 6,13 - node: color: '#9FED5896' id: WarnLineN decals: 141: -6,3 - 315: -7,3 - 317: -5,3 + 317: -7,3 + 319: -5,3 - node: color: '#A4610696' id: WarnLineN @@ -504,14 +504,14 @@ entities: 63: 7,-9 64: 8,-9 70: -1,9 - 311: 7,4 + 313: 7,4 - node: color: '#9FED5896' id: WarnLineS decals: - 318: -5,5 - 320: -8,5 - 321: -8,4 + 320: -5,5 + 322: -8,5 + 323: -8,4 - node: color: '#A4610696' id: WarnLineS @@ -550,16 +550,16 @@ entities: 44: 8,3 45: 1,14 46: 5,14 - 304: 8,9 - 305: 8,7 - 306: 8,5 - 312: -11,-3 + 306: 8,9 + 307: 8,7 + 308: 8,5 + 314: -11,-3 - node: color: '#9FED5896' id: WarnLineW decals: - 314: -6,4 - 316: -7,4 + 316: -6,4 + 318: -7,4 - node: color: '#A4610696' id: WarnLineW @@ -599,29 +599,29 @@ entities: 57: -7,-9 58: -6,-9 71: -1,9 - 310: 7,4 + 312: 7,4 - node: angle: -1.5707963267948966 rad color: '#A4610696' id: food decals: - 348: -12,-1 - 349: -12,-3 + 352: -12,-1 + 353: -12,-3 - node: color: '#A4610696' id: food decals: - 342: 6,-8 - 343: 8,-8 - 346: -8,-8 - 347: -6,-8 + 346: 6,-8 + 347: 8,-8 + 350: -8,-8 + 351: -6,-8 - node: angle: 1.5707963267948966 rad color: '#A4610696' id: food decals: - 344: 12,-1 - 345: 12,-3 + 348: 12,-1 + 349: 12,-3 type: DecalGrid - version: 2 data: @@ -4717,24 +4717,6 @@ entities: type: Transform - stampedName: Unknown type: Stamp -- proto: PortableGeneratorPacmanOn - entities: - - uid: 1040 - components: - - anchored: True - pos: -8.5,-1.5 - parent: 1 - type: Transform - - on: False - type: FuelGenerator - - storage: - Plasma: 3000 - type: MaterialStorage - - bodyType: Static - type: Physics - - endTime: 0 - type: InsertingMaterialStorage - - type: ItemCooldown - proto: PortableScrubber entities: - uid: 9 @@ -7511,11 +7493,4 @@ entities: pos: -6.5,13.5 parent: 1 type: Transform -- proto: Wrench - entities: - - uid: 1041 - components: - - pos: -6.8533325,-0.31925178 - parent: 1 - type: Transform ... From 7930bcbe6b7031b40a4e530b0058c95cee66fe1e Mon Sep 17 00:00:00 2001 From: Dvir Date: Mon, 8 Jan 2024 23:12:28 +0200 Subject: [PATCH 5/8] Enable magnet toggle --- .../MaterialReclaimerMagnetPickupComponent.cs | 6 +++ .../MaterialStorageMagnetPickupComponent.cs | 6 +++ .../MaterialReclaimerMagnetPickupSystem.cs | 52 +++++++++++++++++++ .../MaterialStorageMagnetPickupSystem.cs | 51 ++++++++++++++++++ .../Power/Generation/portable_generator.yml | 6 +++ 5 files changed, 121 insertions(+) diff --git a/Content.Shared/Storage/Components/MaterialReclaimerMagnetPickupComponent.cs b/Content.Shared/Storage/Components/MaterialReclaimerMagnetPickupComponent.cs index 8f407650eac..d24089e9ee2 100644 --- a/Content.Shared/Storage/Components/MaterialReclaimerMagnetPickupComponent.cs +++ b/Content.Shared/Storage/Components/MaterialReclaimerMagnetPickupComponent.cs @@ -11,4 +11,10 @@ public sealed partial class MaterialReclaimerMagnetPickupComponent : Component [ViewVariables(VVAccess.ReadWrite), DataField("range")] public float Range = 1f; + + /// + /// Frontier - Is the magnet currently enabled? + /// + [ViewVariables(VVAccess.ReadWrite), DataField("magnetEnabled")] + public bool MagnetEnabled = true; } diff --git a/Content.Shared/Storage/Components/MaterialStorageMagnetPickupComponent.cs b/Content.Shared/Storage/Components/MaterialStorageMagnetPickupComponent.cs index bf49a942134..9dc39424aba 100644 --- a/Content.Shared/Storage/Components/MaterialStorageMagnetPickupComponent.cs +++ b/Content.Shared/Storage/Components/MaterialStorageMagnetPickupComponent.cs @@ -11,4 +11,10 @@ public sealed partial class MaterialStorageMagnetPickupComponent : Component [ViewVariables(VVAccess.ReadWrite), DataField("range")] public float Range = 1f; + + /// + /// Frontier - Is the magnet currently enabled? + /// + [ViewVariables(VVAccess.ReadWrite), DataField("magnetEnabled")] + public bool MagnetEnabled = true; } diff --git a/Content.Shared/Storage/EntitySystems/MaterialReclaimerMagnetPickupSystem.cs b/Content.Shared/Storage/EntitySystems/MaterialReclaimerMagnetPickupSystem.cs index eb4f55127e5..0986bdb2a29 100644 --- a/Content.Shared/Storage/EntitySystems/MaterialReclaimerMagnetPickupSystem.cs +++ b/Content.Shared/Storage/EntitySystems/MaterialReclaimerMagnetPickupSystem.cs @@ -2,6 +2,10 @@ using Content.Shared.Materials; using Robust.Shared.Physics.Components; using Robust.Shared.Timing; +using Content.Shared.Examine; // Frontier +using Content.Shared.Hands.Components; // Frontier +using Content.Shared.Verbs; // Frontier +using Robust.Shared.Utility; // Frontier namespace Content.Shared.Storage.EntitySystems; @@ -24,6 +28,8 @@ public override void Initialize() _physicsQuery = GetEntityQuery(); SubscribeLocalEvent(OnMagnetMapInit); SubscribeLocalEvent(OnMagnetUnpaused); + SubscribeLocalEvent(OnExamined); // Frontier + SubscribeLocalEvent>(AddToggleMagnetVerb); // Frontier } private void OnMagnetUnpaused(EntityUid uid, MaterialReclaimerMagnetPickupComponent component, ref EntityUnpausedEvent args) @@ -36,6 +42,48 @@ private void OnMagnetMapInit(EntityUid uid, MaterialReclaimerMagnetPickupCompone component.NextScan = _timing.CurTime + TimeSpan.FromSeconds(1f); } + // Frontier, used to add the magnet toggle to the context menu + private void AddToggleMagnetVerb(EntityUid uid, MaterialReclaimerMagnetPickupComponent component, GetVerbsEvent args) + { + if (!args.CanAccess || !args.CanInteract) + return; + + if (!HasComp(args.User)) + return; + + AlternativeVerb verb = new() + { + Act = () => + { + ToggleMagnet(uid, component); + }, + Icon = new SpriteSpecifier.Texture(new("/Textures/Interface/VerbIcons/Spare/poweronoff.svg.192dpi.png")), + Text = Loc.GetString("magnet-pickup-component-toggle-verb"), + Priority = 3 + }; + + args.Verbs.Add(verb); + } + + // Frontier, used to show the magnet state on examination + private void OnExamined(EntityUid uid, MaterialReclaimerMagnetPickupComponent component, ExaminedEvent args) + { + args.PushMarkup(Loc.GetString("magnet-pickup-component-on-examine-main", + ("stateText", Loc.GetString(component.MagnetEnabled + ? "magnet-pickup-component-magnet-on" + : "magnet-pickup-component-magnet-off")))); + } + + // Frontier, used to toggle the magnet on the ore bag/box + public bool ToggleMagnet(EntityUid uid, MaterialReclaimerMagnetPickupComponent comp) + { + var query = EntityQueryEnumerator(); + comp.MagnetEnabled = !comp.MagnetEnabled; + + return comp.MagnetEnabled; + } + + public override void Update(float frameTime) { base.Update(frameTime); @@ -47,6 +95,10 @@ public override void Update(float frameTime) if (comp.NextScan < currentTime) continue; + // Frontier - magnet disabled + if (!comp.MagnetEnabled) + continue; + comp.NextScan += ScanDelay; var parentUid = xform.ParentUid; diff --git a/Content.Shared/Storage/EntitySystems/MaterialStorageMagnetPickupSystem.cs b/Content.Shared/Storage/EntitySystems/MaterialStorageMagnetPickupSystem.cs index d487985d875..bf6c711c4e9 100644 --- a/Content.Shared/Storage/EntitySystems/MaterialStorageMagnetPickupSystem.cs +++ b/Content.Shared/Storage/EntitySystems/MaterialStorageMagnetPickupSystem.cs @@ -2,6 +2,10 @@ using Content.Shared.Materials; using Robust.Shared.Physics.Components; using Robust.Shared.Timing; +using Content.Shared.Examine; // Frontier +using Content.Shared.Hands.Components; // Frontier +using Content.Shared.Verbs; // Frontier +using Robust.Shared.Utility; // Frontier namespace Content.Shared.Storage.EntitySystems; @@ -24,6 +28,8 @@ public override void Initialize() _physicsQuery = GetEntityQuery(); SubscribeLocalEvent(OnMagnetMapInit); SubscribeLocalEvent(OnMagnetUnpaused); + SubscribeLocalEvent(OnExamined); // Frontier + SubscribeLocalEvent>(AddToggleMagnetVerb); // Frontier } private void OnMagnetUnpaused(EntityUid uid, MaterialStorageMagnetPickupComponent component, ref EntityUnpausedEvent args) @@ -36,6 +42,47 @@ private void OnMagnetMapInit(EntityUid uid, MaterialStorageMagnetPickupComponent component.NextScan = _timing.CurTime + TimeSpan.FromSeconds(1f); } + // Frontier, used to add the magnet toggle to the context menu + private void AddToggleMagnetVerb(EntityUid uid, MaterialStorageMagnetPickupComponent component, GetVerbsEvent args) + { + if (!args.CanAccess || !args.CanInteract) + return; + + if (!HasComp(args.User)) + return; + + AlternativeVerb verb = new() + { + Act = () => + { + ToggleMagnet(uid, component); + }, + Icon = new SpriteSpecifier.Texture(new("/Textures/Interface/VerbIcons/Spare/poweronoff.svg.192dpi.png")), + Text = Loc.GetString("magnet-pickup-component-toggle-verb"), + Priority = 3 + }; + + args.Verbs.Add(verb); + } + + // Frontier, used to show the magnet state on examination + private void OnExamined(EntityUid uid, MaterialStorageMagnetPickupComponent component, ExaminedEvent args) + { + args.PushMarkup(Loc.GetString("magnet-pickup-component-on-examine-main", + ("stateText", Loc.GetString(component.MagnetEnabled + ? "magnet-pickup-component-magnet-on" + : "magnet-pickup-component-magnet-off")))); + } + + // Frontier, used to toggle the magnet on the ore bag/box + public bool ToggleMagnet(EntityUid uid, MaterialStorageMagnetPickupComponent comp) + { + var query = EntityQueryEnumerator(); + comp.MagnetEnabled = !comp.MagnetEnabled; + + return comp.MagnetEnabled; + } + public override void Update(float frameTime) { base.Update(frameTime); @@ -47,6 +94,10 @@ public override void Update(float frameTime) if (comp.NextScan < currentTime) continue; + // Frontier - magnet disabled + if (!comp.MagnetEnabled) + continue; + comp.NextScan += ScanDelay; var parentUid = xform.ParentUid; diff --git a/Resources/Prototypes/Entities/Structures/Power/Generation/portable_generator.yml b/Resources/Prototypes/Entities/Structures/Power/Generation/portable_generator.yml index fcc4a717b8c..e445ff5de60 100644 --- a/Resources/Prototypes/Entities/Structures/Power/Generation/portable_generator.yml +++ b/Resources/Prototypes/Entities/Structures/Power/Generation/portable_generator.yml @@ -170,6 +170,9 @@ gasType: CarbonDioxide # 0.5 moles of gas for every sheet of plasma. moleRatio: 0.5 + - type: MaterialStorageMagnetPickup # Frontier + range: 0.30 + magnetEnabled: false - type: entity name: S.U.P.E.R.P.A.C.M.A.N.-type portable generator @@ -219,6 +222,9 @@ - type: UpgradePowerSupplier powerSupplyMultiplier: 1.25 scaling: Exponential + - type: MaterialStorageMagnetPickup # Frontier + range: 0.30 + magnetEnabled: false - type: entity name: J.R.P.A.C.M.A.N.-type portable generator From 5ad0f387699bcf1cd4dd83b49f534e4430de82cc Mon Sep 17 00:00:00 2001 From: Dvir Date: Mon, 22 Jan 2024 17:42:15 +0200 Subject: [PATCH 6/8] Removed --- .../MaterialReclaimerMagnetPickupComponent.cs | 6 --- .../MaterialStorageMagnetPickupComponent.cs | 6 --- .../MaterialReclaimerMagnetPickupSystem.cs | 52 ------------------- .../MaterialStorageMagnetPickupSystem.cs | 51 ------------------ 4 files changed, 115 deletions(-) diff --git a/Content.Shared/Storage/Components/MaterialReclaimerMagnetPickupComponent.cs b/Content.Shared/Storage/Components/MaterialReclaimerMagnetPickupComponent.cs index d24089e9ee2..8f407650eac 100644 --- a/Content.Shared/Storage/Components/MaterialReclaimerMagnetPickupComponent.cs +++ b/Content.Shared/Storage/Components/MaterialReclaimerMagnetPickupComponent.cs @@ -11,10 +11,4 @@ public sealed partial class MaterialReclaimerMagnetPickupComponent : Component [ViewVariables(VVAccess.ReadWrite), DataField("range")] public float Range = 1f; - - /// - /// Frontier - Is the magnet currently enabled? - /// - [ViewVariables(VVAccess.ReadWrite), DataField("magnetEnabled")] - public bool MagnetEnabled = true; } diff --git a/Content.Shared/Storage/Components/MaterialStorageMagnetPickupComponent.cs b/Content.Shared/Storage/Components/MaterialStorageMagnetPickupComponent.cs index 9dc39424aba..bf49a942134 100644 --- a/Content.Shared/Storage/Components/MaterialStorageMagnetPickupComponent.cs +++ b/Content.Shared/Storage/Components/MaterialStorageMagnetPickupComponent.cs @@ -11,10 +11,4 @@ public sealed partial class MaterialStorageMagnetPickupComponent : Component [ViewVariables(VVAccess.ReadWrite), DataField("range")] public float Range = 1f; - - /// - /// Frontier - Is the magnet currently enabled? - /// - [ViewVariables(VVAccess.ReadWrite), DataField("magnetEnabled")] - public bool MagnetEnabled = true; } diff --git a/Content.Shared/Storage/EntitySystems/MaterialReclaimerMagnetPickupSystem.cs b/Content.Shared/Storage/EntitySystems/MaterialReclaimerMagnetPickupSystem.cs index 0986bdb2a29..eb4f55127e5 100644 --- a/Content.Shared/Storage/EntitySystems/MaterialReclaimerMagnetPickupSystem.cs +++ b/Content.Shared/Storage/EntitySystems/MaterialReclaimerMagnetPickupSystem.cs @@ -2,10 +2,6 @@ using Content.Shared.Materials; using Robust.Shared.Physics.Components; using Robust.Shared.Timing; -using Content.Shared.Examine; // Frontier -using Content.Shared.Hands.Components; // Frontier -using Content.Shared.Verbs; // Frontier -using Robust.Shared.Utility; // Frontier namespace Content.Shared.Storage.EntitySystems; @@ -28,8 +24,6 @@ public override void Initialize() _physicsQuery = GetEntityQuery(); SubscribeLocalEvent(OnMagnetMapInit); SubscribeLocalEvent(OnMagnetUnpaused); - SubscribeLocalEvent(OnExamined); // Frontier - SubscribeLocalEvent>(AddToggleMagnetVerb); // Frontier } private void OnMagnetUnpaused(EntityUid uid, MaterialReclaimerMagnetPickupComponent component, ref EntityUnpausedEvent args) @@ -42,48 +36,6 @@ private void OnMagnetMapInit(EntityUid uid, MaterialReclaimerMagnetPickupCompone component.NextScan = _timing.CurTime + TimeSpan.FromSeconds(1f); } - // Frontier, used to add the magnet toggle to the context menu - private void AddToggleMagnetVerb(EntityUid uid, MaterialReclaimerMagnetPickupComponent component, GetVerbsEvent args) - { - if (!args.CanAccess || !args.CanInteract) - return; - - if (!HasComp(args.User)) - return; - - AlternativeVerb verb = new() - { - Act = () => - { - ToggleMagnet(uid, component); - }, - Icon = new SpriteSpecifier.Texture(new("/Textures/Interface/VerbIcons/Spare/poweronoff.svg.192dpi.png")), - Text = Loc.GetString("magnet-pickup-component-toggle-verb"), - Priority = 3 - }; - - args.Verbs.Add(verb); - } - - // Frontier, used to show the magnet state on examination - private void OnExamined(EntityUid uid, MaterialReclaimerMagnetPickupComponent component, ExaminedEvent args) - { - args.PushMarkup(Loc.GetString("magnet-pickup-component-on-examine-main", - ("stateText", Loc.GetString(component.MagnetEnabled - ? "magnet-pickup-component-magnet-on" - : "magnet-pickup-component-magnet-off")))); - } - - // Frontier, used to toggle the magnet on the ore bag/box - public bool ToggleMagnet(EntityUid uid, MaterialReclaimerMagnetPickupComponent comp) - { - var query = EntityQueryEnumerator(); - comp.MagnetEnabled = !comp.MagnetEnabled; - - return comp.MagnetEnabled; - } - - public override void Update(float frameTime) { base.Update(frameTime); @@ -95,10 +47,6 @@ public override void Update(float frameTime) if (comp.NextScan < currentTime) continue; - // Frontier - magnet disabled - if (!comp.MagnetEnabled) - continue; - comp.NextScan += ScanDelay; var parentUid = xform.ParentUid; diff --git a/Content.Shared/Storage/EntitySystems/MaterialStorageMagnetPickupSystem.cs b/Content.Shared/Storage/EntitySystems/MaterialStorageMagnetPickupSystem.cs index bf6c711c4e9..d487985d875 100644 --- a/Content.Shared/Storage/EntitySystems/MaterialStorageMagnetPickupSystem.cs +++ b/Content.Shared/Storage/EntitySystems/MaterialStorageMagnetPickupSystem.cs @@ -2,10 +2,6 @@ using Content.Shared.Materials; using Robust.Shared.Physics.Components; using Robust.Shared.Timing; -using Content.Shared.Examine; // Frontier -using Content.Shared.Hands.Components; // Frontier -using Content.Shared.Verbs; // Frontier -using Robust.Shared.Utility; // Frontier namespace Content.Shared.Storage.EntitySystems; @@ -28,8 +24,6 @@ public override void Initialize() _physicsQuery = GetEntityQuery(); SubscribeLocalEvent(OnMagnetMapInit); SubscribeLocalEvent(OnMagnetUnpaused); - SubscribeLocalEvent(OnExamined); // Frontier - SubscribeLocalEvent>(AddToggleMagnetVerb); // Frontier } private void OnMagnetUnpaused(EntityUid uid, MaterialStorageMagnetPickupComponent component, ref EntityUnpausedEvent args) @@ -42,47 +36,6 @@ private void OnMagnetMapInit(EntityUid uid, MaterialStorageMagnetPickupComponent component.NextScan = _timing.CurTime + TimeSpan.FromSeconds(1f); } - // Frontier, used to add the magnet toggle to the context menu - private void AddToggleMagnetVerb(EntityUid uid, MaterialStorageMagnetPickupComponent component, GetVerbsEvent args) - { - if (!args.CanAccess || !args.CanInteract) - return; - - if (!HasComp(args.User)) - return; - - AlternativeVerb verb = new() - { - Act = () => - { - ToggleMagnet(uid, component); - }, - Icon = new SpriteSpecifier.Texture(new("/Textures/Interface/VerbIcons/Spare/poweronoff.svg.192dpi.png")), - Text = Loc.GetString("magnet-pickup-component-toggle-verb"), - Priority = 3 - }; - - args.Verbs.Add(verb); - } - - // Frontier, used to show the magnet state on examination - private void OnExamined(EntityUid uid, MaterialStorageMagnetPickupComponent component, ExaminedEvent args) - { - args.PushMarkup(Loc.GetString("magnet-pickup-component-on-examine-main", - ("stateText", Loc.GetString(component.MagnetEnabled - ? "magnet-pickup-component-magnet-on" - : "magnet-pickup-component-magnet-off")))); - } - - // Frontier, used to toggle the magnet on the ore bag/box - public bool ToggleMagnet(EntityUid uid, MaterialStorageMagnetPickupComponent comp) - { - var query = EntityQueryEnumerator(); - comp.MagnetEnabled = !comp.MagnetEnabled; - - return comp.MagnetEnabled; - } - public override void Update(float frameTime) { base.Update(frameTime); @@ -94,10 +47,6 @@ public override void Update(float frameTime) if (comp.NextScan < currentTime) continue; - // Frontier - magnet disabled - if (!comp.MagnetEnabled) - continue; - comp.NextScan += ScanDelay; var parentUid = xform.ParentUid; From 65b4557d8bb5f1bce3fa6166848c086ac4874c8b Mon Sep 17 00:00:00 2001 From: Dvir Date: Mon, 22 Jan 2024 17:44:34 +0200 Subject: [PATCH 7/8] Split magnet --- .../Power/Generation/portable_generator.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Resources/Prototypes/Entities/Structures/Power/Generation/portable_generator.yml b/Resources/Prototypes/Entities/Structures/Power/Generation/portable_generator.yml index e445ff5de60..435e61a58e2 100644 --- a/Resources/Prototypes/Entities/Structures/Power/Generation/portable_generator.yml +++ b/Resources/Prototypes/Entities/Structures/Power/Generation/portable_generator.yml @@ -170,9 +170,9 @@ gasType: CarbonDioxide # 0.5 moles of gas for every sheet of plasma. moleRatio: 0.5 - - type: MaterialStorageMagnetPickup # Frontier - range: 0.30 - magnetEnabled: false + # - type: MaterialStorageMagnetPickup # Frontier + # range: 0.30 + # magnetEnabled: false - type: entity name: S.U.P.E.R.P.A.C.M.A.N.-type portable generator @@ -222,9 +222,9 @@ - type: UpgradePowerSupplier powerSupplyMultiplier: 1.25 scaling: Exponential - - type: MaterialStorageMagnetPickup # Frontier - range: 0.30 - magnetEnabled: false + # - type: MaterialStorageMagnetPickup # Frontier + # range: 0.30 + # magnetEnabled: false - type: entity name: J.R.P.A.C.M.A.N.-type portable generator From 653a3fb9f45df18620f631ad58b993d481ba2541 Mon Sep 17 00:00:00 2001 From: Dvir Date: Thu, 25 Jan 2024 01:32:50 +0200 Subject: [PATCH 8/8] Update portable_generator.yml --- .../Structures/Power/Generation/portable_generator.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Resources/Prototypes/Entities/Structures/Power/Generation/portable_generator.yml b/Resources/Prototypes/Entities/Structures/Power/Generation/portable_generator.yml index 435e61a58e2..fcc4a717b8c 100644 --- a/Resources/Prototypes/Entities/Structures/Power/Generation/portable_generator.yml +++ b/Resources/Prototypes/Entities/Structures/Power/Generation/portable_generator.yml @@ -170,9 +170,6 @@ gasType: CarbonDioxide # 0.5 moles of gas for every sheet of plasma. moleRatio: 0.5 - # - type: MaterialStorageMagnetPickup # Frontier - # range: 0.30 - # magnetEnabled: false - type: entity name: S.U.P.E.R.P.A.C.M.A.N.-type portable generator @@ -222,9 +219,6 @@ - type: UpgradePowerSupplier powerSupplyMultiplier: 1.25 scaling: Exponential - # - type: MaterialStorageMagnetPickup # Frontier - # range: 0.30 - # magnetEnabled: false - type: entity name: J.R.P.A.C.M.A.N.-type portable generator