]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Turbo Recharger (#23723)
authorNemanja <98561806+EmoGarbage404@users.noreply.github.com>
Mon, 8 Jan 2024 07:15:13 +0000 (02:15 -0500)
committerGitHub <noreply@github.com>
Mon, 8 Jan 2024 07:15:13 +0000 (00:15 -0700)
turbo charger

14 files changed:
Content.Server/Power/Components/ChargerComponent.cs
Content.Server/Power/EntitySystems/ChargerSystem.cs
Resources/Prototypes/Entities/Objects/Devices/Circuitboards/Machine/production.yml
Resources/Prototypes/Entities/Structures/Machines/lathe.yml
Resources/Prototypes/Entities/Structures/Power/chargers.yml
Resources/Prototypes/Recipes/Lathes/electronics.yml
Resources/Prototypes/Research/industrial.yml
Resources/Textures/Structures/Power/turbo_recharger.rsi/empty.png [new file with mode: 0644]
Resources/Textures/Structures/Power/turbo_recharger.rsi/full.png [new file with mode: 0644]
Resources/Textures/Structures/Power/turbo_recharger.rsi/light-charged.png [new file with mode: 0644]
Resources/Textures/Structures/Power/turbo_recharger.rsi/light-charging.png [new file with mode: 0644]
Resources/Textures/Structures/Power/turbo_recharger.rsi/light-empty.png [new file with mode: 0644]
Resources/Textures/Structures/Power/turbo_recharger.rsi/light-off.png [new file with mode: 0644]
Resources/Textures/Structures/Power/turbo_recharger.rsi/meta.json [new file with mode: 0644]

index b7e3b3da8ceaab825dd98de88527c50b3d7cef80..af4498f01bae6309a93198125ca7ef46bd8f84cc 100644 (file)
@@ -1,7 +1,5 @@
-using Content.Shared.Construction.Prototypes;
 using Content.Shared.Power;
 using Content.Shared.Whitelist;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
 
 namespace Content.Server.Power.Components
 {
@@ -17,25 +15,6 @@ namespace Content.Server.Power.Components
         [DataField("chargeRate")]
         public float ChargeRate = 20.0f;
 
-        /// <summary>
-        /// The charge rate with no machine upgrades
-        /// </summary>
-        [DataField("baseChargeRate")]
-        public float BaseChargeRate = 20.0f;
-
-        /// <summary>
-        /// The machine part that affects the charge rate multiplier of the charger
-        /// </summary>
-        [DataField("machinePartChargeRateModifier", customTypeSerializer: typeof(PrototypeIdSerializer<MachinePartPrototype>))]
-        public string MachinePartChargeRateModifier = "Capacitor";
-
-        /// <summary>
-        /// A value used to scale the charge rate multiplier
-        /// with the corresponding part rating.
-        /// </summary>
-        [DataField("partRatingChargeRateModifier")]
-        public float PartRatingChargeRateModifier = 1.5f;
-
         /// <summary>
         /// The container ID that is holds the entities being charged.
         /// </summary>
index 4c343a4a2c339af531af70fba52f8067cc7380b2..7926e1a84d9c07a2fc3f94ec027e1a0ea8cf6b20 100644 (file)
@@ -1,4 +1,3 @@
-using Content.Server.Construction;
 using Content.Server.Power.Components;
 using Content.Server.PowerCell;
 using Content.Shared.Examine;
@@ -23,8 +22,6 @@ internal sealed class ChargerSystem : EntitySystem
     public override void Initialize()
     {
         SubscribeLocalEvent<ChargerComponent, ComponentStartup>(OnStartup);
-        SubscribeLocalEvent<ChargerComponent, RefreshPartsEvent>(OnRefreshParts);
-        SubscribeLocalEvent<ChargerComponent, UpgradeExamineEvent>(OnUpgradeExamine);
         SubscribeLocalEvent<ChargerComponent, PowerChangedEvent>(OnPowerChanged);
         SubscribeLocalEvent<ChargerComponent, EntInsertedIntoContainerMessage>(OnInserted);
         SubscribeLocalEvent<ChargerComponent, EntRemovedFromContainerMessage>(OnRemoved);
@@ -61,17 +58,6 @@ internal sealed class ChargerSystem : EntitySystem
         }
     }
 
-    private void OnRefreshParts(EntityUid uid, ChargerComponent component, RefreshPartsEvent args)
-    {
-        var modifierRating = args.PartRatings[component.MachinePartChargeRateModifier];
-        component.ChargeRate = component.BaseChargeRate * MathF.Pow(component.PartRatingChargeRateModifier, modifierRating - 1);
-    }
-
-    private void OnUpgradeExamine(EntityUid uid, ChargerComponent component, UpgradeExamineEvent args)
-    {
-        args.AddPercentageUpgrade("charger-component-charge-rate", component.ChargeRate / component.BaseChargeRate);
-    }
-
     private void OnPowerChanged(EntityUid uid, ChargerComponent component, ref PowerChangedEvent args)
     {
         UpdateStatus(uid, component);
index d6863d49a70d6b05a82ce26969727194b5f1c759..90597e809006e8bce4d75a83ba2afd9ea9a8b941 100644 (file)
     - type: StaticPrice
       price: 15
 
+- type: entity
+  id: TurboItemRechargerCircuitboard
+  parent: BaseMachineCircuitboard
+  name: turbo recharger machine board
+  description: A machine printed circuit board for a turbo recharger.
+  components:
+  - type: Sprite
+    sprite: Objects/Misc/module.rsi
+    state: charger_APC
+  - type: MachineBoard
+    prototype: TurboItemRecharger
+    requirements:
+      Capacitor: 2
+    materialRequirements:
+      CableMV: 5
+  - type: PhysicalComposition
+    materialComposition:
+      Steel: 30
+      Plastic: 30
+
 - type: entity
   id: SubstationMachineCircuitboard
   parent: BaseMachineCircuitboard
index 1c9976f8e57db7d2319c0de98d27646b0fe848bc..0dae26e1737ffbe74faf771b96ccc7122b7404cc 100644 (file)
       - HydroponicsTrayMachineCircuitboard
       - SolarControlComputerCircuitboard
       - SolarTrackerElectronics
+      - TurboItemRechargerCircuitboard
       - PowerComputerCircuitboard
       - AutolatheHyperConvectionMachineCircuitboard
       - ProtolatheHyperConvectionMachineCircuitboard
           - Sheet
     - type: StealTarget
       stealGroup: AmmoTechFabCircuitboard
-      
+
 - type: entity
   id: MedicalTechFab
   parent: BaseLathe
     board: MedicalTechFabCircuitboard
   - type: StealTarget
     stealGroup: MedicalTechFabCircuitboard
-    
+
 - type: entity
   parent: BaseLathe
   id: UniformPrinter
index 7630610bd89f8e293beb043609aee4538ba262b7..4e888b0b0b4de9282b5980e4783ba2782aa37726 100644 (file)
           - ProjectileBatteryAmmoProvider
           - Stunbaton
 
+- type: entity
+  parent: BaseItemRecharger
+  id: TurboItemRecharger
+  name: turbo recharger
+  description: An overclocked recharger that's been adapted with a global port.
+  components:
+  - type: Sprite
+    sprite: Structures/Power/turbo_recharger.rsi
+  - type: Machine
+    board: TurboItemRechargerCircuitboard
+  - type: Charger
+    chargeRate: 100
+  - type: ItemSlots
+    slots:
+      charger_slot:
+        ejectOnInteract: true
+        whitelist:
+          components:
+          - HitscanBatteryAmmoProvider
+          - ProjectileBatteryAmmoProvider
+          - Stunbaton
+          - PowerCell
+        blacklist:
+          tags:
+          - PotatoBattery
+
 - type: entity
   parent: BaseItemRecharger
   id: WallWeaponCapacitorRecharger
         map: ["enum.WiresVisualLayers.MaintenancePanel"]
         visible: false
   - type: Charger
-    baseChargeRate: 30
+    chargeRate: 30
     slotId: entity_storage
     whitelist:
       components:
index 55337702b5a0f9f4d7dc42ce0c34272555cefc76..123b7f60367f3f8a0d8842b9dd69b903f51a073c 100644 (file)
     Steel: 50
     Plastic: 50
 
+- type: latheRecipe
+  id: TurboItemRechargerCircuitboard
+  result: TurboItemRechargerCircuitboard
+  completetime: 2
+  materials:
+    Steel: 500
+    Plastic: 500
+    Gold: 100
+
 - type: latheRecipe
   id: DoorElectronics
   result: DoorElectronics
index f47d5a6398570b82062481e313a74eb8db9da56c..d5edbd8f43254b7af373993b26d2bfd46e73cabf 100644 (file)
   id: AdvancedPowercells
   name: research-technology-advanced-powercells
   icon:
-    sprite: Objects/Power/power_cells.rsi
-    state: high
+    sprite: Structures/Power/turbo_recharger.rsi
+    state: empty
   discipline: Industrial
   tier: 1
-  cost: 5000
+  cost: 7500
   recipeUnlocks:
   - PowerCellHigh
+  - TurboItemRechargerCircuitboard
 
 - type: technology
   id: MechanicalCompression
diff --git a/Resources/Textures/Structures/Power/turbo_recharger.rsi/empty.png b/Resources/Textures/Structures/Power/turbo_recharger.rsi/empty.png
new file mode 100644 (file)
index 0000000..aec6663
Binary files /dev/null and b/Resources/Textures/Structures/Power/turbo_recharger.rsi/empty.png differ
diff --git a/Resources/Textures/Structures/Power/turbo_recharger.rsi/full.png b/Resources/Textures/Structures/Power/turbo_recharger.rsi/full.png
new file mode 100644 (file)
index 0000000..aec6663
Binary files /dev/null and b/Resources/Textures/Structures/Power/turbo_recharger.rsi/full.png differ
diff --git a/Resources/Textures/Structures/Power/turbo_recharger.rsi/light-charged.png b/Resources/Textures/Structures/Power/turbo_recharger.rsi/light-charged.png
new file mode 100644 (file)
index 0000000..272c610
Binary files /dev/null and b/Resources/Textures/Structures/Power/turbo_recharger.rsi/light-charged.png differ
diff --git a/Resources/Textures/Structures/Power/turbo_recharger.rsi/light-charging.png b/Resources/Textures/Structures/Power/turbo_recharger.rsi/light-charging.png
new file mode 100644 (file)
index 0000000..05a2890
Binary files /dev/null and b/Resources/Textures/Structures/Power/turbo_recharger.rsi/light-charging.png differ
diff --git a/Resources/Textures/Structures/Power/turbo_recharger.rsi/light-empty.png b/Resources/Textures/Structures/Power/turbo_recharger.rsi/light-empty.png
new file mode 100644 (file)
index 0000000..e519250
Binary files /dev/null and b/Resources/Textures/Structures/Power/turbo_recharger.rsi/light-empty.png differ
diff --git a/Resources/Textures/Structures/Power/turbo_recharger.rsi/light-off.png b/Resources/Textures/Structures/Power/turbo_recharger.rsi/light-off.png
new file mode 100644 (file)
index 0000000..1bdf052
Binary files /dev/null and b/Resources/Textures/Structures/Power/turbo_recharger.rsi/light-off.png differ
diff --git a/Resources/Textures/Structures/Power/turbo_recharger.rsi/meta.json b/Resources/Textures/Structures/Power/turbo_recharger.rsi/meta.json
new file mode 100644 (file)
index 0000000..50271d1
--- /dev/null
@@ -0,0 +1,62 @@
+{
+    "version": 1,
+    "size": {
+        "x": 32,
+        "y": 32
+    },
+    "license": "CC-BY-SA-3.0",
+    "copyright": "adapted from https://github.com/discordia-space/CEV-Eris/raw/9ea3eccbe22e18d24653949067f3d7dd12194ea9/icons/obj/stationobjs.dmi by EmoGarbage404 (github)",
+    "states": [
+        {
+            "name": "empty"
+
+        },
+        {
+            "name": "full"
+
+        },
+        {
+            "name": "light-off",
+            "delays": [
+                [
+                    1
+                ]
+            ]
+        },
+        {
+            "name": "light-empty",
+            "delays": [
+                [
+                    1,
+                    0.2
+                ]
+            ]
+        },
+        {
+            "name": "light-charging",
+            "delays": [
+                [
+                    0.1,
+                    0.1,
+                    0.1,
+                    0.1,
+                    0.1,
+                    0.1,
+                    0.1,
+                    0.1
+                ]
+            ]
+        },
+        {
+            "name": "light-charged",
+            "delays": [
+                [
+                    0.25,
+                    0.05,
+                    0.1,
+                    0.05
+                ]
+            ]
+        }
+    ]
+}