const characterMakers = []; function makeCharacter(name, author, viewInfo, defaultSizes, defaultSize) { views = {}; console.log(viewInfo) Object.entries(viewInfo).forEach(([key, value]) => { console.log(key) views[key] = { attributes: { height: { name: "Height", power: 1, type: "length", base: value.height } }, image: value.image, name: value.name } if (value.mass) { views[key].attributes[key] = { name: "Mass", power: 3, type: "mass", base: value.mass }; } }); const entity = makeEntity(name, "author", views); if (defaultSizes) { entity.defaults = defaultSizes; } if (defaultSize) { entity.views[entity.defaultView].height = defaultSize; } return entity; } characterMakers["Fen"] = () => { return makeCharacter( "Fen", "chemicalcrux", { body: { height: math.unit(2.2428, "meter"), weight: math.unit(124.738, "kg"), name: "Body", image: { source: "./media/characters/fen/back.svg" } } }, [ { name: "Normal", height: math.unit(2.2428, "meter") }, { name: "Big", height: math.unit(12, "feet") }, { name: "Macro", height: math.unit(30, "meter") }, { name: "Macro+", height: math.unit(100, "meter") } ], math.unit(100, "meter") ) }; function makeSofia() { const views = { front: { attributes: { height: { name: "Height", power: 1, type: "length", base: math.unit(183, "cm") }, weight: { name: "Weight", power: 3, type: "mass", base: math.unit(80, "kg") } }, image: { source: "./media/characters/sofia/front.svg" }, name: "Front" }, back: { attributes: { height: { name: "Height", power: 1, type: "length", base: math.unit(183, "cm") }, weight: { name: "Weight", power: 3, type: "mass", base: math.unit(80, "kg") } }, image: { source: "./media/characters/sofia/back.svg" }, name: "Back" } }; const entity = makeEntity("Sofia", "ZakuraTech", views); entity.views.front.height = math.unit(96, "feet"); return entity; } function makeMarch() { const views = { front: { attributes: { height: { name: "Height", power: 1, type: "length", base: math.unit(7, "feet") }, weight: { name: "Weight", power: 3, type: "mass", base: math.unit(100, "kg") } }, image: { source: "./media/characters/march/front.svg" }, name: "Front" } }; const entity = makeEntity("March", "March-Dragon", views); entity.views.front.height = math.unit(2.98, "km"); return entity; } function makeNoir() { const views = { front: { attributes: { height: { name: "Height", power: 1, type: "length", base: math.unit(6, "feet") }, weight: { name: "Weight", power: 3, type: "mass", base: math.unit(60, "kg") } }, image: { source: "./media/characters/noir/front.svg", bottom: 0.01 }, name: "Front" } }; const entity = makeEntity("Noir", "March-Dragon", views); entity.views.front.height = math.unit(2.5, "km"); return entity; } function makeOkuri() { const views = { front: { attributes: { height: { name: "Height", power: 1, type: "length", base: math.unit(7, "feet") }, weight: { name: "Weight", power: 3, type: "mass", base: math.unit(100, "kg") } }, image: { source: "./media/characters/okuri/front.svg" }, name: "Front" }, back: { attributes: { height: { name: "Height", power: 1, type: "length", base: math.unit(7, "feet") }, weight: { name: "Weight", power: 3, type: "mass", base: math.unit(100, "kg") } }, image: { source: "./media/characters/okuri/back.svg" }, name: "Back" } }; const entity = makeEntity("Okuri", "OrionMechadragon", views); entity.views.front.height = math.unit(100, "miles"); return entity; } function makeManny() { const views = { front: { attributes: { height: { name: "Height", power: 1, type: "length", base: math.unit(7, "feet") }, weight: { name: "Weight", power: 3, type: "mass", base: math.unit(100, "kg") } }, image: { source: "./media/characters/manny/front.svg" }, name: "Front" }, back: { attributes: { height: { name: "Height", power: 1, type: "length", base: math.unit(7, "feet") }, weight: { name: "Weight", power: 3, type: "mass", base: math.unit(100, "kg") } }, image: { source: "./media/characters/manny/back.svg" }, name: "Back" } }; const entity = makeEntity("Manny", "Dialuca01", views); entity.views.front.height = math.unit(78, "feet"); return entity; } function makeAdake() { const views = { front: { attributes: { height: { name: "Height", power: 1, type: "length", base: math.unit(7, "feet") }, weight: { name: "Weight", power: 3, type: "mass", base: math.unit(100, "kg") } }, image: { source: "./media/characters/adake/front-1.svg" }, name: "Front" }, frontAlt: { attributes: { height: { name: "Height", power: 1, type: "length", base: math.unit(7, "feet") }, weight: { name: "Weight", power: 3, type: "mass", base: math.unit(100, "kg") } }, image: { source: "./media/characters/adake/front-2.svg", bottom: 0.005 }, name: "Front (Alt)" }, back: { attributes: { height: { name: "Height", power: 1, type: "length", base: math.unit(7, "feet") }, weight: { name: "Weight", power: 3, type: "mass", base: math.unit(100, "kg") } }, image: { source: "./media/characters/adake/back.svg", }, name: "Back" }, kneel: { attributes: { height: { name: "Height", power: 1, type: "length", base: math.unit(5.385, "feet") }, weight: { name: "Weight", power: 3, type: "mass", base: math.unit(100, "kg") } }, image: { source: "./media/characters/adake/kneel.svg", bottom: 0.05 }, name: "Kneeling" }, }; const entity = makeEntity("Adake", "Dialuca01", views); entity.views.front.height = math.unit(78, "feet"); return entity; } function makeElijah() { const views = { side: { attributes: { height: { name: "Height", power: 1, type: "length", base: math.unit(7, "feet") }, weight: { name: "Weight", power: 3, type: "mass", base: math.unit(50, "kg") } }, image: { source: "./media/characters/elijah/side.svg", bottom: 0.01 }, name: "Side" }, foot: { attributes: { height: { name: "Height", power: 1, type: "length", base: math.unit(2, "feet") } }, image: { source: "./media/characters/elijah/foot.svg", }, name: "Foot" } }; const entity = makeEntity("Elijah", "Elijah", views); entity.views.side.height = math.unit(175, "feet"); return entity; } function makeRai() { const views = { front: { attributes: { height: { name: "Height", power: 1, type: "length", base: math.unit(7, "feet") }, weight: { name: "Weight", power: 3, type: "mass", base: math.unit(80, "kg") } }, image: { source: "./media/characters/rai/front.svg" }, name: "Front" }, side: { attributes: { height: { name: "Height", power: 1, type: "length", base: math.unit(7, "feet") }, weight: { name: "Weight", power: 3, type: "mass", base: math.unit(80, "kg") } }, image: { source: "./media/characters/rai/side.svg" }, name: "Side" }, back: { attributes: { height: { name: "Height", power: 1, type: "length", base: math.unit(7, "feet") }, weight: { name: "Weight", power: 3, type: "mass", base: math.unit(80, "kg") } }, image: { source: "./media/characters/rai/back.svg" }, name: "Back" } }; const entity = makeEntity("Rai", "shadowblade945", views); entity.views.front.height = math.unit(302, "feet"); return entity; } function makeJazzy() { const views = { front: { attributes: { height: { name: "Height", power: 1, type: "length", base: math.unit(7, "feet") }, weight: { name: "Weight", power: 3, type: "mass", base: math.unit(80, "kg") } }, image: { source: "./media/characters/jazzy/front.svg", bottom: 0.01 }, name: "Front" }, back: { attributes: { height: { name: "Height", power: 1, type: "length", base: math.unit(7, "feet") }, weight: { name: "Weight", power: 3, type: "mass", base: math.unit(80, "kg") } }, image: { source: "./media/characters/jazzy/back.svg" }, name: "Back" } }; const entity = makeEntity("Jazzy", "Jazzywolf", views); entity.views.front.height = math.unit(216, "feet"); return entity; } function makeFlamm() { const views = { front: { attributes: { height: { name: "Height", power: 1, type: "length", base: math.unit(7, "feet") }, weight: { name: "Weight", power: 3, type: "mass", base: math.unit(80, "kg") } }, image: { source: "./media/characters/flamm/front.svg" }, name: "Front" } }; const entity = makeEntity("Flamm", "Flamm", views); entity.views.front.height = math.unit(200, "feet"); return entity; } function makeZephiro() { const views = { front: { attributes: { height: { name: "Height", power: 1, type: "length", base: math.unit(7, "feet") }, weight: { name: "Weight", power: 3, type: "mass", base: math.unit(80, "kg") } }, image: { source: "./media/characters/zephiro/front.svg" }, name: "Front" }, side: { attributes: { height: { name: "Height", power: 1, type: "length", base: math.unit(7, "feet") }, weight: { name: "Weight", power: 3, type: "mass", base: math.unit(80, "kg") } }, image: { source: "./media/characters/zephiro/side.svg" }, name: "Side" }, back: { attributes: { height: { name: "Height", power: 1, type: "length", base: math.unit(7, "feet") }, weight: { name: "Weight", power: 3, type: "mass", base: math.unit(80, "kg") } }, image: { source: "./media/characters/zephiro/back.svg" }, name: "Back" } }; const entity = makeEntity("Zephiro", "Zephiro", views); entity.views.front.height = math.unit(118, "feet"); entity.defaults.push({ name: "Micro", height: math.unit(3, "inches") }); entity.defaults.push({ name: "Normal", height: math.unit(5 + 3/12, "feet") }); entity.defaults.push({ name: "Macro", height: math.unit(118, "feet") }); return entity; } function makeFory() { const views = { front: { attributes: { height: { name: "Height", power: 1, type: "length", base: math.unit(7, "feet") }, weight: { name: "Weight", power: 3, type: "mass", base: math.unit(90, "kg") } }, image: { source: "./media/characters/fory/front.svg" }, name: "Front" } }; const entity = makeEntity("Fory", "Manny", views); entity.views.front.height = math.unit(50, "feet"); return entity; } function makeKurrikage() { const views = { front: { attributes: { height: { name: "Height", power: 1, type: "length", base: math.unit(7, "feet") }, weight: { name: "Weight", power: 3, type: "mass", base: math.unit(90, "kg") } }, image: { source: "./media/characters/kurrikage/front.svg" }, name: "Front" }, back: { attributes: { height: { name: "Height", power: 1, type: "length", base: math.unit(7, "feet") }, weight: { name: "Weight", power: 3, type: "mass", base: math.unit(90, "kg") } }, image: { source: "./media/characters/kurrikage/back.svg" }, name: "Back" }, paw: { attributes: { height: { name: "Height", power: 1, type: "length", base: math.unit(1.5, "feet") } }, image: { source: "./media/characters/kurrikage/paw.svg" }, name: "Paw" }, staff: { attributes: { height: { name: "Height", power: 1, type: "length", base: math.unit(6.7, "feet") } }, image: { source: "./media/characters/kurrikage/staff.svg" }, name: "Staff" }, peek: { attributes: { height: { name: "Height", power: 1, type: "length", base: math.unit(1.05, "feet") } }, image: { source: "./media/characters/kurrikage/peek.svg", bottom: 0.08 }, name: "Peeking" } }; const entity = makeEntity("Kurrikage", "Kurrikage", views); entity.views.front.height = math.unit(12, "feet"); return entity; } function makeShingo() { const views = { front: { attributes: { height: { name: "Height", power: 1, type: "length", base: math.unit(6, "feet") }, weight: { name: "Weight", power: 3, type: "mass", base: math.unit(75, "kg") } }, image: { source: "./media/characters/shingo/front.svg" }, name: "Front" } }; const entity = makeEntity("Shingo", "Threes", views); entity.defaults.push({ name: "Micro", height: math.unit(4, "inches") }); entity.defaults.push({ name: "Normal", height: math.unit(6, "feet") }); entity.defaults.push({ name: "Macro", height: math.unit(108, "feet") }); return entity; } function makeAigey() { const views = { side: { attributes: { height: { name: "Height", power: 1, type: "length", base: math.unit(6, "feet") }, weight: { name: "Weight", power: 3, type: "mass", base: math.unit(75, "kg") } }, image: { source: "./media/characters/aigey/side.svg" }, name: "Side" } }; const entity = makeEntity("Aigey", "Aigey", views); entity.defaults.push({ name: "Macro", height: math.unit(200, "feet") }); entity.defaults.push({ name: "Megamacro", height: math.unit(100, "miles") }); entity.views[entity.defaultView].height = math.unit(200, "feet"); return entity; } function makeNatasha() { const views = { side: { attributes: { height: { name: "Height", power: 1, type: "length", base: math.unit(6, "feet") }, weight: { name: "Weight", power: 3, type: "mass", base: math.unit(75, "kg") } }, image: { source: "./media/characters/natasha/front.svg" }, name: "Side" } }; const entity = makeEntity("Natasha", "Natasha", views); entity.defaults.push({ name: "Normal", height: math.unit(5 + 5/12, "feet") }); entity.defaults.push({ name: "Large", height: math.unit(12, "feet") }); entity.defaults.push({ name: "Macro", height: math.unit(100, "feet") }); entity.defaults.push({ name: "Macro+", height: math.unit(260, "feet") }); entity.defaults.push({ name: "Macro++", height: math.unit(1, "mile") }); entity.views[entity.defaultView].height = math.unit(100, "feet"); return entity; } function makeMalik() { const views = { front: { attributes: { height: { name: "Height", power: 1, type: "length", base: math.unit(6, "feet") }, weight: { name: "Weight", power: 3, type: "mass", base: math.unit(75, "kg") } }, image: { source: "./media/characters/malik/front.svg" }, name: "Front" }, side: { attributes: { height: { name: "Height", power: 1, type: "length", base: math.unit(6, "feet") }, weight: { name: "Weight", power: 3, type: "mass", base: math.unit(75, "kg") } }, image: { source: "./media/characters/malik/side.svg" }, name: "Side" }, back: { attributes: { height: { name: "Height", power: 1, type: "length", base: math.unit(6, "feet") }, weight: { name: "Weight", power: 3, type: "mass", base: math.unit(75, "kg") } }, image: { source: "./media/characters/malik/back.svg" }, name: "Back" }, }; const entity = makeEntity("Malik", "Fuzzypaws", views); entity.defaults.push({ name: "Macro", height: math.unit(156, "feet") }); entity.defaults.push({ name: "Macro+", height: math.unit(1188, "feet") }); entity.views[entity.defaultView].height = math.unit(156, "feet"); return entity; } function makeSefer() { const views = { front: { attributes: { height: { name: "Height", power: 1, type: "length", base: math.unit(6, "feet") }, weight: { name: "Weight", power: 3, type: "mass", base: math.unit(75, "kg") } }, image: { source: "./media/characters/sefer/front.svg" }, name: "Front" }, back: { attributes: { height: { name: "Height", power: 1, type: "length", base: math.unit(6, "feet") }, weight: { name: "Weight", power: 3, type: "mass", base: math.unit(75, "kg") } }, image: { source: "./media/characters/sefer/back.svg" }, name: "Back" }, }; const entity = makeEntity("Sefer", "Fuzzypaws", views); entity.views[entity.defaultView].height = math.unit(6, "feet"); return entity; } function makeMan() { const views = { body: { attributes: { height: { name: "Height", power: 1, type: "length", base: math.unit(2, "meter") }, weight: { name: "Weight", power: 3, type: "mass", base: math.unit(80, "kg") } }, image: { source: "./man.svg" }, name: "Body" } }; return makeEntity("Man", "Fen", views); } function makeCharacters() { const results = []; results.push({ name: "Sofia", constructor: makeSofia }); results.push({ name: "March", constructor: makeMarch }); results.push({ name: "Noir", constructor: makeNoir }); results.push({ name: "Okuri", constructor: makeOkuri }); results.push({ name: "Manny", constructor: makeManny }); results.push({ name: "Adake", constructor: makeAdake }); results.push({ name: "Elijah", constructor: makeElijah }); results.push({ name: "Rai", constructor: makeRai }); results.push({ name: "Jazzy", constructor: makeJazzy }); results.push({ name: "Flamm", constructor: makeFlamm }); results.push({ name: "Zephiro", constructor: makeZephiro }); results.push({ name: "Fory", constructor: makeFory }); results.push({ name: "Kurrikage", constructor: makeKurrikage }); results.push({ name: "Shingo", constructor: makeShingo }); results.push({ name: "Aigey", constructor: makeAigey }); results.push({ name: "Natasha", constructor: makeNatasha }); results.push({ name: "Malik", constructor: makeMalik }); results.push({ name: "Sefer", constructor: makeSefer }); results.push({ name: "Normal man", constructor: makeMan }); Object.entries(characterMakers).forEach(([key, value]) => { results.push({ name: key, constructor: value }); }); return results; }