123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223 |
- # bratva_pornstudio_actress
- ! list of current studio workers
- if $args[0] = 'actress_list':
- *clr & cla
- act '<b>Close</b>': gt 'bratva_pornstudio'
- act 'Casting': gt 'bratva_pornstudio_actress','casting'
- act 'Filmography studios': gt 'bratva_pornstudio_films','films'
- _actress_count = arrsize('$actress')/8
- _cell_count = 0
- $_actress_str = ''
- i = 0
- :bpa_loop1
- if $actress['<<i>>,retire'] = 0 and $actress['<<i>>,hired'] = 1:
- if _cell_count = 0: $_actress_str += '<tr>'
- $_actress_str += '<td>'+func('bratva_pornstudio_actress','actress_box',i)+'</td>'
- if _cell_count = 3:
- _cell_count = 0
- $_actress_str += '</tr>'
- else
- _cell_count += 1
- end
- end
- i += 1
- if i < _actress_count: jump 'bpa_loop1'
- ! if necessary - we finish the table with empty cells
- if _cell_count > 0:
- i = _cell_count
- :bpa_loop2
- $_actress_str += '</tr>'
- i += 1
- if i <= 3: jump 'bpa_loop2'
- end
- '<center><table border=0>'+$_actress_str+'</table></center>'
- killvar '$_actress_str'
- killvar '_cell_count'
- end
- ! info by actress
- ! args[1] - id actress
- if $args[0] = 'actress_info':
- _actress_info_id = args[1]
- *clr & cla
- act '<b>Close</b>': gt 'bratva_pornstudio'
- act 'List of actresses': gt 'bratva_pornstudio_actress','actress_list'
- act 'Filmography studios': gt 'bratva_pornstudio_films','films'
- ! face actress
- '<center><table border=0>'+func('bratva_pornstudio_actress','actress_box',_actress_info_id)+'</table></center>'
- ! инфо
- $_actress_str = 'Available genres:' + func('bratva_pornstudio_actress','actress_genre',val($actress['<<_actress_info_id>>,genres'])) + '**'
- if $actress['<<_actress_info_id>>,retire'] = 0:
- _next_film_date = func('bratva_pornstudio_actress','calc_relax',_actress_info_id)
- if _next_film_date >= daystart:
- $_actress_str += $actress['<<_actress_info_id>>,name'] + ' will be available for filming through ' + (_next_film_date - daystart + 1) + ' days'
- else
- $_actress_str += $actress['<<_actress_info_id>>,name'] + ' available for filming.'
- end
- else
- $_actress_str += $actress['<<_actress_info_id>>,name'] + ' more you can not be removed.'
- end
- '<div class="film-info">'+$_actress_str+'</div>'
- killvar '$_actress_str'
- killvar '_next_film_date'
- ! Filmography
- gs 'bratva_pornstudio_films','film_list',_actress_info_id
- killvar '_actress_info_id'
- end
- ! actress wrapper
- ! args[1] - id actresses
- if $args[0] = 'actress_box':
- _actress_id = args[1]
- $result = '<div class="box actress">'
- ! photo of the actress
- $result += '<img src="mod/Bratva/locations/city/north/pornstudio/actress/<<_actress_id>>.jpg">'
- ! the name of the actress, it is - a link to the filmography
- $result += '<a href="exec:gt''bratva_pornstudio_actress'',''actress_info'',<<_actress_id>>">'+$actress['<<_actress_id>>,name']+'</a>'
- ! rating
- $result += '<div><img src="mod/Bratva/locations/city/north/pornstudio/rating/'+$actress['<<_actress_id>>,rating']/10+'.png"></div>'
- $result += '</div>'
- killvar '_actress_id'
- end
- ! the timing of the availability of the actress, depending on the conditions in the studio
- ! args[1] - actresses id
- if $args[0] = 'calc_relax':
- _actress_last_id = args[1]
- ! if a last_film_id = -1 - the actress has not yet starred and then available
- _last_film_id = $actress['<<_actress_last_id>>,last_film']
- if _last_film_id < 0:
- result = daystart - 1
- else
- ! if already filmed
- ! we get the genre of the film by its id
- _last_film_genre = $films['<<_last_film_id>>,genre']
- ! рассчитываем время отдыха в зависимости от условий в студии
- _last_film_relax = (1 + _last_film_genre)*2 - studio['relax_area']*3/2
- ! Between shootings there should be at least 2 days, but according to the formula it is possible even less, we check
- if _last_film_relax < 2: _last_film_relax = 2
- ! get the date of the last shooting of the actress and add rest days
- result = val($actress['<<_actress_last_id>>,date']) + _last_film_relax
- ! cleaning variables
- killvar '_actress_last_id'
- killvar '_last_film_id'
- killvar '_last_film_genre'
- killvar '_last_film_relax'
- end
- end
- ! we get the names of the actress who starred in the film
- ! $args[1] - id array of actresses
- if $args[0] = 'get_actress_name':
- $_actress_arr = $args[1]
- ! get the length of the array - the number of actresses
- _actress_count = func('zz_funcs','get_count',$_actress_arr)
- $_actress_names = ''
- _actress_i = 0
- :loop_actress_names
- if _actress_i < _actress_count:
- _actress_num = val(func('zz_funcs','get_item_string',$_actress_arr,_actress_i))
- if $actress['<<_actress_num>>,retire'] = 0:
- $_actress_names += '<a href="exec:gt''bratva_pornstudio_actress'',''actress_info'',<<_actress_num>>">' + $actress['<<_actress_num>>,name'] + '</a>, '
- else
- $_actress_names += $actress['<<_actress_num>>,name'] + ', '
- end
- _actress_i += 1
- jump 'loop_actress_names'
- end
- $result = mid($_actress_names,1,len($_actress_names)-2)
- killvar '$_actress_arr'
- killvar '_actress_count'
- killvar '_actress_i'
- killvar '$_actress_names'
- killvar '_actress_num'
- end
- ! list of genres for actresses
- ! args[1] - maximum available genre
- if $args[0] = 'actress_genre':
- _actress_genre_i = 0
- $result = ''
- :loop_genres
- $result += '<span class="film-tag">' + $film_genre['<<_actress_genre_i>>,name'] + '</span>'
- _actress_genre_i += 1
- if _actress_genre_i <= args[1]: jump 'loop_genres'
- !---
- killvar '_actress_genre_i'
- end
- ! hiring an actress
- ! args[1] - actresses id
- if $args[0] = 'actress_hire':
- $actress['<<args[1]>>,hired'] = 1
- ! remove from the current profit bonus for signing
- studio['money_month'] -= 10000
- ! remove the balance of the studio signing bonus
- studio['money'] -= 10000
- gt 'bratva_pornstudio_actress','casting',args[1]
- end
- !calculation of the average rating of all studio actresses
- if $args[0] = 'avg_rating':
- _actress_avg = 0
- _actress_count = arrsize('$actress')/8
- if _actress_count = 0:
- result = 0
- else
- i = 0
- :loop_avg_rating
- if i < _actress_count:
- _actress_avg += $actress['<<i>>,rating']
- i += 1
- jump 'loop_avg_rating'
- end
- result = _actress_avg / _actress_count
- killvar '_actress_avg'
- killvar '_actress_count'
- end
- end
- ! recount actress stats
- if $args[0] = 'update_actress_info':
- i = 0
- :loop_actress_rating
- if i < arrsize('$actress')/8:
- j = 0
- _actress_rating = 0
- _actress_films_count = 0
- _films_count = arrsize('films')/11
- :loop_films_rating
- if j < _films_count:
- if func('zz_funcs','get_item_id',$films['<<j>>,actress'],str(i)) > 0:
- _actress_rating += $films['<<j>>,rating']
- _actress_films_count += 1
- end
- j += 1
- jump 'loop_films_rating'
- end
- if _actress_films_count > 0:
- $actress['<<i>>,rating'] = _actress_rating / _actress_films_count
- else
- $actress['<<i>>,rating'] = 0
- end
- i += 1
- jump 'loop_actress_rating'
- end
- killvar '_actress_rating'
- killvar '_actress_films_count'
- killvar '_films_count'
- end
- ! casting
- if $args[0] = 'casting':
- *clr & cla
- act '<b>Leave</b>': killvar '_casting_id' & gt 'bratva_pornstudio_actress','actress_list'
- if arrsize('$actress')/8 <= 1: exit
- _casting_id = args[1]
- if _casting_id < 1: _casting_id = 1
- if _casting_id >= arrsize('$actress')/8: _casting_id = 1
- '<center><img <<$set_imgh>> src="mod/Bratva/locations/city/north/pornstudio/actress/casting/'+_casting_id+'.jpg"></center>'
- $_casting_prev = '<a href="exec:gt''bratva_pornstudio_actress'',''casting'',<<_casting_id-1>>">Previous</a>'
- $_casting_next = '<a href="exec:gt''bratva_pornstudio_actress'',''casting'',<<_casting_id+1>>">Next</a>'
- $_casting_hire = ' <a href="exec:gt''bratva_pornstudio_actress'',''actress_hire'',<<_casting_id>>">Hire</a> '
- if $actress['<<_casting_id>>,hired'] = 1:
- '<div class="film-casting">' + $_casting_prev + ' <span>The actress is already busy!</span> ' + $_casting_next + '</div>'
- elseif $actress['<<_casting_id>>,retire'] = 1:
- '<div class="film-casting">' + $_casting_prev + ' <span>The actress is fired!</span> ' + $_casting_next + '</div>'
- else
- '<div class="film-casting">' + $_casting_prev + $_casting_hire + $_casting_next + '</div>'
- end
- end
- --- bratva_pornstudio_actress ---------------------------------
|