临界显示为宝石数

This commit is contained in:
unanmed 2023-08-07 18:45:50 +08:00
parent e7ba4e1507
commit b7f3c98131
5 changed files with 38 additions and 25 deletions

View File

@ -61,7 +61,7 @@ dam4.png ---- 存档 59
[x] 成就系统 [x] 成就系统
[] 宝石目标设定 [] 宝石目标设定
[] 自动宝物规划,选中两个或更多宝物后自动在本地图中规划出最优拾取路线,原则是尽量减少其余宝物的捡拾,自动切换主动技能,怪物造成的伤害最低的路线 [] 自动宝物规划,选中两个或更多宝物后自动在本地图中规划出最优拾取路线,原则是尽量减少其余宝物的捡拾,自动切换主动技能,怪物造成的伤害最低的路线
[] 临界显示方式,宝石数还是数值 [x] 临界显示方式,宝石数还是数值
[x] 怪物目标设定 [x] 怪物目标设定
[x] 木牌查看系统(百科全书) [x] 木牌查看系统(百科全书)
[] 宝物目标设定 [] 宝物目标设定
@ -84,3 +84,4 @@ dam4.png ---- 存档 59
[] 自定义快捷键 [] 自定义快捷键
[] 优化 ui 控制系统 [] 优化 ui 控制系统
[] 优化游戏进程与渲染进程间的通讯 [] 优化游戏进程与渲染进程间的通讯
[] 优化资源分离,音乐放到 bgm 目录下

View File

