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

Separate people-units into their own category. Add blocks as a unit

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

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

@@ -180,6 +180,11 @@ math.createUnit("footballFields", {
definition: "57600 feet^2",
prefixes: "long"
});
math.createUnit("blocks", {
definition: "20000 m^2",
prefixes: "long",
aliases: ["block", "blocks"]
});

math.createUnit("peopleInRural", {
definition: "0.02 miles^2"
@@ -334,31 +339,36 @@ const defaultUnits = {
metric: "meters",
customary: "feet",
relative: "stories",
quirky: "smoots"
quirky: "smoots",
human: "humans"
},
area: {
metric: "meters^2",
customary: "feet^2",
relative: "footballFields",
quirky: "nanoacres"
quirky: "nanoacres",
human: "peopleInCrowd"
},
volume: {
metric: "liters",
customary: "gallons",
relative: "olympicPools",
volume: "barnMegaparsecs"
volume: "barnMegaparsecs",
human: "people"
},
mass: {
metric: "kilograms",
customary: "lbs",
relative: "peopleMass",
quirky: "firkins"
quirky: "firkins",
human: "peopleMass"
},
energy: {
metric: "kJ",
customary: "kcal",
relative: "peopleEaten",
quirky: "donkeySeconds"
relative: "chickenNuggets",
quirky: "donkeySeconds",
human: "peopleEaten"
}
}

@@ -379,7 +389,6 @@ const unitChoices = {
"nauticalMiles",
],
"relative": [
"humans",
"stories",
"buses",
"marathons",
@@ -401,6 +410,9 @@ const unitChoices = {
"furlongs",
"HUs",
"fathoms",
],
"human": [
"humans",
]
},
area: {
@@ -415,18 +427,21 @@ const unitChoices = {
"miles^2"
],
"relative": [
"peopleInRural",
"peopleInManhattan",
"peopleInLooseCrowd",
"peopleInCrowd",
"peopleInDenseCrowd",
"pinHeads",
"dinnerPlates",
"footballFields"
"footballFields",
"blocks"
],
"quirky": [
"barns",
"nanoacres"
],
"human": [
"peopleInRural",
"peopleInManhattan",
"peopleInLooseCrowd",
"peopleInCrowd",
"peopleInDenseCrowd",
]
},
volume: {
@@ -443,7 +458,6 @@ const unitChoices = {
"gallons",
],
"relative": [
"people",
"shippingContainers",
"olympicPools",
"oceans",
@@ -453,6 +467,9 @@ const unitChoices = {
],
"quirky": [
"barnMegaparsecs"
],
"human": [
"people",
]
},
mass: {
@@ -468,7 +485,6 @@ const unitChoices = {
"tons"
],
"relative": [
"peopleMass",
"cars",
"busMasses",
"earthMass",
@@ -476,6 +492,9 @@ const unitChoices = {
],
"quirky": [
"firkins"
],
"human": [
"peopleMass",
]
},
energy: {
@@ -489,14 +508,16 @@ const unitChoices = {
],
"relative": [
"chickenNuggets",
],
"quirky": [
"donkeySeconds"
],
"human": [
"peopleEaten",
"villagesEaten",
"townsEaten",
"citiesEaten",
"metrosEaten",
],
"quirky": [
"donkeySeconds"
]
}
}
@@ -654,7 +675,6 @@ function updateInfo() {

if (capacity && prevSelectedEntity.currentView.weight) {
const containCount = math.divide(capacity, math.divide(prevSelectedEntity.currentView.weight, math.unit("80kg/people")));
console.log(containCount);
if (containCount > 0.1) {
text += selectedEntity.name + " can fit " + math.format(containCount, { precision: 1 }) + " of " + prevSelectedEntity.name + " inside them" + "\n"
}
@@ -663,7 +683,6 @@ function updateInfo() {
if (selectedEntity.currentView.energyIntake && prevSelectedEntity.currentView.energyValue) {
const consumeCount = math.divide(selectedEntity.currentView.energyIntake, prevSelectedEntity.currentView.energyValue);
console.log(consumeCount);
if (consumeCount > 0.1) {
text += selectedEntity.name + " needs to eat " + math.format(consumeCount, { precision: 1 }) + " of " + prevSelectedEntity.name + " per day" + "\n"
}
@@ -2919,7 +2938,8 @@ const settingsData = {
"metric",
"customary",
"relative",
"quirky"
"quirky",
"human"
],
get value() {
return config.units;


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