diff --git a/presets/characters.js b/presets/characters.js index 1eac2179..89ec8e02 100644 --- a/presets/characters.js +++ b/presets/characters.js @@ -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 + } + }, }, [ { diff --git a/presets/naturals.js b/presets/naturals.js index ed6c6400..4745badf 100644 --- a/presets/naturals.js +++ b/presets/naturals.js @@ -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"], diff --git a/presets/objects.js b/presets/objects.js index b99c3471..2fd04429 100644 --- a/presets/objects.js +++ b/presets/objects.js @@ -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 = {};