From 24754621b02f83605c3f7b373284ffa1e680c9a6 Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Mon, 10 Jan 2022 14:13:28 -0600 Subject: [PATCH] Show ratios between extra attributes and height --- macrovision.js | 16 ++++++++++++++++ presets/characters.js | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/macrovision.js b/macrovision.js index de6c13b5..3eed5006 100644 --- a/macrovision.js +++ b/macrovision.js @@ -707,6 +707,22 @@ function updateInfo() { } } + + // todo needs a nice system for formatting this + + Object.entries(selectedEntity.currentView.attributes).forEach(([key, attr]) => { + if (key !== "height") { + if (attr.type === "length") { + const ratio = math.divide(selectedEntity.currentView[key], prevSelectedEntity.currentView.height) + + if (ratio > 1) { + text += selectedEntity.name + "'s " + attr.name + " is " + math.format(ratio, {precision: 2}) + " times longer than " + prevSelectedEntity.name + " is tall\n"; + } else { + text += selectedEntity.name + "'s " + attr.name + " is " + math.format(1/ratio, {precision: 2}) + " times shorter than " + prevSelectedEntity.name + " is tall\n"; + } + } + } + }); } } diff --git a/presets/characters.js b/presets/characters.js index 8012f0c6..d1ae3db8 100644 --- a/presets/characters.js +++ b/presets/characters.js @@ -54587,7 +54587,7 @@ characterMakers.push(() => makeCharacter( base: math.unit(7, "cm") }, "toeclawLength": { - name: "Toelaw Length", + name: "Toeclaw Length", power: 1, type: "length", base: math.unit(4.7, "cm")