2024-03-23 19:34:37 +00:00
|
|
|
package funkin.data.story.level;
|
2023-05-17 02:09:53 +00:00
|
|
|
|
2023-07-14 00:25:01 +00:00
|
|
|
import funkin.data.animation.AnimationData;
|
2023-05-17 02:09:53 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* A type definition for the data in a story mode level JSON file.
|
|
|
|
* @see https://lib.haxe.org/p/json2object/
|
|
|
|
*/
|
|
|
|
typedef LevelData =
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* The version number of the level data schema.
|
|
|
|
* When making changes to the level data format, this should be incremented,
|
|
|
|
* and a migration function should be added to LevelDataParser to handle old versions.
|
|
|
|
*/
|
2024-03-23 19:34:37 +00:00
|
|
|
@:default(funkin.data.story.level.LevelRegistry.LEVEL_DATA_VERSION)
|
2023-05-17 02:09:53 +00:00
|
|
|
var version:String;
|
|
|
|
|
|
|
|
/**
|
2024-03-05 07:29:44 +00:00
|
|
|
* The title of the level, as seen in the top corner.
|
2023-05-17 02:09:53 +00:00
|
|
|
*/
|
|
|
|
var name:String;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The graphic for the level, as seen in the scrolling list.
|
|
|
|
*/
|
2023-09-08 21:45:47 +00:00
|
|
|
@:jcustomparse(funkin.data.DataParse.stringNotEmpty)
|
2023-05-17 02:09:53 +00:00
|
|
|
var titleAsset:String;
|
|
|
|
|
2024-03-05 07:29:44 +00:00
|
|
|
/**
|
|
|
|
* The props to display over the colored background.
|
|
|
|
* In the base game this is usually Boyfriend and the opponent.
|
|
|
|
*/
|
2023-05-17 02:09:53 +00:00
|
|
|
@:default([])
|
|
|
|
var props:Array<LevelPropData>;
|
2024-03-05 07:29:44 +00:00
|
|
|
|
2024-05-02 16:46:24 +00:00
|
|
|
/**
|
|
|
|
* Whether this week is visible in the story menu.
|
|
|
|
* @default `true`
|
|
|
|
*/
|
|
|
|
@:default(true)
|
|
|
|
@:optional
|
|
|
|
var visible:Bool;
|
|
|
|
|
2024-03-05 07:29:44 +00:00
|
|
|
/**
|
|
|
|
* The list of song IDs included in this level.
|
|
|
|
*/
|
|
|
|
@:default(['bopeebo'])
|
2023-05-17 02:09:53 +00:00
|
|
|
var songs:Array<String>;
|
2024-03-05 07:29:44 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The background for the level behind the props.
|
|
|
|
*/
|
|
|
|
@:default('#F9CF51')
|
2023-05-17 02:09:53 +00:00
|
|
|
@:optional
|
|
|
|
var background:String;
|
|
|
|
}
|
|
|
|
|
2024-03-05 07:29:44 +00:00
|
|
|
/**
|
|
|
|
* Data for a single prop for a story mode level.
|
|
|
|
*/
|
2023-05-17 02:09:53 +00:00
|
|
|
typedef LevelPropData =
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* The image to use for the prop. May optionally be a sprite sheet.
|
|
|
|
*/
|
|
|
|
var assetPath:String;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The scale to render the prop at.
|
|
|
|
* @default 1.0
|
|
|
|
*/
|
|
|
|
@:default(1.0)
|
|
|
|
@:optional
|
|
|
|
var scale:Float;
|
|
|
|
|
2023-05-17 20:42:58 +00:00
|
|
|
/**
|
|
|
|
* The opacity to render the prop at.
|
|
|
|
* @default 1.0
|
|
|
|
*/
|
|
|
|
@:default(1.0)
|
|
|
|
@:optional
|
|
|
|
var alpha:Float;
|
|
|
|
|
2023-05-17 02:09:53 +00:00
|
|
|
/**
|
|
|
|
* If true, the prop is a pixel sprite, and will be rendered without smoothing.
|
|
|
|
*/
|
|
|
|
@:default(false)
|
|
|
|
@:optional
|
|
|
|
var isPixel:Bool;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The frequency to bop at, in beats.
|
2023-05-17 20:42:58 +00:00
|
|
|
* @default 1 = every beat, 2 = every other beat, etc.
|
2023-05-17 02:09:53 +00:00
|
|
|
*/
|
2023-05-17 20:42:58 +00:00
|
|
|
@:default(1)
|
2023-05-17 02:09:53 +00:00
|
|
|
@:optional
|
2023-05-17 20:42:58 +00:00
|
|
|
var danceEvery:Int;
|
2023-05-17 02:09:53 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The offset on the position to render the prop at.
|
|
|
|
* @default [0.0, 0.0]
|
|
|
|
*/
|
|
|
|
@:default([0, 0])
|
|
|
|
@:optional
|
2023-05-17 20:42:58 +00:00
|
|
|
var offsets:Array<Float>;
|
2023-05-17 02:09:53 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* A set of animations to play on the prop.
|
|
|
|
* If default/empty, the prop will be static.
|
|
|
|
*/
|
|
|
|
@:default([])
|
|
|
|
@:optional
|
|
|
|
var animations:Array<AnimationData>;
|
|
|
|
}
|