create_memorabilia.js

import { createTimeSeries } from "./create_time_series.js";
import { ENCUMBRANCE, VALUE_MULTIPLIER } from "./constants.js";
import { logger } from "./utils.js";
import { random } from "./random_utils.js";
import { titleCase } from "./string_utils.js";
import Item from "./models/item.js";
import RarityTable from "./tables/rarity_table.js";

// Items could be signed tag=signed would double their value or something like that
const F4 = [
  "Astoundingly Awesome Tales",
  "Guns and Bullets",
  "Hot Rodder",
  "La Coiffe",
  "Massachusetts Surgical Journal",
  "Taboo Tattoos",
  "Tales of a Junktown Jerky Vendor",
  "Tesla Science",
  "Total Hack",
  "Tumblers Today",
  "U.S.Covert Operations Manual",
  "Wasteland Survival Guide ",
];

export const MEMORABILIA = [];

const memorabilia = new RarityTable({ useStrict: false });

// A function-making function to generate printed serials.
function printed(printedType, tags, memorabilia) {
  return function (name, params) {
    createTimeSeries(params).forEach(function (date, i, coll) {
      let series = { title: name, issue: i, total: coll.length, pubDate: date };
      let item = new Item({
        name: printedType,
        enc: ENCUMBRANCE.tiny,
        value: VALUE_MULTIPLIER["rare"],
        frequency: "rare",
        series,
        tags: tags,
      });
      memorabilia.add("rare", item);
      MEMORABILIA.push(item);
    });
  };
}

function addNewsMagazines(memorabilia) {
  let addNews = printed("news magazine", ["collectible", "magazine", "news-magazine"], memorabilia);
  addNews("Atlantic Dispatch Magazine", { period: "weekly" });
  addNews("The Weekly Nation", {
    period: "weekly",
    dayOfWeek: "Monday",
    startDate: "1953-12-31",
  });
  addNews("Verve", {
    period: "monthly",
    format: "short",
    dayOfWeek: "Thursday",
  });
}
function addComicBooks(memorabilia) {
  let addComic = printed("comic book", ["collectible", "comic", "comic-book"], memorabilia);

  addComic("Atomic Age Combat", {
    period: "monthly",
    startDate: "1956-11-31",
    format: "short",
  });
  addComic("Atomic War Comics", {
    period: "bimonthly",
    startDate: "1953-11-31",
    format: "short",
  });
  addComic("Battlefield Action", {
    period: "monthly",
    format: "short",
  });
  addComic("Black Cobra", { period: "monthly", format: "short" });
  addComic("Blazing West", {
    period: "bimonthly",
    startDate: "1948-10-10",
  });
  addComic("Forbidden Worlds", {
    period: "monthly",
    format: "short",
  });
  addComic("Giggle Comics", { period: "weekly" });
  addComic("Madhouse Comics", { period: "monthly", format: "short" });
  addComic("Midnight Mystery", {
    period: "biweekly",
    startDate: "1955-06-06",
  });
  addComic("Space Action", { period: "monthly", format: "short" });
  addComic("The Adventures of Captain Atom", {
    period: "monthly",
    format: "short",
  });
  addComic("The Flame", { period: "monthly", format: "short" });
  addComic("The Hand of Fate", { period: "monthly", format: "short" });
  addComic("War Stories", {
    period: "weekly",
    startDate: "1956-02-15",
  });
  addComic("Wonder Boy", { period: "monthly", format: "short" });
}

