123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976 |
- # transport_functions
- !!=======================================!!
- !! !!
- !! Trains !!
- !! !!
- !!=======================================!!
- if $ARGS[0] = 'buy_train_pass':
- if transportVars['trainpass_day'] <= daystart:
- if max(money, karta) >= 250:
- dynamic 'act ''Buy a daily pass (1 day - 250 <b>₽</b>)'':
- cla
- menu_off = 1
- if money >= 250:
- money -= 250
- else
- karta -= 250
- end
- transportVars[''trainpass_day''] = daystart + 1
- gs ''stat''
- act ''Return'': gt ''<<$loc>>'', ''<<$loc_arg>>''
- end'
- end
- if max(money, karta) >= 1500:
- dynamic 'act ''Buy a weekly pass (7 days - 1500 <b>₽</b>)'':
- cla
- menu_off = 1
- if money >= 1500:
- money -= 1500
- else
- karta -= 1500
- end
- transportVars[''trainpass_day''] = daystart + 7
- gs ''stat''
- act ''Return'': gt ''<<$loc>>'', ''<<$loc_arg>>''
- end'
- end
- if max(money, karta) >= 5500:
- dynamic 'act ''Buy a monthly pass (30 days - 5500 <b>₽</b>)'':
- cla
- menu_off = 1
- if money >= 5500:
- money -= 5500
- else
- karta -= 5500
- end
- transportVars[''trainpass_day''] = daystart + 30
- gs ''stat''
- act ''Return'': gt ''<<$loc>>'', ''<<$loc_arg>>''
- end'
- end
- if max(money, karta) >= 75000:
- dynamic 'act ''Buy a yearly pass (365 days - 75000 <b>₽</b>)'':
- cla
- menu_off = 1
- if money >= 75000:
- money -= 75000
- else
- karta -= 75000
- end
- transportVars[''trainpass_day''] = daystart + 365
- gs ''stat''
- 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] ! 'gadukino': gs 'transport_functions', 'set_train_ticket', $ARGS[1], 'gadukino', '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] ! 'gadukino': gs 'transport_functions', 'set_train_ticket', $ARGS[1], 'gadukino', '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])
- $temp_time = func('transport_functions', 'display_train_timecost', $ARGS[1], $ARGS[2])
- if isnum(mid($temp_time, 1, 1)) and val(mid($temp_time, 1, 1)) < 2:
- if money < ARGS[1]:
- dynamic 'act ''Buy a ticket to <<$ARGS[3]>> (<font color="red"><<$temp_time>> - <<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_time>> - <<temp_price>> <b>₽</b>)'':
- cla
- menu_off = 1
- if money >= <<temp_price>>:
- money -= <<temp_price>>
- else
- karta -= <<temp_price>>
- end
- gt ''train'', ''<<$ARGS[1]>>_<<$ARGS[2]>>''
- end'
- end
- end
- killvar 'temp_price'
- killvar 'temp_time'
- end
- ! Time Table:
- ! Train departs every 15 minutes (between 4:00 and 22:00), 30 minutes (between 22:00 and 01:00) and 60 minute (betweeen 01:00 and 04:00)
- ! pavlovsk (07) -> gadukino (22) -> communal (32) -> ind (42) -> center
- ! center (02) -> ind (07) -> communal (17) -> gadukino (27) -> pavlovsk
- if $ARGS[0] = 'set_train_wait_time':
- if $ARGS[1] = 'pavlovsk':
- if hour = 0:
- temp_transportVars['train_wait_center'] = (67 - minut) mod 30
- elseif hour <= 3:
- temp_transportVars['train_wait_center'] = (67 - minut) mod 60
- elseif hour <= 21:
- temp_transportVars['train_wait_center'] = (67 - minut) mod 15
- else
- temp_transportVars['train_wait_center'] = (67 - minut) mod 30
- end
- elseif $ARGS[1] = 'gadukino':
- if hour = 0:
- temp_transportVars['train_wait_center'] = (82 - minut) mod 30
- temp_transportVars['train_wait_pavlovsk'] = (87 - minut) mod 30
- elseif hour <= 3 or hour = 4 and minut <= 22:
- temp_transportVars['train_wait_center'] = (82 - minut) mod 60
- temp_transportVars['train_wait_pavlovsk'] = (87 - minut) mod 60
- elseif hour = 4 and minut <= 27:
- temp_transportVars['train_wait_center'] = (82 - minut) mod 15
- temp_transportVars['train_wait_pavlovsk'] = (87 - minut) mod 60
- elseif hour <= 21 or hour = 22 and minut <= 7:
- temp_transportVars['train_wait_center'] = (82 - minut) mod 15
- temp_transportVars['train_wait_pavlovsk'] = (87 - minut) mod 15
- elseif hour = 22 and minut <= 12:
- temp_transportVars['train_wait_center'] = (82 - minut) mod 30
- temp_transportVars['train_wait_pavlovsk'] = (87 - minut) mod 15
- else
- temp_transportVars['train_wait_center'] = (82 - minut) mod 30
- temp_transportVars['train_wait_pavlovsk'] = (87 - minut) mod 30
- end
- elseif $ARGS[1] = 'communal':
- if hour = 0 or hour = 1 and minut <= 2:
- temp_transportVars['train_wait_center'] = (92 - minut) mod 30
- temp_transportVars['train_wait_pavlovsk'] = (77 - minut) mod 30
- elseif hour <= 3 or hour = 4 and minut <= 17:
- temp_transportVars['train_wait_center'] = (92 - minut) mod 60
- temp_transportVars['train_wait_pavlovsk'] = (77 - minut) mod 60
- elseif hour = 4 and minut <= 32:
- temp_transportVars['train_wait_center'] = (92 - minut) mod 15
- temp_transportVars['train_wait_pavlovsk'] = (77 - minut) mod 60
- elseif hour <= 21 or hour = 22 and minut <= 2:
- temp_transportVars['train_wait_center'] = (92 - minut) mod 15
- temp_transportVars['train_wait_pavlovsk'] = (77 - minut) mod 15
- elseif hour = 22 and minut <= 17:
- temp_transportVars['train_wait_center'] = (92 - minut) mod 15
- temp_transportVars['train_wait_pavlovsk'] = (77 - minut) mod 30
- else
- temp_transportVars['train_wait_center'] = (92 - minut) mod 30
- temp_transportVars['train_wait_pavlovsk'] = (77 - minut) mod 30
- end
- elseif $ARGS[1] = 'ind':
- if hour = 0:
- temp_transportVars['train_wait_center'] = (102 - minut) mod 30
- temp_transportVars['train_wait_pavlovsk'] = (67 - minut) mod 30
- elseif hour = 1 and minut <= 12:
- temp_transportVars['train_wait_center'] = (102 - minut) mod 30
- temp_transportVars['train_wait_pavlovsk'] = (67 - minut) mod 60
- elseif hour <= 3:
- temp_transportVars['train_wait_center'] = (102 - minut) mod 60
- temp_transportVars['train_wait_pavlovsk'] = (67 - minut) mod 60
- elseif hour = 4 and minut <= 42:
- temp_transportVars['train_wait_center'] = (102 - minut) mod 60
- temp_transportVars['train_wait_pavlovsk'] = (67 - minut) mod 15
- elseif hour <= 21:
- temp_transportVars['train_wait_center'] = (102 - minut) mod 15
- temp_transportVars['train_wait_pavlovsk'] = (67 - minut) mod 15
- elseif hour = 22 and minut <= 27:
- temp_transportVars['train_wait_center'] = (102 - minut) mod 15
- temp_transportVars['train_wait_pavlovsk'] = (67 - minut) mod 30
- else
- temp_transportVars['train_wait_center'] = (102 - minut) mod 30
- temp_transportVars['train_wait_pavlovsk'] = (67 - minut) mod 30
- end
- elseif $ARGS[1] = 'center':
- if hour = 0:
- temp_transportVars['train_wait_pavlovsk'] = (62 - minut) mod 30
- elseif hour <= 3:
- temp_transportVars['train_wait_pavlovsk'] = (62 - minut) mod 60
- elseif hour <= 21:
- temp_transportVars['train_wait_pavlovsk'] = (62 - minut) mod 15
- else
- temp_transportVars['train_wait_pavlovsk'] = (62 - minut) mod 30
- end
- 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':
- temp_mins = func('transport_functions', 'get_train_timecost', $ARGS[1], $ARGS[2])
- if $ARGS[1] = 'pavlovsk' or $ARGS[2] = 'center 'or ($ARGS[1] = 'gadukino' and $ARGS[2] ! 'pavlovsk') or ($ARGS[1] = 'communal' and $ARGS[2] = 'ind'):
- temp_mins += temp_transportVars['train_wait_center']
- else
- temp_mins += temp_transportVars['train_wait_pavlovsk']
- end
- temp_hours = temp_mins / 60
- temp_mins = temp_mins mod 60
- $result = '<<temp_hours>>:<<$mid(100 + temp_mins, 2, 2)>>'
- killvar 'temp_mins'
- killvar 'temp_hours'
- end
- if $ARGS[0] = 'display_train_schedule':
- if $ARGS[1] = 'pc':
- $train_schedule += '<center><h2>Pavlovsk - St. Petersburg</h2></center>'
- $train_schedule += '<br><center><table style="text-align:center">'
- $train_schedule += '<tr><th></th><th></th><th>Communal</th><th>St. Petersburg</th><th>St. Petersburg</th><th style="border-right:2px solid black; border-left:2px solid black"> </th><th></th><th></th><th>Communal</th><th>St. Petersburg</th><th>St. Petersburg</th></tr>'
- $train_schedule += '<tr><th style="border-right:2px solid black">Pavlovsk</th><th style="border-right:2px solid black">Gadukino</th><th style="border-right:2px solid black">Village</th><th style="border-right:2px solid black">Industrial</th><th>Center</th><th style="border-right:2px solid black; border-left:2px solid black"> </th><th style="border-right:2px solid black">Pavlovsk</th><th style="border-right:2px solid black">Gadukino</th><th style="border-right:2px solid black">Village</th><th style="border-right:2px solid black">Industrial</th><th style="border-right:2px solid black">Center</th></tr>'
- $train_schedule += '<tr><td colspan=11 style="border-bottom:2px solid black"></td></tr>'
- th[0] = 0
- :train_schedule_loop1
- $th[1] = mid(100 + th[0], 2, 2)
- $th[2] = mid(100 + th[0] + 1, 2, 2)
- th[3] = th[0] + 12
- $th[4] = mid(100 + th[3], 2, 2)
- $th[5] = mid(100 + th[3] + 1, 2, 2)
- $train_schedule += '<tr>'
- $train_schedule += '<td><<$th[1]>>:07</td><td><<$th[1]>>:22</td><td><<$th[1]>>:32</td><td><<$th[1]>>:42</td><td><<$th[1]>>:47</td>'
- $train_schedule += '<td style="border-right:2px solid black; border-left:2px solid black"> </td>'
- $train_schedule += '<td><<$th[4]>>:07</td><td><<$th[4]>>:22</td><td><<$th[4]>>:32</td><td><<$th[4]>>:42</td><td><<$th[4]>>:47</td>'
- $train_schedule += '</tr>'
- if th[0] >= 4 or th[3] <= 21:
- $train_schedule += '<tr>'
- if th[0] >= 4:
- $train_schedule += '<td><<$th[1]>>:22</td><td><<$th[1]>>:37</td><td><<$th[1]>>:47</td><td><<$th[1]>>:57</td><td><<$th[2]>>:02</td>'
- else
- $train_schedule += '<td colspan=5></td>'
- end
- $train_schedule += '<td style="border-right:2px solid black; border-left:2px solid black"> </td>'
- if th[3] <= 21:
- $train_schedule += '<td><<$th[4]>>:22</td><td><<$th[4]>>:37</td><td><<$th[4]>>:47</td><td><<$th[4]>>:57</td><td><<$th[5]>>:02</td>'
- else
- $train_schedule += '<td colspan=5></td>'
- end
- $train_schedule += '</tr>'
- end
- $train_schedule += '<tr>'
- if th[0] = 0 or th[0] >= 4:
- $train_schedule += '<td><<$th[1]>>:37</td><td><<$th[1]>>:52</td><td><<$th[2]>>:02</td><td><<$th[2]>>:12</td><td><<$th[2]>>:17</td>'
- else
- $train_schedule += '<td colspan=5></td>'
- end
- $train_schedule += '<td style="border-right:2px solid black; border-left:2px solid black"> </td>'
- $train_schedule += '<td><<$th[4]>>:37</td><td><<$th[4]>>:52</td><td><<$th[5]>>:02</td><td><<$th[5]>>:12</td><td><<$th[5]>>:17</td></tr>'
- if th[0] >= 4 or th[3] <= 21:
- $train_schedule += '<tr>'
- if th[0] >= 4:
- $train_schedule += '<td><<$th[1]>>:52</td><td><<$th[2]>>:07</td><td><<$th[2]>>:17</td><td><<$th[2]>>:27</td><td><<$th[2]>>:32</td>'
- else
- $train_schedule += '<td colspan=5></td>'
- end
- $train_schedule += '<td style="border-right:2px solid black; border-left:2px solid black"> </td>'
- if th[3] <= 21:
- $train_schedule += '<td><<$th[4]>>:52</td><td><<$th[5]>>:07</td><td><<$th[5]>>:17</td><td><<$th[5]>>:27</td><td><<$th[5]>>:32</td>'
- else
- $train_schedule += '<td colspan=5></td>'
- end
- $train_schedule += '</tr>'
- end
- $train_schedule += '<tr><td colspan=11 style="border-bottom:1px solid black"></td></tr>'
- th[0] += 1
- if th[0] < 12: jump 'train_schedule_loop1'
- else
- $train_schedule += '<center><h2>St. Petersburg - Pavlovsk</h2></center>'
- $train_schedule += '<br><center><table style="text-align:center">'
- $train_schedule += '<tr><th>St. Petersburg</th><th>St. Petersburg</th><th>Communal</th><th></th><th></th><th style="border-right:2px solid black; border-left:2px solid black"> </th><th>St. Petersburg</th><th>St. Petersburg</th><th>Communal</th><th></th><th></th></tr>'
- $train_schedule += '<tr><th style="border-right:2px solid black">Center</th><th style="border-right:2px solid black">Industrial</th><th style="border-right:2px solid black">Village</th><th style="border-right:2px solid black">Gadukino</th><th>Pavlovsk</th><th style="border-right:2px solid black; border-left:2px solid black"> </th><th style="border-right:2px solid black">Center</th><th style="border-right:2px solid black">Industrial</th><th style="border-right:2px solid black">Village</th><th style="border-right:2px solid black">Gadukino</th><th style="border-right:2px solid black">Pavlovsk</th></tr>'
- $train_schedule += '<tr><td colspan=11 style="border-bottom:2px solid black"></td></tr>'
- th[0] = 0
- :train_schedule_loop2
- $th[1] = mid(100 + th[0], 2, 2)
- $th[2] = mid(100 + th[0] + 1, 2, 2)
- th[3] = th[0] + 12
- $th[4] = mid(100 + th[3], 2, 2)
- $th[5] = mid(100 + th[3] + 1, 2, 2)
- $train_schedule += '<tr>'
- $train_schedule += '<td><<$th[1]>>:02</td><td><<$th[1]>>:07</td><td><<$th[1]>>:17</td><td><<$th[1]>>:27</td><td><<$th[1]>>:42</td>'
- $train_schedule += '<td style="border-right:2px solid black; border-left:2px solid black"> </td>'
- $train_schedule += '<td><<$th[4]>>:02</td><td><<$th[4]>>:07</td><td><<$th[4]>>:17</td><td><<$th[4]>>:27</td><td><<$th[4]>>:42</td>'
- $train_schedule += '</tr>'
- if th[0] >= 4 or th[3] <= 21:
- $train_schedule += '<tr>'
- if th[0] >= 4:
- $train_schedule += '<td><<$th[1]>>:17</td><td><<$th[1]>>:22</td><td><<$th[1]>>:32</td><td><<$th[1]>>:42</td><td><<$th[1]>>:57</td>'
- else
- $train_schedule += '<td colspan=5></td>'
- end
- $train_schedule += '<td style="border-right:2px solid black; border-left:2px solid black"> </td>'
- if th[3] <= 21:
- $train_schedule += '<td><<$th[4]>>:17</td><td><<$th[4]>>:22</td><td><<$th[4]>>:32</td><td><<$th[4]>>:42</td><td><<$th[4]>>:57</td>'
- else
- $train_schedule += '<td colspan=5></td>'
- end
- $train_schedule += '</tr>'
- end
- $train_schedule += '<tr>'
- if th[0] = 0 or th[0] >= 4:
- $train_schedule += '<td><<$th[1]>>:32</td><td><<$th[1]>>:37</td><td><<$th[1]>>:47</td><td><<$th[1]>>:57</td><td><<$th[2]>>:12</td>'
- else
- $train_schedule += '<td colspan=5></td>'
- end
- $train_schedule += '<td style="border-right:2px solid black; border-left:2px solid black"> </td>'
- $train_schedule += '<td><<$th[4]>>:32</td><td><<$th[4]>>:37</td><td><<$th[4]>>:47</td><td><<$th[4]>>:57</td><td><<$th[5]>>:12</td></tr>'
- if th[0] >= 4 or th[3] <= 21:
- $train_schedule += '<tr>'
- if th[0] >= 4:
- $train_schedule += '<td><<$th[1]>>:47</td><td><<$th[1]>>:52</td><td><<$th[2]>>:02</td><td><<$th[2]>>:12</td><td><<$th[2]>>:27</td>'
- else
- $train_schedule += '<td colspan=5></td>'
- end
- $train_schedule += '<td style="border-right:2px solid black; border-left:2px solid black"> </td>'
- if th[3] <= 21:
- $train_schedule += '<td><<$th[4]>>:47</td><td><<$th[4]>>:52</td><td><<$th[5]>>:02</td><td><<$th[5]>>:12</td><td><<$th[5]>>:27</td>'
- else
- $train_schedule += '<td colspan=5></td>'
- end
- $train_schedule += '</tr>'
- end
- $train_schedule += '<tr><td colspan=11 style="border-bottom:1px solid black"></td></tr>'
- th[0] += 1
- if th[0] < 12: jump 'train_schedule_loop2'
- end
- $train_schedule += '</table></center>'
- $train_schedule
- killvar 'train_schedule'
- killvar 'th'
- 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 *= -1
- result += 25
- end
- if $ARGS[0] = '_private_train_price':
- if $ARGS[1] = 'pavlovsk':
- result = 0
- elseif $ARGS[1] = 'gadukino':
- 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 *= -1
- end
- if $ARGS[0] = '_private_train_time':
- if $ARGS[1] = 'pavlovsk':
- result = 0
- elseif $ARGS[1] = 'gadukino':
- result = 15
- elseif $ARGS[1] = 'communal':
- result = 25
- elseif $ARGS[1] = 'ind':
- result = 35
- elseif $ARGS[1] = 'center':
- result = 40
- end
- end
- !!=======================================!!
- !! !!
- !! Busses !!
- !! !!
- !!=======================================!!
- if $ARGS[0] = 'buy_bus_pass':
- if transportVars['buspass_day'] <= daystart:
- if max(money, karta) >= 100:
- dynamic 'act ''Buy a daily bus pass (1 day - 100 <b>₽</b>)'':
- cla
- menu_off = 1
- if money >= 100:
- money -= 100
- else
- karta -= 100
- end
- transportVars[''buspass_day''] = daystart + 1
- gs ''stat''
- act ''Return'': gt ''<<$loc>>'', ''<<$loc_arg>>''
- end'
- end
- if max(money, karta) >= 500:
- dynamic 'act ''Buy a weekly bus pass (7 days - 500 <b>₽</b>)'':
- cla
- menu_off = 1
- if money >= 500:
- money -= 500
- else
- karta -= 500
- end
- transportVars[''buspass_day''] = daystart + 7
- gs ''stat''
- act ''Return'': gt ''<<$loc>>'', ''<<$loc_arg>>''
- end'
- end
- if max(money, karta) >= 1500:
- dynamic 'act ''Buy a monthly bus pass (30 days - 1500 <b>₽</b>)'':
- cla
- menu_off = 1
- if money >= 1500:
- money -= 1500
- else
- karta -= 1500
- end
- transportVars[''buspass_day''] = daystart + 30
- gs ''stat''
- act ''Return'': gt ''<<$loc>>'', ''<<$loc_arg>>''
- end'
- end
- if max(money, karta) >= 13000:
- dynamic 'act ''Buy a yearly bus pass (365 days - 13000 <b>₽</b>)'':
- cla
- menu_off = 1
- if money >= 13000:
- money -= 13000
- else
- karta -= 13000
- end
- transportVars[''buspass_day''] = daystart + 365
- gs ''stat''
- act ''Return'': gt ''<<$loc>>'', ''<<$loc_arg>>''
- end'
- end
- end
- end
- if $ARGS[0] = 'buy_bus_ticket':
- if $ARGS[2] = 'pg':
- if $ARGS[1] ! 'community': gs 'transport_functions', 'set_bus_ticket', $ARGS[1], 'community', 'the Pavlovsk community center'
- if $ARGS[1] ! 'pavstation': gs 'transport_functions', 'set_bus_ticket', $ARGS[1], 'pavstation', 'the Pavlovsk train station'
- if $ARGS[1] ! 'pushkin': gs 'transport_functions', 'set_bus_ticket', $ARGS[1], 'pushkin', 'the old town of Pushkin'
- if $ARGS[1] ! 'construction': gs 'transport_functions', 'set_bus_ticket', $ARGS[1], 'construction', 'the construction site'
- if $ARGS[1] ! 'gadukino': gs 'transport_functions', 'set_bus_ticket', $ARGS[1], 'gadukino', 'the village of Gadukino'
- elseif $ARGS[2] = 'gp':
- if $ARGS[1] ! 'gadukino': gs 'transport_functions', 'set_bus_ticket', $ARGS[1], 'gadukino', 'the village of Gadukino'
- if $ARGS[1] ! 'construction': gs 'transport_functions', 'set_bus_ticket', $ARGS[1], 'construction', 'the construction site'
- if $ARGS[1] ! 'pushkin': gs 'transport_functions', 'set_bus_ticket', $ARGS[1], 'pushkin', 'the old town of Pushkin'
- if $ARGS[1] ! 'pavstation': gs 'transport_functions', 'set_bus_ticket', $ARGS[1], 'pavstation', 'the Pavlovsk train station'
- if $ARGS[1] ! 'community': gs 'transport_functions', 'set_bus_ticket', $ARGS[1], 'community', 'the Pavlovsk community center'
- elseif $ARGS[2] = 'gs':
- if $ARGS[1] ! 'gadukino': gs 'transport_functions', 'set_bus_ticket', $ARGS[1], 'gadukino', 'the village of Gadukino'
- if $ARGS[1] ! 'communal': gs 'transport_functions', 'set_bus_ticket', $ARGS[1], 'communal', 'the communal village'
- if $ARGS[1] ! 'graveyard': gs 'transport_functions', 'set_bus_ticket', $ARGS[1], 'graveyard', 'the graveyard'
- if $ARGS[1] ! 'suburbs': gs 'transport_functions', 'set_bus_ticket', $ARGS[1], 'suburbs', 'the expensive suburb of St. Petersburg'
- else
- if $ARGS[1] ! 'suburbs': gs 'transport_functions', 'set_bus_ticket', $ARGS[1], 'suburbs', 'the expensive suburb of St. Petersburg'
- if $ARGS[1] ! 'graveyard': gs 'transport_functions', 'set_bus_ticket', $ARGS[1], 'graveyard', 'the graveyard'
- if $ARGS[1] ! 'communal': gs 'transport_functions', 'set_bus_ticket', $ARGS[1], 'communal', 'the communal village'
- if $ARGS[1] ! 'gadukino': gs 'transport_functions', 'set_bus_ticket', $ARGS[1], 'gadukino', 'the village of Gadukino'
- end
- end
- ! $ARGS[1] = origin loc_arg
- ! $ARGS[2] = destination loc_arg
- ! $ARGS[3] = destination name
- if $ARGS[0] = 'set_bus_ticket':
- temp_price = func('transport_functions', 'get_bus_price', $ARGS[1], $ARGS[2])
- $temp_time = func('transport_functions', 'display_bus_timecost', $ARGS[1], $ARGS[2])
- if money < ARGS[1]:
- dynamic 'act ''Buy a ticket to <<$ARGS[3]>> (<font color="red"><<$temp_time>> - <<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_time>> - <<temp_price>> <b>₽</b>)'':
- cla
- menu_off = 1
- if money >= <<temp_price>>:
- money -= <<temp_price>>
- else
- karta -= <<temp_price>>
- end
- gt ''bus'', ''<<$ARGS[1]>>_<<$ARGS[2]>>''
- end'
- end
- killvar 'temp_price'
- end
- ! Time Table:
- ! Bus departs every 20 minutes
- ! community (13) -> pavstation (15) -> pushkin (23) -> construction (38) -> gadukino
- ! gadukino (13) -> construction (38) -> pushkin (53) -> pavstation (01) -> community
- ! gadukino (15) -> communal (35) -> graveyard (45) -> suburbs
- ! suburbs (05) -> graveyard (15) -> communal (25) -> gadukino
- if $ARGS[0] = 'set_bus_wait_time':
- if $ARGS[1] = 'community':
- if hour <= 4:
- temp_transportVars['bus_wait_gadukino'] = (313 - minut - hour * 60)
- elseif hour >= 5 and hour <= 22 or hour = 22 and minut <= 53:
- temp_transportVars['bus_wait_gadukino'] = (73 - minut) mod 20
- else
- temp_transportVars['bus_wait_gadukino'] = (433 - minut - (hour-22) * 60)
- end
- elseif $ARGS[1] = 'pavstation':
- if hour <= 4:
- temp_transportVars['bus_wait_gadukino'] = (315 - minut - hour * 60)
- temp_transportVars['bus_wait_pavlovsk'] = (361 - minut - hour * 60)
- elseif hour = 5:
- temp_transportVars['bus_wait_gadukino'] = (75 - minut) mod 20
- temp_transportVars['bus_wait_pavlovsk'] = (61 - minut)
- elseif hour >= 6 and hour <= 22 or hour = 22 and minut <= 55:
- temp_transportVars['bus_wait_gadukino'] = (75 - minut) mod 20
- temp_transportVars['bus_wait_pavlovsk'] = (61 - minut) mod 20
- elseif hour = 22 or hour = 23 and minut <= 41:
- temp_transportVars['bus_wait_gadukino'] = (435 - minut - (hour-22) * 60)
- temp_transportVars['bus_wait_pavlovsk'] = (61 - minut) mod 20
- else
- temp_transportVars['bus_wait_gadukino'] = (375 - minut)
- temp_transportVars['bus_wait_pavlovsk'] = (421 - minut)
- end
- elseif $ARGS[1] = 'pushkin':
- if hour <= 4:
- temp_transportVars['bus_wait_gadukino'] = (323 - minut - hour * 60)
- temp_transportVars['bus_wait_pavlovsk'] = (353 - minut - hour * 60)
- elseif hour = 5 and minut <= 53:
- temp_transportVars['bus_wait_gadukino'] = (63 - minut) mod 20
- temp_transportVars['bus_wait_pavlovsk'] = (53 - minut)
- elseif hour >= 5 and hour <= 22 or hour = 22 and minut <= 55:
- temp_transportVars['bus_wait_gadukino'] = (63 - minut) mod 20
- temp_transportVars['bus_wait_pavlovsk'] = (73 - minut) mod 20
- elseif hour = 22 or hour = 23 and minut <= 3:
- temp_transportVars['bus_wait_gadukino'] = (3 - minut)
- temp_transportVars['bus_wait_pavlovsk'] = (73 - minut) mod 20
- elseif hour = 22 or hour = 23 and minut <= 33:
- temp_transportVars['bus_wait_gadukino'] = (435 - minut - (hour-22) * 60)
- temp_transportVars['bus_wait_pavlovsk'] = (73 - minut) mod 20
- else
- temp_transportVars['bus_wait_gadukino'] = (383 - minut)
- temp_transportVars['bus_wait_pavlovsk'] = (413 - minut)
- end
- elseif $ARGS[1] = 'construction':
- if hour <= 4:
- temp_transportVars['bus_wait_gadukino'] = (338 - minut - hour * 60)
- temp_transportVars['bus_wait_pavlovsk'] = (338 - minut - hour * 60)
- elseif hour = 5 and minut <= 38:
- temp_transportVars['bus_wait_gadukino'] = (38 - minut)
- temp_transportVars['bus_wait_pavlovsk'] = (38 - minut)
- elseif hour >= 5 and hour <= 22:
- temp_transportVars['bus_wait_gadukino'] = (78 - minut) mod 20
- temp_transportVars['bus_wait_pavlovsk'] = (78 - minut) mod 20
- elseif hour <= 23 and minut <= 18:
- temp_transportVars['bus_wait_gadukino'] = (18 - minut)
- temp_transportVars['bus_wait_pavlovsk'] = (18 - minut)
- else
- temp_transportVars['bus_wait_gadukino'] = (398 - minut)
- temp_transportVars['bus_wait_pavlovsk'] = (398 - minut)
- end
- elseif $ARGS[1] = 'gadukino':
- if hour <= 4:
- temp_transportVars['bus_wait_suburbs'] = (315 - minut - hour * 60)
- temp_transportVars['bus_wait_pavlovsk'] = (313 - minut - hour * 60)
- elseif hour >= 5 and hour <= 22 or hour = 22 and minut <= 53:
- temp_transportVars['bus_wait_suburbs'] = (75 - minut) mod 20
- temp_transportVars['bus_wait_pavlovsk'] = (73 - minut) mod 20
- elseif hour = 22 and minut <= 55:
- temp_transportVars['bus_wait_suburbs'] = (55 - minut)
- temp_transportVars['bus_wait_pavlovsk'] = (433 - minut - (hour-22) * 60)
- else
- temp_transportVars['bus_wait_suburbs'] = (435 - minut - (hour-22) * 60)
- temp_transportVars['bus_wait_pavlovsk'] = (433 - minut - (hour-22) * 60)
- end
- elseif $ARGS[1] = 'communal':
- if hour <= 4:
- temp_transportVars['bus_wait_suburbs'] = (335 - minut - hour * 60)
- temp_transportVars['bus_wait_gadukino'] = (325 - minut - hour * 60)
- elseif hour = 5 and minut <= 25:
- temp_transportVars['bus_wait_suburbs'] = (35 - minut)
- temp_transportVars['bus_wait_gadukino'] = (25 - minut)
- elseif hour = 5 and minut <= 35:
- temp_transportVars['bus_wait_suburbs'] = (75 - minut) mod 20
- temp_transportVars['bus_wait_gadukino'] = (65 - minut) mod 20
- elseif hour >= 5 and hour <= 22:
- temp_transportVars['bus_wait_suburbs'] = (75 - minut) mod 20
- temp_transportVars['bus_wait_gadukino'] = (65 - minut) mod 20
- elseif hour = 23 and minut <= 05:
- temp_transportVars['bus_wait_suburbs'] = (15 - minut)
- temp_transportVars['bus_wait_gadukino'] = (05 - minut)
- elseif hour = 23 and minut <= 15:
- temp_transportVars['bus_wait_suburbs'] = (15 - minut)
- temp_transportVars['bus_wait_gadukino'] = (385 - minut)
- else
- temp_transportVars['bus_wait_suburbs'] = (395 - minut)
- temp_transportVars['bus_wait_gadukino'] = (385 - minut)
- end
- elseif $ARGS[1] = 'graveyard':
- if hour <= 4:
- temp_transportVars['bus_wait_suburbs'] = (345 - minut - hour * 60)
- temp_transportVars['bus_wait_gadukino'] = (315 - minut - hour * 60)
- elseif hour = 5 and minut <= 15:
- temp_transportVars['bus_wait_suburbs'] = (45 - minut)
- temp_transportVars['bus_wait_gadukino'] = (15 - minut)
- elseif hour = 5 and minut <= 45:
- temp_transportVars['bus_wait_suburbs'] = (45 - minut)
- temp_transportVars['bus_wait_gadukino'] = (75 - minut) mod 20
- elseif hour >= 5 and hour <= 21 or hour = 22 and minut <= 55:
- temp_transportVars['bus_wait_suburbs'] = (65 - minut) mod 20
- temp_transportVars['bus_wait_gadukino'] = (75 - minut) mod 20
- elseif hour = 22 or hour = 23 and minut <= 25:
- temp_transportVars['bus_wait_suburbs'] = (65 - minut) mod 20
- temp_transportVars['bus_wait_gadukino'] = (435 - minut - (hour-22) * 60)
- else
- temp_transportVars['bus_wait_suburbs'] = (405 - minut)
- temp_transportVars['bus_wait_gadukino'] = (375 - minut)
- end
- elseif $ARGS[1] = 'suburbs':
- if hour <= 4:
- temp_transportVars['bus_wait_gadukino'] = (305 - minut - hour * 60)
- elseif hour >= 5 and hour <= 22 or hour = 22 and minut <= 45:
- temp_transportVars['bus_wait_gadukino'] = (65 - minut) mod 20
- else
- temp_transportVars['bus_wait_gadukino'] = (425 - minut - (hour-22) * 60)
- end
- end
- end
- if $ARGS[0] = 'display_buspass_time':
- $result = 'You have <<transportVars[''buspass_day''] - daystart>> days left on your train pass.'
- end
- if $ARGS[0] = 'display_bus_timecost':
- temp_mins = func('transport_functions', 'get_bus_timecost', $ARGS[1], $ARGS[2]) + func('transport_functions', 'get_bus_wait_time', $ARGS[1], $ARGS[2])
- temp_hours = temp_mins / 60
- temp_mins = temp_mins mod 60
- $result = '<<temp_hours>>:<<$mid(100 + temp_mins, 2, 2)>>'
- killvar 'temp_mins'
- killvar 'temp_hours'
- end
- if $ARGS[0] = 'display_bus_schedule':
- $bus_schedule = '<center><h4>Bus schedule</h4></center>'
- if $ARGS[1] = 'pg':
- $bus_schedule += '<center><h2>Pavlovsk - Gadukino</h2></center>'
- $bus_schedule += '<br><center><table style="text-align:center">'
- $bus_schedule += '<tr><th>Pavlovsk</th><th>Pavlovsk</th><th></th><th></th><th>Construction</th><th style="border-right:2px solid black; border-left:2px solid black"> </th><th>Pavlovsk</th><th>Pavlovsk</th><th></th><th>Construction</th><th></th></tr>'
- $bus_schedule += '<tr><th style="border-right:2px solid black">Community Center</th><th style="border-right:2px solid black">Train Station</th><th style="border-right:2px solid black">Pushkin</th><th style="border-right:2px solid black">Site</th><th>Gadukino</th><th style="border-right:2px solid black; border-left:2px solid black"> </th><th style="border-right:2px solid black">Community Center</th><th style="border-right:2px solid black">Train Station</th><th style="border-right:2px solid black">Pushkin</th><th style="border-right:2px solid black">Site</th><th style="border-right:2px solid black">Gadukino</th></tr>'
- $bus_schedule += '<tr><td colspan=11 style="border-bottom:2px solid black"></td></tr>'
- th[0] = 4
- :bus_schedule_loop1
- $th[1] = mid(100 + th[0], 2, 2)
- $th[2] = mid(100 + th[0] + 1, 2, 2)
- th[3] = th[0] + 10
- $th[4] = mid(100 + th[3], 2, 2)
- $th[5] = mid(100 + th[3] + 1, 2, 2)
- $bus_schedule += '<tr>'
- $bus_schedule += '<td><<$th[1]>>:13</td><td><<$th[1]>>:15</td><td><<$th[1]>>:23</td><td><<$th[1]>>:38</td><td><<$th[2]>>:03</td>'
- $bus_schedule += '<td style="border-right:2px solid black; border-left:2px solid black"> </td>'
- if th[3] <= 22:
- $bus_schedule += '<td><<$th[4]>>:13</td><td><<$th[4]>>:15</td><td><<$th[4]>>:23</td><td><<$th[4]>>:38</td><td><<$th[5]>>:03</td>'
- else
- $bus_schedule += '<td colspan=5></td>'
- end
- $bus_schedule += '</tr>'
- $bus_schedule += '<tr>'
- $bus_schedule += '<td><<$th[1]>>:33</td><td><<$th[1]>>:35</td><td><<$th[1]>>:43</td><td><<$th[1]>>:58</td><td><<$th[2]>>:23</td>'
- $bus_schedule += '<td style="border-right:2px solid black; border-left:2px solid black"> </td>'
- if th[3] <= 22:
- $bus_schedule += '<td><<$th[4]>>:33</td><td><<$th[4]>>:35</td><td><<$th[4]>>:43</td><td><<$th[4]>>:58</td><td><<$th[5]>>:23</td>'
- else
- $bus_schedule += '<td colspan=5></td>'
- end
- $bus_schedule += '</tr>'
- $bus_schedule += '<tr>'
- $bus_schedule += '<td><<$th[1]>>:53</td><td><<$th[1]>>:55</td><td><<$th[2]>>:03</td><td><<$th[2]>>:18</td><td><<$th[2]>>:43</td>'
- $bus_schedule += '<td style="border-right:2px solid black; border-left:2px solid black"> </td>'
- if th[3] <= 22:
- $bus_schedule += '<td><<$th[4]>>:53</td><td><<$th[4]>>:55</td><td><<$th[5]>>:03</td><td><<$th[5]>>:18</td><td><<$th[5]>>:43</td>'
- else
- $bus_schedule += '<td colspan=5></td>'
- end
- $bus_schedule += '</tr>'
- $bus_schedule += '<tr><td colspan=11 style="border-bottom:1px solid black"></td></tr>'
- th[0] += 1
- if th[0] < 14: jump 'bus_schedule_loop1'
- elseif $ARGS[1] = 'gp':
- $bus_schedule += '<center><h2>Gadukino - Pavlovsk</h2></center>'
- $bus_schedule += '<br><center><table style="text-align:center">'
- $bus_schedule += '<tr><th></th><th>Construction</th><th></th><th>Pavlovsk</th><th>Pavlovsk</th><th style="border-right:2px solid black; border-left:2px solid black"> </th><th></th><th>Construction</th><th></th><th>Pavlovsk</th><th>Pavlovsk</th></tr>'
- $bus_schedule += '<tr><th style="border-right:2px solid black">Gadukino</th><th style="border-right:2px solid black">Site</th><th style="border-right:2px solid black">Pushkin</th><th style="border-right:2px solid black">Train Station</th><th>Community center</th><th style="border-right:2px solid black; border-left:2px solid black"> </th><th style="border-right:2px solid black">Gadukino</th><th style="border-right:2px solid black">Site</th><th style="border-right:2px solid black">Pushkin</th><th style="border-right:2px solid black">Train Station</th><th style="border-right:2px solid black">Community center</th></tr>'
- $bus_schedule += '<tr><td colspan=11 style="border-bottom:2px solid black"></td></tr>'
- th[0] = 4
- :bus_schedule_loop2
- $th[1] = mid(100 + th[0], 2, 2)
- $th[2] = mid(100 + th[0] + 1, 2, 2)
- th[3] = th[0] + 10
- $th[4] = mid(100 + th[3], 2, 2)
- $th[5] = mid(100 + th[3] + 1, 2, 2)
- $bus_schedule += '<tr>'
- $bus_schedule += '<td><<$th[1]>>:13</td><td><<$th[1]>>:38</td><td><<$th[1]>>:53</td><td><<$th[2]>>:01</td><td><<$th[2]>>:03</td>'
- $bus_schedule += '<td style="border-right:2px solid black; border-left:2px solid black"> </td>'
- if th[3] <= 22:
- $bus_schedule += '<td><<$th[4]>>:13</td><td><<$th[4]>>:38</td><td><<$th[4]>>:53</td><td><<$th[5]>>:01</td><td><<$th[5]>>:03</td>'
- else
- $bus_schedule += '<td colspan=5></td>'
- end
- $bus_schedule += '</tr>'
- $bus_schedule += '<tr>'
- $bus_schedule += '<tr><td><<$th[1]>>:33</td><td><<$th[1]>>:58</td><td><<$th[2]>>:13</td><td><<$th[2]>>:21</td><td><<$th[2]>>:23</td>'
- $bus_schedule += '<td style="border-right:2px solid black; border-left:2px solid black"> </td>'
- if th[3] <= 22:
- $bus_schedule += '<td><<$th[4]>>:33</td><td><<$th[4]>>:58</td><td><<$th[5]>>:13</td><td><<$th[5]>>:21</td><td><<$th[5]>>:23</td>'
- else
- $bus_schedule += '<td colspan=5></td>'
- end
- $bus_schedule += '</tr>'
- $bus_schedule += '<tr>'
- $bus_schedule += '<td><<$th[1]>>:53</td><td><<$th[2]>>:18</td><td><<$th[2]>>:33</td><td><<$th[2]>>:41</td><td><<$th[2]>>:43</td>'
- $bus_schedule += '<td style="border-right:2px solid black; border-left:2px solid black"> </td>'
- if th[3] <= 22:
- $bus_schedule += '<td><<$th[4]>>:53</td><td><<$th[5]>>:18</td><td><<$th[5]>>:33</td><td><<$th[5]>>:41</td><td><<$th[5]>>:43</td>'
- else
- $bus_schedule += '<td colspan=5></td>'
- end
- $bus_schedule += '</tr>'
- $bus_schedule += '<tr><td colspan=11 style="border-bottom:1px solid black"></td></tr>'
- th[0] += 1
- if th[0] < 14: jump 'bus_schedule_loop2'
- elseif $ARGS[1] = 'gs':
- $bus_schedule += '<center><h2>Gadukino - Suburbs</h2></center>'
- $bus_schedule += '<br><center><table style="text-align:center">'
- $bus_schedule += '<tr><th></th><th>Communal</th><th></th><th>St. Petersburg</th><th style="border-right:2px solid black; border-left:2px solid black"> </th><th></th><th>Communal</th><th></th><th>St. Petersburg</th></tr>'
- $bus_schedule += '<tr><th style="border-right:2px solid black">Gadukino</th><th style="border-right:2px solid black">Village</th><th style="border-right:2px solid black">Cemetary</th><th>Suburbs</th><th style="border-right:2px solid black; border-left:2px solid black"> </th><th style="border-right:2px solid black">Gadukino</th><th style="border-right:2px solid black">Village</th><th style="border-right:2px solid black">Cemetary</th><th>Suburbs</th></tr>'
- $bus_schedule += '<tr><td colspan=9 style="border-bottom:2px solid black"></td></tr>'
- th[0] = 4
- :bus_schedule_loop3
- $th[1] = mid(100 + th[0], 2, 2)
- $th[2] = mid(100 + th[0] + 1, 2, 2)
- th[3] = th[0] + 10
- $th[4] = mid(100 + th[3], 2, 2)
- $th[5] = mid(100 + th[3] + 1, 2, 2)
- $bus_schedule += '<tr>'
- $bus_schedule += '<td><<$th[1]>>:15</td><td><<$th[1]>>:35</td><td><<$th[1]>>:45</td><td><<$th[1]>>:55</td>'
- $bus_schedule += '<td style="border-right:2px solid black; border-left:2px solid black"> </td>'
- if th[3] <= 22:
- $bus_schedule += '<td><<$th[4]>>:15</td><td><<$th[4]>>:35</td><td><<$th[4]>>:45</td><td><<$th[4]>>:55</td>'
- else
- $bus_schedule += '<td colspan=4></td>'
- end
- $bus_schedule += '</tr>'
- $bus_schedule += '<tr>'
- $bus_schedule += '<td><<$th[1]>>:35</td><td><<$th[1]>>:55</td><td><<$th[2]>>:05</td><td><<$th[2]>>:15</td>'
- $bus_schedule += '<td style="border-right:2px solid black; border-left:2px solid black"> </td>'
- if th[3] <= 22:
- $bus_schedule += '<td><<$th[4]>>:35</td><td><<$th[4]>>:55</td><td><<$th[5]>>:05</td><td><<$th[5]>>:15</td>'
- else
- $bus_schedule += '<td colspan=4></td>'
- end
- $bus_schedule += '</tr>'
- $bus_schedule += '<tr>'
- $bus_schedule += '<td><<$th[4]>>:55</td><td><<$th[5]>>:15</td><td><<$th[5]>>:25</td><td><<$th[5]>>:35</td>'
- $bus_schedule += '<td style="border-right:2px solid black; border-left:2px solid black"> </td>'
- if th[3] <= 22:
- $bus_schedule += '<td><<$th[4]>>:55</td><td><<$th[5]>>:15</td><td><<$th[5]>>:25</td><td><<$th[5]>>:35</td>'
- else
- $bus_schedule += '<td colspan=4></td>'
- end
- $bus_schedule += '</tr>'
- $bus_schedule += '<tr><td colspan=9 style="border-bottom:1px solid black"></td></tr>'
- th[0] += 1
- if th[0] < 14: jump 'bus_schedule_loop3'
- else
- $bus_schedule += '<center><h2>Suburbs - Gadukino</h2></center>'
- $bus_schedule += '<br><center><table style="text-align:center">'
- $bus_schedule += '<tr><th>St. Petersburg</th><th></th><th>Communal</th><th></th><th style="border-right:2px solid black; border-left:2px solid black"> </th><th>St. Petersburg</th><th></th><th>Communal</th><th></th></tr>'
- $bus_schedule += '<tr><th style="border-right:2px solid black">Suburbs</th><th style="border-right:2px solid black">Cemetary</th><th style="border-right:2px solid black">Village</th><th>Gadukino</th><th style="border-right:2px solid black; border-left:2px solid black"> </th><th style="border-right:2px solid black">Suburbs</th><th style="border-right:2px solid black">Cemetary</th><th style="border-right:2px solid black">Village</th><th>Gadukino</th></tr>'
- $bus_schedule += '<tr><td colspan=9 style="border-bottom:2px solid black"></td></tr>'
- th[0] = 4
- :bus_schedule_loop4
- $th[1] = mid(100 + th, 2, 2)
- $th[2] = mid(100 + th + 1, 2, 2)
- th[3] = th[0] + 10
- $th[4] = mid(100 + th[3], 2, 2)
- $th[5] = mid(100 + th[3] + 1, 2, 2)
- $bus_schedule += '<tr>'
- $bus_schedule += '<td><<$th[1]>>:05</td><td><<$th[1]>>:15</td><td><<$th[1]>>:25</td><td><<$th[1]>>:45</td>'
- $bus_schedule += '<td style="border-right:2px solid black; border-left:2px solid black"> </td>'
- if th[3] <= 22:
- $bus_schedule += '<td><<$th[4]>>:05</td><td><<$th[4]>>:15</td><td><<$th[4]>>:25</td><td><<$th[4]>>:45</td>'
- else
- $bus_schedule += '<td colspan=4></td>'
- end
- $bus_schedule += '</tr>'
- $bus_schedule += '<tr>'
- $bus_schedule += '<td><<$th[1]>>:25</td><td><<$th[1]>>:35</td><td><<$th[1]>>:45</td><td><<$th[2]>>:05</td>'
- $bus_schedule += '<td style="border-right:2px solid black; border-left:2px solid black"> </td>'
- if th[3] <= 22:
- $bus_schedule += '<td><<$th[4]>>:25</td><td><<$th[4]>>:35</td><td><<$th[4]>>:45</td><td><<$th[5]>>:05</td>'
- else
- $bus_schedule += '<td colspan=4></td>'
- end
- $bus_schedule += '</tr>'
- $bus_schedule += '<tr>'
- $bus_schedule += '<td><<$th[1]>>:45</td><td><<$th[1]>>:55</td><td><<$th[2]>>:05</td><td><<$th[2]>>:25</td>'
- $bus_schedule += '<td style="border-right:2px solid black; border-left:2px solid black"> </td>'
- if th[3] <= 22:
- $bus_schedule += '<td><<$th[4]>>:45</td><td><<$th[4]>>:55</td><td><<$th[5]>>:05</td><td><<$th[5]>>:25</td>'
- else
- $bus_schedule += '<td colspan=4></td>'
- end
- $bus_schedule += '</tr>'
- $bus_schedule += '<tr><td colspan=9 style="border-bottom:1px solid black"></td></tr>'
- th[0] += 1
- if th[0] < 14: jump 'bus_schedule_loop4'
- end
- $bus_schedule += '</table></center>'
- $bus_schedule
- killvar 'bus_schedule'
- killvar 'th'
- end
- if $ARGS[0] = 'get_bus_price':
- result = func('transport_functions', '_private_bus_price', $ARGS[2]) - func('transport_functions', '_private_bus_price', $ARGS[1])
- if result < 0: result *= -1
- result += 10
- end
- if $ARGS[0] = '_private_bus_price':
- if $ARGS[1] = 'community':
- result = 0
- elseif $ARGS[1] = 'pavstation':
- result = 5
- elseif $ARGS[1] = 'pushkin':
- result = 15
- elseif $ARGS[1] = 'construction':
- result = 25
- elseif $ARGS[1] = 'gadukino':
- result = 35
- elseif $ARGS[1] = 'communal':
- result = 45
- elseif $ARGS[1] = 'graveyard':
- result = 55
- elseif $ARGS[1] = 'suburbs':
- result = 65
- end
- end
- if $ARGS[0] = 'get_bus_timecost':
- result = func('transport_functions', '_private_bus_time', $ARGS[2]) - func('transport_functions', '_private_bus_time', $ARGS[1])
- if result < 0: result *= -1
- end
- if $ARGS[0] = '_private_bus_time':
- if $ARGS[1] = 'community':
- result = 0
- elseif $ARGS[1] = 'pavstation':
- result = 2
- elseif $ARGS[1] = 'pushkin':
- result = 10
- elseif $ARGS[1] = 'construction':
- result = 25
- elseif $ARGS[1] = 'gadukino':
- result = 50
- elseif $ARGS[1] = 'communal':
- result = 70
- elseif $ARGS[1] = 'graveyard':
- result = 80
- elseif $ARGS[1] = 'suburbs':
- result = 90
- end
- end
- !!=======================================!!
- !! !!
- !! Metro !!
- !! !!
- !!=======================================!!
- if $ARGS[0] = 'get_metro_price':
- result = 16
- end
- if $ARGS[0] = 'get_metro_timecost':
- result = 10
- end
- --- transport_functions ---------------------------------
|