<% s.names = { "description": "First names of men and women, pulled from the US Census for the 2000s.", "firstNames": [ "Aaliyah", "Aaron", "Abby", "Abigail", "Abraham", "Adam", "Addison", "Adrian", "Adriana", "Adrianna", "Aidan", "Aiden", "Alan", "Alana", "Alejandro", "Alex", "Alexa", "Alexander", "Alexandra", "Alexandria", "Alexia", "Alexis", "Alicia", "Allison", "Alondra", "Alyssa", "Amanda", "Amber", "Amelia", "Amy", "Ana", "Andrea", "Andres", "Andrew", "Angel", "Angela", "Angelica", "Angelina", "Anna", "Anthony", "Antonio", "Ariana", "Arianna", "Ashley", "Ashlyn", "Ashton", "Aubrey", "Audrey", "Austin", "Autumn", "Ava", "Avery", "Ayden", "Bailey", "Benjamin", "Bianca", "Blake", "Braden", "Bradley", "Brady", "Brandon", "Brayden", "Breanna", "Brendan", "Brian", "Briana", "Brianna", "Brittany", "Brody", "Brooke", "Brooklyn", "Bryan", "Bryce", "Bryson", "Caden", "Caitlin", "Caitlyn", "Caleb", "Cameron", "Camila", "Carlos", "Caroline", "Carson", "Carter", "Cassandra", "Cassidy", "Catherine", "Cesar", "Charles", "Charlotte", "Chase", "Chelsea", "Cheyenne", "Chloe", "Christian", "Christina", "Christopher", "Claire", "Cody", "Colby", "Cole", "Colin", "Collin", "Colton", "Conner", "Connor", "Cooper", "Courtney", "Cristian", "Crystal", "Daisy", "Dakota", "Dalton", "Damian", "Daniel", "Daniela", "Danielle", "David", "Delaney", "Derek", "Destiny", "Devin", "Devon", "Diana", "Diego", "Dominic", "Donovan", "Dylan", "Edgar", "Eduardo", "Edward", "Edwin", "Eli", "Elias", "Elijah", "Elizabeth", "Ella", "Ellie", "Emily", "Emma", "Emmanuel", "Eric", "Erica", "Erick", "Erik", "Erin", "Ethan", "Eva", "Evan", "Evelyn", "Faith", "Fernando", "Francisco", "Gabriel", "Gabriela", "Gabriella", "Gabrielle", "Gage", "Garrett", "Gavin", "Genesis", "George", "Gianna", "Giovanni", "Giselle", "Grace", "Gracie", "Grant", "Gregory", "Hailey", "Haley", "Hannah", "Hayden", "Hector", "Henry", "Hope", "Hunter", "Ian", "Isaac", "Isabel", "Isabella", "Isabelle", "Isaiah", "Ivan", "Jack", "Jackson", "Jacob", "Jacqueline", "Jada", "Jade", "Jaden", "Jake", "Jalen", "James", "Jared", "Jasmin", "Jasmine", "Jason", "Javier", "Jayden", "Jayla", "Jazmin", "Jeffrey", "Jenna", "Jennifer", "Jeremiah", "Jeremy", "Jesse", "Jessica", "Jesus", "Jillian", "Jocelyn", "Joel", "John", "Johnathan", "Jonah", "Jonathan", "Jordan", "Jordyn", "Jorge", "Jose", "Joseph", "Joshua", "Josiah", "Juan", "Julia", "Julian", "Juliana", "Justin", "Kaden", "Kaitlyn", "Kaleb", "Karen", "Karina", "Kate", "Katelyn", "Katherine", "Kathryn", "Katie", "Kayla", "Kaylee", "Kelly", "Kelsey", "Kendall", "Kennedy", "Kenneth", "Kevin", "Kiara", "Kimberly", "Kyle", "Kylee", "Kylie", "Landon", "Laura", "Lauren", "Layla", "Leah", "Leonardo", "Leslie", "Levi", "Liam", "Liliana", "Lillian", "Lilly", "Lily", "Lindsey", "Logan", "Lucas", "Lucy", "Luis", "Luke", "Lydia", "Mackenzie", "Madeline", "Madelyn", "Madison", "Makayla", "Makenzie", "Malachi", "Manuel", "Marco", "Marcus", "Margaret", "Maria", "Mariah", "Mario", "Marissa", "Mark", "Martin", "Mary", "Mason", "Matthew", "Max", "Maxwell", "Maya", "Mckenzie", "Megan", "Melanie", "Melissa", "Mia", "Micah", "Michael", "Michelle", "Miguel", "Mikayla", "Miranda", "Molly", "Morgan", "Mya", "Naomi", "Natalia", "Natalie", "Nathan", "Nathaniel", "Nevaeh", "Nicholas", "Nicolas", "Nicole", "Noah", "Nolan", "Oliver", "Olivia", "Omar", "Oscar", "Owen", "Paige", "Parker", "Patrick", "Paul", "Payton", "Peter", "Peyton", "Preston", "Rachel", "Raymond", "Reagan", "Rebecca", "Ricardo", "Richard", "Riley", "Robert", "Ruby", "Ryan", "Rylee", "Sabrina", "Sadie", "Samantha", "Samuel", "Sara", "Sarah", "Savannah", "Sean", "Sebastian", "Serenity", "Sergio", "Seth", "Shane", "Shawn", "Shelby", "Sierra", "Skylar", "Sofia", "Sophia", "Sophie", "Spencer", "Stephanie", "Stephen", "Steven", "Summer", "Sydney", "Tanner", "Taylor", "Thomas", "Tiffany", "Timothy", "Travis", "Trenton", "Trevor", "Trinity", "Tristan", "Tyler", "Valeria", "Valerie", "Vanessa", "Veronica", "Victor", "Victoria", "Vincent", "Wesley", "William", "Wyatt", "Xavier", "Zachary", "Zoe", "Zoey" ] }; s.places = { "description": "Setting and location archetypes.", "settings": [ { "name": "void", "synonyms": ["nowhere","nothingness"], "qualities": ["empty","quiet","lonesome"], "nature": "neutral" }, { "name": "tavern", "synonyms": ["pub","inn","bar"], "qualities": ["social","educational","inspiring","busy"], "nature": "neutral" }, { "name": "library", "synonyms": ["study"], "qualities": ["educational","enlightening","inspiring"], "nature": "good" }, { "name": "office", "synonyms": ["workplace","workshop"], "qualities": ["mundane","routine","productive","busy"], "nature": "neutral" }, { "name": "dungeon", "synonyms": ["pit","trap","jail"], "qualities": ["dark","hopeless","trapped"], "nature": "evil" }, { "name": "haven", "synonyms": ["home","safety","sanctuary","asylum","refuge","shelter"], "qualities": ["restful","peaceful","pleasant","light","recovery"], "nature": "good" }, { "name": "shop", "synonyms": ["store","market","bazaar"], "qualities": ["mundane","productive"], "nature": "neutral" }, { "name": "church", "synonyms": ["temple","mosque","chapel","cathedral","parish","shrine","synagogue"], "qualities": ["spiritual","welcoming","peaceful","enlightening","inspiring","hopeful","healing"], "nature": "good" }, { "name": "tower", "synonyms": ["spire","belfry","lookout","minaret","pillar","skyscraper","turret"], "qualities": ["lofty","thoughtful","watchful","isolated"], "nature": "good" }, { "name": "bridge", "synonyms": ["arch","connection","walkway"], "qualities": ["connecting","joining","healing","linking","meeting"], "nature": "neutral" }, { "name": "plaza", "synonyms": ["clearing","field","square","meadow"], "qualities": ["open","exposed","spacious","clear"], "nature": "good" }, { "name": "road", "synonyms": ["path","street","trail","lane","passage"], "qualities": ["inspiring","mundane","moving","productive","progressive"], "nature": "good" }, { "name": "crossroads", "synonyms": ["intersection","fork"], "qualities": ["transitional","thoughtful","progressive"], "nature": "neutral" }, { "name": "forest", "synonyms": ["jungle","wilderness","woods"], "qualities": ["mysterious","dark","dangerous","wild","uncontrollable","tangled","difficult"], "nature": "evil" }, { "name": "cave", "synonyms": ["hideout","tunnel"], "qualities": ["deepness","dark","dangerous","mysterious","inside"], "nature": "evil" }, { "name": "shore", "synonyms": ["beach","bank","edge","cliff"], "qualities": ["transitional","changing","impeding"], "nature": "neutral" }, { "name": "river", "synonyms": ["stream","creek","brook"], "qualities": ["dangerous","uncontrollable","flowing","moving"], "nature": "neutral" }, { "name": "water", "synonyms": ["lake","pond","pool"], "qualities": ["spiritual","cleansing","purifying"], "nature": "good" }, { "name": "ocean", "synonyms": ["sea"], "qualities": ["timeless","eternal","mysterious","expansive","unknowable","immense"], "nature": "neutral" }, { "name": "garden", "synonyms": ["park","yard"], "qualities": ["safe","orderly","controlled","happy","nurturing","growing"], "nature": "good" }, { "name": "desert", "synonyms": ["wasteland"], "qualities": ["arid","empty","hopeless","isolated","lonesome","harsh","dangerous","changing"], "nature": "evil" }, { "name": "island", "synonyms": ["ship","boat","airplane","enclave"], "qualities": ["isolated","safe"], "nature": "good" }, { "name": "mountain", "synonyms": ["hill","peak","crag"], "qualities": ["dangerous","transitional","challenging"], "nature": "neutral" }, { "name": "labyrinth", "synonyms": ["maze"], "qualities": ["confusing","challenging","difficult"], "nature": "evil" }, { "name": "day", "synonyms": ["daytime","sunlight"], "qualities": ["ordered","safe","enlightening","productive"], "nature": "good" }, { "name": "night", "synonyms": ["darkness","twilight"], "qualities": ["dark","dangerous","chaotic","mysterious","playful"], "nature": "evil" }, { "name": "dawn", "synonyms": ["sunrise","morning"], "qualities": ["emerging","awakening","enlightening","safe"], "nature": "good" }, { "name": "dusk", "synonyms": ["evening","sunset"], "qualities": ["dark","dangerous","hiding"], "nature": "evil" }, { "name": "fortress", "synonyms": ["citadel","abbey","hold","hideout","base","castle","keep"], "qualities": ["strong","safe","protected"], "nature": "neutral" } ] }; s.likes = [ "kittens", "puppies", "octopus", "starry skies", "skulls", "glitter", "pastel tones", "dark shades", "candy floss", "spicy mints", "ice cream", "chocolate", "coffee" ]; s.starters = [ "You wake up in ", "You start your day in ", "It's a bright new day in " ]; s.moods = [ "to be doing okay", "to be doing well", "to be doing fine", "to be doing badly", "to be doing not so well", "to be doing sort of okay", "happy", "sad", "jumpy", "anxious", "moody", "brooding", "oblivious", "to be daydreaming", "to be longing for something", "to be longing for better days", 'to be saying "OH, SHIT" a lot', 'to be saying "WELL, SHIT" a lot', 'to be saying "SHIT" a lot', 'to be saying "OH, FUCK" a lot', 'to be saying "WELL, FUCK" a lot', 'to be saying "FUCK" a lot' ]; function capitalize(string) { return string.charAt(0).toUpperCase() + string.slice(1); } s.town_name = function() { var text = ""; var possible = [ [ "b", "c", "d", "f", "g", "h", "k", "l", "m", "n", "p", "q", "r", "s", "t", "v", "x", "y", "z" ], [ "a", "e", "i", "j", "o", "u", "w" ] ] for (var i = 0; i < 6; i++) { var letter_type = _.random(0, 1); text += possible[letter_type][_.random(0, possible[letter_type].length-1)]; } return capitalize(text); } s.setter_link = function(display, target, script){ return '<a onclick="' + script + ';" href="javascript:void(0);" data-passage=' + target + '>' + display + '</a>'; } s.set_townsperson = function(townsperson){ s.townsperson = townsperson; } s.townsperson = ""; s.friends = 0; s.days = 0; s.misses = []; s.vigil = 0; s.leave = 0; s.pc = { "likes": _.sample(s.likes, 3), "misses": [] }; s.npcs = {} s.create_npc = function(range){ s.npcs["npc_"+range] = { "key": "npc_"+range, "name": _.sample(s.names["firstNames"]), "likes": _.sample(s.likes, 3), "affinity": 0 }; }; for (var i = 0; i < 12; i++) { s.create_npc(i); } s.town_description = function() { var place = _.sample(s.places["settings"]); var name = _.sample(_.union(place["name"], place["synonyms"])); s.quality = _.sample(place["qualities"]) s.landmark = s.quality + " " + name; return "Famous for its " + s.landmark + "."; } s.gen_town = function (){ return { "name": s.town_name(), "population": _.sample(s.npcs, 3), "description": s.town_description(), "quality": s.quality, "landmark": s.landmark }; } s.get_affinity = function (pc, npc) { npc = s.npcs[npc["key"]]; var affinity = _.intersection(pc["likes"], npc["likes"]); if (affinity.length > 0){ npc["affinity"]++; if (npc["affinity"] == 1){ s.friends++; pc["misses"].push(npc["name"]); } return "\nIt looks like you and " + npc["name"] + " enjoy " + affinity.join(" and ") + "! That's nice =) \n\n Maybe you should try [[talking to other people->You wake up]] too."; } else { return "\nIt looks like you don't really get along with " + npc["name"] + ". You should [[talk to someone else->You wake up]]."; } } s.get_misses = function (pc) { for (var i = 0; i < s.town["population"].length; i++){ s.misses.push(s.town["population"][i]["name"]); } return _.difference(pc["misses"], s.misses); } %> # You wake up in a new town By Florencia Rumpel Rodriguez ## [[Start]]<% s.town = s.gen_town(); s.friends = 0; s.misses = []; s.days++; %> [[You wake up]] in a new town. You wonder which town is it this time. <% if (s.vigil > 1 || s.leave > 1){ print("Are you really content with your lot in this randomly generated universe?"); print("\n\nYou. The real you can leave " + s.town["name"] + " and any other town that I might put together. Why don't you?"); } %><% print(_.sample(s.starters)); print(s.town["name"]); %>. <% print(s.town["description"]); %> <% for (var i = 0; i < s.town["population"].length; i++) { var setter = "window.story.state.set_townsperson('" + s.town['population'][i]['key'] + "')"; if (i < s.town["population"].length - 1){ print(s.setter_link(s.town["population"][i]["name"],"match", setter)); %>, <% } else if (i == s.town["population"].length - 1){ %>and <% print(s.setter_link(s.town["population"][i]["name"],"match", setter)); %> are in town today. Maybe you should say hi.<% } } %> You could always [[check out the <% print(s.town["landmark"]); %>->landmark]] or [[go back to bed->Start]]. <% if (s.vigil >= 1 && s.leave >= 1){ print(" Not that it makes a difference anyway."); } %><% var current_speaker = _.findWhere(s.town["population"], {"key": s.townsperson}); %> <% print(current_speaker["name"]); %> seems <% print(_.sample(s.moods)); %>. You talk a little. <% print(s.get_affinity(s.pc, current_speaker)); %>The <% print(s.town["landmark"]); %> seems to be very <% print(s.town["quality"]); %>. <% switch(s.friends) { case 0: print("\nLooks like you have made no new friends today. Try not to worry about it."); break; case 1: print("\nLooks like you made one new friend today."); break; default: print("\nLooks like you made " + s.friends + " new friends today."); } %> <% var current_miss = s.get_misses(s.pc); if (current_miss.length > 0){ print("You miss " + current_miss.join(" and ") + "."); } if (s.days > 3){ print("\n\nYou don't know for how long this has been going. Waking up in a different town that will be gone after you go to bed is taking a toll on you."); if (current_miss.length > 0){ if (!s.leave){ print("\n\nYou're tired of missing your friends. Maybe you could [[try to go visit them->leave]]."); } else { print("\n\nYou tried to [[leave]] and it was pointless. Maybe you should drop it."); } } if (!s.vigil){ print("\n\nMaybe if you don't go to bed and [[stay awake->vigil]], things won't change."); } else { print("\n\nYou tried to [[stay awake->vigil]] and it was futile. Why should you try again?"); } } %> It's getting late. [[Go back to bed->Start]]?<% s.leave++; %> You [[start walking]].You [[put one foot after the other]].You [[walk one hundred steps]].You [[walk one thousand more]].You need to [[rest->Start]].<% s.vigil++; %> You [[try to stay awake]].Your eyes are sore. You [[rub them]].You're feeling drowsy. You [[resist]].You [[fall asleep->Start]].