const bbCards = {
  "Baltimore Orioles": [
    "George Zuverink",
    "Jim Busby",
    "George Kell",
    "Joe Ginsberg",
    "Billy O'Dell",
    "Joe Durham",
    "Billy Gardner",
    "Jerry Walker",
    "Eddie Miksis",
    "Ken Lehman",
    "Bob Nieman",
    "Willy Miranda",
    "Art Ceccarelli",
    "Jack Harshman",
    "Frank Zupo",
    "Al Pilaik",
    "Connie Johnson",
    "Bob Boyd",
    "Brooks Robinson",
    "Bert Hamric",
    "Billy Loes",
    "Hal Brown",
    "Gene Woodling",
    "Foster Castleman",
    "Gus Triandos",
    "Jim Marshall",
    "Milt Pappas",
    "Arnie Portocarrero",
    "Lenny Green",
  ],
  "Boston Red Sox": [
    "Ted Williams",
    "Frank Sullivan",
    "Ted Lepcio",
    "Dick Gernert",
    "Dave Sisler",
    "Pete Daley",
    "Billy Klaus",
    "Jackie Jensen",
    "Billy Consolo",
    "Frank Baumann",
    "George Susce",
    "Haywood Sullivan",
    "Leo Kiely",
    "Tom Brewer",
    "Gene Stephens",
    "Frank Malzone",
    "Pete Runnels",
    "Jim Piersall",
    "Don Buddin",
    "Ike Delock",
    "Bob Porterfield",
    "Mike Fornieles",
    "Marty Keough",
    "Lou Berberet",
    "Willard Nixon",
    "Murray Wall",
    "Sammy White",
    "Bob Smith",
    "Bill Renna",
    "Frank Malzone",
    "Ted Williams",
    "Jackie Jensen",
  ],
  "Chicago Cubs": [
    "Dale Long",
    "Cal Neeman",
    "Dave Hillman",
    "Lee Walls",
    "Dick Drott",
    "Chuck Tanner",
    "Bobby Adams",
    "Walt Moryn",
    "Moe Drabowsky",
    "Bobby Morgan",
    "Taylor Phillips",
    "Elvin Tappe",
    "Jim Bolger",
    "Bob Anderson",
    "Jerry Kindall",
    "Dick Littlefield",
    "Turk Lown",
    "Sammy Taylor",
    "Ernie Banks",
    "Jim Brosnan",
    "Don Elston",
    "John Goryl",
    "Tony Taylor",
    "Bobby Thomson",
    "Gene Fodge",
    "Ed Mayer",
    "Glen Hobbie",
    "Ernie Banks",
  ],
  "Chicago White Sox": [
    "Jim Rivera",
    "Ron H. Jackson",
    "Billy Piee",
    "Bill Fischer",
    "Luis Aparicio",
    "Early Wynn",
    "Jim Landis",
    "Jim Derrington",
    "Earl Torgeson",
    "Les Moss",
    "Jim Wilson",
    "Al Smith",
    "Bob Keegan",
    "Bubba Phillips",
    "Billy Goodman",
    "Ray Moore",
    "Sherm Lollar",
    "Dick Donovan",
    "Tito Francona",
    "Walt Dropo",
    "Don Rudolph",
    "Earl Battey",
    "Nellie Fox",
    "Jerry Staley",
    "Dixie Howell",
    "Sammy Esposito",
    "Tom Qualters",
    "Nellie Fox",
    "Luis Aparicio",
    "Sherm Lollar",
  ],
  "Cincinnati Reds": [
    "George Crowe",
    "Bud Freeman",
    "Bob Thurman",
    "Smoky Burgess",
    "Joe Nuxhall",
    "Gus Bell",
    "Jerry Lynch",
    "Harvey Haddix",
    "Stan Palys",
    "Bob Henrich",
    "Tom Acker",
    "Dee Fondy",
    "Don Hoak",
    "Johnny Temple",
    "Willard Schmidt",
    "Bill Wight",
    "Johnny Klippstein",
    "Alex Grammas",
    "Frank Robinson",
    "Hal Jeffcoat",
    "Bob Purkey",
    "Ed Bailey",
    "Steve Bilko",
    "Roy McMillan",
    "Brooks Lawrence",
    "Charley Rabe",
    "Dutch Dotterer",
    "Vada Pinson",
    "Pete Whisenant",
    "Johnny Temple",
    "Frank Robinson",
    "Ed Bailey",
  ],
  "Cleveland Indians": [
    "Bob Lemon",
    "Hal Naragon",
    "Don Mossi",
    "Roger Maris",
    "Chico Carrasquel",
    "Dick Williams",
    "George Strickland",
    "Dick Tomanek",
    "Russ Nixon",
    "Vic Wertz",
    "Joe Caffie",
    "Mike Gaia",
    "Cal McLish",
    "Bud Daley",
    "Mickey Vernon",
    "Larry Raines",
    "Bobby Avila",
    "Minnie Minoso",
    "Hoyt Wilhelm",
    "Fred Hatfield",
    "Herb Score",
    "Rocky Colavito",
    "Billy Moran",
    "Mudcat Grant",
    "Larry Doby",
    "Ray Narleski",
    "Billy Harrell",
    "Carroll Hardy",
    "Dick Brown",
    "Gary Geiger",
    "Don Ferrarese",
    "Herb Score",
  ],
  "Detroit Tigers": [
    "Billy Hoeft",
    "J.W. Porter",
    "Lou Sleater",
    "Tim Thompson",
    "Al Kaline",
    "Steve Boros",
    "Frank Bolling",
    "Gus Zernial",
    "Jim Bunning",
    "Harry Byrd",
    "Ray Boone",
    "Bob Shaw",
    "Red Wilson",
    "Reno Bertoia",
    "Frank Lary",
    "Johnny Groth",
    "Billy Martin",
    "Paul Foytack",
    "Gail Harris",
    "Lou Skizas",
    "Hank Aguirre",
    "Jim Hegan",
    "Tom Morgan",
    "Charlie Maxwell",
    "Bill Taylor",
    "Harvey Kuenn",
    "Charley Lau",
    "Vito Valentinetti",
  ],
  "Kansas City Athletics": [
    "Alex Kellner",
    "Bill Tuttle",
    "Bob Martyn",
    "Joe DeMaestri",
    "Wally Burnette",
    "Billy Hunter",
    "Harry Chiti",
    "George Brunet",
    "Hector Lopez",
    "Ralph Terry",
    "Milt Graff",
    "Woodie Held",
    "Duke Maas",
    "Tom Gorman",
    "Hal W. Smith",
    "Virgil Trucks",
    "Ned Garver",
    "Mike Baxes",
    "Frank House",
    "Bob Cerv",
    "Murry Dickson",
    "Jack Urban",
    "Ray Herbert",
    "Dave Melton",
    "Vic Power",
    "Preston Ward",
  ],
  "Los Angeles Dodgers": [
    "Charlie Neal",
    "Don Drysdale",
    "John Roseboro",
    "Don Zimmer",
    "Duke Snider",
    "Sandy Amoros",
    "Johnny Podres",
    "Dick Gray",
    "Gil Hodges",
    "Sandy Koufax",
    "Roger Craig",
    "Rube Walker",
    "Jim Gilliam",
    "Don Demeter",
    "Carl Erskine",
    "Gino Cimoli",
    "Randy Jackson",
    "Clem Labine",
    "Elmer Valo",
    "Don Newcombe",
    "Danny McDevitt",
    "Joe Pignatano",
    "Pee Wee Reese",
    "Don Bessent",
    "Carl Furillo",
    "Ed Roebuck",
  ],
  "Milwaukee Braves": [
    "Lou Burdette",
    "Felix Mantilla",
    "Hank Aaron",
    "Del Rice",
    "Ernie Johnson",
    "Bob Hazle",
    "Johnny Logan",
    "Frank Torre",
    "Wes Covington",
    "Don McMahon",
    "Bob Taylor",
    "Bob Buhl",
    "Red Schoendienst",
    "Andy Pafko",
    "Carl Sawatski",
    "Casey Wise",
    "Bob Trowbridge",
    "Warrenahn",
    "Ray Shearer",
    "Bob Rush",
    "Joe Adcock",
    "Bill Bruton",
    "Del Crandall",
    "Carl Willey",
    "Gene Conley",
    "Eddie Mathews",
    "Harry Hanebrink",
    "Joe Jay",
    "Eddie Mathews",
    "Hank Aaron",
    "Warrenahn",
  ],
  "New York Yankees": [
    "Hank Bauer",
    "Gil McDougald",
    "Sal Maglie",
    "Norm Siebern",
    "Darrell Johnson",
    "Johnny Kucks",
    "Bobby Richardson",
    "Tom Sturdivant",
    "Enos Slaughter",
    "Mickey Mantle",
    "Don Larsen",
    "Marv Throneberry",
    "Jerry Lumpe",
    "Bob Grim",
    "Bill Skowron",
    "Bob Turley",
    "Elston Howard",
    "Ryne Duren",
    "Harry Simpson",
    "Whitey Ford",
    "Andy Carey",
    "Art Ditmar",
    "Yogi Berra",
    "Al Cicotte",
    "Tony Kubek",
    "Bobby Shantz",
    "Bill Skowron",
    "Mickey Mantle",
    "Bob Turley",
  ],
  "Philadelphia Phillies": [
    "Rip Repulski",
    "Ted Kazanski",
    "Chuck Harmon",
    "Joe Lonnett",
    "Dick Farrell",
    "Robin Roberts",
    "Dave Philley",
    "Harry Anderson",
    "Willie Jones",
    "Jack Meyer",
    "Solly Hemus",
    "Richiehburn",
    "Warren Hacker",
    "Jack Sanford",
    "Granny Hamner",
    "Mack Burk",
    "Don Landrum",
    "Jim Hearn",
    "Bob Miller",
    "Chico Fernandez",
    "Stan Lopata",
    "Don Cardwell",
    "Wally Post",
    "Curt Simmons",
    "Bob Bowman",
    "Pancho Herrera",
    "Chuck Essegian",
    "Ray Semproch",
  ],
  "Pittsburgh Pirates": [
    "Hank Foiles",
    "Dick Groat",
    "Robertoemente",
    "Roy Face",
    "Ron Kline",
    "Bob Skinner",
    "Jim Pendleton",
    "Vern Law",
    "Buddy Pritchard",
    "Don Gross",
    "Ted Kluszewski",
    "Bill Virdon",
    "Dick Rand",
    "Bob Smith",
    "Bill Mazeroski",
    "Paul Smith",
    "Gene Freese",
    "Whammy Douglas",
    "Bob Friend",
    "Harding Peterson",
    "Gene Baker",
    "Bennie Daniels",
    "Frank Thomas",
    "Johnny O'Brien",
    "John Powers",
    "Danny Kravitz",
    "Roman Mejias",
    "Ron Blackburn",
    "R.C. Stevens",
    "Bob Friend",
  ],
  "San Francisco Giants": [
    "Willie Mays",
    "Curt Balay",
    "Mike McCormick",
    "Darylencer",
    "Valmy Thomas",
    "Ozzie Virgil Sr.",
    "Stu Miller",
    "Willie Kirkland",
    "Jim Finigan",
    "Johnny Antonelli",
    "Danny O'Connell",
    "Dave Jolly",
    "Whitey Lockman",
    "Pete Burnside",
    "Don Mueller",
    "Eddie Bressoud",
    "Ray Crone",
    "Ray Katt",
    "Paul Giel",
    "Jim King",
    "Ruben Gomez",
    "Orlando Cepeda",
    "Ray Jablonski",
    "Hank Sa",
    "Marv Grissom",
    "Jim Davenport",
    "Al Worthington",
    "Bobeake",
    "Ray Monzant",
    "Bob Schmidt",
    "Willie Mays",
  ],
  "St. Louis Cardinals": [
    "Eddie Kasko",
    "Hobie Landrith",
    "Morrie Martin",
    "Del Ennis",
    "Von McDaniel",
    "Larry Jackson",
    "Dick Schofield",
    "Irv Noren",
    "Alvin Dark",
    "Billy Muffett",
    "Joe Cunningham",
    "Lindy McDaniel",
    "Don Blasingame",
    "Wally Moon",
    "Lloyd Merritt",
    "Herm Wehmeier",
    "Hal R. Smith",
    "Sam Jones",
    "Ken Boyer",
    "Gene Green",
    "Wilmer Mizell",
    "Bobby Gene Smith",
    "Philark",
    "Phil Paine",
    "Joe Taylor",
    "Curt Flood",
  ],
  "Washington Senators": [
    "Jim Lemon",
    "Texevenger",
    "Art Schult",
    "Bud Byerly",
    "Clint Courtney",
    "Herb Plews",
    "Bob Usher",
    "Russ Kemmerer",
    "Dick Hyde",
    "Eddie Yost",
    "Milt Bolling",
    "Camilo Pascual",
    "Ed Fitz Gerald",
    "Chuck Stobbs",
    "Roy Sievers",
    "Rocky Bridges",
    "Harmon Killebrew",
    "Neil Chrisley",
    "Albie Pearson",
    "Pedro Ramos",
    "Bobby Malkmus",
    "Ralph Lumenti",
    "Steve Koheck",
    "Kenpromonte",
    "Norm Zauchin",
    "Whitey Herzog",
    "Hal Griggs",
    "Julio Becq",
  ],
};

