@@ -1,7 +1,5 @@
|
|||||||
using Content.Shared.Construction.Prototypes;
|
|
||||||
using Content.Shared.Power;
|
using Content.Shared.Power;
|
||||||
using Content.Shared.Whitelist;
|
using Content.Shared.Whitelist;
|
||||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
|
||||||
|
|
||||||
namespace Content.Server.Power.Components
|
namespace Content.Server.Power.Components
|
||||||
{
|
{
|
||||||
@@ -17,25 +15,6 @@ namespace Content.Server.Power.Components
|
|||||||
[DataField("chargeRate")]
|
[DataField("chargeRate")]
|
||||||
public float ChargeRate = 20.0f;
|
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>
|
/// <summary>
|
||||||
/// The container ID that is holds the entities being charged.
|
/// The container ID that is holds the entities being charged.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
using Content.Server.Construction;
|
|
||||||
using Content.Server.Power.Components;
|
using Content.Server.Power.Components;
|
||||||
using Content.Server.PowerCell;
|
using Content.Server.PowerCell;
|
||||||
using Content.Shared.Examine;
|
using Content.Shared.Examine;
|
||||||
@@ -23,8 +22,6 @@ internal sealed class ChargerSystem : EntitySystem
|
|||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
SubscribeLocalEvent<ChargerComponent, ComponentStartup>(OnStartup);
|
SubscribeLocalEvent<ChargerComponent, ComponentStartup>(OnStartup);
|
||||||
SubscribeLocalEvent<ChargerComponent, RefreshPartsEvent>(OnRefreshParts);
|
|
||||||
SubscribeLocalEvent<ChargerComponent, UpgradeExamineEvent>(OnUpgradeExamine);
|
|
||||||
SubscribeLocalEvent<ChargerComponent, PowerChangedEvent>(OnPowerChanged);
|
SubscribeLocalEvent<ChargerComponent, PowerChangedEvent>(OnPowerChanged);
|
||||||
SubscribeLocalEvent<ChargerComponent, EntInsertedIntoContainerMessage>(OnInserted);
|
SubscribeLocalEvent<ChargerComponent, EntInsertedIntoContainerMessage>(OnInserted);
|
||||||
SubscribeLocalEvent<ChargerComponent, EntRemovedFromContainerMessage>(OnRemoved);
|
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)
|
private void OnPowerChanged(EntityUid uid, ChargerComponent component, ref PowerChangedEvent args)
|
||||||
{
|
{
|
||||||
UpdateStatus(uid, component);
|
UpdateStatus(uid, component);
|
||||||
|
|||||||
@@ -707,6 +707,26 @@
|
|||||||
- type: StaticPrice
|
- type: StaticPrice
|
||||||
price: 15
|
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
|
- type: entity
|
||||||
id: SubstationMachineCircuitboard
|
id: SubstationMachineCircuitboard
|
||||||
parent: BaseMachineCircuitboard
|
parent: BaseMachineCircuitboard
|
||||||
|
|||||||
@@ -387,6 +387,7 @@
|
|||||||
- HydroponicsTrayMachineCircuitboard
|
- HydroponicsTrayMachineCircuitboard
|
||||||
- SolarControlComputerCircuitboard
|
- SolarControlComputerCircuitboard
|
||||||
- SolarTrackerElectronics
|
- SolarTrackerElectronics
|
||||||
|
- TurboItemRechargerCircuitboard
|
||||||
- PowerComputerCircuitboard
|
- PowerComputerCircuitboard
|
||||||
- AutolatheHyperConvectionMachineCircuitboard
|
- AutolatheHyperConvectionMachineCircuitboard
|
||||||
- ProtolatheHyperConvectionMachineCircuitboard
|
- ProtolatheHyperConvectionMachineCircuitboard
|
||||||
|
|||||||
@@ -109,6 +109,32 @@
|
|||||||
- ProjectileBatteryAmmoProvider
|
- ProjectileBatteryAmmoProvider
|
||||||
- Stunbaton
|
- 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
|
- type: entity
|
||||||
parent: BaseItemRecharger
|
parent: BaseItemRecharger
|
||||||
id: WallWeaponCapacitorRecharger
|
id: WallWeaponCapacitorRecharger
|
||||||
@@ -157,7 +183,7 @@
|
|||||||
map: ["enum.WiresVisualLayers.MaintenancePanel"]
|
map: ["enum.WiresVisualLayers.MaintenancePanel"]
|
||||||
visible: false
|
visible: false
|
||||||
- type: Charger
|
- type: Charger
|
||||||
baseChargeRate: 30
|
chargeRate: 30
|
||||||
slotId: entity_storage
|
slotId: entity_storage
|
||||||
whitelist:
|
whitelist:
|
||||||
components:
|
components:
|
||||||
|
|||||||
@@ -38,6 +38,15 @@
|
|||||||
Steel: 50
|
Steel: 50
|
||||||
Plastic: 50
|
Plastic: 50
|
||||||
|
|
||||||
|
- type: latheRecipe
|
||||||
|
id: TurboItemRechargerCircuitboard
|
||||||
|
result: TurboItemRechargerCircuitboard
|
||||||
|
completetime: 2
|
||||||
|
materials:
|
||||||
|
Steel: 500
|
||||||
|
Plastic: 500
|
||||||
|
Gold: 100
|
||||||
|
|
||||||
- type: latheRecipe
|
- type: latheRecipe
|
||||||
id: DoorElectronics
|
id: DoorElectronics
|
||||||
result: DoorElectronics
|
result: DoorElectronics
|
||||||
|
|||||||
@@ -19,13 +19,14 @@
|
|||||||
id: AdvancedPowercells
|
id: AdvancedPowercells
|
||||||
name: research-technology-advanced-powercells
|
name: research-technology-advanced-powercells
|
||||||
icon:
|
icon:
|
||||||
sprite: Objects/Power/power_cells.rsi
|
sprite: Structures/Power/turbo_recharger.rsi
|
||||||
state: high
|
state: empty
|
||||||
discipline: Industrial
|
discipline: Industrial
|
||||||
tier: 1
|
tier: 1
|
||||||
cost: 5000
|
cost: 7500
|
||||||
recipeUnlocks:
|
recipeUnlocks:
|
||||||
- PowerCellHigh
|
- PowerCellHigh
|
||||||
|
- TurboItemRechargerCircuitboard
|
||||||
|
|
||||||
- type: technology
|
- type: technology
|
||||||
id: MechanicalCompression
|
id: MechanicalCompression
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 918 B |
BIN
Resources/Textures/Structures/Power/turbo_recharger.rsi/full.png
Normal file
BIN
Resources/Textures/Structures/Power/turbo_recharger.rsi/full.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 918 B |
Binary file not shown.
|
After Width: | Height: | Size: 579 B |
Binary file not shown.
|
After Width: | Height: | Size: 846 B |
Binary file not shown.
|
After Width: | Height: | Size: 525 B |
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
@@ -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
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user