Apps Home
|
Create an App
RCD TruthOrDare
Author:
randomchancedraw
Description
Source Code
Launch App
Current Users
Created by:
Randomchancedraw
/* Application: TruthOrDare Developer: randomchancedraw Version: 1.0 (26/03/2014) Description: Truth Or Dare game with randomized questions/dares and increasing stakes */ var possibleQuestions = [ ['Are you a morning person or a night owl?', 'Are you generally shy, or quite outgoing?', 'Are you more artistic or more mathematical?'], ['Do you play any sports?', 'Do you have any creative/artistic hobbies such as writing, photography, painting, etc?', 'Do you have any entrepreneurial ambitions? If so, what sort of business/company do you want to start?'], ['Which types of music do you prefer: electronic; rock; pop; metal; classical; jazz; something else?', 'What sort of books do you have on your bookshelf: textbooks; biographies; history; fiction; something else?', 'What genre of film do you like to watch: romantic comedy; action blockbuster; suspense thriller; horror; something else?'], ['What is the funniest thing which you\'ve noticed this year?', 'What is the most spontaneous thing you\'ve done this year?', 'What is the weirdest thing which you\'ve witnessed happen this year?'], ['When you go out, do you prefer going to clubs or to pubs?', 'What is your favourite drink: beer; wine; spirits (neat or mixed?); if it has alcohol I\'ll drink it?', 'When you go out to clubs, are you more likely to be found on the dance-floor or near the bar?'], ['Would your favourite dessert involve lots of: chocolate; caramel; strawberry; apple; maple syrup; something else?', 'In your opinion, which of the following is more cute: baby rabbit; kit fox; duckling; little lamb; none of the above?', 'Which is more relaxing: a long, hot shower; a long, steamy bath; a long, firm massage; a long, restful sleep?'], ['Disregarding price, the car you would love to own is: Jaguar E-Type; Aston Martin DB5; Shelby Mustang; Porsche 911; Range Rover Evoque; something else?', 'What sort of house would you prefer to live in: a huge mansion; a romantic chalet; a castle of course! something else?', 'If you got to choose, would you prefer to own: a private jet; a super-yacht; an island?'], ['Your lover takes you out to a romantic restaurant. You hope it\'s: French; Italian; Japanese; something else?', 'Your idea of a romantic holiday destination is: Paris; Prague; Hawaii; Machu Pichu; something else?', 'Your idea of a romantic night out would be going to: ballet; opera; symphony orchestra; fashion show; art exhibition; something else?'], ['Which do you think is sexier: high heels; stockings; corset; red lipstick; handcuffs; all of the above?', 'Do you often walk around your house (not just your bedroom) completely naked?', 'How much lingerie do you own? What is the sexiest lingerie you own?'], ['Have you ever played strip-poker?', 'Have you ever played strip-twister?', 'Have you ever played strip-blackjack?'], ['Describe your three biggest turn-ons?', 'What is your favourite sex position, and why?', 'Do you prefer giving or receiving oral sex?'], ['Have you ever had sex in a public place?', 'Have you ever had sex with another woman?', 'Have you ever had anal sex?'], ['When it comes to sex, do you prefer to be dominant or submissive?', 'How many times have you had group sex or threesomes?', 'On a scale of 1 to 10, with 1 being very gentle and 10 being extremely rough, how rough do you like sex to be?'], ['What is your wildest sexual fantasy?'] ]; var questions = []; // populated via randomization below. for (var pqi = 0; pqi < possibleQuestions.length; ++pqi) { var pqiidx = Math.floor(Math.random() * possibleQuestions[pqi].length); questions[pqi] = possibleQuestions[pqi][pqiidx]; } var possibleDares = [ ['Blow kiss'], ['Suck finger'], ['Flash tits'], ['Flash ass'], ['Shirt off'], ['Play with hair and rub tits'], ['Get naked'], ['Naked dance'], ['Finger in pussy'], ['Two fingers in pussy'], ['Dildo play'], ['Orgasm!'] ]; var dares = []; for (var pdi = 0; pdi < possibleDares.length; ++pdi) { var pdiidx = Math.floor(Math.random() * possibleDares[pdi].length); dares[pdi] = possibleDares[pdi][pdiidx]; } cb.settings_choices = [ {name: 'stakes', type: 'int', minValue: 1, maxValue: 100, label: 'How much the stakes go up by each round (in tokens)', defaultValue: 10} ]; var lowestPrice = cb.settings.stakes >= 1 ? cb.settings.stakes : 1; var questionsAsked = 0; var daresAsked = 0; var questioners = []; // Name, NumberQuestions, TipCount var darers = []; // Name, NumberDares, TipCount var players = []; // Name, NumberQD, TipCount cb.changeRoomSubject('Truth Or Dare! /t to see truths, /d to see dares'); cb.onEnter(function (user) { var notices = ""; notices += "Welcome, " + user['user'] + "! We are playing Truth Or Dare.\n"; notices += "The current stakes are:"; if (questionsAsked < questions.length) { notices += "\nTruth: " + ((questionsAsked*lowestPrice) + lowestPrice) + " tokens to ask: " + questions[questionsAsked]; } else { notices += "\nTruth: all Truth questions have been answered already!"; } if (daresAsked < dares.length) { notices += "\nDare: " + ((daresAsked*lowestPrice) + lowestPrice + 1) + " tokens to dare: " + dares[daresAsked]; } else { notices += "\nDare: all Dare challenges have been accepted already!"; } notices += "\nType /t to see the list of truths."; notices += "\nType /d to see the list of dares."; cb.sendNotice(notices, user['user'], '', '#FF6600', 'bold'); }); cb.onMessage(function(msg) { if(msg['m'].match(/\/t/i)) { msg['X-Spam'] = true; showTruths(msg['user']); } else if(msg['m'].match(/\/d/i)) { msg['X-Spam'] = true; showDares(msg['user']); } return msg; }); function showTruths(username) { var notices = ""; notices += "** TRUTHS (next one costs: " + ((daresAsked*lowestPrice) + lowestPrice) + " tokens) **"; for (var i = 0; i < questions.length; ++i) { notices += "\n" + questions[i]; } cb.sendNotice(notices, username, '#F0FAFF'); } function showDares(username) { var notices = ""; notices += "** Dares (next one costs: " + ((daresAsked*lowestPrice) + lowestPrice + 1) + " tokens) **"; for (var i = 0; i < dares.length; ++i) { notices += "\n" + dares[i]; } cb.sendNotice(notices, username, '#F0FAFF'); } cb.onTip(function (tip) { var thisTip = parseInt(tip['amount']); if (questionsAsked < questions.length && thisTip == ((questionsAsked * lowestPrice) + lowestPrice)) { // this is a truth. var foundQuestioner = false; for (var i = 0; i < questioners.length; ++i) { if (questioners[i].Name == tip['from_user']) { foundQuestioner = true; questioners[i].NumberQuestions = questioners[i].NumberQuestions + 1; questioners[i].TipCount = questioners[i].TipCount + thisTip; break; } } if (foundQuestioner == false) { // new truth tipper. var questioner = { 'Name': tip['from_user'], 'NumberQuestions': 1, 'TipCount': thisTip }; questioners.push(questioner); } var foundPlayer = false; for (var i = 0; i < players.length; ++i) { if (players[i].Name == tip['from_user']) { foundPlayer = true; players[i].NumberQD = players[i].NumberQD + 1; players[i].TipCount = players[i].TipCount + thisTip; } } if (foundPlayer == false) { // new game player. var player = { 'Name': tip['from_user'], 'NumberQD': 1, 'TipCount': thisTip }; players.push(player); } var questionNotice = "NEW TRUTH!!! " + tip['from_user'] + " asked " + cb.room_slug + ": " + questions[questionsAsked]; cb.sendNotice(questionNotice, '', '#CCFFCC', '#000000', 'bold'); questions[questionsAsked] = questions[questionsAsked] + ' -- ASKED (' + thisTip + ' tokens) by ' + tip['from_user']; questionsAsked = questionsAsked + 1; cb.drawPanel(); cb.setTimeout(function() { var notices = ""; if (questionsAsked < questions.length) { notices = "The next TRUTH (for " + ((questionsAsked*lowestPrice) + lowestPrice) + " tokens): " + questions[questionsAsked]; } else { notices = "All TRUTHS have been asked!"; for (var j = 0; j < questions.length; ++j) { notices += "\n" + questions[j]; } } cb.sendNotice(notices, '', '#CCFFCC', '#000000', 'bold'); }, 3000); // wait three seconds, then advertise the next TRUTH stake } else if (daresAsked < dares.length && thisTip == ((daresAsked * lowestPrice) + lowestPrice + 1)) { // this is a dare. var foundDarer = false; for (var i = 0; i < darers.length; ++i) { if (darers[i].Name == tip['from_user']) { foundDarer = true; darers[i].NumberDares = darers[i].NumberDares + 1; darers[i].TipCount = darers[i].TipCount + thisTip; break; } } if (foundDarer == false) { // new dare tipper. var darer = { 'Name': tip['from_user'], 'NumberDares': 1, 'TipCount': thisTip }; darers.push(darer); } var foundPlayer = false; for (var i = 0; i < players.length; ++i) { if (players[i].Name == tip['from_user']) { foundPlayer = true; players[i].NumberQD = players[i].NumberQD + 1; players[i].TipCount = players[i].TipCount + thisTip; } } if (foundPlayer == false) { // new game player. var player = { 'Name': tip['from_user'], 'NumberQD': 1, 'TipCount': thisTip }; players.push(player); } var dareNotice = "NEW DARE!!! " + tip['from_user'] + " dared " + cb.room_slug + ": " + dares[daresAsked]; cb.sendNotice(dareNotice, '', '#CCFFCC', '#000000', 'bold'); dares[daresAsked] = dares[daresAsked] + ' -- DARED (' + thisTip + ' tokens) by ' + tip['from_user']; daresAsked = daresAsked + 1; cb.drawPanel(); cb.setTimeout(function() { var notices = ""; if (daresAsked < dares.length) { notices = "The next DARE (for " + ((daresAsked*lowestPrice) + lowestPrice + 1) + " tokens): " + dares[daresAsked]; } else { notices = "All DARES have been asked!"; for (var j = 0; j < dares.length; ++j) { notices += "\n" + dares[j]; } } cb.sendNotice(notices, '', '#CCFFCC', '#000000', 'bold'); }, 3000); // wait three seconds, then advertise the next DARE stake } else { // unrelated to the game. ignore this tip. } }); function mostValuableQuestioner() { var mvq = ""; var mvqIdx = -1; var biggestTip = 0; for (var i = 0; i < questioners.length; ++i) { if (questioners[i].TipCount > biggestTip) { biggestTip = questioners[i].TipCount; mvqIdx = i; } } if (mvqIdx >= 0) { mvq = "" + questioners[mvqIdx].Name + " - " + questioners[mvqIdx].NumberQuestions + " truths - " + questioners[mvqIdx].TipCount + " tokens!"; } else { mvq = "No questioners, yet!"; } return mvq; } function mostValuableDarer() { var mvd = ""; var mvdIdx = -1; var biggestTip = 0; for (var i = 0; i < darers.length; ++i) { if (darers[i].TipCount > biggestTip) { biggestTip = darers[i].TipCount; mvdIdx = i; } } if (mvdIdx >= 0) { mvd = "" + darers[mvdIdx].Name + " - " + darers[mvdIdx].NumberDares + " dares - " + darers[mvdIdx].TipCount + " tokens!"; } else { mvd = "No darers, yet!"; } return mvd; } function mostValuablePlayer() { var mvp = ""; var mvpIdx = -1; var biggestTip = 0; for (var i = 0; i < players.length; ++i) { if (players[i].TipCount > biggestTip) { biggestTip = players[i].TipCount; mvpIdx = i; } } if (mvpIdx >= 0) { mvp = "" + players[mvpIdx].Name + " - " + players[mvpIdx].NumberQD + " questions+dares - " + players[mvpIdx].TipCount + " tokens!"; } else { mvp = "No players, yet!"; } return mvp; } cb.onDrawPanel(function (user) { return { 'template': '3_rows_11_21_31', 'row1_value': 'MVP: ' + mostValuablePlayer(), 'row2_value': 'Most curious: ' + mostValuableQuestioner(), 'row3_value': 'Most daring: ' + mostValuableDarer() }; });
© Copyright Chaturbate 2011- 2026. All Rights Reserved.