|
@@ -0,0 +1,102 @@
|
|
|
+# train_functions
|
|
|
+
|
|
|
+
|
|
|
+if $ARGS[0] = 'buy_train_pass':
|
|
|
+ if Trainpass_day <= daystart:
|
|
|
+ if money >= 250:
|
|
|
+ dynamic 'act ''Buy a daily pass (1 day - 250 <b>₽</b>)'':
|
|
|
+ cla
|
|
|
+ money -= 250
|
|
|
+ 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
|
|
|
+ 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
|
|
|
+ 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
|
|
|
+ Trainpass_day = daystart + 365
|
|
|
+ act ''Return'': gt ''<<$loc>>'', ''<<$loc_arg>>''
|
|
|
+ end'
|
|
|
+ end
|
|
|
+ end
|
|
|
+end
|
|
|
+
|
|
|
+
|
|
|
+! Prices:
|
|
|
+! Get on price: 25
|
|
|
+! Pav - Gad: 50
|
|
|
+! Gad - Com: 25
|
|
|
+! Com - Ind: 25
|
|
|
+! Ind - Cen: 25
|
|
|
+if $ARGS[0] = 'buy_ticket':
|
|
|
+ if $ARGS[1] = 'pavlovsk':
|
|
|
+ gs 'train_functions', 'set_ticket', 75, 'pav_train_hall', 'village', 'the village of Gadukino'
|
|
|
+ gs 'train_functions', 'set_ticket', 100, 'pav_train_hall', 'communal', 'the communal village'
|
|
|
+ gs 'train_functions', 'set_ticket', 125, 'pav_train_hall', 'ind', 'the city industrial area'
|
|
|
+ gs 'train_functions', 'set_ticket', 150, 'pav_train_hall', 'center', 'the city center'
|
|
|
+
|
|
|
+ elseif $ARGS[1] = 'gadukino':
|
|
|
+ gs 'train_functions', 'set_ticket', 75, 'train', 'village_pavlovsk', 'Pavlovsk'
|
|
|
+ gs 'train_functions', 'set_ticket', 50, 'train', 'village_communal', 'the communal village'
|
|
|
+ gs 'train_functions', 'set_ticket', 75, 'train', 'village_ind', 'St. Petersburg city industrial area'
|
|
|
+ gs 'train_functions', 'set_ticket', 100, 'train', 'village_center', 'St. Petersburg city center'
|
|
|
+
|
|
|
+ elseif $ARGS[1] = 'communal':
|
|
|
+ gs 'train_functions', 'set_ticket', 75, 'train', 'communal_center', 'St. Petersburg city center'
|
|
|
+ gs 'train_functions', 'set_ticket', 50, 'train', 'communal_ind', 'St. Petersburg city industrial area'
|
|
|
+ gs 'train_functions', 'set_ticket', 50, 'train', 'communal_village', 'the village of Gadukino'
|
|
|
+ gs 'train_functions', 'set_ticket', 100, 'train', 'communal_pavlovsk', 'Pavlovsk'
|
|
|
+
|
|
|
+ elseif $ARGS[1] = 'ind':
|
|
|
+ gs 'train_functions', 'set_ticket', 50, 'city_industrial_train', 'center', 'St. Petersburg city center'
|
|
|
+ gs 'train_functions', 'set_ticket', 50, 'city_industrial_train', 'communal', 'the communal village'
|
|
|
+ gs 'train_functions', 'set_ticket', 75, 'city_industrial_train', 'village', 'the village of Gadukino'
|
|
|
+ gs 'train_functions', 'set_ticket', 125, 'city_industrial_train', 'pavlovsk', 'Pavlovsk'
|
|
|
+
|
|
|
+ elseif $ARGS[1] = 'center':
|
|
|
+ gs 'train_functions', 'set_ticket', 50, 'city_train', 'ind', 'the city industrial area'
|
|
|
+ gs 'train_functions', 'set_ticket', 75, 'city_train', 'communal', 'the communal village'
|
|
|
+ gs 'train_functions', 'set_ticket', 100, 'city_train', 'village', 'the village of Gadukino'
|
|
|
+ gs 'train_functions', 'set_ticket', 150, 'city_train', 'pavlovsk', 'Pavlovsk'
|
|
|
+ end
|
|
|
+end
|
|
|
+
|
|
|
+
|
|
|
+! ARGS[1] = price
|
|
|
+! $ARGS[2] = desitination loc
|
|
|
+! $ARGS[3] = destinatino loc_arg
|
|
|
+! $ARGS[4] = destination name
|
|
|
+if $ARGS[0] = 'set_ticket':
|
|
|
+ if money < ARGS[1]:
|
|
|
+ dynamic 'act ''Buy a ticket to <<$ARGS[4]>> (<font color="red"><<ARGS[1]>> <b>₽</b></font>)'': ''<br><font color="red">You don''t have enough money for a ticket to <<$ARGS[4]>>'' '
|
|
|
+ else
|
|
|
+ dynamic 'act ''Buy a ticket to <<$ARGS[4]>> (<<ARGS[1]>> <b>₽</b>)'':
|
|
|
+ money -= <<ARGS[1]>>
|
|
|
+ menu_off = 1
|
|
|
+ gt ''<<$ARGS[2]>>'', ''<<$ARGS[3]>>''
|
|
|
+ end'
|
|
|
+ end
|
|
|
+end
|
|
|
+
|
|
|
+
|
|
|
+--- train_functions ---------------------------------
|