Преглед изворни кода

Add a separate standard prey-capacity attribute

master
Fen Dweller пре 4 година
родитељ
комит
361f66fe69
2 измењених фајлова са 29 додато и 19 уклоњено
  1. +6
    -6
      macrovision.js
  2. +23
    -13
      presets/characters.js

+ 6
- 6
macrovision.js Прегледај датотеку

@@ -614,9 +614,9 @@ function updateInfo() {


text += prevSelectedEntity.name + " looks " + math.format(apparentHeight, { precision: 3}) + " tall to " + selectedEntity.name + "\n"; text += prevSelectedEntity.name + " looks " + math.format(apparentHeight, { precision: 3}) + " tall to " + selectedEntity.name + "\n";


if (selectedEntity.currentView.capacity && prevSelectedEntity.currentView.weight) {
const containCount = math.divide(selectedEntity.currentView.capacity, math.divide(prevSelectedEntity.currentView.weight, math.unit("80kg/people")));
if (selectedEntity.currentView.preyCapacity && prevSelectedEntity.currentView.weight) {
const containCount = math.divide(selectedEntity.currentView.preyCapacity, math.divide(prevSelectedEntity.currentView.weight, math.unit("80kg/people")));
console.log(containCount);
if (containCount > 0.1) { if (containCount > 0.1) {
text += selectedEntity.name + " can fit " + math.format(containCount, { precision: 1 }) + " of " + prevSelectedEntity.name + " inside them" + "\n" text += selectedEntity.name + " can fit " + math.format(containCount, { precision: 1 }) + " of " + prevSelectedEntity.name + " inside them" + "\n"
} }
@@ -1315,9 +1315,9 @@ function makeEntity(info, views, sizes, forms = {}) {
} }
} }


