1
0

gschool_randperson.qsrc 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. # gschool_randperson
  2. !! arguments: <gender> <excluded_first_name> <grupTipeEnabled>...
  3. !! gender : 0 for male, 1 for female
  4. !! excluded_first_name : can be '' or you can provide result of previous invocation, so you can compose non-repeating pairs of people
  5. !! <grupTipeEnabled>... : 1 if you include grupTipe, 0 otherwise, look at examples below
  6. !!
  7. !! example:
  8. !! $rand_girl = func('gschool_randperson', 1, '', 1, 1, 0, 1, 0, 0)
  9. !! $rand_girl1 = func('gschool_randperson', 1, $rand_girl, 1, 1, 0, 1)
  10. !!
  11. !! Having grupTipes (social groups)
  12. !! 1 - cool kids
  13. !! 2 - jocks
  14. !! 3 - nerds
  15. !! 4 - Gopnik
  16. !! 5 - outcasts
  17. !! 6 - teachers
  18. !! examples above instruct to choose random person from: cool kids, jocks and gopniks
  19. !! NOTE that in $rand_girl1 zero values for outcasts and teachers are not defined - undefined values will be zero by language
  20. !! Thanks to that you can include new social group and you don''t need to make changes in all places
  21. !! need rework
  22. !!if $ARGS[0] = 'person_generator':
  23. !! rand_person_ind = 0
  24. !! rand_filtered_ind = 0
  25. !! :filter_loop
  26. !! rand_person_ind = rand_person_ind + 1
  27. !! if rand_person_ind >= ARRSIZE('grupTipe') : jump 'outside_filter_loop'
  28. !! genderMatches = ARGS[0] = npcPol[rand_person_ind]
  29. !! nameIsNotRepeated = ARGS[1] <> $npc_firstname[$school_static_num[rand_person_ind]]
  30. !! grupTipeIsLegal = grupTipe[rand_person_ind] > 0
  31. !! grupTipeMatches = ARGS[grupTipe[rand_person_ind] + 1] = 1
  32. !! if genderMatches and nameIsNotRepeated and grupTipeIsLegal and grupTipeMatches :
  33. !! rand_filtered[rand_filtered_ind] = rand_person_ind
  34. !! rand_filtered_ind = rand_filtered_ind + 1
  35. !! end
  36. !! jump 'filter_loop'
  37. !! :outside_filter_loop
  38. !! if ARRSIZE('rand_filtered') > 0 :
  39. !! random_person = rand_filtered[rand(0,ARRSIZE('rand_filtered'))]
  40. !! $RESULT = $npc_firstname[$school_static_num[random_person]]
  41. !! else
  42. !! $rand_gender = IIF (ARGS[0] = 0, 'boy', 'girl')
  43. !! $RESULT = '<<$rand_gender>> you don''t know'
  44. !! end
  45. !! KILLVAR 'rand_person_ind'
  46. !! KILLVAR 'rand_filtered_ind'
  47. !! KILLVAR 'rand_filtered'
  48. !! KILLVAR '$rand_gender'
  49. !! KILLVAR 'random_person'
  50. !! KILLVAR 'genderMatches'
  51. !! KILLVAR 'nameIsNotRepeated'
  52. !! KILLVAR 'grupTipeIsLegal'
  53. !! KILLVAR 'grupTipeMatches'
  54. !!end
  55. if $ARGS[0] = 'couple_generator':
  56. :couple_jump
  57. couple_rand = rand(1,53)
  58. if couple_rand = 1:
  59. $rand_girl = 'Viktoriya'
  60. $rand_boy = 'Vanya'
  61. elseif couple_rand = 2:
  62. $rand_girl = 'Lina'
  63. $rand_boy = 'Ivan'
  64. elseif couple_rand = 3:
  65. $rand_girl = 'Stasya'
  66. $rand_boy = 'Andrey'
  67. elseif couple_rand = 4:
  68. $rand_girl = 'Lariska'
  69. $rand_boy = 'Ivan'
  70. elseif couple_rand = 5:
  71. $rand_girl = 'Lizaveta'
  72. $rand_boy = 'Andrey'
  73. elseif couple_rand = 6:
  74. $rand_girl = 'Lina'
  75. $rand_boy = 'Lazar'
  76. elseif couple_rand = 7:
  77. $rand_girl = 'Bella'
  78. $rand_boy = 'Lazar'
  79. elseif couple_rand = 8:
  80. $rand_girl = 'Lariska'
  81. $rand_boy = 'Lazar'
  82. elseif couple_rand = 9:
  83. $rand_girl = 'Irina'
  84. $rand_boy = 'Lazar'
  85. elseif couple_rand = 10:
  86. $rand_girl = 'Irina'
  87. $rand_boy = 'Dimka'
  88. elseif couple_rand = 11:
  89. $rand_girl = 'Anushka'
  90. $rand_boy = 'Marcus'
  91. elseif couple_rand = 12 and kotovLoveQW <= 0:
  92. $rand_girl = 'Pauline'
  93. $rand_boy = 'Vitek'
  94. elseif couple_rand = 13:
  95. $rand_girl = 'Pauline'
  96. $rand_boy = 'Dan'
  97. elseif couple_rand = 14:
  98. $rand_girl = 'Anushka'
  99. $rand_boy = 'Radomir'
  100. elseif couple_rand = 15:
  101. $rand_girl = 'Anushka'
  102. $rand_boy = 'Valentin'
  103. elseif couple_rand = 16:
  104. $rand_girl = 'Anushka'
  105. $rand_boy = 'Arkadi'
  106. elseif couple_rand = 17:
  107. $rand_girl = 'Alyona'
  108. $rand_boy = 'Valentin'
  109. elseif couple_rand = 18:
  110. $rand_girl = 'Alyona'
  111. $rand_boy = 'Arkadi'
  112. elseif couple_rand = 19:
  113. $rand_girl = 'Sonia'
  114. $rand_boy = 'Andrey'
  115. elseif couple_rand = 20:
  116. $rand_girl = 'Sonia'
  117. $rand_boy = 'Ivan'
  118. elseif couple_rand = 21:
  119. $rand_girl = 'Sonia'
  120. $rand_boy = 'Dimka'
  121. elseif couple_rand = 22:
  122. $rand_girl = 'Sonia'
  123. $rand_boy = 'Lazar'
  124. elseif couple_rand = 23:
  125. $rand_girl = 'Sonia'
  126. $rand_boy = 'Vasily'
  127. elseif couple_rand = 24:
  128. $rand_girl = 'Sonia'
  129. $rand_boy = 'Svyatoslav'
  130. elseif couple_rand = 25:
  131. $rand_girl = 'Sonia'
  132. $rand_boy = 'Erast'
  133. elseif couple_rand = 26 and fedorlove < 1:
  134. $rand_girl = 'Sonia'
  135. $rand_boy = 'Fedor'
  136. elseif couple_rand = 27:
  137. $rand_girl = 'Sonia'
  138. $rand_boy = 'Marcus'
  139. elseif couple_rand = 28 and kotovLoveQW <= 0:
  140. $rand_girl = 'Sonia'
  141. $rand_boy = 'Vitek'
  142. elseif couple_rand = 29:
  143. $rand_girl = 'Sonia'
  144. $rand_boy = 'Dan'
  145. elseif couple_rand = 30:
  146. $rand_girl = 'Sonia'
  147. $rand_boy = 'Radomir'
  148. elseif couple_rand = 31:
  149. $rand_girl = 'Sonia'
  150. $rand_boy = 'Valentin'
  151. elseif couple_rand = 32:
  152. $rand_girl = 'Sonia'
  153. $rand_boy = 'Arkadi'
  154. elseif couple_rand = 33:
  155. $rand_girl = 'Sonia'
  156. $rand_boy = 'Roman'
  157. elseif couple_rand = 34:
  158. $rand_girl = 'Pauline'
  159. $rand_boy = 'Radomir'
  160. elseif couple_rand = 35:
  161. $rand_girl = 'Anushka'
  162. $rand_boy = 'Lazar'
  163. elseif couple_rand = 36:
  164. $rand_girl = 'Anushka'
  165. $rand_boy = 'Ivan'
  166. elseif couple_rand = 37:
  167. $rand_girl = 'Anushka'
  168. $rand_boy = 'Lavrenti'
  169. elseif couple_rand = 38:
  170. $rand_girl = 'Alyona'
  171. $rand_boy = 'Lavrenti'
  172. elseif couple_rand = 39:
  173. $rand_girl = 'Albina'
  174. $rand_boy = 'Lazar'
  175. elseif couple_rand = 40:
  176. $rand_girl = 'Sonia'
  177. $rand_boy = 'Lavrenti'
  178. elseif couple_rand = 41:
  179. $rand_girl = 'Alyona'
  180. $rand_boy = 'Radomir'
  181. elseif couple_rand = 42:
  182. $rand_girl = 'Lizaveta'
  183. $rand_boy = 'Lavrenti'
  184. elseif couple_rand = 43 and christinaQW['dompath'] < 6:
  185. $rand_girl = 'Christina'
  186. $rand_boy = 'Lazar'
  187. elseif couple_rand = 44 and christinaQW['dompath'] < 6:
  188. $rand_girl = 'Christina'
  189. $rand_boy = 'Ivan'
  190. elseif couple_rand = 45:
  191. $rand_girl = 'Lariska'
  192. $rand_boy = 'Ivan'
  193. elseif couple_rand = 46:
  194. $rand_girl = 'Lariska'
  195. $rand_boy = 'Radomir'
  196. elseif couple_rand = 47:
  197. $rand_girl = 'Lina'
  198. $rand_boy = 'Andrey'
  199. elseif couple_rand = 48:
  200. $rand_girl = 'Lina'
  201. $rand_boy = 'Svyatoslav'
  202. elseif couple_rand = 49:
  203. $rand_girl = 'Lina'
  204. $rand_boy = 'Radomir'
  205. elseif couple_rand = 50:
  206. $rand_girl = 'Pauline'
  207. $rand_boy = 'Radomir'
  208. elseif couple_rand = 51:
  209. $rand_girl = 'Lena'
  210. $rand_boy = 'Radomir'
  211. elseif couple_rand = 52:
  212. $rand_girl = 'Lena'
  213. $rand_boy = 'Lavrenti'
  214. elseif couple_rand = 53:
  215. $rand_girl = 'Sonia'
  216. $rand_boy = 'Niko'
  217. else
  218. jump 'couple_jump'
  219. end
  220. killvar 'couple_rand'
  221. end
  222. --- gschool_randperson ---------------------------------