danoniplus 43.6.3 → 44.0.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 +56 -20
- package/js/lib/danoni_constants.js +35 -3
- package/package.json +1 -1
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 : 2026/
|
|
7
|
+
* Revised : 2026/02/07
|
|
8
8
|
*
|
|
9
9
|
* https://github.com/cwtickle/danoniplus
|
|
10
10
|
*/
|
|
11
|
-
const g_version = `Ver
|
|
12
|
-
const g_revisedDate = `2026/
|
|
11
|
+
const g_version = `Ver 44.0.0`;
|
|
12
|
+
const g_revisedDate = `2026/02/07`;
|
|
13
13
|
|
|
14
14
|
// カスタム用バージョン (danoni_custom.js 等で指定可)
|
|
15
15
|
let g_localVersion = ``;
|
|
@@ -3969,6 +3969,12 @@ const headerConvert = _dosObj => {
|
|
|
3969
3969
|
}
|
|
3970
3970
|
});
|
|
3971
3971
|
|
|
3972
|
+
// 縦伸縮率の設定
|
|
3973
|
+
const stretchYRate = [];
|
|
3974
|
+
_dosObj.stretchYRate?.split(`$`).forEach((val, j) => {
|
|
3975
|
+
stretchYRate[j] = hasVal(val) ? setVal(val, 1, C_TYP_FLOAT) : 1;
|
|
3976
|
+
});
|
|
3977
|
+
obj.stretchYRate = makeBaseArray(stretchYRate, obj.difLabels.length, 1);
|
|
3972
3978
|
// 最終演出表示有無(noneで無効化)
|
|
3973
3979
|
obj.finishView = _dosObj.finishView ?? ``;
|
|
3974
3980
|
|
|
@@ -5760,7 +5766,7 @@ const playBGM = async (_num, _currentLoopNum = g_settings.musicLoopNum) => {
|
|
|
5760
5766
|
|
|
5761
5767
|
/**
|
|
5762
5768
|
* BGMのループ処理 (base64エンコード時用)
|
|
5763
|
-
* - base64エンコード時はtimeupdate
|
|
5769
|
+
* - base64エンコード時はtimeupdateイベントが発火しないため、監視しながらループ処理を行う
|
|
5764
5770
|
*/
|
|
5765
5771
|
const repeatBGM = () => {
|
|
5766
5772
|
const numAtStart = g_settings.musicIdxNum;
|
|
@@ -5789,22 +5795,36 @@ const playBGM = async (_num, _currentLoopNum = g_settings.musicLoopNum) => {
|
|
|
5789
5795
|
);
|
|
5790
5796
|
};
|
|
5791
5797
|
|
|
5798
|
+
/**
|
|
5799
|
+
* 既存のAudio/AudioPlayerをクローズ
|
|
5800
|
+
*/
|
|
5801
|
+
const closeExistingAudio = () => {
|
|
5802
|
+
if (g_stateObj.bgmTimeupdateEvtId !== null && g_stateObj.bgmTimeupdateEvtId !== undefined) {
|
|
5803
|
+
g_handler.removeListener(g_stateObj.bgmTimeupdateEvtId);
|
|
5804
|
+
g_stateObj.bgmTimeupdateEvtId = null;
|
|
5805
|
+
}
|
|
5806
|
+
if (g_audioForMS instanceof AudioPlayer) {
|
|
5807
|
+
g_musicdata = ``;
|
|
5808
|
+
g_audioForMS.close();
|
|
5809
|
+
}
|
|
5810
|
+
};
|
|
5811
|
+
|
|
5792
5812
|
if (encodeFlg) {
|
|
5793
5813
|
try {
|
|
5794
5814
|
// base64エンコードは読込に時間が掛かるため、曲変更時のみ読込
|
|
5795
5815
|
if (!hasVal(g_musicdata) || Math.abs(_num) % g_headerObj.musicIdxList.length !== 0) {
|
|
5796
|
-
|
|
5797
|
-
g_audioForMS.close();
|
|
5798
|
-
}
|
|
5816
|
+
closeExistingAudio();
|
|
5799
5817
|
await loadScript2(url);
|
|
5800
5818
|
musicInit();
|
|
5801
5819
|
if (!isTitle()) {
|
|
5820
|
+
g_musicdata = ``;
|
|
5802
5821
|
return;
|
|
5803
5822
|
}
|
|
5804
5823
|
const tmpAudio = new AudioPlayer();
|
|
5805
5824
|
const array = Uint8Array.from(atob(g_musicdata), v => v.charCodeAt(0));
|
|
5806
5825
|
await tmpAudio.init(array.buffer);
|
|
5807
5826
|
if (!isTitle()) {
|
|
5827
|
+
g_musicdata = ``;
|
|
5808
5828
|
tmpAudio.close();
|
|
5809
5829
|
return;
|
|
5810
5830
|
}
|
|
@@ -5823,13 +5843,7 @@ const playBGM = async (_num, _currentLoopNum = g_settings.musicLoopNum) => {
|
|
|
5823
5843
|
|
|
5824
5844
|
} else {
|
|
5825
5845
|
// 既存の監視を解除し、AudioPlayer を確実にクローズ
|
|
5826
|
-
|
|
5827
|
-
g_handler.removeListener(g_stateObj.bgmTimeupdateEvtId);
|
|
5828
|
-
g_stateObj.bgmTimeupdateEvtId = null;
|
|
5829
|
-
}
|
|
5830
|
-
if (g_audioForMS instanceof AudioPlayer) {
|
|
5831
|
-
g_audioForMS.close();
|
|
5832
|
-
}
|
|
5846
|
+
closeExistingAudio();
|
|
5833
5847
|
g_audioForMS = new Audio();
|
|
5834
5848
|
g_audioForMS.src = url;
|
|
5835
5849
|
g_audioForMS.autoplay = false;
|
|
@@ -9768,6 +9782,28 @@ const loadingScoreInit = async () => {
|
|
|
9768
9782
|
}
|
|
9769
9783
|
g_scoreObj = scoreConvert(g_rootObj, g_stateObj.scoreId, 0, dummyIdHeader);
|
|
9770
9784
|
|
|
9785
|
+
// Motionオプション適用時の矢印別の速度を取得(配列形式)
|
|
9786
|
+
g_workObj.motionOnFrames = setMotionOnFrame();
|
|
9787
|
+
g_workObj.motionReverseFlg = g_workObj.motionOnFrames.filter(val => g_stateObj.speed + val < 0).length > 0;
|
|
9788
|
+
|
|
9789
|
+
// 矢印描画時間の引き伸ばし設定(個別加速がある場合かつ逆走を伴うモーションは初期倍速によりさらに引き伸ばしを行う)
|
|
9790
|
+
// ただし、速度による引き伸ばし(boostFactor)の上限は描画の関係で2倍までとする
|
|
9791
|
+
let maxBoost = 1;
|
|
9792
|
+
for (let j = 0; j < g_scoreObj.boostData.length; j += 2) {
|
|
9793
|
+
maxBoost = Math.max(maxBoost, g_scoreObj.boostData[j + 1]);
|
|
9794
|
+
}
|
|
9795
|
+
const boostFactor = 1 + (
|
|
9796
|
+
(g_settings.motionDistRates[g_settings.motionNum] === 1 || !g_workObj.motionReverseFlg)
|
|
9797
|
+
? 0
|
|
9798
|
+
: (
|
|
9799
|
+
g_stateObj.speed * g_headerObj.baseSpeed - g_settings.motionBoostFactorMinSpd > 0 && maxBoost > 1
|
|
9800
|
+
? Math.min(maxBoost / 4, 1) : 0
|
|
9801
|
+
)
|
|
9802
|
+
);
|
|
9803
|
+
g_scoreObj.distY = Math.max(
|
|
9804
|
+
g_headerObj.stretchYRate[g_stateObj.scoreId], g_settings.motionDistRates[g_settings.motionNum] * boostFactor
|
|
9805
|
+
) * g_posObj.distY;
|
|
9806
|
+
|
|
9771
9807
|
// 最終フレーム数の取得
|
|
9772
9808
|
let lastFrame = getLastFrame(g_scoreObj) + g_headerObj.blankFrame;
|
|
9773
9809
|
|
|
@@ -9780,9 +9816,6 @@ const loadingScoreInit = async () => {
|
|
|
9780
9816
|
// フレームごとの速度を取得(配列形式)
|
|
9781
9817
|
let speedOnFrame = setSpeedOnFrame(g_scoreObj.speedData, lastFrame);
|
|
9782
9818
|
|
|
9783
|
-
// Motionオプション適用時の矢印別の速度を取得(配列形式)
|
|
9784
|
-
g_workObj.motionOnFrames = setMotionOnFrame();
|
|
9785
|
-
|
|
9786
9819
|
// 最初のフレームで出現する矢印が、ステップゾーンに到達するまでのフレーム数を取得
|
|
9787
9820
|
const firstFrame = (g_scoreObj.frameNum === 0 ? 0 : g_scoreObj.frameNum + g_headerObj.blankFrame);
|
|
9788
9821
|
let arrivalFrame = getFirstArrivalFrame(firstFrame, speedOnFrame);
|
|
@@ -10830,7 +10863,7 @@ const getFountainTrace = (_frms, _spd) => {
|
|
|
10830
10863
|
_frms[j] = Math.floor((10 - (j - C_MOTION_STD_POS - 1) * diff) * factor);
|
|
10831
10864
|
}
|
|
10832
10865
|
return _frms;
|
|
10833
|
-
}
|
|
10866
|
+
};
|
|
10834
10867
|
|
|
10835
10868
|
/**
|
|
10836
10869
|
* 最初のフレームで出現する矢印が、ステップゾーンに到達するまでのフレーム数を取得
|
|
@@ -10842,7 +10875,7 @@ const getFirstArrivalFrame = (_startFrame, _speedOnFrame) => {
|
|
|
10842
10875
|
let startY = 0;
|
|
10843
10876
|
let frm = _startFrame;
|
|
10844
10877
|
|
|
10845
|
-
while (
|
|
10878
|
+
while (g_scoreObj.distY - startY > 0) {
|
|
10846
10879
|
startY += _speedOnFrame[frm];
|
|
10847
10880
|
frm++;
|
|
10848
10881
|
}
|
|
@@ -11190,7 +11223,7 @@ const getArrowStartFrame = (_frame, _speedOnFrame) => {
|
|
|
11190
11223
|
motionFrm: C_MOTION_STD_POS
|
|
11191
11224
|
};
|
|
11192
11225
|
|
|
11193
|
-
while (
|
|
11226
|
+
while (g_scoreObj.distY - obj.startY > 0) {
|
|
11194
11227
|
obj.startY += _speedOnFrame[obj.frm - 1];
|
|
11195
11228
|
|
|
11196
11229
|
if (_speedOnFrame[obj.frm - 1] !== 0) {
|
|
@@ -12782,6 +12815,7 @@ const mainInit = () => {
|
|
|
12782
12815
|
currentArrow.y -= (g_workObj.currentSpeed * currentArrow.boostSpd +
|
|
12783
12816
|
(g_workObj.motionOnFrames[boostCnt] || 0) * currentArrow.boostDir) * currentArrow.dir;
|
|
12784
12817
|
$id(arrowName).top = wUnit(currentArrow.y);
|
|
12818
|
+
g_motionAlphaFunc.get(g_stateObj.motion)(arrowName, currentArrow);
|
|
12785
12819
|
currentArrow.boostCnt--;
|
|
12786
12820
|
}
|
|
12787
12821
|
judgeMotionFunc[`${_name}${g_stateObj.autoAll}`](_j, arrowName, --currentArrow.cnt);
|
|
@@ -12932,8 +12966,10 @@ const mainInit = () => {
|
|
|
12932
12966
|
|
|
12933
12967
|
// 移動
|
|
12934
12968
|
if (g_workObj.currentSpeed !== 0) {
|
|
12969
|
+
currentFrz.prevY = currentFrz.y;
|
|
12935
12970
|
currentFrz.y -= movY + (g_workObj.motionOnFrames[currentFrz.boostCnt] || 0) * currentFrz.dir * currentFrz.boostDir;
|
|
12936
12971
|
$id(frzName).top = wUnit(currentFrz.y);
|
|
12972
|
+
g_motionAlphaFunc.get(g_stateObj.motion)(frzName, currentFrz);
|
|
12937
12973
|
currentFrz.boostCnt--;
|
|
12938
12974
|
}
|
|
12939
12975
|
currentFrz.cnt--;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Source by tickle
|
|
7
7
|
* Created : 2019/11/19
|
|
8
|
-
* Revised : 2026/
|
|
8
|
+
* Revised : 2026/02/07 (v44.0.0)
|
|
9
9
|
*
|
|
10
10
|
* https://github.com/cwtickle/danoniplus
|
|
11
11
|
*/
|
|
@@ -1218,9 +1218,16 @@ const g_settings = {
|
|
|
1218
1218
|
speedNum: 0,
|
|
1219
1219
|
speedTerms: [20, 5, 1],
|
|
1220
1220
|
|
|
1221
|
-
motions: [C_FLG_OFF, `Boost`, `Hi-Boost`, `Brake`, `Compress`, `Fountain`],
|
|
1221
|
+
motions: [C_FLG_OFF, `Boost`, `Hi-Boost`, `Brake`, `Compress`, `Fountain`, `Magnet`],
|
|
1222
1222
|
motionNum: 0,
|
|
1223
1223
|
|
|
1224
|
+
// 移動距離倍率 (Compress, Fountain, Magnetのみ倍率を変更)
|
|
1225
|
+
motionDistRates: [1, 1, 1, 1, 1.25, 3, 1.5],
|
|
1226
|
+
// 速度が逆転するときのアルファ値 (g_motionAlphaFuncで使用)
|
|
1227
|
+
motionAlpha: 0.625,
|
|
1228
|
+
// 移動距離倍率の補正を行う最小の初期倍速
|
|
1229
|
+
motionBoostFactorMinSpd: 5,
|
|
1230
|
+
|
|
1224
1231
|
reverses: [C_FLG_OFF, C_FLG_ON],
|
|
1225
1232
|
reverseNum: 0,
|
|
1226
1233
|
|
|
@@ -1563,9 +1570,34 @@ const g_motionFunc = new Map([
|
|
|
1563
1570
|
['Hi-Boost', _frms => getBoostTrace(_frms, g_stateObj.speed * 2)],
|
|
1564
1571
|
['Brake', _frms => getBrakeTrace(_frms)],
|
|
1565
1572
|
['Compress', _frms => getBoostTrace(_frms, g_stateObj.speed * 5 / 8, -1)],
|
|
1566
|
-
['Fountain', _frms => getFountainTrace(_frms, g_stateObj.speed
|
|
1573
|
+
['Fountain', _frms => getFountainTrace(_frms, g_stateObj.speed)],
|
|
1574
|
+
['Magnet', _frms => getFountainTrace(_frms, g_stateObj.speed * 2)],
|
|
1575
|
+
]);
|
|
1576
|
+
|
|
1577
|
+
/**
|
|
1578
|
+
* モーション適用中のアルファ値制御関数
|
|
1579
|
+
* @param {object} _obj 対象オブジェクト
|
|
1580
|
+
* @param {object} _property 対象オブジェクトのプロパティ情報 (g_attrObj[オブジェクト名])
|
|
1581
|
+
*/
|
|
1582
|
+
const g_motionAlphaFunc = new Map([
|
|
1583
|
+
['OFF', () => ``],
|
|
1584
|
+
['Boost', () => ``],
|
|
1585
|
+
['Hi-Boost', () => ``],
|
|
1586
|
+
['Brake', () => ``],
|
|
1587
|
+
['Compress', () => ``],
|
|
1588
|
+
['Fountain', (_obj, _property) => motionAlphaToggle(_obj, _property)],
|
|
1589
|
+
['Magnet', (_obj, _property) => motionAlphaToggle(_obj, _property)],
|
|
1567
1590
|
]);
|
|
1568
1591
|
|
|
1592
|
+
const motionAlphaToggle = (_obj, _property) => {
|
|
1593
|
+
const dir = (_property.y - _property.prevY) * _property.dir;
|
|
1594
|
+
if (($id(_obj).opacity === ``) && dir > 0) {
|
|
1595
|
+
$id(_obj).opacity = g_settings.motionAlpha;
|
|
1596
|
+
} else if (Number($id(_obj).opacity) === g_settings.motionAlpha && dir < 0) {
|
|
1597
|
+
$id(_obj).opacity = ``;
|
|
1598
|
+
}
|
|
1599
|
+
};
|
|
1600
|
+
|
|
1569
1601
|
/**
|
|
1570
1602
|
* PlayWindow適用関数
|
|
1571
1603
|
*/
|