function addBaseballCards(memorabilia) {
  let i = 0;
  Object.keys(bbCards).forEach((team) => {
    bbCards[team].forEach((player) => {
      i++;
      let name = "baseball card{|s}";
      let title = `${player}, ${team}, Pennant brand 1958`;
      let series = { title, issue: i, total: 466 };
      let item = new Item({
        name,
        enc: 0,
        value: 2,
        frequency: "rare",
        series,
        tags: ["trading-card", "baseball-card", "collectible"],
      });
      memorabilia.add("rare", item);
      MEMORABILIA.push(item);
    });
  });
}

const encyclopedias = [
  "I",
  "II",
  "III",
  "IV",
  "V",
  "VI",
  "VII",
  "VIII",
  "IX",
  "X",
  "XI",
  "XII",
  "XIII",
  "XIV",
  "XV",
  "XVI",
  "XVII",
  "XVIII",
  "XIX",
  "XX",
  "XXI",
  "XXII",
  "XXIII",
  "XIV",
];

function addEncyclopedias(memorabilia) {
  encyclopedias.map(function (numeral, i) {
    let letter = i === 23 ? "XYZ" : String.fromCharCode(i + 65);
    let title = "Encyclopedia Britannica vol. " + numeral + ", letter " + letter;
    let series = { title, issue: i + 1, total: 24 };
    let item = new Item({
      name: "encyclopedia",
      value: 15,
      enc: ENCUMBRANCE.bulky,
      series,
      frequency: "rare",
      tags: ["collectible", "book", "encyclopedia"],
    });
    memorabilia.add("rare", item);
    MEMORABILIA.push(item);
  });
}

