bratva_pornstudio_actress.qsrc 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. # bratva_pornstudio_actress
  2. ! list of current studio workers
  3. if $args[0] = 'actress_list':
  4. *clr & cla
  5. act '<b>Close</b>': gt 'bratva_pornstudio'
  6. act 'Casting': gt 'bratva_pornstudio_actress','casting'
  7. act 'Filmography studios': gt 'bratva_pornstudio_films','films'
  8. _actress_count = arrsize('$actress')/8
  9. _cell_count = 0
  10. $_actress_str = ''
  11. i = 0
  12. :bpa_loop1
  13. if $actress['<<i>>,retire'] = 0 and $actress['<<i>>,hired'] = 1:
  14. if _cell_count = 0: $_actress_str += '<tr>'
  15. $_actress_str += '<td>'+func('bratva_pornstudio_actress','actress_box',i)+'</td>'
  16. if _cell_count = 3:
  17. _cell_count = 0
  18. $_actress_str += '</tr>'
  19. else
  20. _cell_count += 1
  21. end
  22. end
  23. i += 1
  24. if i < _actress_count: jump 'bpa_loop1'
  25. ! if necessary - we finish the table with empty cells
  26. if _cell_count > 0:
  27. i = _cell_count
  28. :bpa_loop2
  29. $_actress_str += '</tr>'
  30. i += 1
  31. if i <= 3: jump 'bpa_loop2'
  32. end
  33. '<center><table border=0>'+$_actress_str+'</table></center>'
  34. killvar '$_actress_str'
  35. killvar '_cell_count'
  36. end
  37. ! info by actress
  38. ! args[1] - id actress
  39. if $args[0] = 'actress_info':
  40. _actress_info_id = args[1]
  41. *clr & cla
  42. act '<b>Close</b>': gt 'bratva_pornstudio'
  43. act 'List of actresses': gt 'bratva_pornstudio_actress','actress_list'
  44. act 'Filmography studios': gt 'bratva_pornstudio_films','films'
  45. ! face actress
  46. '<center><table border=0>'+func('bratva_pornstudio_actress','actress_box',_actress_info_id)+'</table></center>'
  47. ! инфо
  48. $_actress_str = 'Available genres:' + func('bratva_pornstudio_actress','actress_genre',val($actress['<<_actress_info_id>>,genres'])) + '**'
  49. if $actress['<<_actress_info_id>>,retire'] = 0:
  50. _next_film_date = func('bratva_pornstudio_actress','calc_relax',_actress_info_id)
  51. if _next_film_date >= daystart:
  52. $_actress_str += $actress['<<_actress_info_id>>,name'] + ' will be available for filming through ' + (_next_film_date - daystart + 1) + ' days'
  53. else
  54. $_actress_str += $actress['<<_actress_info_id>>,name'] + ' available for filming.'
  55. end
  56. else
  57. $_actress_str += $actress['<<_actress_info_id>>,name'] + ' more you can not be removed.'
  58. end
  59. '<div class="film-info">'+$_actress_str+'</div>'
  60. killvar '$_actress_str'
  61. killvar '_next_film_date'
  62. ! Filmography
  63. gs 'bratva_pornstudio_films','film_list',_actress_info_id
  64. killvar '_actress_info_id'
  65. end
  66. ! actress wrapper
  67. ! args[1] - id actresses
  68. if $args[0] = 'actress_box':
  69. _actress_id = args[1]
  70. $result = '<div class="box actress">'
  71. ! photo of the actress
  72. $result += '<img src="mod/Bratva/locations/city/north/pornstudio/actress/<<_actress_id>>.jpg">'
  73. ! the name of the actress, it is - a link to the filmography
  74. $result += '<a href="exec:gt''bratva_pornstudio_actress'',''actress_info'',<<_actress_id>>">'+$actress['<<_actress_id>>,name']+'</a>'
  75. ! rating
  76. $result += '<div><img src="mod/Bratva/locations/city/north/pornstudio/rating/'+$actress['<<_actress_id>>,rating']/10+'.png"></div>'
  77. $result += '</div>'
  78. killvar '_actress_id'
  79. end
  80. ! the timing of the availability of the actress, depending on the conditions in the studio
  81. ! args[1] - actresses id
  82. if $args[0] = 'calc_relax':
  83. _actress_last_id = args[1]
  84. ! if a last_film_id = -1 - the actress has not yet starred and then available
  85. _last_film_id = $actress['<<_actress_last_id>>,last_film']
  86. if _last_film_id < 0:
  87. result = daystart - 1
  88. else
  89. ! if already filmed
  90. ! we get the genre of the film by its id
  91. _last_film_genre = $films['<<_last_film_id>>,genre']
  92. ! рассчитываем время отдыха в зависимости от условий в студии
  93. _last_film_relax = (1 + _last_film_genre)*2 - studio['relax_area']*3/2
  94. ! Between shootings there should be at least 2 days, but according to the formula it is possible even less, we check
  95. if _last_film_relax < 2: _last_film_relax = 2
  96. ! get the date of the last shooting of the actress and add rest days
  97. result = val($actress['<<_actress_last_id>>,date']) + _last_film_relax
  98. ! cleaning variables
  99. killvar '_actress_last_id'
  100. killvar '_last_film_id'
  101. killvar '_last_film_genre'
  102. killvar '_last_film_relax'
  103. end
  104. end
  105. ! we get the names of the actress who starred in the film
  106. ! $args[1] - id array of actresses
  107. if $args[0] = 'get_actress_name':
  108. $_actress_arr = $args[1]
  109. ! get the length of the array - the number of actresses
  110. _actress_count = func('zz_funcs','get_count',$_actress_arr)
  111. $_actress_names = ''
  112. _actress_i = 0
  113. :loop_actress_names
  114. if _actress_i < _actress_count:
  115. _actress_num = val(func('zz_funcs','get_item_string',$_actress_arr,_actress_i))
  116. if $actress['<<_actress_num>>,retire'] = 0:
  117. $_actress_names += '<a href="exec:gt''bratva_pornstudio_actress'',''actress_info'',<<_actress_num>>">' + $actress['<<_actress_num>>,name'] + '</a>, '
  118. else
  119. $_actress_names += $actress['<<_actress_num>>,name'] + ', '
  120. end
  121. _actress_i += 1
  122. jump 'loop_actress_names'
  123. end
  124. $result = mid($_actress_names,1,len($_actress_names)-2)
  125. killvar '$_actress_arr'
  126. killvar '_actress_count'
  127. killvar '_actress_i'
  128. killvar '$_actress_names'
  129. killvar '_actress_num'
  130. end
  131. ! list of genres for actresses
  132. ! args[1] - maximum available genre
  133. if $args[0] = 'actress_genre':
  134. _actress_genre_i = 0
  135. $result = ''
  136. :loop_genres
  137. $result += '<span class="film-tag">' + $film_genre['<<_actress_genre_i>>,name'] + '</span>'
  138. _actress_genre_i += 1
  139. if _actress_genre_i <= args[1]: jump 'loop_genres'
  140. !---
  141. killvar '_actress_genre_i'
  142. end
  143. ! hiring an actress
  144. ! args[1] - actresses id
  145. if $args[0] = 'actress_hire':
  146. $actress['<<args[1]>>,hired'] = 1
  147. ! remove from the current profit bonus for signing
  148. studio['money_month'] -= 10000
  149. ! remove the balance of the studio signing bonus
  150. studio['money'] -= 10000
  151. gt 'bratva_pornstudio_actress','casting',args[1]
  152. end
  153. !calculation of the average rating of all studio actresses
  154. if $args[0] = 'avg_rating':
  155. _actress_avg = 0
  156. _actress_count = arrsize('$actress')/8
  157. if _actress_count = 0:
  158. result = 0
  159. else
  160. i = 0
  161. :loop_avg_rating
  162. if i < _actress_count:
  163. _actress_avg += $actress['<<i>>,rating']
  164. i += 1
  165. jump 'loop_avg_rating'
  166. end
  167. result = _actress_avg / _actress_count
  168. killvar '_actress_avg'
  169. killvar '_actress_count'
  170. end
  171. end
  172. ! recount actress stats
  173. if $args[0] = 'update_actress_info':
  174. i = 0
  175. :loop_actress_rating
  176. if i < arrsize('$actress')/8:
  177. j = 0
  178. _actress_rating = 0
  179. _actress_films_count = 0
  180. _films_count = arrsize('films')/11
  181. :loop_films_rating
  182. if j < _films_count:
  183. if func('zz_funcs','get_item_id',$films['<<j>>,actress'],str(i)) > 0:
  184. _actress_rating += $films['<<j>>,rating']
  185. _actress_films_count += 1
  186. end
  187. j += 1
  188. jump 'loop_films_rating'
  189. end
  190. if _actress_films_count > 0:
  191. $actress['<<i>>,rating'] = _actress_rating / _actress_films_count
  192. else
  193. $actress['<<i>>,rating'] = 0
  194. end
  195. i += 1
  196. jump 'loop_actress_rating'
  197. end
  198. killvar '_actress_rating'
  199. killvar '_actress_films_count'
  200. killvar '_films_count'
  201. end
  202. ! casting
  203. if $args[0] = 'casting':
  204. *clr & cla
  205. act '<b>Leave</b>': killvar '_casting_id' & gt 'bratva_pornstudio_actress','actress_list'
  206. if arrsize('$actress')/8 <= 1: exit
  207. _casting_id = args[1]
  208. if _casting_id < 1: _casting_id = 1
  209. if _casting_id >= arrsize('$actress')/8: _casting_id = 1
  210. '<center><img <<$set_imgh>> src="mod/Bratva/locations/city/north/pornstudio/actress/casting/'+_casting_id+'.jpg"></center>'
  211. $_casting_prev = '<a href="exec:gt''bratva_pornstudio_actress'',''casting'',<<_casting_id-1>>">Previous</a>'
  212. $_casting_next = '<a href="exec:gt''bratva_pornstudio_actress'',''casting'',<<_casting_id+1>>">Next</a>'
  213. $_casting_hire = ' <a href="exec:gt''bratva_pornstudio_actress'',''actress_hire'',<<_casting_id>>">Hire</a> '
  214. if $actress['<<_casting_id>>,hired'] = 1:
  215. '<div class="film-casting">' + $_casting_prev + ' <span>The actress is already busy!</span> ' + $_casting_next + '</div>'
  216. elseif $actress['<<_casting_id>>,retire'] = 1:
  217. '<div class="film-casting">' + $_casting_prev + ' <span>The actress is fired!</span> ' + $_casting_next + '</div>'
  218. else
  219. '<div class="film-casting">' + $_casting_prev + $_casting_hire + $_casting_next + '</div>'
  220. end
  221. end
  222. --- bratva_pornstudio_actress ---------------------------------