Skip to content

Commit

Permalink
Add SoSo pop script
Browse files Browse the repository at this point in the history
  • Loading branch information
hymccord committed Apr 25, 2024
1 parent e7033d2 commit bfc1f55
Show file tree
Hide file tree
Showing 7 changed files with 192 additions and 30 deletions.
1 change: 1 addition & 0 deletions build/process-population.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"data/pop-csv/queso-geyser.csv",
"data/pop-csv/queso-river.csv",
"data/pop-csv/ronza.csv",
"data/pop-csv/school-of-sorcery.csv",
"data/pop-csv/table-of-contents.csv",
"data/pop-csv/town-of-digby.csv",
"data/pop-csv/town-of-gnawnia.csv",
Expand Down
12 changes: 12 additions & 0 deletions data/_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@ var json2csv = require("json2csv");
var _ = require("lodash");
var Combinatorics = require("js-combinatorics");

/**
* @typedef {Object} AttractionData
* @property {string} location
* @property {string} stage
* @property {string} cheese
* @property {string} charm
* @property {string} attraction
* @property {string} mouse
* @property {number} sample
* @property {number} seen
*/

// Location,Phase,Cheese,Charm,Attraction Rate,Mouse,Sample Size
exports.POP_FIELDS = [
{ label: "Location", value: "location" },
Expand Down
31 changes: 31 additions & 0 deletions data/pop-csv/school-of-sorcery.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"Location","Phase","Cheese","Charm","Attraction Rate","Mouse","Sample Size"
"School of Sorcery","Hallway","SB+/Gouda/Brie/Apprentice Ambert/Master Mimolette","-","100%","Hall Monitor",1
"School of Sorcery","Arcane Arts","SB+/Gouda/Brie","-","41.18%","Broomstick Bungler",1394
"School of Sorcery","Arcane Arts","SB+/Gouda/Brie","-","38.52%","Perpetual Detention",1394
"School of Sorcery","Arcane Arts","SB+/Gouda/Brie","-","20.30%","Misfortune Teller",1394
"School of Sorcery","Arcane Arts","Apprentice Ambert","-","45.40%","Invisible Fashionista",1749
"School of Sorcery","Arcane Arts","Apprentice Ambert","-","40.02%","Arcana Overachiever",1749
"School of Sorcery","Arcane Arts","Apprentice Ambert","-","14.58%","Enchanted Chess Club Champion",1749
"School of Sorcery","Arcane Arts","Master Mimolette","-","44.89%","Featherlight",323
"School of Sorcery","Arcane Arts","Master Mimolette","-","37.46%","Illustrious Illusionist",323
"School of Sorcery","Arcane Arts","Master Mimolette","-","17.65%","Constructively Critical Artist",323
"School of Sorcery","Shadow Sciences","SB+/Gouda/Brie","-","40.91%","Uncoordinated Cauldron Carrier",1227
"School of Sorcery","Shadow Sciences","SB+/Gouda/Brie","-","39.85%","Mixing Mishap",1227
"School of Sorcery","Shadow Sciences","SB+/Gouda/Brie","-","19.23%","Bookworm",1227
"School of Sorcery","Shadow Sciences","Apprentice Ambert","-","42.97%","Audacious Alchemist",1720
"School of Sorcery","Shadow Sciences","Apprentice Ambert","-","40.87%","Classroom Keener",1720
"School of Sorcery","Shadow Sciences","Apprentice Ambert","-","16.16%","Prestigious Prestidigitator",1720
"School of Sorcery","Shadow Sciences","Master Mimolette","-","48.87%","Teleporting Truant",309
"School of Sorcery","Shadow Sciences","Master Mimolette","-","37.22%","Classroom Disrupter",309
"School of Sorcery","Shadow Sciences","Master Mimolette","-","13.92%","Magical Multitasker",309
"School of Sorcery","Final Exam - Arcane","Master Mimolette","-","34.82%","Featherlight",112
"School of Sorcery","Final Exam - Arcane","Master Mimolette","-","33.93%","Illustrious Illusionist",112
"School of Sorcery","Final Exam - Arcane","Master Mimolette","-","27.68%","Constructively Critical Artist",112
"School of Sorcery","Final Exam - Arcane","Master Mimolette","-","3.57%","Tyrannical Thaumaturge",112
"School of Sorcery","Final Exam - Shadow","Master Mimolette","-","36.36%","Teleporting Truant",110
"School of Sorcery","Final Exam - Shadow","Master Mimolette","-","32.73%","Classroom Disrupter",110
"School of Sorcery","Final Exam - Shadow","Master Mimolette","-","18.18%","Magical Multitasker",110
"School of Sorcery","Final Exam - Shadow","Master Mimolette","-","12.73%","Data Devourer",110
"School of Sorcery","Arcane Arts - Boss","SB+/Gouda/Brie/Apprentice Ambert/Master Mimolette","-","100%","Arcane Master Sorcerer",1
"School of Sorcery","Shadow Sciences - Boss","SB+/Gouda/Brie/Apprentice Ambert/Master Mimolette","-","100%","Shadow Master Sorcerer",1
"School of Sorcery","Final Exam Boss - Boss","SB+/Gouda/Brie/Apprentice Ambert/Master Mimolette","-","100%","Mythical Master Sorcerer",1
4 changes: 2 additions & 2 deletions data/pop-js/_template.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ module.exports = {
],
/**
*
* @param {{stage: string, location: string, cheese: string, mouse: string, attraction: string, sample: number}[]} data
* @returns {{stage: string, location: string, cheese: string, mouse: string, attraction: string, sample: number}[]}
* @param {import('../_utils').AttractionData[]} data
* @returns {import('../_utils').AttractionData[]}
*/
postProcess: function(data) {
return data;
Expand Down
145 changes: 145 additions & 0 deletions data/pop-js/school-of-sorcery.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
const utils = require("../_utils");

const stages = ["Arcane Arts", "Shadow Sciences", "Final Exam - Arcane", "Final Exam - Shadow"];
const cheeses = ["Standard", "Apprentice Ambert", "Master Mimolette"];

const miceByStageThenCheese = {
"Arcane Arts": {
"Standard": [
"Perpetual Detention",
"Broomstick Bungler",
"Misfortune Teller",
],
"Apprentice Ambert": [
"Arcana Overachiever",
"Invisible Fashionista",
"Enchanted Chess Club Champion",
],
"Master Mimolette": [
"Illustrious Illusionist",
"Featherlight",
"Constructively Critical Artist",
]
},
"Shadow Sciences": {
"Standard": [
"Mixing Mishap",
"Uncoordinated Cauldron Carrier",
"Bookworm",
],
"Apprentice Ambert": [
"Classroom Keener",
"Audacious Alchemist",
"Prestigious Prestidigitator",
],
"Master Mimolette": [
"Classroom Disrupter",
"Teleporting Truant",
"Magical Multitasker",
]
}
}

// Instead of repeating a lot of line just use previous pools
miceByStageThenCheese["Final Exam - Arcane"] = {
"Standard": [
...miceByStageThenCheese["Arcane Arts"]["Standard"],
"Sleep Starved Scholar",
],
"Apprentice Ambert": [
...miceByStageThenCheese["Arcane Arts"]["Apprentice Ambert"],
"Class Clown",
],
"Master Mimolette": [
...miceByStageThenCheese["Arcane Arts"]["Master Mimolette"],
"Tyrannical Thaumaturge",
]
};

miceByStageThenCheese["Final Exam - Shadow"] = {
"Standard": [
...miceByStageThenCheese["Shadow Sciences"]["Standard"],
"Cheat Sheet Conjurer",
],
"Apprentice Ambert": [
...miceByStageThenCheese["Shadow Sciences"]["Apprentice Ambert"],
"Celestial Summoner",
],
"Master Mimolette": [
...miceByStageThenCheese["Shadow Sciences"]["Master Mimolette"],
"Data Devourer",
]
}

const standardCheeseVarItem = {
vars: {
cheese: {
Brie: true,
"Empowered Brie": true,
Gouda: true,
"SB+": true,
"ESB+": true,
}
},
fields: {
cheese: "SB+/Gouda/Brie"
}
}

function genSeries() {
const series = [];
for (const stage of stages) {
for (const cheese of cheeses) {
const config = {
stage: utils.genVarField("stage", stage),
cheese: utils.genVarField("cheese", cheese),
config: [
{
opts: {
include: miceByStageThenCheese[stage][cheese]
}
}
]
};

// Replace the standard placeholder with actual multi cheese config (see above)
if (cheese === "Standard") {
config.cheese[0] = standardCheeseVarItem;
}

series.push(config);
}
}

return series;
}

module.exports = {
default: {
location: utils.genVarField("location", "School of Sorcery"),
},
series: genSeries(),
/**
*
* @param {import('../_utils').AttractionData[]} data
* @returns {import('../_utils').AttractionData[]}
*/
postProcess: function(data) {

// Put this first
data.unshift(
// Hallway, why are you here!
{location: "School of Sorcery", cheese: "SB+/Gouda/Brie/Apprentice Ambert/Master Mimolette", stage: "Hallway", mouse: "Hall Monitor", attraction: "100%", sample: 1},
);

// These last
data.push(
// Manually add boss stages
{location: "School of Sorcery", cheese: "SB+/Gouda/Brie/Apprentice Ambert/Master Mimolette", stage: "Arcane Arts - Boss", mouse: "Arcane Master Sorcerer", attraction: "100%", sample: 1},
{location: "School of Sorcery", cheese: "SB+/Gouda/Brie/Apprentice Ambert/Master Mimolette", stage: "Shadow Sciences - Boss", mouse: "Shadow Master Sorcerer", attraction: "100%", sample: 1},
{location: "School of Sorcery", cheese: "SB+/Gouda/Brie/Apprentice Ambert/Master Mimolette", stage: "Final Exam Boss - Boss", mouse: "Mythical Master Sorcerer", attraction: "100%", sample: 1},
);

return data;
}
}
28 changes: 0 additions & 28 deletions data/populations.csv
Original file line number Diff line number Diff line change
Expand Up @@ -2852,31 +2852,3 @@ Twisted Garden,Poured,Lunaria Camembert,-,29.63%,Twisted Carmine,
Twisted Garden,Poured,Lunaria Camembert,Shattering,38.86%,Camofusion,
Twisted Garden,Poured,Lunaria Camembert,Shattering,36.57%,Fungal Spore,
Twisted Garden,Poured,Lunaria Camembert,Shattering,24.57%,Shattered Carmine,
School of Sorcery,Hallway,SB+/Gouda/Brie,-,100.00%,Hall Monitor,
School of Sorcery,Arcane Arts,SB+/Gouda/Brie,-,33.33%,Perpetual Detention,
School of Sorcery,Arcane Arts,SB+/Gouda/Brie,-,33.33%,Broomstick Bungler,
School of Sorcery,Arcane Arts,SB+/Gouda/Brie,-,33.33%,Misfortune Teller,
School of Sorcery,Arcane Arts,Apprentice Ambert,-,40.00%,Arcana Overachiever,
School of Sorcery,Arcane Arts,Apprentice Ambert,-,45.00%,Invisible Fashionista,
School of Sorcery,Arcane Arts,Apprentice Ambert,-,15.00%,Enchanted Chess Club Champion,
School of Sorcery,Arcane Arts,Master Mimolette,-,40.00%,Illustrious Illusionist,
School of Sorcery,Arcane Arts,Master Mimolette,-,45.00%,Featherlight,
School of Sorcery,Arcane Arts,Master Mimolette,-,15.00%,Constructively Critical Artist,
School of Sorcery,Arcane Arts - Boss,SB+/Gouda/Brie/Apprentice Ambert/Master Mimolette,-,100.00%,Arcane Master Sorcerer,
School of Sorcery,Shadow Sciences,SB+/Gouda/Brie,-,33.33%,Mixing Mishap,
School of Sorcery,Shadow Sciences,SB+/Gouda/Brie,-,33.33%,Uncoordinated Cauldron Carrier,
School of Sorcery,Shadow Sciences,SB+/Gouda/Brie,-,33.33%,Bookworm,
School of Sorcery,Shadow Sciences,Apprentice Ambert,-,40.00%,Classroom Keener,
School of Sorcery,Shadow Sciences,Apprentice Ambert,-,45.00%,Audacious Alchemist,
School of Sorcery,Shadow Sciences,Apprentice Ambert,-,15.00%,Prestigious Prestidigitator,
School of Sorcery,Shadow Sciences,Master Mimolette,-,40.00%,Classroom Disrupter,
School of Sorcery,Shadow Sciences,Master Mimolette,-,45.00%,Teleporting Truant,
School of Sorcery,Shadow Sciences,Master Mimolette,-,15.00%,Magical Multitasker,
School of Sorcery,Shadow Sciences - Boss,SB+/Gouda/Brie/Apprentice Ambert/Master Mimolette,-,100.00%,Shadow Master Sorcerer,
School of Sorcery,Final Exam - Arcane,SB+/Gouda/Brie,-,100.00%,Sleep Starved Scholar,
School of Sorcery,Final Exam - Arcane,Apprentice Ambert,-,100.00%,Class Clown,
School of Sorcery,Final Exam - Arcane,Master Mimolette,-,100.00%,Tyrannical Thaumaturge,
School of Sorcery,Final Exam - Shadow,SB+/Gouda/Brie,-,100.00%,Cheat Sheet Conjurer,
School of Sorcery,Final Exam - Shadow,Apprentice Ambert,-,100.00%,Celestial Summoner,
School of Sorcery,Final Exam - Shadow,Master Mimolette,-,100.00%,Data Devourer,
School of Sorcery,Final Exam - Boss,SB+/Gouda/Brie/Apprentice Ambert/Master Mimolette,-,100.00%,Mythical Master Sorcerer,
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"pop:prickly": "node data/pop prickly-plains > data/pop-csv/prickly-plains.csv",
"pop:queso": "node data/pop queso-river > data/pop-csv/queso-river.csv",
"pop:ronza": "node data/pop ronza > data/pop-csv/ronza.csv",
"pop:soso": "node data/pop school-of-sorcery > data/pop-csv/school-of-sorcery.csv",
"pop:toc": "node data/pop table-of-contents > data/pop-csv/table-of-contents.csv",
"pop:toxic": "node data/pop toxic-spill > data/pop-csv/toxic-spill.csv",
"pop:vrift": "node data/pop valour-rift > data/pop-csv/valour-rift.csv",
Expand Down

0 comments on commit bfc1f55

Please sign in to comment.