NoSloppy

Untitled

Oct 4th, 2020
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. /*
  2.  
  3. quote_player.h
  4.  
  5. supports per font (or common) quote player function
  6.  
  7. note: for each font where you want their own theatrical quotes to play, please make sure
  8. your preset has a font search path, and that you add the quote folder like so:
  9.  
  10. ;font/quote
  11.  
  12. then create your quote folder under that font, and populate it with 00xx.wav files
  13.  
  14. note: if you want to share common quotes between fonts, try something like this:
  15.  
  16. ;common/quote
  17.  
  18. */
  19.  
  20. // select a (sort-of) random number
  21. playNumber = random(1,10);
  22.  
  23. // frequency distribution
  24. // 10% chance for each
  25. if (playNumber > 9)
  26. {
  27. playFile = "quote10.wav";
  28. }
  29. else if (playNumber > 8)
  30. {
  31. playFile = "quote09.wav";
  32. }
  33. else if (playNumber > 7)
  34. {
  35. playFile = "quote08.wav";
  36. }
  37. else if (playNumber > 6)
  38. {
  39. playFile = "quote07.wav";
  40. }
  41. else if (playNumber > 5)
  42. {
  43. playFile = "quote06.wav";
  44. }
  45. else if (playNumber > 4)
  46. {
  47. playFile = "quote05.wav";
  48. }
  49. else if (playNumber > 3)
  50. {
  51. playFile = "quote04.wav";
  52. }
  53. else if (playNumber > 2)
  54. {
  55. playFile = "quote03.wav";
  56. }
  57. else if (playNumber > 1)
  58. {
  59. playFile = "quote02.wav";
  60. }
  61. else
  62. {
  63. playFile = "quote01.wav";
  64. }
  65.  
  66. // play randomized quote
  67. ::CommandParser::DoParse("play", playFile);
  68.  
Advertisement
Add Comment
Please, Sign In to add comment