@ -319,15 +319,14 @@ function handleScreenSetting<T extends number | boolean>(
canvas.classList.add('no-anti-aliasing'); canvas.classList.add('no-anti-aliasing');
} }
} }
} else if (key === 'autoScale') {
// 自动放缩
core.setLocalStorage('autoScale', n);
} else if (key === 'fontSize') { } else if (key === 'fontSize') {
// 字体大小 // 字体大小
core.setLocalStorage('fontSize', n); core.setLocalStorage('fontSize', n);
root.style.fontSize = root2.style.fontSize = `${n}px`; root.style.fontSize = root2.style.fontSize = `${n}px`;
} else if (key === 'smoothView') { } else if (key === 'smoothView') {
core.setLocalStorage('smoothView', n); 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') { if (key === 'autoSkill') {
// 自动切换技能 // 自动切换技能
flags.autoSkill = n; flags.autoSkill = n;
} } else if (key === 'fixed') {
if (key === 'fixed') {
// 定点查看 // 定点查看
core.setLocalStorage('fixed', n); core.setLocalStorage('fixed', n);
} }
@ -355,6 +352,9 @@ function handleUtilsSetting<T extends number | boolean>(
if (key === 'betterLoad') { if (key === 'betterLoad') {
// 加载优化 // 加载优化
core.setLocalStorage('betterLoad', n); core.setLocalStorage('betterLoad', n);
} else if (key === 'autoScale') {
// 自动放缩
core.setLocalStorage('autoScale', n);
} }
} }
@ -370,9 +370,10 @@ mainSetting
.register('itemDetail', '宝石血瓶显伤', true) .register('itemDetail', '宝石血瓶显伤', true)
.register('transition', '界面动画', false) .register('transition', '界面动画', false)
.register('antiAlias', '抗锯齿', false) .register('antiAlias', '抗锯齿', false)
.register('autoScale', '自动放缩', true)
.register('fontSize', '字体大小', 16, [8, 28, 1]) .register('fontSize', '字体大小', 16, [8, 28, 1])
.register('smoothView', '平滑镜头', true) .register('smoothView', '平滑镜头', true)
.register('criticalGem', '临界显示方式', false)
.setDisplayFunc('criticalGem', value => (value ? '宝石数' : '攻击'))
) )
.register( .register(
'action', 'action',
@ -387,7 +388,9 @@ mainSetting
.register( .register(
'utils', 'utils',
'功能设置', '功能设置',
new MotaSetting().register('betterLoad', '优化加载', true) new MotaSetting()
.register('betterLoad', '优化加载', true)
.register('autoScale', '自动放缩', true)
); );
loading.once('coreInit', () => { loading.once('coreInit', () => {
@ -398,15 +401,15 @@ loading.once('coreInit', () => {
'screen.itemDetail': !!core.getLocalStorage('itemDetail', true), 'screen.itemDetail': !!core.getLocalStorage('itemDetail', true),
'screen.transition': !!core.getLocalStorage('transition', false), 'screen.transition': !!core.getLocalStorage('transition', false),
'screen.antiAlias': !!core.getLocalStorage('antiAlias', false), 'screen.antiAlias': !!core.getLocalStorage('antiAlias', false),
'screen.autoScale': !!core.getLocalStorage('autoScale', true),
'screen.fontSize': core.getLocalStorage('fontSize', 16), 'screen.fontSize': core.getLocalStorage('fontSize', 16),
'screen.smoothView': !!core.getLocalStorage('smoothView', true), 'screen.smoothView': !!core.getLocalStorage('smoothView', true),
'action.fixed': !!core.getLocalStorage('fixed', 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({ mainSetting.reset({
'action.autoSkill': flags.autoSkill ?? true 'action.autoSkill': flags.autoSkill ?? true
}); });

View File

@ -14,19 +14,11 @@
"antiAlias": [ "antiAlias": [
"是否开启抗锯齿。开启后,画面会变得不那么锐利,观感更加舒适;关闭后,可以更好地展现出像素感,同时部分像素错误也不会出现。" "是否开启抗锯齿。开启后,画面会变得不那么锐利,观感更加舒适;关闭后,可以更好地展现出像素感,同时部分像素错误也不会出现。"
], ],
"autoScale": [
"开启后,每次进入游戏时会自动缩放游戏画面至合适值。该项只对电脑端有效。",
"<br>",
"<br>",
"缩放原则如下:",
"<br>",
"1. 首先尝试缩放至最大缩放比例",
"<br>",
"2. 如果缩放后游戏画面高度高于页面高度的95%,那么缩小一个缩放比例,否则保持最大比例"
],
"fontSize": [ "fontSize": [
"在各种 ui 界面中显示的文字大小,范围为 8 - 28。注意字体过大可能会引起 ui 布局发生错误" "在各种 ui 界面中显示的文字大小,范围为 8 - 28。注意字体过大可能会引起 ui 布局发生错误"
] ],
"criticalGem": ["临界是否显示为在当前地图要吃的宝石数"]
}, },
"action": { "action": {
"autoSkill": [ "autoSkill": [
@ -50,6 +42,16 @@
"<br>", "<br>",
"<br>", "<br>",
"注:修改后刷新页面起效。" "注:修改后刷新页面起效。"
],
"autoScale": [
"开启后,每次进入游戏时会自动缩放游戏画面至合适值。该项只对电脑端有效。",
"<br>",
"<br>",
"缩放原则如下:",
"<br>",
"1. 首先尝试缩放至最大缩放比例",
"<br>",
"2. 如果缩放后游戏画面高度高于页面高度的95%,那么缩小一个缩放比例,否则保持最大比例"
] ]
} }
} }

View File

@ -193,8 +193,13 @@ export class EnemyCollection implements RangeCollection<DamageEnemy> {
py: 32 * (v.y! + 1) - 1, py: 32 * (v.y! + 1) - 1,
color: color 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({ core.status.damage.data.push({
text: critical?.atkDelta.toString() ?? '?', text: isFinite(cri) ? cri.toString() : '?',
px: 32 * v.x! + 1, px: 32 * v.x! + 1,
py: 32 * (v.y! + 1) - 11, py: 32 * (v.y! + 1) - 11,
color: '#fff' color: '#fff'

View File

@ -20,6 +20,7 @@ import * as utils from './utils';
import * as chase from './chase'; import * as chase from './chase';
import * as damage from './enemy/damage'; import * as damage from './enemy/damage';
import * as battle from './enemy/battle'; import * as battle from './enemy/battle';
import * as special from './enemy/special';
export { export {
halo, halo,
@ -35,5 +36,6 @@ export {
utils, utils,
chase, chase,
damage, damage,
battle battle,
special
}; };