if (config.autoPreyCapacity !== "none" && view.attributes.weight !== undefined && view.attributes.capacity === undefined) {
view.attributes.capacity = {
name: "Capacity",
if (config.autoPreyCapacity !== "none" && view.attributes.weight !== undefined && view.attributes.preyCapacity === undefined) {
view.attributes.preyCapacity = {
name: "Prey Capacity",
power: 3, power: 3,
type: "volume", type: "volume",
base: math.unit((config.autoPreyCapacity == "same-size" ? 1 : 0.05) * 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")


+ 23
- 13
presets/characters.js Прегледај датотеку

@@ -48,6 +48,15 @@ function makeCharacter(info, viewInfo, defaultSizes, forms) {
} }
} }


if (value.preyCapacity) {
views[key].attributes.preyCapacity = {
name: "Prey Capacity",
power: 3,
type: "volume",
base: value.preyCapacity
}
}

if (value.energyNeed) { if (value.energyNeed) {
views[key].attributes.capacity = { views[key].attributes.capacity = {
name: "Food Intake", name: "Food Intake",
@@ -2061,7 +2070,7 @@ characterMakers.push(() => makeCharacter(
height: math.unit(12, "feet"), height: math.unit(12, "feet"),
weight: math.unit(3600, "lb"), weight: math.unit(3600, "lb"),
volume: math.unit(1000, "liters"), volume: math.unit(1000, "liters"),
capacity: math.unit(6, "people"),
preyCapacity: math.unit(6, "people"),
name: "Goo", name: "Goo",
image: { image: {
source: "./media/characters/fen/goo.svg", source: "./media/characters/fen/goo.svg",
@@ -2080,7 +2089,7 @@ characterMakers.push(() => makeCharacter(
height: math.unit(6.6, "feet"), height: math.unit(6.6, "feet"),
weight: math.unit(3000, "lb"), weight: math.unit(3000, "lb"),
volume: math.unit(1000, "liters"), volume: math.unit(1000, "liters"),
capacity: math.unit(6, "people"),
preyCapacity: math.unit(6, "people"),
name: "Goo (Ceiling)", name: "Goo (Ceiling)",
image: { image: {
source: "./media/characters/fen/goo-ceiling.svg" source: "./media/characters/fen/goo-ceiling.svg"
@@ -2119,7 +2128,7 @@ characterMakers.push(() => makeCharacter(
gooLounging: { gooLounging: {
height: math.unit(4.53, "feet"), height: math.unit(4.53, "feet"),
weight: math.unit(3000, "lb"), weight: math.unit(3000, "lb"),
capacity: math.unit(6, "people"),
preyCapacity: math.unit(6, "people"),
name: "Goo (Lounging)", name: "Goo (Lounging)",
image: { image: {
source: "./media/characters/fen/goo-lounging.svg", source: "./media/characters/fen/goo-lounging.svg",
@@ -8882,7 +8891,7 @@ characterMakers.push(() => makeCharacter(
front: { front: {
height: math.unit(14, "feet"), height: math.unit(14, "feet"),
weight: math.unit(1450, "kg"), weight: math.unit(1450, "kg"),
capacity: math.unit(15, "people"),
preyCapacity: math.unit(15, "people"),
name: "Front", name: "Front",
image: { image: {
source: "./media/characters/aura-starwind/front.svg", source: "./media/characters/aura-starwind/front.svg",
@@ -8893,7 +8902,7 @@ characterMakers.push(() => makeCharacter(
side: { side: {
height: math.unit(14, "feet"), height: math.unit(14, "feet"),
weight: math.unit(1450, "kg"), weight: math.unit(1450, "kg"),
capacity: math.unit(15, "people"),
preyCapacity: math.unit(15, "people"),
name: "Side", name: "Side",
image: { image: {
source: "./media/characters/aura-starwind/side.svg", source: "./media/characters/aura-starwind/side.svg",
@@ -8903,7 +8912,7 @@ characterMakers.push(() => makeCharacter(
taur: { taur: {
height: math.unit(18, "feet"), height: math.unit(18, "feet"),
weight: math.unit(5500, "kg"), weight: math.unit(5500, "kg"),
capacity: math.unit(50, "people"),
preyCapacity: math.unit(50, "people"),
name: "Taur", name: "Taur",
image: { image: {
source: "./media/characters/aura-starwind/taur.svg", source: "./media/characters/aura-starwind/taur.svg",
@@ -8913,7 +8922,7 @@ characterMakers.push(() => makeCharacter(
feral: { feral: {
height: math.unit(46, "feet"), height: math.unit(46, "feet"),
weight: math.unit(25000, "kg"), weight: math.unit(25000, "kg"),
capacity: math.unit(120, "people"),
preyCapacity: math.unit(120, "people"),
name: "Feral", name: "Feral",
image: { image: {
source: "./media/characters/aura-starwind/feral.svg" source: "./media/characters/aura-starwind/feral.svg"
@@ -26616,7 +26625,7 @@ characterMakers.push(() => makeCharacter(
front: { front: {
height: math.unit(6.71, "feet"), height: math.unit(6.71, "feet"),
weight: math.unit(200, "lb"), weight: math.unit(200, "lb"),
capacity: math.unit(1000000, "people"),
preyCapacity: math.unit(1000000, "people"),
name: "Front", name: "Front",
image: { image: {
source: "./media/characters/gliss/front.svg", source: "./media/characters/gliss/front.svg",
@@ -26627,7 +26636,7 @@ characterMakers.push(() => makeCharacter(
hammerspaceSize: { hammerspaceSize: {
height: math.unit(6.71 * 717, "feet"), height: math.unit(6.71 * 717, "feet"),
weight: math.unit(200, "lb"), weight: math.unit(200, "lb"),
capacity: math.unit(1000000, "people"),
preyCapacity: math.unit(1000000, "people"),
name: "Hammerspace Size", name: "Hammerspace Size",
image: { image: {
source: "./media/characters/gliss/front.svg", source: "./media/characters/gliss/front.svg",
@@ -26871,7 +26880,7 @@ characterMakers.push(() => makeCharacter(
belly: { belly: {
height: math.unit(33, "feet"), height: math.unit(33, "feet"),
name: "Belly", name: "Belly",
capacity: math.unit(500, "people"),
preyCapacity: math.unit(500, "people"),
image: { image: {
source: "./media/characters/mandarax/belly.svg" source: "./media/characters/mandarax/belly.svg"
} }
@@ -27212,7 +27221,7 @@ characterMakers.push(() => makeCharacter(
}, },
stomach: { stomach: {
height: math.unit(6.8, "feet"), height: math.unit(6.8, "feet"),
capacity: math.unit(20, "people"),
preyCapacity: math.unit(20, "people"),
name: "Stomach", name: "Stomach",
image: { image: {
source: "./media/characters/koros/stomach.svg" source: "./media/characters/koros/stomach.svg"
@@ -27388,7 +27397,7 @@ characterMakers.push(() => makeCharacter(
}, },
stomach: { stomach: {
height: math.unit(0.89, "feet"), height: math.unit(0.89, "feet"),
capacity: math.unit(4, "liters"),
preyCapacity: math.unit(4, "liters"),
name: "Stomach", name: "Stomach",
image: { image: {
source: "./media/characters/juri/stomach.svg" source: "./media/characters/juri/stomach.svg"
@@ -35258,13 +35267,14 @@ characterMakers.push(() => makeCharacter(
meowberusSide: { meowberusSide: {
height: math.unit(75, "feet"), height: math.unit(75, "feet"),
weight: math.unit(180000, "kg"), weight: math.unit(180000, "kg"),
preyCapacity: math.unit(50000, "people"),
name: "Side", name: "Side",
image: { image: {
source: "./media/characters/saphinara/meowberus-side.svg", source: "./media/characters/saphinara/meowberus-side.svg",
extra: 1400/711, extra: 1400/711,
bottom: 126/1526 bottom: 126/1526
}, },
form: "meowberus",
form: "meowberus"
}, },
}, },
[ [


Loading…
Откажи
Сачувај