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
🆑
add: Added powers to arithmetic circuit components.
/🆑
This commit is contained in:
Sarah C
2025-11-13 14:53:16 -05:00
committed by GitHub
parent 2558996d5b
commit d84c8c59f9
@@ -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