danoniplus 38.0.3 → 38.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.
package/js/danoni_main.js CHANGED
@@ -4,25 +4,25 @@
4
4
  *
5
5
  * Source by tickle
6
6
  * Created : 2018/10/08
7
- * Revised : 2024/11/11
7
+ * Revised : 2024/12/07
8
8
  *
9
9
  * https://github.com/cwtickle/danoniplus
10
10
  */
11
- const g_version = `Ver 38.0.3`;
12
- const g_revisedDate = `2024/11/11`;
11
+ const g_version = `Ver 38.1.1`;
12
+ const g_revisedDate = `2024/12/07`;
13
13
 
14
14
  // カスタム用バージョン (danoni_custom.js 等で指定可)
15
15
  let g_localVersion = ``;
16
16
  let g_localVersion2 = ``;
17
17
 
18
18
  // ショートカット用文字列(↓の文字列を検索することで対象箇所へジャンプできます)
19
- // 共通:water 初期化:peach タイトル:melon 設定:lime ディスプレイ:lemon キーコンフィグ:orange 譜面読込:strawberry メイン:banana 結果:grape
19
+ // 共通:water 初期化:peach タイトル:melon 設定:lime ディスプレイ:lemon キーコンフィグ:orange 譜面読込:strawberry メイン:banana 結果:grape
20
20
  // シーンジャンプ:Scene
21
21
 
22
22
  /**
23
23
  * ▽ 画面の構成
24
24
  * [タイトル]-[設定]-[ディスプレイ]-[キーコンフィグ]-[譜面読込]-[メイン]-[リザルト]
25
- * ⇒ 各画面に Init がついたものが画面の基本構成(ルート)を表す。
25
+ * ⇒ 各画面に Init がついたものが画面の基本構成(ルート)を表す。
26
26
  *
27
27
  * ▽ スプライトの親子関係
28
28
  * 基本的にdiv要素で管理。最下層を[divRoot]とし、createEmptySprite()でdiv子要素を作成。
@@ -39,11 +39,12 @@ const current = () => {
39
39
  };
40
40
  const g_rootPath = current().match(/(^.*\/)/)[0];
41
41
  const g_workPath = new URL(location.href).href.match(/(^.*\/)/)[0];
42
- const g_remoteFlg = g_rootPath.match(`^https://cwtickle.github.io/danoniplus/`) !== null;
42
+ const g_remoteFlg = g_rootPath.match(`^https://cwtickle.github.io/danoniplus/`) !== null ||
43
+ g_rootPath.match(/danoniplus.netlify.app/) !== null;
43
44
  const g_randTime = Date.now();
44
45
  const g_isFile = location.href.match(/^file/);
45
46
  const g_isLocal = location.href.match(/^file/) || location.href.indexOf(`localhost`) !== -1;
46
- const isLocalMusicFile = _scoreId => g_isFile && !listMatching(getMusicUrl(g_stateObj.scoreId), [`.js`, `.txt`], { suffix: `$` });
47
+ const isLocalMusicFile = _scoreId => g_isFile && !listMatching(getMusicUrl(_scoreId), [`.js`, `.txt`], { suffix: `$` });
47
48
 
48
49
  window.onload = async () => {
49
50
  g_loadObj.main = true;
@@ -1008,7 +1009,7 @@ const makeColorGradation = (_colorStr, { _defaultColorgrd = g_headerObj.defaultC
1008
1009
  }
1009
1010
 
1010
1011
  // 矢印の塗りつぶしの場合:透明度を50%にする
1011
- // 背景矢印の場合    :透明度を25%にする
1012
+ // 背景矢印の場合 :透明度を25%にする
1012
1013
  const alphaVal = (_shadowFlg && _objType !== `frz`) ? `80` : (_objType === `titleArrow` ? `40` : ``);
1013
1014
 
1014
1015
  let convertColorStr = ``;
@@ -2809,6 +2810,9 @@ const preheaderConvert = _dosObj => {
2809
2810
  obj.jsData.push([_type === `skin` ? `danoni_skin_${jsFile}.js` : jsFile, jsDir]);
2810
2811
  });
2811
2812
 
2813
+ const convLocalPath = (_file, _type) =>
2814
+ g_remoteFlg && !_file.includes(`(..)`) ? `(..)../${_type}/${_file}` : _file;
2815
+
2812
2816
  // 外部スキンファイルの指定
2813
2817
  const tmpSkinType = _dosObj.skinType ?? g_presetObj.skinType ?? `default`;
2814
2818
  const tmpSkinTypes = tmpSkinType.split(`,`);
@@ -2817,11 +2821,13 @@ const preheaderConvert = _dosObj => {
2817
2821
 
2818
2822
  // 外部jsファイルの指定
2819
2823
  const tmpCustomjs = getHeader(_dosObj, ...getHname(`customJs`)) ?? g_presetObj.customJs ?? C_JSF_CUSTOM;
2820
- setJsFiles(tmpCustomjs.replaceAll(`*`, g_presetObj.customJs).split(`,`), C_DIR_JS);
2824
+ setJsFiles(tmpCustomjs.replaceAll(`*`, g_presetObj.customJs).split(`,`)
2825
+ .map(file => convLocalPath(file, `js`)), C_DIR_JS);
2821
2826
 
2822
2827
  // 外部cssファイルの指定
2823
2828
  const tmpCustomcss = getHeader(_dosObj, ...getHname(`customCss`)) ?? g_presetObj.customCss ?? ``;
2824
- setJsFiles(tmpCustomcss.replaceAll(`*`, g_presetObj.customCss).split(`,`), C_DIR_CSS);
2829
+ setJsFiles(tmpCustomcss.replaceAll(`*`, g_presetObj.customCss).split(`,`)
2830
+ .map(file => convLocalPath(file, `css`)), C_DIR_CSS);
2825
2831
 
2826
2832
  // デフォルト曲名表示、背景、Ready表示の利用有無
2827
2833
  g_titleLists.init.forEach(objName => {
@@ -5449,7 +5455,7 @@ const setDifficulty = (_initFlg) => {
5449
5455
 
5450
5456
  if (!g_stateObj.extraKeyFlg) {
5451
5457
 
5452
- // キー別のローカルストレージの初期設定 ※特殊キーは除く
5458
+ // キー別のローカルストレージの初期設定 ※特殊キーは除く
5453
5459
  g_localKeyStorage = hasKeyStorage ? JSON.parse(hasKeyStorage) : {
5454
5460
  reverse: C_FLG_OFF,
5455
5461
  keyCtrl: [[]],
@@ -5803,7 +5809,7 @@ const createOptionWindow = _sprite => {
5803
5809
  // 縦位置: 7.5
5804
5810
  spriteList.gauge.appendChild(createLblSetting(`Gauge`));
5805
5811
 
5806
- // ゲージ設定詳細 縦位置: ゲージ設定+1
5812
+ // ゲージ設定詳細 縦位置: ゲージ設定+1
5807
5813
  spriteList.gauge.appendChild(createDivCss2Label(`lblGauge2`, ``, g_lblPosObj.lblGauge2));
5808
5814
 
5809
5815
  if (g_headerObj.gaugeUse) {
@@ -8281,7 +8287,7 @@ const scoreConvert = (_dosObj, _scoreId, _preblankFrame, _dummyNo = ``,
8281
8287
  }
8282
8288
  }
8283
8289
  } else if (val.indexOf(`...`) > 0) {
8284
- // 範囲指定表記の補完 例. 0...3 -> 0/1/2/3
8290
+ // 範囲指定表記の補完 例. 0...3 -> 0/1/2/3
8285
8291
  const [valMin, valMax] = [val.split(`...`)[0], val.split(`...`)[1]].map(val => setIntVal(val));
8286
8292
  for (let k = valMin; k <= valMax; k++) {
8287
8293
  colorVals.push(setIntVal(k));
@@ -8793,6 +8799,26 @@ const getBrakeTrace = _frms => {
8793
8799
  return _frms;
8794
8800
  };
8795
8801
 
8802
+ /**
8803
+ * Fountain用の適用関数
8804
+ * - 反対側から出現し、画面中央付近で折り返す。タイミングは初期速度により変化。
8805
+ * @param {number[]} _frms
8806
+ * @param {number} _spd
8807
+ * @returns {number[]}
8808
+ */
8809
+ const getFountainTrace = (_frms, _spd) => {
8810
+ const minj = C_MOTION_STD_POS + 1;
8811
+ const maxj = C_MOTION_STD_POS + Math.ceil(400 / _spd) + 1;
8812
+ const maxMotionFrm = Math.max(maxj, C_MOTION_STD_POS + 200);
8813
+ const diff = 50 / (maxj - minj);
8814
+ const factor = 0.5 + _spd / 40;
8815
+
8816
+ for (let j = minj; j < maxMotionFrm; j++) {
8817
+ _frms[j] = Math.floor((10 - (j - C_MOTION_STD_POS - 1) * diff) * factor);
8818
+ }
8819
+ return _frms;
8820
+ }
8821
+
8796
8822
  /**
8797
8823
  * 最初のフレームで出現する矢印が、ステップゾーンに到達するまでのフレーム数を取得
8798
8824
  * @param {number} _startFrame
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * Source by tickle
7
7
  * Created : 2019/11/19
8
- * Revised : 2024/11/04 (v38.0.0)
8
+ * Revised : 2024/12/02 (v38.1.0)
9
9
  *
10
10
  * https://github.com/cwtickle/danoniplus
11
11
  */
