Просмотр исходного кода

Add an option to estimate caloric value for a creature

master
Fen Dweller 4 лет назад
Родитель
Сommit
c9ce3b6c9a
1 измененных файлов: 21 добавлений и 0 удалений
  1. +21
    -0
      macrovision.js

+ 21
- 0
macrovision.js Просмотреть файл

@@ -1199,6 +1199,15 @@ function makeEntity(info, views, sizes, forms = {}) {
}
}

if (config.autoCaloricValue && view.attributes.weight !== undefined && view.attributes.energyWorth === undefined) {
view.attributes.energyNeed = {
name: "Caloric Value",
power: 3,
type: "energy",
base: math.unit(860 * view.attributes.weight.base.toNumber("lbs"), "kcal")
}
}

if (config.autoPreyCapacity !== "none" && view.attributes.weight !== undefined && view.attributes.capacity === undefined) {
view.attributes.capacity = {
name: "Capacity",
@@ -2772,6 +2781,18 @@ const settingsData = {
config.autoFoodIntake = param
}
},
"auto-caloric-value": {
name: "Estimate Caloric Value",
desc: "Guess how much food a creature is worth -- 860kcal per pound",
type: "toggle",
default: false,
get value() {
return config.autoCaloricValue
},
set value(param) {
config.autoCaloricValue = param
}
},
"auto-prey-capacity": {
name: "Estimate Prey Capacity",
desc: "Guess how much prey creatures can hold, based on their mass",


Загрузка…
Отмена
Сохранить