const warTitles = [
  "150_million_americans.jpg",
  "am_i_proud.gif",
  "america_calling.jpg",
  "are_you_playing_square.gif",
  "be_a_victory_farm_volunteer.gif",
  "books_are_weapons_in_the_war_of_ideas.gif",
  "both_are_weapons.gif",
  "busshelprog.jpg",
  "carry_on_don't_be_carried_out.gif",
  "do_the_job_he_left_behind.gif",
  "farm_scrap_builds_tanks_&_guns.gif",
  "fontana_dam.gif",
  "food_is_a_weapon.gif",
  "food_is_fighting_strength.gif",
  "for_service_in_civilian_defense.gif",
  "forgetfulness_helps_the_enemy.gif",
  "foxy_foreign_ideas.gif",
  "free_speech_doesn't_mean_careless_talk.gif",
  "groundwork_for_victory.gif",
  "harvest_war_crops.gif",
  "help_harvest.gif",
  "help_win_the_war.gif",
  "here's_a_war_job_for_you.gif",
  "hunger_breeds_madness.gif",
  "is_your_trip_necessary.gif",
  "it's_only_1000_minutes_from_cheyenned_to_berlin.gif",
  "join_the_schools_at_war_program.gif",
  "my_tank's_in_the_war_too.gif",
  "on_time_all_the_time.gif",
  "plan_a_victory_garden.gif",
  "plan_today_build_tomorrow.gif",
  "processed_food_is_ammunition.gif",
  "protect_yourself_in_event_of_attack.jpg",
  "radioactive_fallout_can_reach_your_farm.jpg",
  "rationing_means_a_fair_share_for_all_of_us.gif",
  "report_faulty_wiring.gif",
  "right_is_might.gif",
  "save_your_cans.gif",
  "scrap_will_help_win.gif",
  "scrap.gif",
  "serving_you_in_time_of_emergency_support_civil_defense.jpg",
  "share_a_ride.gif",
  "share_your_car.gif",
  "shoot_to_kill.gif",
  "silence_means_security.gif",
  "soldiers_without_guns.gif",
  "stamp_out_black_markets.gif",
  "sucker.gif",
  "take_your_place_in_civilian_defense.gif",
  "the_2nd_front_depends_on_the_home_front.gif",
  "the_army_needs_more_lumber.gif",
  "the_inland_way_for_the_USA.gif",
  "the_key_to_victory.gif",
  "the_world_cry_food.gif",
  "this_war.gif",
  "today.gif",
  "together_we_can_do_it.gif",
  "together_we_win.gif",
  "vacation_at_home.gif",
  "victory_is_a_question_of_stamina.gif",
  "victory_patterns.gif",
  "wanted_for_victory.gif",
  "washington_beckons_you.gif",
  "we_are_helping_with_salvage.gif",
  "we're_needed_again.gif",
  "work_in_a_food_processing_plant.gif",
  "you_can_protect_yourself.jpg",
  "your_country_needs_soybeans.gif",
  "your_victory_garden.gif",
];

