···33use crate::{impl_timed, loose_enum};
44use serde::{Deserialize, Serialize};
5566+/// Controls the rotation that interactable objects spawn in 90/360 degree difficulties.
67#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
78#[cfg_attr(
89 feature = "bevy_reflect",
···2122impl_timed!(LaneRotationEvent::beat);
22232324loose_enum!(
2424- /// Determines when a [`LaneRotationEvent`] will be applied to objects placed on the same beat as this event.
2525+ /// Determines when a [`LaneRotationEvent`] will be applied to objects.
2526 #[derive(Default, Copy)]
2627 ExecutionTime: i32 {
2727- /// The [`LaneRotationEvent`] will affect objects with a beat greater than or equal to the event's beat.
2828+ /// The [`LaneRotationEvent`] will affect objects with a beat *greater than or equal to* the event's beat.
2829 #[default]
2930 Early = 0,
3030- /// The [`LaneRotationEvent`] will affect objects with a beat greater than the event's beat.
3131+ /// The [`LaneRotationEvent`] will affect objects with a beat *greater than* the event's beat.
3132 Late = 1,
3233 }
3334);
+7-19
src/difficulty/lightshow.rs
···1313use crate::loose_enum;
14141515loose_enum! {
1616- /// The distribution value does different things depending on the type.
1717- ///
1818- /// # [Beat Distribution](https://bsmg.wiki/mapping/map-format/lightshow.html#light-color-event-boxes-beat-distribution):
1919- /// ### Wave:
2020- /// The value represents the total time for all steps to complete.
2121- /// ### Step:
2222- /// The value represents the time until the next step is completed.
2323- ///
2424- /// # [Brightness](https://bsmg.wiki/mapping/map-format/lightshow.html#light-color-event-boxes-effect-distribution) and [Rotation Distribution](https://bsmg.wiki/mapping/map-format/lightshow.html#light-rotation-event-boxes-effect-distribution):
2525- /// ### Wave:
2626- /// The value represents the total difference between the first and last step.
2727- /// ### Step:
2828- /// The value represents the different between the current and next step.
1616+ /// The way that the distribution value is used.
2917 #[derive(Default, Copy)]
3018 DistributionType: i32 {
1919+ /// The distribution value represents the difference between *the last and first step*.
3120 #[default]
3221 Wave = 1,
2222+ /// The distribution value represents the difference between *each step*.
3323 Step = 2,
3424 }
3525}
···7666}
77677868loose_enum! {
7979- /// Controls how the value is changed from the previous event.
8080- /// - Transition: The value will blend from the previous event's value, using the
8181- /// [easing](Easing) value.
8282- /// - Extend: The event's value will be ignored, replaced with the values from the previous event.
8383- ///
8484- /// More info [here](https://bsmg.wiki/mapping/map-format/lightshow.html#light-rotation-events-type).
6969+ /// Controls how the state is changed relative to the previous event.
8570 #[derive(Default, Copy)]
8671 TransitionType: i32 {
7272+ /// The state will blend from the previous event's state, using the events [easing](Easing).
8773 #[default]
8874 Transition = 0,
7575+ /// The event's state will be ignored, replaced with the state from the previous event.
8976 Extend = 1,
9077 }
9178}
92799380loose_enum! {
8181+ /// The axis that a rotation/translation event effects.
9482 #[derive(Default, Copy)]
9583 EventAxis: i32 {
9684 #[default]
+4
src/difficulty/lightshow/easing.rs
···22use simple_easing::*;
3344loose_enum! {
55+ /// The easing that a [transition](crate::lightshow::TransitionType::Transition) event will use.
56 #[derive(Default, Copy)]
67 Easing: i32 {
78 #[default]
···3940 OutBounce = 29,
4041 InOutBounce = 30,
41424343+ /// Note: For [`Easing::ease`], the result will be the same as [`Easing::InOutBack`].
4244 BeatSaberInOutBack = 100,
4545+ /// Note: For [`Easing::ease`], the result will be the same as [`Easing::InOutElastic`].
4346 BeatSaberInOutElastic = 101,
4747+ /// Note: For [`Easing::ease`], the result will be the same as [`Easing::InOutBounce`].
4448 BeatSaberInOutBounce = 102,
4549 }
4650}
+14-16
src/difficulty/lightshow/filter.rs
···22use crate::utils::LooseBool;
33use serde::{Deserialize, Serialize};
4455-/// Controls which light indices are affected by event boxes.
55+/// Controls which light IDs are affected by an event box.
66#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
77#[cfg_attr(
88 feature = "bevy_reflect",
···1111)]
1212pub struct Filter {
1313 // V3.0:
1414+ /// Controls how [`parameter1`](Self::parameter1) and [`parameter2`](Self::parameter2) are used.
1415 #[serde(rename = "f")]
1516 pub filter_type: FilterType,
1616- /// Dependent on the [`FilterType`]
1717+ /// Dependent on the [`FilterType`].
1718 #[serde(rename = "p")]
1819 pub parameter1: i32,
1919- /// Dependent on the [`FilterType`]
2020+ /// Dependent on the [`FilterType`].
2021 #[serde(rename = "t")]
2122 pub parameter2: i32,
2323+ /// If true, the filter will start at the end of a group and work backwards.
2224 #[serde(rename = "r")]
2325 pub reverse: LooseBool,
2426 // V3.1:
···152154}
153155154156loose_enum! {
155155- /// The parameters of a [Filter] do different things depending on the type.
156156- ///
157157- /// ### [Division](https://bsmg.wiki/mapping/map-format/lightshow.html#index-filters-type-1):
158158- /// Splits the group up into equal sections and selects one.
159159- /// - Parameter 1 determines the number of sections.
160160- /// It will be rounded up to the nearest multiple of the group size.
161161- /// - Parameter 2 determines the section to select, starting at 0.
162162- ///
163163- /// ### [Step and Offset](https://bsmg.wiki/mapping/map-format/lightshow.html#index-filters-type-2):
164164- /// Alternates selecting and not selecting lights.
165165- /// - Parameter 1 is the index of the first light that will be selected, starting at 0.
166166- /// - Parameter 2 determines the number of IDs to move forward before selecting another light.
157157+ /// Controls how a [`Filter`]'s [`parameter1`](Filter::parameter1)
158158+ /// and [`parameter2`](Filter::parameter2) values are used.
167159 #[derive(Default, Copy)]
168160 FilterType: i32 {
161161+ /// Splits the group up into equal sections and selects one.
162162+ /// - [`parameter1`](Filter::parameter1) determines the number of sections.
163163+ /// It will be rounded up to the nearest multiple of the group size.
164164+ /// - [`parameter2`](Filter::parameter2) determines the section to select, starting at 0.
169165 #[default]
170170- //Todo Doesn't match wiki
171166 Division = 1,
167167+ /// Alternates selecting and not selecting lights.
168168+ /// - [`parameter1`](Filter::parameter1) is the index of the first light that will be selected, starting at 0.
169169+ /// - [`parameter2`](Filter::parameter2) determines the number of IDs to move forward before selecting another light.
172170 StepAndOffset = 2,
173171 }
174172}
+23-1
src/difficulty/playfield.rs
···33use crate::{impl_duration, impl_timed, loose_enum};
44use serde::{Deserialize, Serialize};
5566-/// The standard block/note.
66+/// The standard block/note that a player cuts.
77#[doc(alias = "Block")]
88#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
99#[cfg_attr(
···2323 /// In the range 0..3 inclusive, with zero being the far left and three being the far right column.
2424 #[serde(rename = "x")]
2525 pub col: i32,
2626+ /// The color that determines which saber should be used to cut the note.
2627 #[serde(rename = "c")]
2728 pub color: NoteColor,
2929+ /// The direction the note should be cut.
2830 #[serde(rename = "d")]
2931 pub direction: CutDirection,
3032 /// The number of degrees counter-clockwise to offset the object by.
···5759 UpRight = 5,
5860 DownLeft = 6,
5961 DownRight = 7,
6262+ #[doc(alias = "Dot")]
6063 Any = 8,
6164 }
6265}
···8184 }
8285}
83868787+/// The spiked bombs that players avoid hitting with their sabers.
8488#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
8589#[cfg_attr(
8690 feature = "bevy_reflect",
···103107104108impl_timed!(Bomb::beat);
105109110110+/// A wall/obstacle that players avoid running into.
106111#[doc(alias = "Obstacle")]
107112#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
108113#[cfg_attr(
···125130 /// In the range 0..3 inclusive, with zero being the far left and three being the far right column.
126131 #[serde(rename = "x")]
127132 pub col: i32,
133133+ /// The number of columns that the wall will take up.
128134 #[serde(rename = "w")]
129135 pub width: i32,
136136+ /// The number of rows that the wall will take up.
137137+ ///
138138+ /// A standard wall has a height of five while a crouch wall has a height of three.
130139 #[serde(rename = "h")]
131140 pub height: i32,
132141}
···146155147156impl_duration!(Wall::beat, duration: duration);
148157158158+/// A glowing line that guides the player's saber.
149159#[doc(alias = "Slider")]
150160#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
151161#[cfg_attr(
···165175 /// In the range 0..3 inclusive, with zero being the far left and three being the far right column.
166176 #[serde(rename = "x")]
167177 pub col: i32,
178178+ /// The color of the arc.
168179 #[serde(rename = "c")]
169180 pub color: NoteColor,
181181+ /// The direction the arc moves in at the start.
170182 #[serde(rename = "d")]
171183 pub direction: CutDirection,
172184 /// Controls how far away the starting bezier control point is in [cut direction](Self::direction).
···184196 /// In the range 0..3 inclusive, with zero being the far left and three being the far right column.
185197 #[serde(rename = "tx")]
186198 pub tail_col: i32,
199199+ /// The direction the arc moves in at the end.
187200 #[serde(rename = "tc")]
188201 pub tail_direction: CutDirection,
189202 /// Controls how far away the ending bezier control point is in [tail cut direction](Self::tail_direction).
190203 #[serde(rename = "tmu")]
191204 pub tail_control_point: f32,
192205206206+ /// Controls how the arc curves from its head to its tail.
193207 #[serde(rename = "m")]
194208 pub mid_anchor_mode: MidAnchorMode,
195209}
···216230impl_duration!(Arc::beat, end: tail_beat);
217231218232loose_enum! {
233233+ /// Controls how an arc curves from its head to its tail.
219234 #[derive(Default, Copy)]
220235 MidAnchorMode: i32 {
221236 #[default]
···225240 }
226241}
227242243243+/// A chain/burst of mini-notes.
228244#[doc(alias = "BurstSlider")]
229245#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
230246#[cfg_attr(
···244260 /// In the range 0..3 inclusive, with zero being the far left and three being the far right column.
245261 #[serde(rename = "x")]
246262 pub col: i32,
263263+ /// The color that determines which saber should be used to cut the chain links.
247264 #[serde(rename = "c")]
248265 pub color: NoteColor,
266266+ /// The direction the start of the chain should be cut.
249267 #[serde(rename = "d")]
250268 pub direction: CutDirection,
251269···264282 /// The number of links the chain has, including the connected [`Note`].
265283 #[serde(rename = "sc")]
266284 pub link_count: i32,
285285+ /// The percent of the path (from head to tail) that will be used, usually in the range 0..1 inclusive.
286286+ /// Smaller values will result in the chain links bunching up near the head.
287287+ ///
288288+ /// Setting this to zero will crash the game.
267289 #[serde(rename = "s")]
268290 pub link_squish: f32,
269291}
+4-2
src/info.rs
···77use crate::loose_enum;
88use serde::{Deserialize, Serialize};
991010+/// A map's `Info.dat` file.
1011#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
1112#[cfg_attr(
1213 feature = "bevy_reflect",
···5152 /// The path to the cover image file, relative to the map's folder.
5253 #[serde(rename = "_coverImageFilename")]
5354 pub cover_image_file: String,
5555+ /// The environment that will be used for 90 and 360 degree difficulties.
5656+ ///
5757+ /// Starting in info file V2.1, individual difficulties can override this using [environment_index](DifficultyInfo::environment_index).
5458 #[serde(rename = "_environmentName")]
5559 pub environment: Environment,
5660 /// The environment that will be used for 90 and 360 degree difficulties.
5757- ///
5858- /// Starting in info file V2.1, Individual difficulties can override this using [environment_index](DifficultyInfo::environment_index).
5961 #[serde(rename = "_allDirectionsEnvironmentName")]
6062 pub all_directions_environment: AllDirectionEnvironment,
6163 /// > Only present in info file V2.1 or higher.
+4-1
src/info/color_scheme.rs
···11+//! Describes the colors of objects and lights for an environment/map.
22+13pub mod presets;
2435#[allow(unused_imports)]
···1820 pub color_scheme: ColorScheme,
1921}
20222121-/// Describes the colors of objects a lights for an environment/map.
2323+/// The colors of objects and lights for an environment/map.
2224///
2325/// This does *not* currently support while light color overrides.
2426#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
···105107 }
106108}
107109110110+/// The color of an object/light.
108111#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)]
109112#[cfg_attr(
110113 feature = "bevy_reflect",
+2
src/info/color_scheme/presets.rs
···11+//! Defines the color schemes provided by the base game for each environment.
22+13use crate::info::color_scheme::{Color, ColorScheme};
24use crate::info::{AllDirectionEnvironment, Environment};
35