// VARIABLES AND LISTS var name1; var name2; var name3; var name4; var nameList = []; //CHANGING VARIABLES onEvent("n1", "change", function( ) { name1 = getText("n1"); appendItem(nameList, getText("n1")); }); onEvent("n2", "change", function( ) { name2 = getText("n2"); appendItem(nameList, getText("n2")); }); onEvent("n3", "change", function( ) { name3 = getText("n3"); appendItem(nameList, getText ("n3")); }); onEvent("n4", "change", function( ) { name4 = getText("n4"); appendItem(nameList, getText ("n4")); }); // IF STATEMENTS onEvent("genbutton", "click", function( ) { if (nameList.length == 1) { setText("t1", "Please add two or more characters to generate a scenario."); } if (nameList.length == 0) { setText("t1", "Please add two or more characters to generate a scenario."); } if (nameList.length == 2) { var ranNum2; ranNum2 = randomNumber(0, 4); if (ranNum2 == 0) { setText("t1", nameList[0] + (": " + (nameList[1] + (", why are you looking in the garbage bin?" + ("\n" + (nameList[1] + ": I was looking for you, dummy.")))))); } else if (ranNum2==1) { setText("t1", (nameList[1] + ": How do you spell 'me' without the D?" + "\n" + nameList[0] + ": ..There is no D in me." + "\n" + "*")+ nameList[1]+" laughing hysterically*"); } else if ((ranNum2==2)) { setText("t1", nameList[0] + ": I'm bored." + "\n" + nameList[1] + ": Cardboard or pastry board?"); } else if (ranNum2==3) { setText("t1", (nameList[0] + ": I hate life.") + "\n" + nameList[1] + ": Life hates you too." + "\n" + nameList[0] + ": Why?" + "\n" + nameList[1] + ": Because everytime it gives you lemons, you make awful lemonade."); } else { setText("t1", (nameList [0] + ": *Standing in ") + nameList[1] + "'s doorway*" + "\n" + "I threw up." + "\n" + nameList[1] + ": ..And how did you get in my house?!!"); } } if (nameList.length == 3) { var ranNum3; ranNum3 = randomNumber(0, 4); if (ranNum3 == 0) { setText("t1", (nameList[1] + ": I'm hungry." + "\n" + nameList[0] + ": Have some cereal, it's on the top shelf." + "\n" + nameList [1] + ": I'm hungry for revenge on ") + nameList [2] +"."); } else if (ranNum3 == 1) { setText("t1", (((nameList[1] + ": Guys!! I lost something expensive!!" + "\n" + nameList[2]) +": Did you put it under the bed?" + "\n" + nameList[1] +": Why would I?!") + "\n" + nameList [0] +": I couldn’t care less about your valuables. Now can I have my bracelet back?") + "\n" + nameList[1]+ ": When did I say I lost MY expensive thing?" ); } else if ((ranNum3 == 2)) { setText("t1", (nameList[2] + ": Guys did you hear?" + "\n" + nameList[0] + ": Hear what?" + "\n" + nameList[1] + ": I think we’re supposed to guess." + "\n" + nameList[0] +": …Hmmm… did you finally get rid of your credit card debt?" + "\n") + nameList[2] + ": …No. I got us some chips.." + "\n" + nameList [1] +": Good enough."); } else if (ranNum3 == 3) { setText("t1", (nameList[1] + ": Hey! You can’t place two cards down at once, it doesn’t say that in the rule book!" + "\n" + nameList[2] +": Rule book?? You read that thing? This is UNO nobody cares." + "\n" + nameList[0] + ": Be glad they didn't put down a Pokemon card.") + "\n" + nameList[2] +": Let's not give " + nameList[1] + " ideas."); } else { setText("t1", ((nameList[0]+ ": I'm doin' ya mom!" + "\n") + nameList[1] + ": DAD?! You came back!!") + "\n" + nameList[1]+ "'s mom: I bet you didn't even remember to get the milk. I already filed for a divorce, and got engaged to " + nameList[2] + "!" ); } } if (nameList.length == 4) { var ranNum4; ranNum4 = randomNumber(0, 3); if (ranNum4 == 0) { setText("t1", "Unfortunately there are no four-person skits availiable yet. If you have ideas, feel free to contact @grapeseed.crepes on Instagram."); } else if (ranNum4 == 1) { setText("t1", "Unfortunately there are no four-person skits availiable yet. If you have ideas, feel free to contact @grapeseed.crepes on Instagram."); } else if (ranNum4 == 2) { setText("t1", "Unfortunately there are no four-person skits availiable yet. If you have ideas, feel free to contact @grapeseed.crepes on Instagram."); } else { setText("t1", "Unfortunately there are no four-person skits availiable yet. If you have ideas, feel free to contact @grapeseed.crepes on Instagram."); } } }); //four person!