|
|
|
@@ -323,7 +323,8 @@ const config = { |
|
|
|
autoFit: false, |
|
|
|
drawYAxis: true, |
|
|
|
drawXAxis: false, |
|
|
|
autoFoodIntake: false |
|
|
|
autoFoodIntake: false, |
|
|
|
autoPreyCapacity: false |
|
|
|
} |
|
|
|
|
|
|
|
const availableEntities = { |
|
|
|
@@ -810,6 +811,15 @@ function makeEntity(info, views, sizes) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (config.autoPreyCapacity && view.attributes.weight !== undefined && view.attributes.capacity === undefined) { |
|
|
|
view.attributes.capacity = { |
|
|
|
name: "Capacity", |
|
|
|
power: 3, |
|
|
|
type: "volume", |
|
|
|
base: math.unit(0.2 * view.attributes.weight.base.toNumber("lbs") / 150, "people") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
Object.entries(view.attributes).forEach(([key, val]) => { |
|
|
|
Object.defineProperty( |
|
|
|
view, |
|
|
|
@@ -2033,7 +2043,7 @@ const settingsData = { |
|
|
|
}, |
|
|
|
"auto-food-intake": { |
|
|
|
name: "Estimate Food Intake", |
|
|
|
desc: "Guess how much food creatures need, based on their mass", |
|
|
|
desc: "Guess how much food creatures need, based on their mass -- 2000kcal per 150lbs", |
|
|
|
type: "toggle", |
|
|
|
default: false, |
|
|
|
get value() { |
|
|
|
@@ -2042,6 +2052,18 @@ const settingsData = { |
|
|
|
set value(param) { |
|
|
|
config.autoFoodIntake = param |
|
|
|
} |
|
|
|
}, |
|
|
|
"auto-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, |
|
|
|
get value() { |
|
|
|
return config.autoPreyCapacity |
|
|
|
}, |
|
|
|
set value(param) { |
|
|
|
config.autoPreyCapacity = param |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|