瀏覽代碼

Allow choosing between realistic and same-size prey capacity

master
Fen Dweller 5 年之前
父節點
當前提交
8383ba0f74
共有 1 個檔案被更改,包括 13 行新增8 行删除
  1. +13
    -8
      macrovision.js

+ 13
- 8
macrovision.js 查看文件

@@ -811,12 +811,12 @@ function makeEntity(info, views, sizes) {
} }
} }


if (config.autoPreyCapacity && view.attributes.weight !== undefined && view.attributes.capacity === undefined) {
if (config.autoPreyCapacity !== "none" && view.attributes.weight !== undefined && view.attributes.capacity === undefined) {
view.attributes.capacity = { view.attributes.capacity = {
name: "Capacity", name: "Capacity",
power: 3, power: 3,
type: "volume", type: "volume",
base: math.unit(0.2 * view.attributes.weight.base.toNumber("lbs") / 150, "people")
base: math.unit((config.autoPreyCapacity == "same-size" ? 1 : 0.05) * view.attributes.weight.base.toNumber("lbs") / 150, "people")
} }
} }


@@ -2055,16 +2055,21 @@ const settingsData = {
}, },
"auto-prey-capacity": { "auto-prey-capacity": {
name: "Estimate Prey Capacity", name: "Estimate Prey Capacity",
desc: "Guess how many people a creature could eat, based on its mass -- 1 person per 750lbs",
type: "toggle",
default: false,
desc: "Guess how much prey creatures can hold, based on their mass",
type: "select",
default: "none",
options: [
"none",
"realistic",
"same-size"
],
get value() { get value() {
return config.autoPreyCapacity
return config.autoPreyCapacity;
}, },
set value(param) { set value(param) {
config.autoPreyCapacity = param
config.autoPreyCapacity = param;
} }
}
},
} }


function getBoundingBox(entities, margin = 0.05) { function getBoundingBox(entities, margin = 0.05) {


Loading…
取消
儲存