sonolus-pjsekai-js 1.0.10 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
Binary file
Binary file
Binary file
package/dist/index.cjs CHANGED
@@ -20,7 +20,7 @@ Object.defineProperty(exports, "susToUSC", { enumerable: true, get: function ()
20
20
  var convert_cjs_2 = require("./usc/convert.cjs");
21
21
  Object.defineProperty(exports, "uscToLevelData", { enumerable: true, get: function () { return convert_cjs_2.uscToLevelData; } });
22
22
  __exportStar(require("./usc/index.cjs"), exports);
23
- exports.version = '1.0.10';
23
+ exports.version = '1.1.1';
24
24
  exports.databaseEngineItem = {
25
25
  name: 'prosekaR',
26
26
  version: 13,
package/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { susToUSC } from './sus/convert.cjs';
2
2
  export { uscToLevelData } from './usc/convert.cjs';
3
3
  export * from './usc/index.cjs';
4
- export declare const version = "1.0.10";
4
+ export declare const version = "1.1.1";
5
5
  export declare const databaseEngineItem: {
6
6
  readonly name: "prosekaR";
7
7
  readonly version: 13;
@@ -95,9 +95,11 @@ const directions = {
95
95
  right: 1,
96
96
  };
97
97
  const eases = {
98
+ outin: -2,
98
99
  out: -1,
99
100
  linear: 0,
100
101
  in: 1,
102
+ inout: 2,
101
103
  };
102
104
  const bpm = (object, append) => {
103
105
  append({
@@ -156,21 +158,48 @@ const slide = (object, append) => {
156
158
  if (i === 0) {
157
159
  switch (connection.type) {
158
160
  case 'start': {
159
- const ci = {
160
- archetype: connection.trace
161
+ let archetype;
162
+ let sim = true;
163
+ if ('judgeType' in connection) {
164
+ if (connection.judgeType === "none") {
165
+ archetype = "IgnoredSlideStartNote";
166
+ sim = false;
167
+ }
168
+ else if (connection.judgeType === "trace") {
169
+ if (connection.critical) {
170
+ archetype = "CriticalTraceSlideStartNote";
171
+ }
172
+ else {
173
+ archetype = "NormalTraceSlideStartNote";
174
+ }
175
+ }
176
+ else {
177
+ if (connection.critical) {
178
+ archetype = "CriticalSlideStartNote";
179
+ }
180
+ else {
181
+ archetype = "NormalSlideStartNote";
182
+ }
183
+ }
184
+ }
185
+ else {
186
+ archetype = connection.trace
161
187
  ? connection.critical
162
188
  ? 'CriticalSlideTraceNote'
163
189
  : 'NormalSlideTraceNote'
164
190
  : connection.critical
165
191
  ? 'CriticalSlideStartNote'
166
- : 'NormalSlideStartNote',
192
+ : 'NormalSlideStartNote';
193
+ }
194
+ const ci = {
195
+ archetype,
167
196
  data: {
168
197
  [core_1.EngineArchetypeDataName.Beat]: connection.beat,
169
198
  lane: connection.lane,
170
199
  size: connection.size,
171
200
  },
172
- sim: true,
173
- ease: connection.ease,
201
+ sim,
202
+ ease: connection.ease
174
203
  };
175
204
  cis.push(ci);
176
205
  joints.push(ci);
@@ -355,11 +384,64 @@ const slide = (object, append) => {
355
384
  append(connector);
356
385
  }
357
386
  };
387
+ const guide = (object, append) => {
388
+ const critical = object.color === 'yellow' ? true : false;
389
+ // midpoints를 slide의 connections 형태로 변환
390
+ const connections = object.midpoints.map((midpoint, i) => {
391
+ if (i === 0) {
392
+ return {
393
+ type: 'start',
394
+ beat: midpoint.beat,
395
+ lane: midpoint.lane,
396
+ size: midpoint.size,
397
+ trace: false,
398
+ critical: false,
399
+ ease: midpoint.ease === 'out' ? 'out'
400
+ : midpoint.ease === 'linear' ? 'linear'
401
+ : midpoint.ease === 'in' ? 'in'
402
+ : 'linear',
403
+ };
404
+ }
405
+ else if (i === object.midpoints.length - 1) {
406
+ return {
407
+ type: 'end',
408
+ beat: midpoint.beat,
409
+ lane: midpoint.lane,
410
+ size: midpoint.size,
411
+ trace: false,
412
+ critical: false,
413
+ direction: undefined,
414
+ };
415
+ }
416
+ else {
417
+ return {
418
+ type: 'tick',
419
+ beat: midpoint.beat,
420
+ lane: midpoint.lane,
421
+ size: midpoint.size,
422
+ trace: false,
423
+ critical: false,
424
+ ease: midpoint.ease === 'out' ? 'out'
425
+ : midpoint.ease === 'linear' ? 'linear'
426
+ : midpoint.ease === 'in' ? 'in'
427
+ : 'linear',
428
+ };
429
+ }
430
+ });
431
+ const slideObj = {
432
+ type: 'slide',
433
+ active: true,
434
+ critical,
435
+ connections,
436
+ };
437
+ slide(slideObj, append);
438
+ };
358
439
  const handlers = {
359
440
  bpm,
360
441
  single,
361
442
  timeScale,
362
443
  slide,
444
+ guide,
363
445
  };
364
446
  const getConnections = (object) => {
365
447
  if (!object.active)
@@ -1,2 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.USCFade = exports.USCColor = void 0;
4
+ exports.USCColor = {
5
+ neutral: 0,
6
+ red: 1,
7
+ green: 2,
8
+ blue: 3,
9
+ yellow: 4,
10
+ purple: 5,
11
+ cyan: 6,
12
+ black: 7,
13
+ };
14
+ exports.USCFade = {
15
+ in: 2,
16
+ out: 0,
17
+ none: 1,
18
+ };
@@ -2,7 +2,7 @@ export type USC = {
2
2
  offset: number;
3
3
  objects: USCObject[];
4
4
  };
5
- export type USCObject = USCBpmChange | USCTimeScaleChange | USCSingleNote | USCSlideNote;
5
+ export type USCObject = USCBpmChange | USCTimeScaleChange | USCSingleNote | USCSlideNote | USCGuideNote;
6
6
  type BaseUSCObject = {
7
7
  beat: number;
8
8
  };
@@ -63,4 +63,30 @@ export type USCSlideNote = {
63
63
  USCConnectionEndNote | USCConnectionIgnoreNote
64
64
  ];
65
65
  };
66
+ export declare const USCColor: {
67
+ neutral: number;
68
+ red: number;
69
+ green: number;
70
+ blue: number;
71
+ yellow: number;
72
+ purple: number;
73
+ cyan: number;
74
+ black: number;
75
+ };
76
+ export type USCColor = keyof typeof USCColor;
77
+ export type USCGuideMidpointNote = BaseUSCNote & {
78
+ ease: "out" | "linear" | "in" | "inOut" | "outIn";
79
+ };
80
+ export declare const USCFade: {
81
+ in: number;
82
+ out: number;
83
+ none: number;
84
+ };
85
+ export type USCFade = keyof typeof USCFade;
86
+ export type USCGuideNote = {
87
+ type: "guide";
88
+ color: USCColor;
89
+ fade: USCFade;
90
+ midpoints: USCGuideMidpointNote[];
91
+ };
66
92
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sonolus-pjsekai-js",
3
- "version": "1.0.10",
3
+ "version": "1.1.1",
4
4
  "description": "A recreation of Project Sekai: Colorful Stage! engine in Sonolus",
5
5
  "type": "module",
6
6
  "files": [