소스 검색

Add an option to estimate caloric value for a creature

master
Fen Dweller 4 년 전
부모
커밋
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) { if (config.autoPreyCapacity !== "none" && view.attributes.weight !== undefined && view.attributes.capacity === undefined) {
view.attributes.capacity = { view.attributes.capacity = {
name: "Capacity", name: "Capacity",
@@ -2772,6 +2781,18 @@ const settingsData = {
config.autoFoodIntake = param 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": { "auto-prey-capacity": {
name: "Estimate Prey Capacity", name: "Estimate Prey Capacity",
desc: "Guess how much prey creatures can hold, based on their mass", desc: "Guess how much prey creatures can hold, based on their mass",


불러오는 중...
취소
저장