123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 |
- # transport_functions
- !!=======================================!!
- !! !!
- !! Trains !!
- !! !!
- !!=======================================!!
- if $ARGS[0] = 'buy_train_pass':
- if transportVars['trainpass_day'] <= daystart:
- if money >= 250:
- dynamic 'act ''Buy a daily pass (1 day - 250 <b>₽</b>)'':
- cla
- money -= 250
- transportVars[''trainpass_day''] = daystart + 1
- act ''Return'': gt ''<<$loc>>'', ''<<$loc_arg>>''
- end'
- end
- if money >= 1500:
- dynamic 'act ''Buy a weekly pass (7 days - 1500 <b>₽</b>)'':
- cla
- money -= 1500
- transportVars[''trainpass_day''] = daystart + 7
- act ''Return'': gt ''<<$loc>>'', ''<<$loc_arg>>''
- end'
- end
- if money >= 5500:
- dynamic 'act ''Buy a monthly pass (30 days - 5500 <b>₽</b>)'':
- cla
- money -= 5500
- transportVars[''trainpass_day''] = daystart + 30
- act ''Return'': gt ''<<$loc>>'', ''<<$loc_arg>>''
- end'
- end
- if money >= 75000:
- dynamic 'act ''Buy a yearly pass (365 days - 75000 <b>₽</b>)'':
- cla
- money -= 75000
- transportVars[''trainpass_day''] = daystart + 365
- act ''Return'': gt ''<<$loc>>'', ''<<$loc_arg>>''
- end'
- end
- end
- end
- if $ARGS[0] = 'buy_train_ticket':
- if $ARGS[2] = 'pc':
- if $ARGS[1] ! 'pavlovsk': gs 'transport_functions', 'set_train_ticket', $ARGS[1], 'pavlovsk', 'Pavlovsk'
- if $ARGS[1] ! 'village': gs 'transport_functions', 'set_train_ticket', $ARGS[1], 'village', 'the village of Gadukino'
- if $ARGS[1] ! 'communal': gs 'transport_functions', 'set_train_ticket', $ARGS[1], 'communal', 'the communal village'
- if $ARGS[1] ! 'ind': gs 'transport_functions', 'set_train_ticket', $ARGS[1], 'ind', 'St. Petersburg city industrial area'
- if $ARGS[1] ! 'center': gs 'transport_functions', 'set_train_ticket', $ARGS[1], 'center', 'St. Petersburg city center'
- else
- if $ARGS[1] ! 'center': gs 'transport_functions', 'set_train_ticket', $ARGS[1], 'center', 'St. Petersburg city center'
- if $ARGS[1] ! 'ind': gs 'transport_functions', 'set_train_ticket', $ARGS[1], 'ind', 'St. Petersburg city industrial area'
- if $ARGS[1] ! 'communal': gs 'transport_functions', 'set_train_ticket', $ARGS[1], 'communal', 'the communal village'
- if $ARGS[1] ! 'village': gs 'transport_functions', 'set_train_ticket', $ARGS[1], 'village', 'the village of Gadukino'
- if $ARGS[1] ! 'pavlovsk': gs 'transport_functions', 'set_train_ticket', $ARGS[1], 'pavlovsk', 'Pavlovsk'
- end
- end
- ! $ARGS[1] = origin loc_arg
- ! $ARGS[2] = destination loc_arg
- ! $ARGS[3] = destination name
- if $ARGS[0] = 'set_train_ticket':
- temp_price = func('transport_functions', 'get_train_price', $ARGS[1], $ARGS[2])
- if money < ARGS[1]:
- dynamic 'act ''Buy a ticket to <<$ARGS[3]>> (<font color="red"><<temp_price>> <b>₽</b></font>)'': ''<br><font color="red">You don''t have enough money for a ticket to <<$ARGS[3]>>'' '
- else
- dynamic 'act ''Buy a ticket to <<$ARGS[3]>> (<<temp_price>> <b>₽</b>)'':
- money -= <<temp_price>>
- menu_off = 1
- gt ''train'', ''<<$ARGS[1]>>_<<$ARGS[2]>>''
- end'
- end
- killvar 'temp_price'
- end
- if $ARGS[0] = 'get_train_price':
- result = func('transport_functions', '_private_train_price', $ARGS[2]) - func('transport_functions', '_private_train_price', $ARGS[1])
- if result < 0: result = -result
- result += 25
- end
- if $ARGS[0] = '_private_train_price':
- if $ARGS[1] = 'pavlovsk':
- result = 0
- elseif $ARGS[1] = 'village':
- result = 50
- elseif $ARGS[1] = 'communal':
- result = 75
- elseif $ARGS[1] = 'ind':
- result = 100
- elseif $ARGS[1] = 'center':
- result = 125
- end
- end
- if $ARGS[0] = 'get_train_timecost':
- result = func('transport_functions', '_private_train_time', $ARGS[2]) - func('transport_functions', '_private_train_time', $ARGS[1])
- if result < 0: result = -result
- end
- if $ARGS[0] = '_private_train_time':
- if $ARGS[1] = 'pavlovsk':
- result = 0
- elseif $ARGS[1] = 'village':
- result = 15
- elseif $ARGS[1] = 'communal':
- result = 25
- elseif $ARGS[1] = 'ind':
- result = 35
- elseif $ARGS[1] = 'center':
- result = 40
- end
- end
- if $ARGS[0] = 'display_trainpass_time':
- $result = 'You have <<transportVars[''trainpass_day''] - daystart>> days left on your train pass.'
- end
- if $ARGS[0] = 'display_train_timecost':
- $result = '00:' + $mid(100 + func('transport_functions', 'get_train_timecost', $ARGS[1], $ARGS[2]), 2, 2)
- end
- !!=======================================!!
- !! !!
- !! Busses !!
- !! !!
- !!=======================================!!
- !!=======================================!!
- !! !!
- !! Metro !!
- !! !!
- !!=======================================!!
- if $ARGS[0] = 'get_metro_price':
- result = 16
- end
- if $ARGS[0] = 'get_metro_timecost':
- result = 10
- end
- --- transport_functions ---------------------------------
|