Browse Source

Add volumes for planets; add a view for Gliss

master
Fen Dweller 5 years ago
parent
commit
8a5cfd87cb
3 changed files with 52 additions and 1 deletions
  1. +11
    -0
      presets/characters.js
  2. +1
    -1
      presets/naturals.js
  3. +40
    -0
      presets/objects.js

+ 11
- 0
presets/characters.js View File

@@ -22583,6 +22583,17 @@ characterMakers.push(() => makeCharacter(
bottom: 113/2462
}
},
hammerspaceSize: {
height: math.unit(6.71*717, "feet"),
weight: math.unit(200, "lb"),
capacity: math.unit(1000000, "people"),
name: "Hammerspace Size",
image: {
source: "./media/characters/gliss/front.svg",
extra: 2347/2231,
bottom: 113/2462
}
},
},
[
{


+ 1
- 1
presets/naturals.js View File

@@ -973,7 +973,7 @@ function makeGIS(data, category) {
function makeNaturals() {
const results = [];

results.push(makeHeightWeight(
results.push(makeHeightWeightSphere(
[
["Mercury", 4879, "km", 0.330e24, "kg", "./media/naturals/planet-generic.svg"],
["Venus", 12104, "km", 4.87e24, "kg", "./media/naturals/planet-generic.svg"],


+ 40
- 0
presets/objects.js View File

@@ -24,6 +24,15 @@ function makeObject(name, viewInfo) {
base: value.mass
};
}

if (value.volume) {
views[key].attributes.capacity = {
name: "Volume",
power: 3,
type: "volume",
base: value.volume
}
}
});

return makeEntity({ name: name }, views);
@@ -100,6 +109,37 @@ function makeHeightWeight(info, category, prefix = "", type = "objects") {
}
}


function makeHeightWeightSphere(info, category, prefix = "", type = "objects") {
const views = {};
info.forEach(object => {
let src;
// this lets us provide our own source if needed
// useful for reusing existing art
if (object[5]) {
src = object[5];
} else {
src = "./media/" + type + "/" + category.replace(/ /g, "-").toLowerCase() + "/" + prefix + object[0] + ".svg";
}
views[object[0]] = {
height: math.unit(object[1], object[2]),
mass: math.unit(object[3], object[4]),
volume: math.unit(Math.PI * 4 / 3 * Math.pow((object[1]/2), 3), object[2] + "^3"),
image: { source: src },
name: object[0].replace(/-/g, " ").replace(/\b\w/g, x => x.toUpperCase()),
rename: true
}
});

return {
name: category,
constructor: () => makeObject(
category,
views
)
}
}

function makeShoes() {
const views = {};



Loading…
Cancel
Save