const movieTitles = [
  "100_rifles.jpg",
  "23_paces_to_baker_street.jpg",
  "aces_high.jpg",
  "atomic_city.jpg",
  "atomic_kid.jpg",
  "atomic_man.jpg",
  "atomic_monster.jpg",
  "atomic_submarine.jpg",
  "atomictpistols.jpg",
  "bad_mans_river.jpg",
  "bandolero.jpg",
  "bullet_for_a_badman.jpg",
  "canadian_mounties_vs_atomic_invaders.jpg",
  "cattle_empire.jpg",
  "cheaper_by_the_dozen.jpg",
  "cigarette_girl.jpg",
  "count_five_and_die.jpg",
  "crack_in_the_mirror.jpg",
  "day_of_the_triffids.jpg",
  "desert_hell.jpg",
  "dig_that_uranium.jpg",
  "east_of_eden.jpg",
  "emmanuelle.jpg",
  "england_made_me.jpg",
  "family_doctor.jpg",
  "frankenstein_and_the_monster_from_hell.jpg",
  "gang_war.jpg",
  "garden_of_evil.jpg",
  "gone_with_the_wind.jpg",
  "guns_for_san_sebastian.jpg",
  "hombre.jpg",
  "hotel_sahara.jpg",
  "impulse.jpg",
  "in_love_and_war.jpg",
  "intent_to_kill.jpg",
  "julius_caesar.jpg",
  "junior_army.jpg",
  "kiss_of_the_vampire.jpg",
  "lion_of_the_desert.jpg",
  "lost_lives.jpg",
  "man_hunt.jpg",
  "moon_zero_two.jpg",
  "night_was_our_friend.jpg",
  "nor_the_moon_by_night.jpg",
  "operation_uranium.jpg",
  "pretty_poison.jpg",
  "return_of_the_texan.jpg",
  "rocket_to_the_moon.jpg",
  "rogues_yarn.jpg",
  "roseanna_mccoy.jpg",
  "sierra_baron.jpg",
  "sumuru.jpg",
  "sword_of_sherwood_forest.jpg",
  "teenage_rebel.jpg",
  "the_black_castle.jpg",
  "the_brass_bottle.jpg",
  "the_chalk_garden.jpg",
  "the_curse_of_the_mummys_tomb.jpg",
  "the_deep_blue_sea.jpg",
  "the_dunwich_horror.jpg",
  "the_fiend_who_walked_the_west.jpg",
  "the_gamma_people.jpg",
  "the_gift_of_love.jpg",
  "the_hallelujah_trail.jpg",
  "the_hellfire_club.jpg",
  "the_hound_of_the_baskervilles.jpg",
  "the_legend_of_frenchie_king.jpg",
  "the_lieutenant_wore_skirts.jpg",
  "the_long_hot_summer.jpg",
  "the_man_who_never_was.jpg",
  "the_man_with_the_x-ray_eyes.jpg",
  "the_many_loves_of_hilda_crane.jpg",
  "the_mummy.jpg",
  "the_pride_of_st_louis.jpg",
  "the_raid.jpg",
  "the_reward.jpg",
  "the_riddle_of_the_sands.jpg",
  "the_sheriff_of_fractured_jaw.jpg",
  "the_sleeping_tiger.jpg",
  "the_sun_also_rises.jpg",
  "the_viking_queen.jpg",
  "the_wind_cannot_read.jpg",
  "the_young_warriors.jpg",
  "them.jpg",
  "three_little_girls_in_blue.jpg",
  "uranium_boom.jpg",
  "villa.jpg",
  "wolf_dog.jpg",
];

