临界显示为宝石数

This commit is contained in:
AncTe committed 2023-08-07 18:45:50 +08:00
1 parent e7ba4e1507
commit b7f3c98131
5 files changed
+38 -25

No files matched your search

+14 -11
View File
@@ -319,15 +319,14 @@ function handleScreenSetting<T extends number | boolean>(
canvas.classList.add('no-anti-aliasing');
}
}
} else if (key === 'autoScale') {
// 自动放缩
core.setLocalStorage('autoScale', n);
} else if (key === 'fontSize') {
// 字体大小
core.setLocalStorage('fontSize', n);
root.style.fontSize = root2.style.fontSize = `${n}px`;
} else if (key === 'smoothView') {
core.setLocalStorage('smoothView', n);
} else if (key === 'criticalGem') {
core.setLocalStorage('criticalGem', n);
}
}
@@ -339,9 +338,7 @@ function handleActionSetting<T extends number | boolean>(
if (key === 'autoSkill') {
// 自动切换技能
flags.autoSkill = n;
}
if (key === 'fixed') {
} else if (key === 'fixed') {
// 定点查看
core.setLocalStorage('fixed', n);
}
@@ -355,6 +352,9 @@ function handleUtilsSetting<T extends number | boolean>(
if (key === 'betterLoad') {
// 加载优化
core.setLocalStorage('betterLoad', n);
} else if (key === 'autoScale') {
// 自动放缩
core.setLocalStorage('autoScale', n);
}
}
@@ -370,9 +370,10 @@ mainSetting
.register('itemDetail', '宝石血瓶显伤', true)
.register('transition', '界面动画', false)
.register('antiAlias', '抗锯齿', false)
.register('autoScale', '自动放缩', true)
.register('fontSize', '字体大小', 16, [8, 28, 1])
.register('smoothView', '平滑镜头', true)
.register('criticalGem', '临界显示方式', false)
.setDisplayFunc('criticalGem', value => (value ? '宝石数' : '攻击'))
)
.register(
'action',
@@ -387,7 +388,9 @@ mainSetting
.register(
'utils',
'功能设置',
new MotaSetting().register('betterLoad', '优化加载', true)
new MotaSetting()
.register('betterLoad', '优化加载', true)
.register('autoScale', '自动放缩', true)
);
loading.once('coreInit', () => {
@@ -398,15 +401,15 @@ loading.once('coreInit', () => {
'screen.itemDetail': !!core.getLocalStorage('itemDetail', true),
'screen.transition': !!core.getLocalStorage('transition', false),
'screen.antiAlias': !!core.getLocalStorage('antiAlias', false),
'screen.autoScale': !!core.getLocalStorage('autoScale', true),
'screen.fontSize': core.getLocalStorage('fontSize', 16),
'screen.smoothView': !!core.getLocalStorage('smoothView', true),
'action.fixed': !!core.getLocalStorage('fixed', true),
'utils.betterLoad': !!core.getLocalStorage('betterLoad', true)
'utils.betterLoad': !!core.getLocalStorage('betterLoad', true),
'utils.autoScale': !!core.getLocalStorage('autoScale', true)
});
});
hook.once('reset', () => {
hook.on('reset', () => {
mainSetting.reset({
'action.autoSkill': flags.autoSkill ?? true
});
+13 -11
View File
@@ -14,19 +14,11 @@
"antiAlias": [
"是否开启抗锯齿。开启后,画面会变得不那么锐利,观感更加舒适;关闭后,可以更好地展现出像素感,同时部分像素错误也不会出现。"
],
"autoScale": [
"开启后,每次进入游戏时会自动缩放游戏画面至合适值。该项只对电脑端有效。",
"<br>",
"<br>",
"缩放原则如下:",
"<br>",
"1. 首先尝试缩放至最大缩放比例",
"<br>",
"2. 如果缩放后游戏画面高度高于页面高度的95%,那么缩小一个缩放比例,否则保持最大比例"
],
"fontSize": [
"在各种 ui 界面中显示的文字大小,范围为 8 - 28。注意,字体过大可能会引起 ui 布局发生错误"
]
],
"criticalGem": ["临界是否显示为在当前地图要吃的宝石数"]
},
"action": {
"autoSkill": [
@@ -50,6 +42,16 @@
"<br>",
"<br>",
"注:修改后刷新页面起效。"
],
"autoScale": [
"开启后,每次进入游戏时会自动缩放游戏画面至合适值。该项只对电脑端有效。",
"<br>",
"<br>",
"缩放原则如下:",
"<br>",
"1. 首先尝试缩放至最大缩放比例",
"<br>",
"2. 如果缩放后游戏画面高度高于页面高度的95%,那么缩小一个缩放比例,否则保持最大比例"
]
}
}
+6 -1
View File
@@ -193,8 +193,13 @@ export class EnemyCollection implements RangeCollection<DamageEnemy> {
py: 32 * (v.y! + 1) - 1,
color: color
});
const criGem = core.getLocalStorage('criticalGem', false);
const n = critical?.atkDelta ?? Infinity;
const ratio = core.status.maps[this.floorId].ratio;
const cri = criGem ? Math.ceil(n / ratio) : n;
core.status.damage.data.push({
text: critical?.atkDelta.toString() ?? '?',
text: isFinite(cri) ? cri.toString() : '?',
px: 32 * v.x! + 1,
py: 32 * (v.y! + 1) - 11,
color: '#fff'
+3 -1
View File
@@ -20,6 +20,7 @@ import * as utils from './utils';
import * as chase from './chase';
import * as damage from './enemy/damage';
import * as battle from './enemy/battle';
import * as special from './enemy/special';
export {
halo,
@@ -35,5 +36,6 @@ export {
utils,
chase,
damage,
battle
battle,
special
};