1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- # newspaper
- !!=======================================================!!
- !! !!
- !! CIKL !!
- !! !!
- !!=======================================================!!
- if $ARGS[0] = 'cikl':
- mc_inventory['newspaper'] = 0
- gs 'newspaper_pages', 'init'
- idx = rand(0, arrsize('np_front_pages') - 1)
- $newspaperVars['page_0'] = $np_front_pages[idx]
- killvar 'np_front_pages'
- i = 1
- :newspaper_shuffle_loop
- idx = rand(0, arrsize('$np_pages') - 1)
- $newspaperVars['page_<<i>>'] = $np_pages[idx]
- i += 1
- killvar '$np_pages', idx
- if arrsize('$np_pages') > 0: jump 'newspaper_shuffle_loop'
- newspaperVars['max_page_num'] = i - 1
- killvar 'i'
- killvar '$np_pages'
- end
- !!=======================================================!!
- !! !!
- !! VIEW !!
- !! !!
- !!=======================================================!!
- if $ARGS[0] = 'start':
- temp_np_page = 0
- gs 'newspaper', 'view'
- end
- if $ARGS[0] = 'view':
- *clr & cla
- '<center><h2>Delovoy Petersburg</h2></center>'
- act 'Put the newspaper away':
- killvar 'temp_np_page'
- if newspaperVars['dbag'] = 0:
- gt $menu_loc, $menu_arg
- else
- gs 'din_bad', 'd_bag'
- end
- end
- if temp_np_page < newspaperVars['max_page_num']:
- act 'Flip to the next article':
- temp_np_page += 1
- gs 'newspaper', 'view'
- end
- end
- if temp_np_page > 0:
- act 'Flip to the previous article':
- temp_np_page -= 1
- gs 'newspaper', 'view'
- end
- end
- dynamic $newspaperVars['page_<<temp_np_page>>']
- end
- --- newspaper ---------------------------------
|