From d84c8c59f97beea560cdadd8885dcbaeb61e80e7 Mon Sep 17 00:00:00 2001 From: Sarah C <93578146+SapphicOverload@users.noreply.github.com> Date: Thu, 13 Nov 2025 14:53:16 -0500 Subject: [PATCH] Adds power to arithmetic components (#93913) ## About The Pull Request Arithmetic circuit components are given the ability to calculate powers. ## Why It's Good For The Game This is necessary for certain calculations like finding the distance between two points, allowing greater creativity in circuit design. ## Changelog :cl: add: Added powers to arithmetic circuit components. /:cl: --- code/modules/wiremod/components/math/arithmetic.dm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/code/modules/wiremod/components/math/arithmetic.dm b/code/modules/wiremod/components/math/arithmetic.dm index 20474ec9492..d190c632119 100644 --- a/code/modules/wiremod/components/math/arithmetic.dm +++ b/code/modules/wiremod/components/math/arithmetic.dm @@ -5,6 +5,7 @@ #define COMP_ARITHMETIC_MODULO "Modulo" #define COMP_ARITHMETIC_MIN "Minimum" #define COMP_ARITHMETIC_MAX "Maximum" +#define COMP_ARITHMETIC_POWER "Power" /** * # Arithmetic Component @@ -38,6 +39,7 @@ COMP_ARITHMETIC_MODULO, COMP_ARITHMETIC_MIN, COMP_ARITHMETIC_MAX, + COMP_ARITHMETIC_POWER, ) arithmetic_option = add_option_port("Arithmetic Option", component_options) @@ -83,6 +85,8 @@ result = max(result, value) if(COMP_ARITHMETIC_MIN) result = min(result, value) + if(COMP_ARITHMETIC_POWER) + result = result ** value output.set_output(result) @@ -93,3 +97,4 @@ #undef COMP_ARITHMETIC_MODULO #undef COMP_ARITHMETIC_MIN #undef COMP_ARITHMETIC_MAX +#undef COMP_ARITHMETIC_POWER