From 6e536789914d314a89959df95710069d4cf82eec Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Sat, 23 Apr 2022 15:21:12 -0500 Subject: [PATCH] Moved createModifierSection to modifiers.tsx --- src/data/common.tsx | 2 +- src/game/modifiers.tsx | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/data/common.tsx b/src/data/common.tsx index 0798adb..b258c88 100644 --- a/src/data/common.tsx +++ b/src/data/common.tsx @@ -5,7 +5,7 @@ import { GenericClickable } from "features/clickables/clickable"; import { GenericConversion } from "features/conversion"; -import { CoercableComponent, OptionsFunc, jsx, Replace, setDefault } from "features/feature"; +import { CoercableComponent, jsx, OptionsFunc, Replace, setDefault } from "features/feature"; import { displayResource } from "features/resources/resource"; import { createTreeNode, diff --git a/src/game/modifiers.tsx b/src/game/modifiers.tsx index 532473f..6e2acfe 100644 --- a/src/game/modifiers.tsx +++ b/src/game/modifiers.tsx @@ -113,3 +113,32 @@ export function createSequentialModifier(...modifiers: Modifier[]): Required, + base = 1, + unit = "" +) { + return ( +
+

+ {title} + {subtitle ? ({subtitle}) : null} +

+
+
+ + {base} + {unit} + + Base +
+ {renderJSX(unref(modifier.description))} +
+ Total: {format(modifier.apply(base))} + {unit} +
+ ); +}