From c861b66a476a1ea1037ec173b088cafd5519f757 Mon Sep 17 00:00:00 2001 From: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> Date: Mon, 8 Jan 2024 02:15:13 -0500 Subject: [PATCH] Turbo Recharger (#23723) turbo charger --- .../Power/Components/ChargerComponent.cs | 21 ------ .../Power/EntitySystems/ChargerSystem.cs | 14 ---- .../Circuitboards/Machine/production.yml | 20 ++++++ .../Entities/Structures/Machines/lathe.yml | 5 +- .../Entities/Structures/Power/chargers.yml | 28 +++++++- .../Prototypes/Recipes/Lathes/electronics.yml | 9 +++ Resources/Prototypes/Research/industrial.yml | 7 +- .../Power/turbo_recharger.rsi/empty.png | Bin 0 -> 918 bytes .../Power/turbo_recharger.rsi/full.png | Bin 0 -> 918 bytes .../turbo_recharger.rsi/light-charged.png | Bin 0 -> 579 bytes .../turbo_recharger.rsi/light-charging.png | Bin 0 -> 846 bytes .../Power/turbo_recharger.rsi/light-empty.png | Bin 0 -> 525 bytes .../Power/turbo_recharger.rsi/light-off.png | Bin 0 -> 1886 bytes .../Power/turbo_recharger.rsi/meta.json | 62 ++++++++++++++++++ 14 files changed, 125 insertions(+), 41 deletions(-) create mode 100644 Resources/Textures/Structures/Power/turbo_recharger.rsi/empty.png create mode 100644 Resources/Textures/Structures/Power/turbo_recharger.rsi/full.png create mode 100644 Resources/Textures/Structures/Power/turbo_recharger.rsi/light-charged.png create mode 100644 Resources/Textures/Structures/Power/turbo_recharger.rsi/light-charging.png create mode 100644 Resources/Textures/Structures/Power/turbo_recharger.rsi/light-empty.png create mode 100644 Resources/Textures/Structures/Power/turbo_recharger.rsi/light-off.png create mode 100644 Resources/Textures/Structures/Power/turbo_recharger.rsi/meta.json diff --git a/Content.Server/Power/Components/ChargerComponent.cs b/Content.Server/Power/Components/ChargerComponent.cs index b7e3b3da8c..af4498f01b 100644 --- a/Content.Server/Power/Components/ChargerComponent.cs +++ b/Content.Server/Power/Components/ChargerComponent.cs @@ -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; - /// - /// The charge rate with no machine upgrades - /// - [DataField("baseChargeRate")] - public float BaseChargeRate = 20.0f; - - /// - /// The machine part that affects the charge rate multiplier of the charger - /// - [DataField("machinePartChargeRateModifier", customTypeSerializer: typeof(PrototypeIdSerializer))] - public string MachinePartChargeRateModifier = "Capacitor"; - - /// - /// A value used to scale the charge rate multiplier - /// with the corresponding part rating. - /// - [DataField("partRatingChargeRateModifier")] - public float PartRatingChargeRateModifier = 1.5f; - /// /// The container ID that is holds the entities being charged. /// diff --git a/Content.Server/Power/EntitySystems/ChargerSystem.cs b/Content.Server/Power/EntitySystems/ChargerSystem.cs index 4c343a4a2c..7926e1a84d 100644 --- a/Content.Server/Power/EntitySystems/ChargerSystem.cs +++ b/Content.Server/Power/EntitySystems/ChargerSystem.cs @@ -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(OnStartup); - SubscribeLocalEvent(OnRefreshParts); - SubscribeLocalEvent(OnUpgradeExamine); SubscribeLocalEvent(OnPowerChanged); SubscribeLocalEvent(OnInserted); SubscribeLocalEvent(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); diff --git a/Resources/Prototypes/Entities/Objects/Devices/Circuitboards/Machine/production.yml b/Resources/Prototypes/Entities/Objects/Devices/Circuitboards/Machine/production.yml index d6863d49a7..90597e8090 100644 --- a/Resources/Prototypes/Entities/Objects/Devices/Circuitboards/Machine/production.yml +++ b/Resources/Prototypes/Entities/Objects/Devices/Circuitboards/Machine/production.yml @@ -707,6 +707,26 @@ - 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 diff --git a/Resources/Prototypes/Entities/Structures/Machines/lathe.yml b/Resources/Prototypes/Entities/Structures/Machines/lathe.yml index 1c9976f8e5..0dae26e173 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/lathe.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/lathe.yml @@ -387,6 +387,7 @@ - HydroponicsTrayMachineCircuitboard - SolarControlComputerCircuitboard - SolarTrackerElectronics + - TurboItemRechargerCircuitboard - PowerComputerCircuitboard - AutolatheHyperConvectionMachineCircuitboard - ProtolatheHyperConvectionMachineCircuitboard @@ -751,7 +752,7 @@ - Sheet - type: StealTarget stealGroup: AmmoTechFabCircuitboard - + - type: entity id: MedicalTechFab parent: BaseLathe @@ -822,7 +823,7 @@ board: MedicalTechFabCircuitboard - type: StealTarget stealGroup: MedicalTechFabCircuitboard - + - type: entity parent: BaseLathe id: UniformPrinter diff --git a/Resources/Prototypes/Entities/Structures/Power/chargers.yml b/Resources/Prototypes/Entities/Structures/Power/chargers.yml index 7630610bd8..4e888b0b0b 100644 --- a/Resources/Prototypes/Entities/Structures/Power/chargers.yml +++ b/Resources/Prototypes/Entities/Structures/Power/chargers.yml @@ -109,6 +109,32 @@ - 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 @@ -157,7 +183,7 @@ map: ["enum.WiresVisualLayers.MaintenancePanel"] visible: false - type: Charger - baseChargeRate: 30 + chargeRate: 30 slotId: entity_storage whitelist: components: diff --git a/Resources/Prototypes/Recipes/Lathes/electronics.yml b/Resources/Prototypes/Recipes/Lathes/electronics.yml index 55337702b5..123b7f6036 100644 --- a/Resources/Prototypes/Recipes/Lathes/electronics.yml +++ b/Resources/Prototypes/Recipes/Lathes/electronics.yml @@ -38,6 +38,15 @@ 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 diff --git a/Resources/Prototypes/Research/industrial.yml b/Resources/Prototypes/Research/industrial.yml index f47d5a6398..d5edbd8f43 100644 --- a/Resources/Prototypes/Research/industrial.yml +++ b/Resources/Prototypes/Research/industrial.yml @@ -19,13 +19,14 @@ 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 index 0000000000000000000000000000000000000000..aec66639da0170393ee80572097d042fd6092343 GIT binary patch literal 918 zcmV;H18Mw;P)EX>4Tx04R}tkv&MmKpe$i(@M3rIM_kNAwzYtAS&W0RV;#q(pG5I!Q|2}Xws0R zxHt-~1qVMCs}3&Cx;nTDg5U>;i>s5Oi*kx9)Hhl#~v2g@DIN`^{2O&n2Fjq-)8 z%L?Z$&T6H`TKD8H4Cb|!G}md4AdV#@kc0>sHIz|-g($5WDJD|1AM4^DcKk_l$>b`7 zkz)Z>sE`~#_#gc4)+|g-x=Fzp(DP#3AESVO7iiXP`}^3on(uK!sNueF@IKG`KF{;H_kDO@K$osRR+pL}r^8)UvMv-3w9Vh61^@uu3oaC;lI)y` zF(R-PRFp?GKwY~#dz3vpH}k7_)c}|0sm3@I4gdh04mWPnw`x-=*GCUfA0dRYmG((T zM?eT^X=?(|>`$BycViq12S5nH=vC@I2pWGOOhX-Q^2- zHf!zSU#wktUu~EX>4Tx04R}tkv&MmKpe$i(@M3rIM_kNAwzYtAS&W0RV;#q(pG5I!Q|2}Xws0R zxHt-~1qVMCs}3&Cx;nTDg5U>;i>s5Oi*kx9)Hhl#~v2g@DIN`^{2O&n2Fjq-)8 z%L?Z$&T6H`TKD8H4Cb|!G}md4AdV#@kc0>sHIz|-g($5WDJD|1AM4^DcKk_l$>b`7 zkz)Z>sE`~#_#gc4)+|g-x=Fzp(DP#3AESVO7iiXP`}^3on(uK!sNueF@IKG`KF{;H_kDO@K$osRR+pL}r^8)UvMv-3w9Vh61^@uu3oaC;lI)y` zF(R-PRFp?GKwY~#dz3vpH}k7_)c}|0sm3@I4gdh04mWPnw`x-=*GCUfA0dRYmG((T zM?eT^X=?(|>`$BycViq12S5nH=vC@I2pWGOOhX-Q^2- zHf!zSU#wktUu~EX>4Tx04R}tkv&MmKpe$iTT8W89PA+CkfAzR5ET(8sbUcwvW#V(+gyEO`v6HZbn2KZkr>th56>;lcYWqlu8R`Ue#Jp)&2+h1(}GoPf_ z+gjuZ=-&n|uG^Zl2VCv|gHM{Mi?-yW=`9q1_cQvY958ST1lOG2TKhPC05a6o@(pls z2#gjfd)?*T-JQMtd#2Uj4{y|Rra;gy&;S4cc}YY;RCt{2*|80Q0T71aS7QY`D44-6 zR#1!D3U)CA#lM3UG{43Gf=KW@<{900000_y=G8MfDwigRj1n1ONcQ({7-MDh1ze Rs}cYJ002ovPDHLkV1n7e0igf@ literal 0 HcmV?d00001 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 index 0000000000000000000000000000000000000000..05a2890a67e8fdf2c5f5aee49ae28b948644e19c GIT binary patch literal 846 zcmV-U1F`&xP)EX>4Tx04R}tkv&MmKpe$iTT8W89PA+CkfAzR5ET(8sbUcwvW#V(+gyEO`v6HZbn2KZkr>th56>;lcYWqlu8R`Ue#Jp)&2+h1(}GoPf_ z+gjuZ=-&n|uG^Zl2VCv|gHM{Mi?-yW=`9q1_cQvY958ST1lOG2TKhPC05a6o@(pls z2#gjfd)?*T-JQMtd#2Uj4{y|Rra;gy&;S4dgh@m}RCt{2+cB<#FbsfUr#py~^&qgY zRo%QH?$AS4?E&(Z$5K%UCBZ=cZ>cy+K3a=twMKX*(lJreC zVjO=o*20T;iM1IRQsXDU`Uy0T4*&p=8S9^3kE{L9zdh^$dt&{E=yA1)Zy6f^00000 z0000008+AUPR(^bVKnHLi8#T00`ma@ZufMT%Eeej|4&^bt+%K6x4ZiH>nTN9N#E)C z`a>nSFP~2^N!ZZ@9m0=-pP-aw7@}@kZ?T6V`643k*E4z^f)AkY)L9-vQC2b}VoQCe zt|+Ty>o2N+*yXpx@B~;&@dN=_Zx224>;ZOi?aOB-0000000000002M+G+}>y-L&)T zTF)n>G?f5NI3MuY207LinKJ%XCR-Ehru9Wxh26r)K3f3K+7dYXrG`V8Y|mcNA0LAn z&nK)AQ~|S%u})p=)mNEX>4Tx04R}tkv&MmKpe$iTT8W89PA+CkfAzR5ET(8sbUcwvW#V(+gyEO`v6HZbn2KZkr>th56>;lcYWqlu8R`Ue#Jp)&2+h1(}GoPf_ z+gjuZ=-&n|uG^Zl2VCv|gHM{Mi?-yW=`9q1_cQvY958ST1lOG2TKhPC05a6o@(pls z2#gjfd)?*T-JQMtd#2Uj4{y|Rra;gy&;S4cLrFwIRA_wFvt!&>}Pu z9zGHT1D#1Wy4~aw00000-cojsYtm;XN!piNy{r1%|0{>~uiyg!0N_mn3QP(EuLKO6 P00000NkvXXu0mjf9f0GL literal 0 HcmV?d00001 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 index 0000000000000000000000000000000000000000..1bdf052387ecd1862e3e0a0e156d77658a1909be GIT binary patch literal 1886 zcmV-k2ch_hP) zaB^>EX>4U6ba`-PAZ2)IW&i+q+U-|cmfR=|{bv=k1SBB@%MoDC$qr`ubHT3as!AuR zB=a+8Vs}{}V?FK_j}FJ*UuO6V7gH)Bsg+!Fj<`}yl^u-|&+C*F(|+!YuUF_l>BId6 zLnV-McJpzKcj)!w151~_J?n$@%TBorT`z71WqDrS#uemcNchy#)erRw$@4=x*Kc;N zOQr36_1aGcFowdOaNt8o;(qe!Nf3opaXe{1_dwh(f_LkwU*i|<(0u~nz4d}$?3Z3X z;5ZH4(#kJ5U3${b@!KdpMnrt~%#RVJ7A-zrkNC||<~+{qJmmnm@|DyrmEFQXK$>KK zmT?#N;Jr6(y?Wyjt~>>IW$TICMSQ&$u>uBl!(5P{$99@%N*}c)n`em{Ff_$;zL1T}03d>IMKGxD zL@|>nWs1gZM8L6tA4lXYi5nOo4ax&iauUfPr||NPZ;bX>RzB5OUOCwxck89s?t_O6ECFHUVWW&X{GbD+bfiO% zeArQrdiX@GO_^!x%+qF>b^4vPi`8e=UYYwoYjm;3o2WI;K3Id=>}G=2a-xefFvf|% zxGe@y(7ZT{g;L_h+~O=&mVi}?5v4A21}(`jFUli|41)_S0ZMinc18cGkGUVV>74gQ;^1vB3lMYwIPzXvByQPeI zeicxJ37eGoW^3iQSyOTBCL6{kRCLFIgYh?I_|bq%-aMFNVXiBf3S@aDFeM}8Fe^q$ zX-}zKz#g4jJ4t!qVKn9|t@Vevn`D5sRU5tH)AxUv@6kH1q{w!79}pK;Cq)-2@xG+c zBE|=o_i^4khx_gWgnF5&X2&?7YL=0T$HZ)IMGU;68$qgJ3`oq>6X}HvJlEGfe0;x) z@+|Lrf36-SZ!*9q63;T-u!z@*r#CH~^FDEyl_Z7uoOsNj28kcJF1!53x#+OKGs8wE zHAfsK7K?2xw=pXjD)AI?L{T-$7qTuZoVPfuF6XU=)mk0S1huC{9Q&B}(0bx!pvY$wI1&OG~mDK79CsRZc*F zhoQS?DoN(CkQ;Qf=PX3wr>4Y{WeyW1@wZ@ZH%Y-wl@O4S5NF`xcWzrsn-KW$ z;R99FknMn<-<~pXORzJnTel9Yd{9sj!^>|^XAIEM!}#0 Y02}Ewnr@L;u>b%707*qoM6N<$f{Iybi~s-t literal 0 HcmV?d00001 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 index 0000000000..50271d1e33 --- /dev/null +++ b/Resources/Textures/Structures/Power/turbo_recharger.rsi/meta.json @@ -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 + ] + ] + } + ] +} -- 2.51.2