Apps Home
|
Create an App
RedaDice II
Author:
redadare
Description
Source Code
Launch App
Current Users
Created by:
Redadare
// RedaDice II game by Redadare // June 2014 var lastRoller = '--'; var lastArticle = '--'; init(); function init() { cb.changeRoomSubject('RedaDice II game running! Roll the dice (' + cb.settings.tokens + ' per roll). Each result = 1 piece of clothing and 1 situation. If the clothing is on I take it off, if it is already off I put it back on again....in the rolled situation!'); } cb.onEnter(function (user) { cb.chatNotice('Welcome ' + user['user'] + '!', user['user'], '', '#E31E24', 'bold'); cb.chatNotice('RedaDice II game running! Tip ' + cb.settings.tokens + ' to roll the dice.', user['user'], '', '#E31E24', 'bold'); cb.chatNotice('Each result = 1 piece of clothing and a situation. If the clothing is on I take it off, if it is already off I put it back on again....in the rolled situation!', user['user'], '', '#E31E24', 'bold'); cb.chatNotice('Tip to keep the game going!', user['user'], '', '#E31E24', 'bold'); }); cb.settings_choices = [ { name: 'tokens', type: 'int', minValue: 1, maxValue: 200, label: 'Cost per Roll (in tokens)', defaultValue: 25 }, { name: 'article1', type: 'str', label: 'Clothing article if 1 is rolled?' }, { name: 'article2', type: 'str', label: 'Clothing article if 2 is rolled?' }, { name: 'article3', type: 'str', label: 'Clothing article if 3 is rolled?' }, { name: 'article4', type: 'str', label: 'Clothing article if 4 is rolled?' }, { name: 'article5', type: 'str', label: 'Clothing article if 5 is rolled?' }, { name: 'article6', type: 'str', label: 'Clothing article if 6 is rolled?' }, { name: 'situation1', type: 'str', label: 'Situation if 6 is rolled?' }, { name: 'situation2', type: 'str', label: 'Situation if 6 is rolled?' }, { name: 'situation3', type: 'str', label: 'Situation if 6 is rolled?' }, { name: 'situation4', type: 'str', label: 'Situation if 6 is rolled?' }, { name: 'situation5', type: 'str', label: 'Situation if 6 is rolled?' }, { name: 'situation6', type: 'str', label: 'Situation if 6 is rolled?' } ]; cb.onTip(function (tip) { if (parseInt(tip['amount']) >= cb.settings.tokens) { var rolls = Math.floor(parseInt(tip['amount']) / cb.settings.tokens); for (var r = 0; r < rolls; r++) { var dieRoll = Math.floor((Math.random() * 6) + 1); if (dieRoll == 1) prize = cb.settings.article1; if (dieRoll == 2) prize = cb.settings.article2; if (dieRoll == 3) prize = cb.settings.article3; if (dieRoll == 4) prize = cb.settings.article4; if (dieRoll == 5) prize = cb.settings.article5; if (dieRoll == 6) prize = cb.settings.article6; lastRoller = tip['from_user']; lastArticle = prize; // cb.chatNotice(tip['from_user'] + ' has rolled a :redadie' + dieRoll + ' = ' + prize, '', '', '#E31E24', 'bold'); var dieRoll2 = Math.floor((Math.random() * 6) + 1); if (dieRoll2 == 1) prize2 = cb.settings.situation1; if (dieRoll2 == 2) prize2 = cb.settings.situation2; if (dieRoll2 == 3) prize2 = cb.settings.situation3; if (dieRoll2 == 4) prize2 = cb.settings.situation4; if (dieRoll2 == 5) prize2 = cb.settings.situation5; if (dieRoll2 == 6) prize2 = cb.settings.situation6; // lastRoller = tip['from_user']; // lastArticle = prize; cb.chatNotice(tip['from_user'] + ' has rolled a :redadie' + dieRoll + ' = ' + prize + ', and a :redadie' + dieRoll2 + ' = ' + prize2, '', '', '#E31E24', 'bold'); // cb.chatNotice('and a :redadie' + dieRoll2 + ' = ' + prize, '', '', '#E31E24', 'bold'); } cb.drawPanel(); } }); cb.onDrawPanel(function (user) { return { 'template': '3_rows_12_22_31', 'row1_label': 'Last roll by:', 'row1_value': lastRoller, 'row2_label': 'Result:', 'row2_value': lastArticle, 'row3_value': 'Tip to keep game going' }; });
© Copyright Chaturbate 2011- 2026. All Rights Reserved.