danoniplus 36.4.1 → 36.5.0

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.
package/README.md CHANGED
@@ -2,7 +2,8 @@
2
2
 
3
3
  [![CodeFactor](https://www.codefactor.io/repository/github/cwtickle/danoniplus/badge)](https://www.codefactor.io/repository/github/cwtickle/danoniplus)
4
4
  [![Codacy Badge](https://app.codacy.com/project/badge/Grade/1213a18348c34328ac4f10c9e8a2b987)](https://app.codacy.com/gh/cwtickle/danoniplus/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
5
- [![CodeQL](https://github.com/cwtickle/danoniplus/workflows/CodeQL/badge.svg)](https://github.com/cwtickle/danoniplus/actions?query=workflow%3ACodeQL)
5
+ [![CodeQL](https://github.com/cwtickle/danoniplus/workflows/CodeQL/badge.svg)](https://github.com/cwtickle/danoniplus/actions?query=workflow%3ACodeQL)
6
+ [![Discord](https://img.shields.io/discord/698460971231870977?style=flat&logo=discord&logoColor=%23ffffff&label=Discord&labelColor=%236666ff&color=%23000066)](https://discord.gg/YVWUdUGyMy)
6
7
  [![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/cwtickle/danoniplus?sort=semver)](https://github.com/cwtickle/danoniplus/security/policy)
7
8
  [![GitHub All Releases](https://img.shields.io/github/downloads/cwtickle/danoniplus/total?color=%23ff3399&label=downloads%20%28recently%29)](https://github.com/cwtickle/danoniplus/releases)
8
9
  [![GitHub](https://img.shields.io/github/license/cwtickle/danoniplus)](https://github.com/cwtickle/danoniplus/blob/develop/LICENSE)
package/js/danoni_main.js CHANGED
@@ -4,12 +4,12 @@
4
4
  *
5
5
  * Source by tickle
6
6
  * Created : 2018/10/08
7
- * Revised : 2024/05/18
7
+ * Revised : 2024/06/01
8
8
  *
9
9
  * https://github.com/cwtickle/danoniplus
10
10
  */
11
- const g_version = `Ver 36.4.1`;
12
- const g_revisedDate = `2024/05/18`;
11
+ const g_version = `Ver 36.5.0`;
12
+ const g_revisedDate = `2024/06/05`;
13
13
 
14
14
  // カスタム用バージョン (danoni_custom.js 等で指定可)
15
15
  let g_localVersion = ``;
@@ -242,7 +242,7 @@ const convertStrToVal = _str => {
242
242
  * 半角スペース、タブを文字列から除去
243
243
  * @param {string} _str
244
244
  */
245
- const trimStr = _str => _str?.split(`\t`).join(``).trimStart().trimEnd();
245
+ const trimStr = _str => _str?.split(`\t`).join(``).replace(/^ +| +$/g, ``);
246
246
 
247
247
  /*-----------------------------------------------------------*/
248
248
  /* 値や配列のチェック・変換 */
@@ -1582,7 +1582,8 @@ const makeSpriteData = (_data, _calcFrame = _frame => _frame) => {
1582
1582
  const tmpSpriteData = tmpData.split(`,`).map(val => trimStr(val));
1583
1583
 
1584
1584
  // 深度が"-"の場合はスキップ
1585
- if (!hasVal(tmpSpriteData[1], `-`)) {
1585
+ if (tmpSpriteData[1] === undefined || tmpSpriteData[1] === `-` ||
1586
+ (tmpSpriteData[1] === `` && ![`[loop]`, `[jump]`].includes(tmpSpriteData[2]))) {
1586
1587
  return;
1587
1588
  }
1588
1589
 
@@ -7637,6 +7638,7 @@ const applySRandom = (_keyNum, _shuffleGroup, _arrowHeader, _frzHeader) => {
7637
7638
 
7638
7639
  const tmpArrowData = [...Array(_keyNum)].map(_ => []);
7639
7640
  const tmpFrzData = [...Array(_keyNum)].map(_ => []);
7641
+ const scatterFrame = 10;
7640
7642
 
7641
7643
  // シャッフルグループごとに処理
7642
7644
  _shuffleGroup.forEach(_group => {
@@ -7653,28 +7655,61 @@ const applySRandom = (_keyNum, _shuffleGroup, _arrowHeader, _frzHeader) => {
7653
7655
  // 重ならないようにフリーズを配置
7654
7656
  allFreezeArrows.forEach(_freeze => {
7655
7657
  // 置ける場所を検索
7658
+ const freeSpacesFlat = _group.filter(
7659
+ _key => tmpFrzData[_key].find(_other => _freeze.begin - scatterFrame <= _other.end + scatterFrame) === undefined
7660
+ );
7656
7661
  const freeSpaces = _group.filter(
7657
7662
  _key => tmpFrzData[_key].find(_other => _freeze.begin <= _other.end) === undefined
7658
7663
  );
7664
+ let currentFreeSpaces = freeSpaces;
7665
+ if (g_stateObj.shuffle.startsWith(`Scatter`)) {
7666
+ currentFreeSpaces = freeSpacesFlat.length > 0 ? freeSpacesFlat : freeSpaces;
7667
+ }
7659
7668
  // ランダムに配置
7660
- const random = Math.floor(Math.random() * freeSpaces.length);
7661
- tmpFrzData[freeSpaces[random]].push(_freeze);
7669
+ const random = Math.floor(Math.random() * currentFreeSpaces.length);
7670
+ tmpFrzData[currentFreeSpaces[random]].push(_freeze);
7662
7671
  });
7663
7672
 
7664
7673
  // 通常矢印の配置
7665
7674
  const allArrows = _group.map(_key => g_scoreObj[`${_arrowHeader}Data`][_key]).flat();
7666
7675
  allArrows.sort((_a, _b) => _a - _b);
7676
+ let prev2Num = 0, prevNum = 0;
7667
7677
  allArrows.forEach(_arrow => {
7678
+
7679
+ // 直前の矢印のフレーム数を取得
7680
+ if (prev2Num !== _arrow) {
7681
+ if (prevNum !== _arrow) {
7682
+ prev2Num = prevNum;
7683
+ prevNum = _arrow;
7684
+ }
7685
+ }
7686
+
7668
7687
  // 置ける場所を検索
7688
+ const freeSpacesFlat = _group.filter(_key =>
7689
+ // フリーズと重ならない (前後10フレーム)
7690
+ tmpFrzData[_key].find(_freeze => _arrow >= _freeze.begin - scatterFrame && _arrow <= _freeze.end + scatterFrame) === undefined
7691
+ // 通常矢印と重ならない (前後10フレーム)
7692
+ && tmpArrowData[_key].find(_other => _arrow >= _other - scatterFrame && _arrow <= _other + scatterFrame) === undefined
7693
+ // 直前の矢印と重ならない
7694
+ && tmpArrowData[_key].find(_other => prev2Num === _other) === undefined
7695
+ );
7669
7696
  const freeSpaces = _group.filter(_key =>
7670
7697
  // フリーズと重ならない
7671
7698
  tmpFrzData[_key].find(_freeze => _arrow >= _freeze.begin && _arrow <= _freeze.end) === undefined
7672
7699
  // 通常矢印と重ならない
7673
7700
  && tmpArrowData[_key].find(_other => _arrow === _other) === undefined
7674
7701
  );
7702
+ const freeSpacesAlt = _group.filter(_key =>
7703
+ // 通常矢印と重ならない
7704
+ tmpArrowData[_key].find(_other => _arrow === _other) === undefined
7705
+ );
7675
7706
  // ランダムに配置
7676
- const random = Math.floor(Math.random() * freeSpaces.length);
7677
- tmpArrowData[freeSpaces[random]].push(_arrow);
7707
+ let currentFreeSpaces = freeSpaces.length > 0 ? freeSpaces : freeSpacesAlt;
7708
+ if (g_stateObj.shuffle.startsWith(`Scatter`)) {
7709
+ currentFreeSpaces = freeSpacesFlat.length > 0 ? freeSpacesFlat : currentFreeSpaces;
7710
+ }
7711
+ const random = Math.floor(Math.random() * currentFreeSpaces.length);
7712
+ tmpArrowData[currentFreeSpaces[random]].push(_arrow);
7678
7713
  })
7679
7714
  });
7680
7715
 
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * Source by tickle
7
7
  * Created : 2019/11/19
8
- * Revised : 2024/05/18 (v36.4.1)
8
+ * Revised : 2024/06/05 (v36.5.0)
9
9
  *
10
10
  * https://github.com/cwtickle/danoniplus
11
11
  */
@@ -966,7 +966,7 @@ const g_settings = {
966
966
  scrolls: [],
967
967
  scrollNum: 0,
968
968
 
969
- shuffles: [C_FLG_OFF, `Mirror`, `X-Mirror`, `Turning`, `Random`, `Random+`, `S-Random`, `S-Random+`],
969
+ shuffles: [C_FLG_OFF, `Mirror`, `X-Mirror`, `Turning`, `Random`, `Random+`, `S-Random`, `S-Random+`, `Scatter`, `Scatter+`],
970
970
  shuffleNum: 0,
971
971
  swapPattern: [4, 5, 6, 7],
972
972
 
@@ -1057,6 +1057,14 @@ const g_shuffleFunc = {
1057
1057
  applySRandom(keyNum, [[...Array(keyNum).keys()]], `arrow`, `frz`);
1058
1058
  applySRandom(keyNum, [[...Array(keyNum).keys()]], `dummyArrow`, `dummyFrz`);
1059
1059
  },
1060
+ 'Scatter': (keyNum, shuffleGroup) => {
1061
+ applySRandom(keyNum, shuffleGroup, `arrow`, `frz`);
1062
+ applySRandom(keyNum, shuffleGroup, `dummyArrow`, `dummyFrz`);
1063
+ },
1064
+ 'Scatter+': keyNum => {
1065
+ applySRandom(keyNum, [[...Array(keyNum).keys()]], `arrow`, `frz`);
1066
+ applySRandom(keyNum, [[...Array(keyNum).keys()]], `dummyArrow`, `dummyFrz`);
1067
+ },
1060
1068
  };
1061
1069
 
1062
1070
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "danoniplus",
3
- "version": "36.4.1",
3
+ "version": "36.5.0",
4
4
  "description": "Dancing☆Onigiri (CW Edition) - Web-based Rhythm Game",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/skin/skin_css.zip DELETED
Binary file