function poster(collection, type, tags, value, memorabilia) {
  collection.map(function (base, i) {
    let title = titleCase(base.replace(/_/g, " ").replace(".jpg", "").replace(".gif", ""));
    let name = type + " poster";
    let series = { title, issue: i + 1, total: collection.length };
    let item = new Item({
      name,
      value,
      series,
      frequency: "rare",
      enc: ENCUMBRANCE.hand,
      image: "/src/images/" + type + "/" + base,
      tags: tags,
    });
    memorabilia.add("rare", item);
    MEMORABILIA.push(item);
  });
}

function addMoviePosters(memorabilia) {
  poster(movieTitles, "movie", ["collectible", "poster", "movie-poster"], 10, memorabilia);
}

function addPropagandaPosters(memorabilia) {
  poster(warTitles, "propaganda", ["collectible", "poster", "propaganda-poster"], 10, memorabilia);
}

addBaseballCards(memorabilia);
addComicBooks(memorabilia);
addEncyclopedias(memorabilia);
addNewsMagazines(memorabilia);
addMoviePosters(memorabilia);
addPropagandaPosters(memorabilia);

const TYPES = [
  "encyclopedia",
  "baseball-card",
  "comic-book",
  "news-magazine",
  "movie-poster",
  "propaganda-poster",
];

export const getMemorabiliaTypes = () => TYPES;

/**
 * Creates a random piece of pre-collapse memorabilia, such as a comic book, trading card,
 * magazine, or movie poster.
 *
 * @param {Object} [options={}] - Memorabilia creation options
 * @param {string} [options.type="random"] - Category of memorabilia to create. One of: "random",
 *    "encyclopedia", "baseball-card", "comic-book", "news-magazine", "movie-poster", or
 *    "propaganda-poster". Use `getMemorabiliaTypes()` to get the full list of valid types.
 * @returns {Item} An Item instance representing a piece of memorabilia
 */
export function createMemorabilia({ type = "random" } = {}) {
  logger.start("createMemorabilia", { type });
  if (type === "random") {
    return logger.end(memorabilia.get());
  }
  const items = memorabilia.rows.filter((item) => item.has(type));
  return logger.end(random(items));
}