@@ -952,7 +952,7 @@ const g_settings = {
952
952
  speedNum: 0,
953
953
  speedTerms: [20, 5, 1],
954
954
 
955
- motions: [C_FLG_OFF, `Boost`, `Hi-Boost`, `Brake`],
955
+ motions: [C_FLG_OFF, `Boost`, `Hi-Boost`, `Brake`, `Compress`, `Fountain`],
956
956
  motionNum: 0,
957
957
 
958
958
  reverses: [C_FLG_OFF, C_FLG_ON],
@@ -1073,6 +1073,8 @@ const g_motionFunc = {
1073
1073
  'Boost': _frms => getBoostTrace(_frms, 3),
1074
1074
  'Hi-Boost': _frms => getBoostTrace(_frms, g_stateObj.speed * 2),
1075
1075
  'Brake': _frms => getBrakeTrace(_frms),
1076
+ 'Compress': _frms => getBoostTrace(_frms, g_stateObj.speed * 5 / 8, -1),
1077
+ 'Fountain': _frms => getFountainTrace(_frms, g_stateObj.speed * 2),
1076
1078
  };
1077
1079
 
1078
1080
  const g_keycons = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "danoniplus",
3
- "version": "38.0.3",
3
+ "version": "38.1.1",
4
4
  "description": "Dancing☆Onigiri (CW Edition) - Web-based Rhythm Game",
5
5
  "main": "index.js",
6
6
  "scripts": {