Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- quote_player.h
- supports per font (or common) quote player function
- note: for each font where you want their own theatrical quotes to play, please make sure
- your preset has a font search path, and that you add the quote folder like so:
- ;font/quote
- then create your quote folder under that font, and populate it with 00xx.wav files
- note: if you want to share common quotes between fonts, try something like this:
- ;common/quote
- */
- // select a (sort-of) random number
- playNumber = random(1,10);
- // frequency distribution
- // 10% chance for each
- if (playNumber > 9)
- {
- playFile = "quote10.wav";
- }
- else if (playNumber > 8)
- {
- playFile = "quote09.wav";
- }
- else if (playNumber > 7)
- {
- playFile = "quote08.wav";
- }
- else if (playNumber > 6)
- {
- playFile = "quote07.wav";
- }
- else if (playNumber > 5)
- {
- playFile = "quote06.wav";
- }
- else if (playNumber > 4)
- {
- playFile = "quote05.wav";
- }
- else if (playNumber > 3)
- {
- playFile = "quote04.wav";
- }
- else if (playNumber > 2)
- {
- playFile = "quote03.wav";
- }
- else if (playNumber > 1)
- {
- playFile = "quote02.wav";
- }
- else
- {
- playFile = "quote01.wav";
- }
- // play randomized quote
- ::CommandParser::DoParse("play", playFile);
Advertisement
Add Comment
Please, Sign In to add comment