santa/
levels.rs

1use serde::{Deserialize, Serialize};
2
3use abstio::MapName;
4use geom::{Duration, LonLat};
5
6#[derive(Serialize, Deserialize, PartialEq, Clone)]
7pub struct Level {
8    pub title: String,
9    pub description: String,
10    pub map: MapName,
11    pub music: String,
12    pub start: LonLat,
13    pub minimap_zoom: usize,
14    pub time_limit: Duration,
15    pub goal: usize,
16
17    pub unlock_upzones: usize,
18    pub unlock_vehicles: Vec<String>,
19}
20
21impl Level {
22    pub fn all() -> Vec<Level> {
23        vec![
24            Level {
25                title: "Queen Anne".to_string(),
26                description: "Nice hilltop views, beautiful houses -- but are they far from \
27                              stores?"
28                    .to_string(),
29                map: MapName::seattle("qa"),
30                music: "jingle_bells".to_string(),
31                start: LonLat::new(-122.3649489, 47.6395838),
32                minimap_zoom: 1,
33                time_limit: Duration::seconds(90.0),
34                goal: 350,
35
36                unlock_upzones: 1,
37                unlock_vehicles: vec![],
38            },
39            Level {
40                title: "University District".to_string(),
41                description: "Tear yourself away from all the bubble tea to deliver presents to \
42                              some college students, whether they've been naughty or nice."
43                    .to_string(),
44                map: MapName::seattle("udistrict_ravenna"),
45                music: "god_rest_ye_merry_gentlemen".to_string(),
46                start: LonLat::new(-122.3130618, 47.6648984),
47                minimap_zoom: 1,
48                time_limit: Duration::minutes(2),
49                goal: 1500,
50
51                unlock_upzones: 1,
52                unlock_vehicles: vec!["cargo bike".to_string()],
53            },
54            Level {
55                title: "Wallingfjord".to_string(),
56                description: "Stone and 45th have food aplenty, but can you manage deliveries to \
57                              everyone tucked away in the neighborhood?"
58                    .to_string(),
59                map: MapName::seattle("wallingford"),
60                music: "silent_night".to_string(),
61                start: LonLat::new(-122.3427877, 47.648515),
62                minimap_zoom: 2,
63                time_limit: Duration::minutes(3),
64                goal: 1500,
65
66                unlock_upzones: 1,
67                unlock_vehicles: vec!["sleigh".to_string()],
68            },
69            Level {
70                title: "Montlake".to_string(),
71                description: "With the Montlake Market closed, how will you manage to bring cheer \
72                              to this sleepy little pocket of the city?"
73                    .to_string(),
74                map: MapName::seattle("montlake"),
75                music: "dance_sugar_plum_fairy".to_string(),
76                start: LonLat::new(-122.3020559, 47.639528),
77                minimap_zoom: 1,
78                time_limit: Duration::minutes(3),
79                goal: 1000,
80
81                unlock_upzones: 1,
82                unlock_vehicles: vec![],
83            },
84            Level {
85                title: "Phinney Ridge".to_string(),
86                description: "Take your pick from the scrumptious options along Greenwood Ave! \
87                              But stray into the neighborhood at your own risk..."
88                    .to_string(),
89                map: MapName::seattle("phinney"),
90                music: "silent_night".to_string(),
91                start: LonLat::new(-122.3552942, 47.6869442),
92                minimap_zoom: 1,
93                time_limit: Duration::minutes(3),
94                goal: 1500,
95
96                unlock_upzones: 1,
97                unlock_vehicles: vec![],
98            },
99            Level {
100                title: "South Pole Union".to_string(),
101                description: "Suddenly, shops everywhere! Can you find all of the residents \
102                              huddled inside?"
103                    .to_string(),
104                map: MapName::seattle("slu"),
105                music: "carol_bells".to_string(),
106                start: LonLat::new(-122.334343, 47.623173),
107                minimap_zoom: 1,
108                time_limit: Duration::seconds(90.0),
109                goal: 1300,
110
111                unlock_upzones: 3,
112                unlock_vehicles: vec![],
113            },
114            Level {
115                title: "Magnolia".to_string(),
116                description: "Struggle past the intense hills and restrictive zoning to tackle \
117                              one of the lowest-density parts of Seattle!"
118                    .to_string(),
119                map: MapName::seattle("central_seattle"),
120                music: "god_rest_ye_merry_gentlemen".to_string(),
121                start: LonLat::new(-122.4008951, 47.6558634),
122                minimap_zoom: 2,
123                time_limit: Duration::minutes(4),
124                goal: 5000,
125
126                unlock_upzones: 5,
127                unlock_vehicles: vec![],
128            },
129        ]
130    }
131}