From a06e45b7f680e3ad6f7d66bfac6860266ebb8bf9 Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Sat, 9 May 2020 14:01:31 -0400 Subject: [PATCH] Add Gliss; allow characters to have a capacity This also fixes a bug that caused the initial value for each attribute to be wrong if the default unit didn't match the unit used internally. --- macrovision.js | 16 +- media/attribution.js | 12 + media/characters/gliss/front.svg | 1018 ++++++++++++++++++++++++++++++ presets/characters.js | 32 + 4 files changed, 1076 insertions(+), 2 deletions(-) create mode 100644 media/characters/gliss/front.svg diff --git a/macrovision.js b/macrovision.js index 7a35bd78..d03e7a75 100644 --- a/macrovision.js +++ b/macrovision.js @@ -110,6 +110,11 @@ math.createUnit("multiverses", { prefixes: "long" }); +math.createUnit("people", { + definition: "75 liters", + prefixes: "long" +}); + const unitChoices = { length: [ "meters", @@ -138,6 +143,13 @@ const unitChoices = { "acres", "miles^2" ], + volume: [ + "liters", + "milliliters", + "m^3", + "gallons", + "people" + ], mass: [ "kilograms", "milligrams", @@ -791,8 +803,6 @@ function configViewOptions(entity, view) { input.setAttribute("type", "number"); input.setAttribute("min", 1); - setNumericInput(input, entity.views[view][key].value); - const select = document.createElement("select"); select.classList.add("options-field-unit"); select.id = "options-view-" + key + "-select" @@ -822,6 +832,8 @@ function configViewOptions(entity, view) { }) select.setAttribute("oldUnit", select.value); + + setNumericInput(input, entity.views[view][key].toNumber(select.value)); // TODO does this ever cause a change in the world? select.addEventListener("input", e => { diff --git a/media/attribution.js b/media/attribution.js index 99646852..6087416d 100644 --- a/media/attribution.js +++ b/media/attribution.js @@ -9695,6 +9695,18 @@ const attributionData = { "makar-ro" ] }, + { + prefix: "./media/characters/gliss/", + files: [ + { name: "front.svg", source: "https://www.furaffinity.net/view/18718168/" } + ], + authors: [ + "xanaomin" + ], + owners: [ + "xanaomin" + ] + }, //characters { prefix: "./media/dildos/chance/", diff --git a/media/characters/gliss/front.svg b/media/characters/gliss/front.svg new file mode 100644 index 00000000..dc7d13b1 --- /dev/null +++ b/media/characters/gliss/front.svg @@ -0,0 +1,1018 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/presets/characters.js b/presets/characters.js index dca2c134..52240a6c 100644 --- a/presets/characters.js +++ b/presets/characters.js @@ -27,6 +27,15 @@ function makeCharacter(info, viewInfo, defaultSizes) { base: value.weight }; } + + if (value.capacity) { + views[key].attributes.capacity = { + name: "Capacity", + power: 3, + type: "volume", + base: value.capacity + } + } }); return createEntityMaker(info, views, defaultSizes); @@ -22560,6 +22569,29 @@ characterMakers.push(() => makeCharacter( ] )) +characterMakers.push(() => makeCharacter( + { name: "Gliss" }, + { + front: { + height: math.unit(6.71, "feet"), + weight: math.unit(200, "lb"), + capacity: math.unit(1000000, "people"), + name: "Front", + image: { + source: "./media/characters/gliss/front.svg", + extra: 2347/2231, + bottom: 113/2462 + } + }, + }, + [ + { + name: "Normal", + height: math.unit(6.71, "feet"), + default: true + }, + ] +)) //characters