u_commands.txt 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. function initPlotFlags() {
  2. list = list.new();
  3. list.add(list, initPlotFlag(calcLeftShift(30), "SUB_PLOT_FLAG"));
  4. list.add(list, initPlotFlag(calcLeftShift(29), "FREE_FLAG"));
  5. list.add(list, initPlotFlag(calcLeftShift(28), "CITY_FLAG"));
  6. list.add(list, initPlotFlag(calcLeftShift(27), "EXPLOSION_FLAG"));
  7. list.add(list, initPlotFlag(calcLeftShift(26), "DISABLE_SIGNS_FLAG"));
  8. list.add(list, initPlotFlag(calcLeftShift(5), "ENTITY_INTERACT_FLAG"));
  9. list.add(list, initPlotFlag(calcLeftShift(4), "BLOCK_INTERACT_FLAG"));
  10. list.add(list, initPlotFlag(calcLeftShift(3), "HIT_AMBIENT_FLAG"));
  11. list.add(list, initPlotFlag(calcLeftShift(2), "BUCKET_FLAG"));
  12. list.add(list, initPlotFlag(calcLeftShift(1), "BREAK_FLAG"));
  13. list.add(list, initPlotFlag(calcLeftShift(0), "PLACE_FLAG"));
  14. setScriptVar("all_plot_flags", list);
  15. }
  16. function initPlotFlag(f, f_name) {
  17. a = array.new(2);
  18. a[0] = f;
  19. a[1] = f_name;
  20. return a;
  21. }
  22. function getAllPlotFlags() {
  23. return getScriptVar("all_plot_flags");
  24. }
  25. function getFlagLists(plot) {
  26. flags = plot.getFlags(plot);
  27. all_flags = getAllPlotFlags();
  28. flags_true = list.new();
  29. flags_false = list.new();
  30. iter = iterator(all_flags);
  31. while(hasNext(iter)) {
  32. a = next(iter);
  33. f = a[0];
  34. if(flags >= f) {
  35. list.add(flags_true, a);
  36. flags -= f;
  37. } else {
  38. list.add(flags_false, a);
  39. }
  40. }
  41. a = array.new(2);
  42. a[0] = flags_true;
  43. a[1] = flags_false;
  44. return a;
  45. }
  46. function getRickRollSounds() {
  47. RickRollSounds = list.new();
  48. list.add(RickRollSounds, math.pow(2, -6 / 12));//6
  49. list.add(RickRollSounds, math.pow(2, -4 / 12));//8
  50. list.add(RickRollSounds, math.pow(2, -1 / 12));//11
  51. list.add(RickRollSounds, math.pow(2, -4 / 12));//8
  52. list.add(RickRollSounds, math.pow(2, 3 / 12));//15
  53. list.add(RickRollSounds, math.pow(2, 3 / 12));//15
  54. list.add(RickRollSounds, math.pow(2, 1 / 12));//13
  55. list.add(RickRollSounds, math.pow(2, -6 / 12));//6
  56. list.add(RickRollSounds, math.pow(2, -4 / 12));//8
  57. list.add(RickRollSounds, math.pow(2, -1 / 12));//11
  58. list.add(RickRollSounds, math.pow(2, -4 / 12));//8
  59. list.add(RickRollSounds, math.pow(2, 1 / 12));//13
  60. list.add(RickRollSounds, math.pow(2, 1 / 12));//13
  61. list.add(RickRollSounds, math.pow(2, -1 / 12));//11
  62. list.add(RickRollSounds, math.pow(2, -2 / 12));//10
  63. list.add(RickRollSounds, math.pow(2, -4 / 12));//8
  64. list.add(RickRollSounds, math.pow(2, -6 / 12));//6
  65. list.add(RickRollSounds, math.pow(2, -4 / 12));//8
  66. list.add(RickRollSounds, math.pow(2, -1 / 12));//11
  67. list.add(RickRollSounds, math.pow(2, -4 / 12));//8
  68. list.add(RickRollSounds, math.pow(2, -1 / 12));//11
  69. list.add(RickRollSounds, math.pow(2, 1 / 12));//13
  70. list.add(RickRollSounds, math.pow(2, -2 / 12));//10
  71. list.add(RickRollSounds, math.pow(2, -4 / 12));//8
  72. list.add(RickRollSounds, math.pow(2, -6 / 12));//6
  73. list.add(RickRollSounds, math.pow(2, -6 / 12));//6
  74. list.add(RickRollSounds, math.pow(2, -6 / 12));//6
  75. list.add(RickRollSounds, math.pow(2, 1 / 12));//13
  76. list.add(RickRollSounds, math.pow(2, -1 / 12));//11
  77. //6,8,11,8,15,15,13,6,8,11,8,13,13,11,10,8,6,8,11,8,11,13,10,8,6,6,6,13,11
  78. return RickRollSounds;
  79. }
  80. function getRickRollSoundDists() {
  81. RickRollSoundDists = list.new();
  82. list.add(RickRollSoundDists, 2);//1
  83. list.add(RickRollSoundDists, 2);//1
  84. list.add(RickRollSoundDists, 2);//1
  85. list.add(RickRollSoundDists, 2);//1
  86. list.add(RickRollSoundDists, 6);//3
  87. list.add(RickRollSoundDists, 6);//3
  88. list.add(RickRollSoundDists, 12);//6
  89. list.add(RickRollSoundDists, 2);//1
  90. list.add(RickRollSoundDists, 2);//1
  91. list.add(RickRollSoundDists, 2);//1
  92. list.add(RickRollSoundDists, 2);//1
  93. list.add(RickRollSoundDists, 6);//3
  94. list.add(RickRollSoundDists, 6);//3
  95. list.add(RickRollSoundDists, 6);//3
  96. list.add(RickRollSoundDists, 2);//1
  97. list.add(RickRollSoundDists, 6);//3
  98. list.add(RickRollSoundDists, 2);//1
  99. list.add(RickRollSoundDists, 2);//1
  100. list.add(RickRollSoundDists, 2);//1
  101. list.add(RickRollSoundDists, 2);//1
  102. list.add(RickRollSoundDists, 8);//4
  103. list.add(RickRollSoundDists, 4);//2
  104. list.add(RickRollSoundDists, 6);//3
  105. list.add(RickRollSoundDists, 2);//1
  106. list.add(RickRollSoundDists, 4);//2
  107. list.add(RickRollSoundDists, 4);//2
  108. list.add(RickRollSoundDists, 6);//3
  109. list.add(RickRollSoundDists, 8);//4
  110. list.add(RickRollSoundDists, 2);//1
  111. //2,2,2,2,2,6,6,12,2,2,2,2,6,6,6,2,6,2,2,2,2,8,4,6,2,4,4,6,8
  112. return RickRollSoundDists;
  113. }
  114. function getBobbyCarSounds() {
  115. bobbyCarSounds = list.new();
  116. list.add(bobbyCarSounds, math.pow(2, 4 / 12));
  117. list.add(bobbyCarSounds, math.pow(2, 2 / 12));
  118. list.add(bobbyCarSounds, math.pow(2, 1 / 12));
  119. list.add(bobbyCarSounds, math.pow(2, 4 / 12));
  120. list.add(bobbyCarSounds, math.pow(2, -3 / 12));
  121. list.add(bobbyCarSounds, math.pow(2, 1 / 12));
  122. list.add(bobbyCarSounds, math.pow(2, -1 / 12));
  123. list.add(bobbyCarSounds, math.pow(2, 2 / 12));
  124. list.add(bobbyCarSounds, math.pow(2, -4 / 12));
  125. list.add(bobbyCarSounds, math.pow(2, -1 / 12));
  126. list.add(bobbyCarSounds, math.pow(2, -3 / 12));
  127. list.add(bobbyCarSounds, math.pow(2, -1 / 12));
  128. list.add(bobbyCarSounds, math.pow(2, 1 / 12));
  129. return bobbyCarSounds;
  130. }
  131. function getBobbyCarSoundDists() {
  132. bobbyCarSoundDists = list.new();
  133. list.add(bobbyCarSoundDists, 8);
  134. list.add(bobbyCarSoundDists, 8);
  135. list.add(bobbyCarSoundDists, 4);
  136. list.add(bobbyCarSoundDists, 6);
  137. list.add(bobbyCarSoundDists, 6);
  138. list.add(bobbyCarSoundDists, 6);
  139. list.add(bobbyCarSoundDists, 6);
  140. list.add(bobbyCarSoundDists, 6);
  141. list.add(bobbyCarSoundDists, 6);
  142. list.add(bobbyCarSoundDists, 6);
  143. list.add(bobbyCarSoundDists, 4);
  144. list.add(bobbyCarSoundDists, 6);
  145. list.add(bobbyCarSoundDists, 6);
  146. return bobbyCarSoundDists;
  147. }