danoniplus 38.0.2 → 38.1.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/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/07
7
+ * Revised : 2024/12/02
8
8
  *
9
9
  * https://github.com/cwtickle/danoniplus
10
10
  */
11
- const g_version = `Ver 38.0.2`;
12
- const g_revisedDate = `2024/11/07`;
11
+ const g_version = `Ver 38.1.0`;
12
+ const g_revisedDate = `2024/12/02`;
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;
@@ -516,6 +517,9 @@ const fuzzyListMatching = (_str, _headerList, _footerList) =>
516
517
  * @returns {string} 置換後文字列
517
518
  */
518
519
  const replaceStr = (_str, _pairs) => {
520
+ if (_str === undefined) {
521
+ return _str;
522
+ }
519
523
  let tmpStr = _str;
520
524
  _pairs.forEach(pair => tmpStr = String(tmpStr)?.split(pair[0]).join(pair[1]));
521
525
  return tmpStr;
@@ -1005,7 +1009,7 @@ const makeColorGradation = (_colorStr, { _defaultColorgrd = g_headerObj.defaultC
1005
1009
  }
1006
1010
 
1007
1011
  // 矢印の塗りつぶしの場合:透明度を50%にする
1008
- // 背景矢印の場合    :透明度を25%にする
1012
+ // 背景矢印の場合 :透明度を25%にする
1009
1013
  const alphaVal = (_shadowFlg && _objType !== `frz`) ? `80` : (_objType === `titleArrow` ? `40` : ``);
1010
1014
 
1011
1015
  let convertColorStr = ``;
@@ -2806,6 +2810,9 @@ const preheaderConvert = _dosObj => {
2806
2810
  obj.jsData.push([_type === `skin` ? `danoni_skin_${jsFile}.js` : jsFile, jsDir]);
2807
2811
  });
2808
2812
 
2813
+ const convLocalPath = (_file, _type) =>
2814
+ g_remoteFlg && !_file.includes(`(..)`) ? `(..)../${_type}/${_file}` : _file;
2815
+
2809
2816
  // 外部スキンファイルの指定
2810
2817
  const tmpSkinType = _dosObj.skinType ?? g_presetObj.skinType ?? `default`;
2811
2818
  const tmpSkinTypes = tmpSkinType.split(`,`);
@@ -2814,11 +2821,13 @@ const preheaderConvert = _dosObj => {
2814
2821
 
2815
2822
  // 外部jsファイルの指定
2816
2823
  const tmpCustomjs = getHeader(_dosObj, ...getHname(`customJs`)) ?? g_presetObj.customJs ?? C_JSF_CUSTOM;
2817
- 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);
2818
2826
 
2819
2827
  // 外部cssファイルの指定
2820
2828
  const tmpCustomcss = getHeader(_dosObj, ...getHname(`customCss`)) ?? g_presetObj.customCss ?? ``;
2821
- 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);
2822
2831
 
2823
2832
  // デフォルト曲名表示、背景、Ready表示の利用有無
2824
2833
  g_titleLists.init.forEach(objName => {
@@ -5446,7 +5455,7 @@ const setDifficulty = (_initFlg) => {
5446
5455
 
5447
5456
  if (!g_stateObj.extraKeyFlg) {
5448
5457
 
5449
- // キー別のローカルストレージの初期設定 ※特殊キーは除く
5458
+ // キー別のローカルストレージの初期設定 ※特殊キーは除く
5450
5459
  g_localKeyStorage = hasKeyStorage ? JSON.parse(hasKeyStorage) : {
5451
5460
  reverse: C_FLG_OFF,
5452
5461
  keyCtrl: [[]],
@@ -5800,7 +5809,7 @@ const createOptionWindow = _sprite => {
5800
5809
  // 縦位置: 7.5
5801
5810
  spriteList.gauge.appendChild(createLblSetting(`Gauge`));
5802
5811
 
5803
- // ゲージ設定詳細 縦位置: ゲージ設定+1
5812
+ // ゲージ設定詳細 縦位置: ゲージ設定+1
5804
5813
  spriteList.gauge.appendChild(createDivCss2Label(`lblGauge2`, ``, g_lblPosObj.lblGauge2));
5805
5814
 
5806
5815
  if (g_headerObj.gaugeUse) {
@@ -8264,7 +8273,7 @@ const scoreConvert = (_dosObj, _scoreId, _preblankFrame, _dummyNo = ``,
8264
8273
  const pos = tmpColorData[1]?.indexOf(`:`);
8265
8274
  const patternStr = pos > 0 ? [trimStr(tmpColorData[1].substring(0, pos)), trimStr(tmpColorData[1].substring(pos + 1))]
8266
8275
  : [tmpColorData[1]];
8267
- const patterns = replaceStr(trimStr(patternStr[1]), g_escapeStr.colorPatternName)?.split(`/`) || [`Arrow`];
8276
+ const patterns = replaceStr(trimStr(patternStr[1] || `Arrow`), g_escapeStr.colorPatternName).split(`/`);
8268
8277
 
8269
8278
  // 矢印番号の組み立て
8270
8279
  const colorVals = [];
@@ -8278,7 +8287,7 @@ const scoreConvert = (_dosObj, _scoreId, _preblankFrame, _dummyNo = ``,
8278
8287
  }
8279
8288
  }
8280
8289
  } else if (val.indexOf(`...`) > 0) {
8281
- // 範囲指定表記の補完 例. 0...3 -> 0/1/2/3
8290
+ // 範囲指定表記の補完 例. 0...3 -> 0/1/2/3
8282
8291
  const [valMin, valMax] = [val.split(`...`)[0], val.split(`...`)[1]].map(val => setIntVal(val));
8283
8292
  for (let k = valMin; k <= valMax; k++) {
8284
8293
  colorVals.push(setIntVal(k));
@@ -8790,6 +8799,25 @@ const getBrakeTrace = _frms => {
8790
8799
  return _frms;
8791
8800
  };
8792
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 diff = 50 / (maxj - minj);
8813
+ const factor = 0.5 + _spd / 40;
8814
+
8815
+ for (let j = minj; j < maxj; j++) {
8816
+ _frms[j] = Math.floor((10 - (j - C_MOTION_STD_POS - 1) * diff) * factor);
8817
+ }
8818
+ return _frms;
8819
+ }
8820
+
8793
8821
  /**
8794
8822
  * 最初のフレームで出現する矢印が、ステップゾーンに到達するまでのフレーム数を取得
8795
8823
  * @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.2",
3
+ "version": "38.1.0",
4
4
  "description": "Dancing☆Onigiri (CW Edition) - Web-based Rhythm Game",
5
5
  "main": "index.js",
6
6
  "scripts": {