浏览代码

Show ratios between extra attributes and height

master
Fen Dweller 3 年前
父节点
当前提交
24754621b0
共有 2 个文件被更改,包括 17 次插入1 次删除
  1. +16
    -0
      macrovision.js
  2. +1
    -1
      presets/characters.js

+ 16
- 0
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";
}
}
}
});
}
}


+ 1
- 1
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")


正在加载...
取消
保存