danoniplus 28.3.1 → 28.4.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,12 +4,12 @@
4
4
  *
5
5
  * Source by tickle
6
6
  * Created : 2018/10/08
7
- * Revised : 2022/10/16
7
+ * Revised : 2022/10/20
8
8
  *
9
9
  * https://github.com/cwtickle/danoniplus
10
10
  */
11
- const g_version = `Ver 28.3.1`;
12
- const g_revisedDate = `2022/10/16`;
11
+ const g_version = `Ver 28.4.0`;
12
+ const g_revisedDate = `2022/10/20`;
13
13
  const g_alphaVersion = ``;
14
14
 
15
15
  // カスタム用バージョン (danoni_custom.js 等で指定可)
@@ -7345,34 +7345,39 @@ const setSpeedOnFrame = (_speedData, _lastFrame) => {
7345
7345
 
7346
7346
  /**
7347
7347
  * Motionオプション適用時の矢印別の速度設定
7348
- * - 配列の数字は小さいほどステップゾーンに近いことを示す。
7349
- * - 15がステップゾーン上、0~14は矢印の枠外管理用
7348
+ * - 矢印が表示される最大フレーム数を 縦ピクセル数×20 と定義。
7350
7349
  */
7351
- const setMotionOnFrame = _ => {
7350
+ const setMotionOnFrame = _ => g_motionFunc[g_stateObj.motion]([...Array(g_sHeight * 20 + 1)].fill(0));
7352
7351
 
7353
- // 矢印が表示される最大フレーム数
7354
- const motionLastFrame = g_sHeight * 20;
7355
- const brakeLastFrame = g_sHeight / 2;
7356
-
7357
- const motionOnFrame = [...Array(motionLastFrame + 1)].fill(0);
7358
-
7359
- if (g_stateObj.motion === C_FLG_OFF) {
7360
- } else if (g_stateObj.motion === `Boost`) {
7361
- // ステップゾーンに近づくにつれて加速量を大きくする (16 85)
7362
- for (let j = C_MOTION_STD_POS + 1; j < C_MOTION_STD_POS + 70; j++) {
7363
- motionOnFrame[j] = (C_MOTION_STD_POS + 70 - j) * 3 / 50;
7364
- }
7365
- } else if (g_stateObj.motion === `Brake`) {
7366
- // 初期は+2x、ステップゾーンに近づくにつれて加速量を下げる (20 → 34)
7367
- for (let j = C_MOTION_STD_POS + 5; j < C_MOTION_STD_POS + 19; j++) {
7368
- motionOnFrame[j] = (j - 15) * 4 / 14;
7369
- }
7370
- for (let j = C_MOTION_STD_POS + 19; j <= brakeLastFrame; j++) {
7371
- motionOnFrame[j] = 4;
7372
- }
7352
+ /**
7353
+ * Boost用の適用関数
7354
+ * - ステップゾーンに近づくにつれて加速量を大きく/小さくする (16 → 85)
7355
+ * @param {array} _frms
7356
+ * @param {number} _spd
7357
+ * @param {number} _pnFlg 正負(1 もしくは -1)
7358
+ * @returns
7359
+ */
7360
+ const getBoostTrace = (_frms, _spd, _pnFlg = 1) => {
7361
+ for (let j = C_MOTION_STD_POS + 1; j < C_MOTION_STD_POS + 70; j++) {
7362
+ _frms[j] = (C_MOTION_STD_POS + 70 - j) * _pnFlg * _spd / 50;
7373
7363
  }
7364
+ return _frms;
7365
+ };
7374
7366
 
7375
- return motionOnFrame;
7367
+ /**
7368
+ * Brake用の適用関数
7369
+ * - 初期は+2x、ステップゾーンに近づくにつれて加速量を下げる (20 → 34)
7370
+ * @param {array} _frms
7371
+ * @returns
7372
+ */
7373
+ const getBrakeTrace = _frms => {
7374
+ for (let j = C_MOTION_STD_POS + 5; j < C_MOTION_STD_POS + 19; j++) {
7375
+ _frms[j] = (j - 15) * 4 / 14;
7376
+ }
7377
+ for (let j = C_MOTION_STD_POS + 19; j <= g_sHeight / 2; j++) {
7378
+ _frms[j] = 4;
7379
+ }
7380
+ return _frms;
7376
7381
  };
7377
7382
 
7378
7383
  /**
@@ -7390,7 +7395,6 @@ const getFirstArrivalFrame = (_startFrame, _speedOnFrame, _motionOnFrame) => {
7390
7395
  startY += _speedOnFrame[frm];
7391
7396
 
7392
7397
  if (_speedOnFrame[frm] !== 0) {
7393
- startY += _motionOnFrame[motionFrm];
7394
7398
  motionFrm++;
7395
7399
  }
7396
7400
  frm++;
@@ -7537,18 +7541,13 @@ const pushArrows = (_dataObj, _speedOnFrame, _motionOnFrame, _firstArrivalFrame)
7537
7541
  if (hasArrayList(_dataObj.boostData, 2)) {
7538
7542
  let delBoostIdx = 0;
7539
7543
  for (let k = _dataObj.boostData.length - 2; k >= 0; k -= 2) {
7540
- if (_dataObj.boostData[k] < g_scoreObj.frameNum) {
7541
- delBoostIdx = k + 2;
7544
+ tmpObj = getArrowStartFrame(_dataObj.boostData[k], _speedOnFrame, _motionOnFrame);
7545
+ if (tmpObj.frm < g_scoreObj.frameNum) {
7546
+ _dataObj.boostData[k] = g_scoreObj.frameNum;
7547
+ delBoostIdx = k;
7542
7548
  break;
7543
7549
  } else {
7544
- tmpObj = getArrowStartFrame(_dataObj.boostData[k], _speedOnFrame, _motionOnFrame);
7545
- if (tmpObj.frm < g_scoreObj.frameNum) {
7546
- _dataObj.boostData[k] = g_scoreObj.frameNum;
7547
- delBoostIdx = k;
7548
- break;
7549
- } else {
7550
- _dataObj.boostData[k] = tmpObj.frm;
7551
- }
7550
+ _dataObj.boostData[k] = tmpObj.frm;
7552
7551
  }
7553
7552
  }
7554
7553
  for (let k = 0; k < delBoostIdx; k++) {
@@ -7710,7 +7709,6 @@ const getArrowStartFrame = (_frame, _speedOnFrame, _motionOnFrame) => {
7710
7709
  obj.startY += _speedOnFrame[obj.frm];
7711
7710
 
7712
7711
  if (_speedOnFrame[obj.frm] !== 0) {
7713
- obj.startY += _motionOnFrame[obj.motionFrm];
7714
7712
  obj.motionFrm++;
7715
7713
  }
7716
7714
  obj.frm--;
@@ -8261,6 +8259,7 @@ const mainInit = _ => {
8261
8259
  // 現在の矢印・フリーズアローの速度、個別加算速度の初期化 (速度変化時に直す)
8262
8260
  g_workObj.currentSpeed = 2;
8263
8261
  g_workObj.boostSpd = 1;
8262
+ g_workObj.boostDir = 1;
8264
8263
 
8265
8264
  // 開始位置、楽曲再生位置の設定
8266
8265
  const firstFrame = g_scoreObj.frameNum;
@@ -8321,7 +8320,7 @@ const mainInit = _ => {
8321
8320
 
8322
8321
  // フレーム数
8323
8322
  divRoot.appendChild(
8324
- createDivCss2Label(`lblframe`, g_scoreObj.frameNum, { x: 0, y: 0, w: 100, h: 30, siz: 20, display: g_workObj.lifegaugeDisp, })
8323
+ createDivCss2Label(`lblframe`, g_scoreObj.nominalFrameNum, { x: 0, y: 0, w: 100, h: 30, siz: 20, display: g_workObj.lifegaugeDisp, })
8325
8324
  );
8326
8325
 
8327
8326
  // ライフ(数字)部作成
@@ -8847,12 +8846,13 @@ const mainInit = _ => {
8847
8846
  * @param {string} _color 矢印色
8848
8847
  */
8849
8848
  const makeArrow = (_j, _arrowCnt, _name, _color) => {
8850
- const boostSpdDir = g_workObj.boostSpd * g_workObj.scrollDir[_j];
8851
8849
  const dividePos = g_workObj.dividePos[_j];
8852
8850
  const colorPos = g_keyObj[`color${keyCtrlPtn}`][_j];
8853
8851
 
8854
8852
  const arrowName = `${_name}${_j}_${_arrowCnt}`;
8855
- const firstPosY = C_STEP_Y + g_posObj.reverseStepY * dividePos + g_workObj.initY[g_scoreObj.frameNum] * boostSpdDir;
8853
+ const firstPosY = C_STEP_Y + g_posObj.reverseStepY * dividePos +
8854
+ (g_workObj.initY[g_scoreObj.frameNum] * g_workObj.boostSpd +
8855
+ sumData(g_workObj.motionOnFrames.filter((val, j) => j < g_workObj.motionFrame[g_scoreObj.frameNum])) * g_workObj.boostDir) * g_workObj.scrollDir[_j];
8856
8856
 
8857
8857
  const stepRoot = createEmptySprite(arrowSprite[dividePos], arrowName, {
8858
8858
  x: g_workObj.stepX[_j], y: firstPosY, w: C_ARW_WIDTH, h: C_ARW_WIDTH,
@@ -8860,7 +8860,8 @@ const mainInit = _ => {
8860
8860
  g_attrObj[arrowName] = {
8861
8861
  cnt: g_workObj.arrivalFrame[g_scoreObj.frameNum] + 1,
8862
8862
  boostCnt: g_workObj.motionFrame[g_scoreObj.frameNum],
8863
- boostSpd: boostSpdDir, dividePos: dividePos,
8863
+ boostSpd: g_workObj.boostSpd, dividePos: dividePos,
8864
+ dir: g_workObj.scrollDir[_j], boostDir: g_workObj.boostDir,
8864
8865
  prevY: firstPosY, y: firstPosY,
8865
8866
  };
8866
8867
  arrowSprite[dividePos].appendChild(stepRoot);
@@ -8907,7 +8908,7 @@ const mainInit = _ => {
8907
8908
  if (g_workObj.currentSpeed !== 0) {
8908
8909
  const boostCnt = g_attrObj[arrowName].boostCnt;
8909
8910
  g_attrObj[arrowName].prevY = g_attrObj[arrowName].y;
8910
- g_attrObj[arrowName].y -= (g_workObj.currentSpeed + g_workObj.motionOnFrames[boostCnt]) * g_attrObj[arrowName].boostSpd;
8911
+ g_attrObj[arrowName].y -= (g_workObj.currentSpeed * g_attrObj[arrowName].boostSpd + g_workObj.motionOnFrames[boostCnt] * g_attrObj[arrowName].boostDir) * g_attrObj[arrowName].dir;
8911
8912
  document.getElementById(arrowName).style.top = `${g_attrObj[arrowName].y}px`;
8912
8913
  g_attrObj[arrowName].boostCnt--;
8913
8914
  }
@@ -8923,11 +8924,12 @@ const mainInit = _ => {
8923
8924
  * @param {string} _barColor
8924
8925
  */
8925
8926
  const makeFrzArrow = (_j, _arrowCnt, _name, _normalColor, _barColor) => {
8926
- const boostSpdDir = g_workObj.boostSpd * g_workObj.scrollDir[_j];
8927
8927
  const dividePos = g_workObj.dividePos[_j];
8928
8928
  const frzNo = `${_j}_${_arrowCnt}`;
8929
8929
  const frzName = `${_name}${frzNo}`;
8930
- const firstPosY = C_STEP_Y + g_posObj.reverseStepY * dividePos + g_workObj.initY[g_scoreObj.frameNum] * boostSpdDir;
8930
+ const firstPosY = C_STEP_Y + g_posObj.reverseStepY * dividePos +
8931
+ (g_workObj.initY[g_scoreObj.frameNum] * g_workObj.boostSpd +
8932
+ sumData(g_workObj.motionOnFrames.filter((val, j) => j < g_workObj.motionFrame[g_scoreObj.frameNum])) * g_workObj.boostDir) * g_workObj.scrollDir[_j];
8931
8933
  const firstBarLength = g_workObj[`mk${toCapitalize(_name)}Length`][_j][(_arrowCnt - 1) * 2] * g_workObj.boostSpd;
8932
8934
 
8933
8935
  const frzRoot = createEmptySprite(arrowSprite[dividePos], frzName, {
@@ -8937,10 +8939,8 @@ const mainInit = _ => {
8937
8939
  cnt: g_workObj.arrivalFrame[g_scoreObj.frameNum] + 1,
8938
8940
  boostCnt: g_workObj.motionFrame[g_scoreObj.frameNum],
8939
8941
  judgEndFlg: false, isMoving: true, frzBarLength: firstBarLength, keyUpFrame: 0,
8940
- boostSpd: boostSpdDir, dividePos: dividePos, dir: g_workObj.scrollDir[_j],
8941
- y: firstPosY,
8942
- barY: C_ARW_WIDTH / 2 - firstBarLength * dividePos,
8943
- btmY: firstBarLength * g_workObj.scrollDir[_j],
8942
+ boostSpd: g_workObj.boostSpd, dividePos: dividePos, dir: g_workObj.scrollDir[_j], boostDir: g_workObj.boostDir,
8943
+ y: firstPosY, barY: C_ARW_WIDTH / 2 - firstBarLength * dividePos, btmY: firstBarLength * g_workObj.scrollDir[_j],
8944
8944
  };
8945
8945
  arrowSprite[dividePos].appendChild(frzRoot);
8946
8946
 
@@ -9000,7 +9000,7 @@ const mainInit = _ => {
9000
9000
  const movFrzArrow = (_j, _k, _name) => {
9001
9001
  const frzNo = `${_j}_${_k}`;
9002
9002
  const frzName = `${_name}${frzNo}`;
9003
- const movY = g_workObj.currentSpeed * g_attrObj[frzName].boostSpd;
9003
+ const movY = g_workObj.currentSpeed * g_attrObj[frzName].boostSpd * g_attrObj[frzName].dir;
9004
9004
 
9005
9005
  if (!g_attrObj[frzName].judgEndFlg) {
9006
9006
  if (g_attrObj[frzName].isMoving) {
@@ -9010,7 +9010,7 @@ const mainInit = _ => {
9010
9010
 
9011
9011
  // 移動
9012
9012
  if (g_workObj.currentSpeed !== 0) {
9013
- g_attrObj[frzName].y -= movY + g_workObj.motionOnFrames[g_attrObj[frzName].boostCnt] * g_attrObj[frzName].boostSpd;
9013
+ g_attrObj[frzName].y -= movY + g_workObj.motionOnFrames[g_attrObj[frzName].boostCnt] * g_attrObj[frzName].dir * g_attrObj[frzName].boostDir;
9014
9014
  document.getElementById(frzName).style.top = `${g_attrObj[frzName].y}px`;
9015
9015
  g_attrObj[frzName].boostCnt--;
9016
9016
  }
@@ -9064,7 +9064,7 @@ const mainInit = _ => {
9064
9064
  const flowTimeline = _ => {
9065
9065
 
9066
9066
  const currentFrame = g_scoreObj.frameNum;
9067
- lblframe.textContent = currentFrame;
9067
+ lblframe.textContent = g_scoreObj.nominalFrameNum;
9068
9068
 
9069
9069
  // キーの押下状態を取得
9070
9070
  for (let j = 0; j < keyNum; j++) {
@@ -9117,6 +9117,7 @@ const mainInit = _ => {
9117
9117
  }
9118
9118
  while (g_workObj.boostData !== undefined && currentFrame >= g_workObj.boostData[boostCnts]) {
9119
9119
  g_workObj.boostSpd = g_workObj.boostData[boostCnts + 1];
9120
+ g_workObj.boostDir = (g_workObj.boostSpd > 0 ? 1 : -1);
9120
9121
  boostCnts += 2;
9121
9122
  }
9122
9123
 
@@ -9439,7 +9440,7 @@ const changeHitFrz = (_j, _k, _name) => {
9439
9440
  // 早押ししたboostCnt分のフリーズアロー終端位置の修正
9440
9441
  let delFrzMotionLength = 0;
9441
9442
  for (let i = 0; i < g_attrObj[frzName].cnt; i++) {
9442
- delFrzMotionLength += g_workObj.motionOnFrames[g_attrObj[frzName].boostCnt - i] * g_attrObj[frzName].boostSpd;
9443
+ delFrzMotionLength += g_workObj.motionOnFrames[g_attrObj[frzName].boostCnt - i];
9443
9444
  }
9444
9445
 
9445
9446
  g_attrObj[frzName].frzBarLength -= (delFrzLength + delFrzMotionLength) * g_attrObj[frzName].dir;
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * Source by tickle
7
7
  * Created : 2019/11/19
8
- * Revised : 2022/10/16 (v28.3.1)
8
+ * Revised : 2022/10/20 (v28.4.0)
9
9
  *
10
10
  * https://github.com/cwtickle/danoniplus
11
11
  */
@@ -746,7 +746,7 @@ const g_settings = {
746
746
  speedNum: 0,
747
747
  speedTerms: [20, 5, 1],
748
748
 
749
- motions: [C_FLG_OFF, `Boost`, `Brake`],
749
+ motions: [C_FLG_OFF, `Boost`, `Hi-Boost`, `Brake`],
750
750
  motionNum: 0,
751
751
 
752
752
  reverses: [C_FLG_OFF, C_FLG_ON],
@@ -815,6 +815,18 @@ const g_shuffleFunc = {
815
815
  },
816
816
  };
817
817
 
818
+ /**
819
+ * モーション適用関数
820
+ * - frmsはフレーム別の速度設定用配列。
821
+ * - 配列の15がステップゾーン上、0~14は矢印の枠外管理用
822
+ */
823
+ const g_motionFunc = {
824
+ 'OFF': _frms => _frms,
825
+ 'Boost': _frms => getBoostTrace(_frms, 3),
826
+ 'Hi-Boost': _frms => getBoostTrace(_frms, g_stateObj.speed * 2),
827
+ 'Brake': _frms => getBrakeTrace(_frms),
828
+ };
829
+
818
830
  const g_keycons = {
819
831
  configTypes: [`Main`, `Replaced`, `ALL`],
820
832
  configTypeNum: 0,
@@ -2968,6 +2980,7 @@ const g_lblNameObj = {
2968
2980
  'u_OFF': `OFF`,
2969
2981
  'u_ON': `ON`,
2970
2982
  'u_Boost': `Boost`,
2983
+ 'u_Hi-Boost': `Hi-Boost`,
2971
2984
  'u_Brake': `Brake`,
2972
2985
 
2973
2986
  'u_Cross': `Cross`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "danoniplus",
3
- "version": "28.3.1",
3
+ "version": "28.4.0",
4
4
  "description": "Dancing☆Onigiri (CW Edition) - Web-based Rhythm Game",
5
5
  "main": "index.js",
6
6
  "scripts": {