mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-06-28 21:27:59 +08:00
fix
This commit is contained in:
parent
84620ce779
commit
87c82aa0e2
@ -865,10 +865,7 @@ actions.prototype._getClickLoc = function (x, y) {
|
|||||||
|
|
||||||
if (core.domStyle.isVertical) {
|
if (core.domStyle.isVertical) {
|
||||||
statusBar.x = 3;
|
statusBar.x = 3;
|
||||||
statusBar.y =
|
statusBar.y = core.dom.gameDraw.offsetTop;
|
||||||
core.dom.statusBar.offsetHeight +
|
|
||||||
3 +
|
|
||||||
32 * core.values.statusCanvasRowsOnMobile;
|
|
||||||
} else {
|
} else {
|
||||||
statusBar.x = core.dom.statusBar.offsetWidth + 3;
|
statusBar.x = core.dom.statusBar.offsetWidth + 3;
|
||||||
statusBar.y = 3;
|
statusBar.y = 3;
|
||||||
|
@ -3709,6 +3709,7 @@ control.prototype.resize = function () {
|
|||||||
extendToolbar = false;
|
extendToolbar = false;
|
||||||
BAR_WIDTH = Math.round(core._PX_ * 0.3);
|
BAR_WIDTH = Math.round(core._PX_ * 0.3);
|
||||||
}
|
}
|
||||||
|
core.domStyle.isVertical = matchMedia('(max-width: 600px)').matches;
|
||||||
|
|
||||||
var statusCanvas = core.flags.statusCanvas,
|
var statusCanvas = core.flags.statusCanvas,
|
||||||
statusCanvasRows = core.values.statusCanvasRowsOnMobile || 3;
|
statusCanvasRows = core.values.statusCanvasRowsOnMobile || 3;
|
||||||
|
@ -77,7 +77,7 @@ items.prototype.getItemEffectTip = function (itemId) {
|
|||||||
////// 使用道具 //////
|
////// 使用道具 //////
|
||||||
items.prototype.useItem = function (itemId, noRoute, callback) {
|
items.prototype.useItem = function (itemId, noRoute, callback) {
|
||||||
/** @type {AllIdsOf<'items'>[]} */
|
/** @type {AllIdsOf<'items'>[]} */
|
||||||
const ignore = ['I560', 'I559', 'skill1', 'I642', 'I565', 'I558'];
|
const ignore = ['I342'];
|
||||||
if (
|
if (
|
||||||
!this.canUseItem(itemId) ||
|
!this.canUseItem(itemId) ||
|
||||||
(core.isReplaying() && ignore.includes(itemId))
|
(core.isReplaying() && ignore.includes(itemId))
|
||||||
|
@ -736,7 +736,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
|
|||||||
"hatred": 2,
|
"hatred": 2,
|
||||||
"animateSpeed": 300,
|
"animateSpeed": 300,
|
||||||
"moveSpeed": 100,
|
"moveSpeed": 100,
|
||||||
"statusCanvasRowsOnMobile": 3,
|
"statusCanvasRowsOnMobile": 0,
|
||||||
"floorChangeTime": 500
|
"floorChangeTime": 500
|
||||||
},
|
},
|
||||||
"flags": {
|
"flags": {
|
||||||
|
@ -492,10 +492,24 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
|
|||||||
// 更新跟随者状态,并绘制
|
// 更新跟随者状态,并绘制
|
||||||
core.updateFollowers();
|
core.updateFollowers();
|
||||||
core.drawHero();
|
core.drawHero();
|
||||||
|
// 检查中毒状态的扣血和死亡
|
||||||
|
if (core.hasFlag('poison')) {
|
||||||
|
core.status.hero.statistics.poisonDamage +=
|
||||||
|
core.values.poisonDamage;
|
||||||
|
core.status.hero.hp -= core.values.poisonDamage;
|
||||||
|
if (core.status.hero.hp <= 0) {
|
||||||
|
core.status.hero.hp = 0;
|
||||||
|
core.updateStatusBar(false, true);
|
||||||
|
core.events.lose();
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
core.updateStatusBar(false, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 从v2.7开始,每一步行走不会再刷新状态栏。
|
// 从v2.7开始,每一步行走不会再刷新状态栏。
|
||||||
// 如果有特殊要求(如每走一步都加buff之类),可手动取消注释下面这一句:
|
// 如果有特殊要求(如每走一步都加buff之类),可手动取消注释下面这一句:
|
||||||
// core.updateStatusBar(true);
|
// core.updateStatusBar(true, true);
|
||||||
|
|
||||||
// 检查自动事件
|
// 检查自动事件
|
||||||
core.checkAutoEvents();
|
core.checkAutoEvents();
|
||||||
@ -519,6 +533,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
|
|||||||
// 执行目标点的阻激夹域事件
|
// 执行目标点的阻激夹域事件
|
||||||
core.checkBlock();
|
core.checkBlock();
|
||||||
|
|
||||||
|
// 执行目标点的script和事件
|
||||||
if (!hasTrigger) core.trigger(nowx, nowy, callback);
|
if (!hasTrigger) core.trigger(nowx, nowy, callback);
|
||||||
|
|
||||||
// 检查该点是否是滑冰
|
// 检查该点是否是滑冰
|
||||||
@ -533,6 +548,8 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ------ 检查目标点事件 END ------ //
|
||||||
|
|
||||||
// 如需强行终止行走可以在这里条件判定:
|
// 如需强行终止行走可以在这里条件判定:
|
||||||
// core.stopAutomaticRoute();
|
// core.stopAutomaticRoute();
|
||||||
},
|
},
|
||||||
|
@ -121,6 +121,26 @@ gameKey
|
|||||||
name: '轻按_2',
|
name: '轻按_2',
|
||||||
defaults: KeyCode.Digit7
|
defaults: KeyCode.Digit7
|
||||||
})
|
})
|
||||||
|
.register({
|
||||||
|
id: 'num1',
|
||||||
|
name: '破墙镐',
|
||||||
|
defaults: KeyCode.Digit1
|
||||||
|
})
|
||||||
|
.register({
|
||||||
|
id: 'num2',
|
||||||
|
name: '炸弹',
|
||||||
|
defaults: KeyCode.Digit2
|
||||||
|
})
|
||||||
|
.register({
|
||||||
|
id: 'num3',
|
||||||
|
name: '飞行器',
|
||||||
|
defaults: KeyCode.Digit3
|
||||||
|
})
|
||||||
|
.register({
|
||||||
|
id: 'num4',
|
||||||
|
name: '其他道具',
|
||||||
|
defaults: KeyCode.Digit3
|
||||||
|
})
|
||||||
.register({
|
.register({
|
||||||
id: 'mark',
|
id: 'mark',
|
||||||
name: '标记怪物',
|
name: '标记怪物',
|
||||||
@ -488,6 +508,42 @@ gameKey
|
|||||||
})
|
})
|
||||||
.realize('comment', () => {
|
.realize('comment', () => {
|
||||||
core.actions._clickGameInfo_openComments();
|
core.actions._clickGameInfo_openComments();
|
||||||
|
})
|
||||||
|
.realize('num1', () => {
|
||||||
|
if (core.hasItem('pickaxe')) {
|
||||||
|
core.useItem('pickaxe');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.realize('num2', () => {
|
||||||
|
if (core.hasItem('bomb')) {
|
||||||
|
core.useItem('bomb');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.realize('num3', () => {
|
||||||
|
if (core.hasItem('centerFly')) {
|
||||||
|
core.useItem('centerFly');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.realize('num4', () => {
|
||||||
|
const list: ItemIdOf<'tools' | 'constants'>[] = [
|
||||||
|
'icePickaxe',
|
||||||
|
'freezeBadge',
|
||||||
|
'earthquake',
|
||||||
|
'upFly',
|
||||||
|
'downFly',
|
||||||
|
'jumpShoes',
|
||||||
|
'lifeWand',
|
||||||
|
'poisonWine',
|
||||||
|
'weakWine',
|
||||||
|
'curseWine',
|
||||||
|
'superWine'
|
||||||
|
];
|
||||||
|
for (const id of list) {
|
||||||
|
if (core.canUseItem(id)) {
|
||||||
|
core.useItem(id);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// ----- Storage
|
// ----- Storage
|
||||||
|
@ -16,9 +16,7 @@ export function getEnemy(
|
|||||||
return v.x === x && v.y === y;
|
return v.x === x && v.y === y;
|
||||||
});
|
});
|
||||||
if (!enemy) {
|
if (!enemy) {
|
||||||
throw new Error(
|
return null;
|
||||||
`Get null when getting enemy on '${x},${y}' in '${floorId}'`
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
return enemy;
|
return enemy;
|
||||||
}
|
}
|
||||||
@ -30,7 +28,7 @@ function init() {
|
|||||||
floorId: FloorIds = core.status.floorId
|
floorId: FloorIds = core.status.floorId
|
||||||
) {
|
) {
|
||||||
const enemy = getEnemy(x, y, floorId);
|
const enemy = getEnemy(x, y, floorId);
|
||||||
const { damage } = enemy.calDamage();
|
const { damage } = enemy!.calDamage();
|
||||||
|
|
||||||
return damage < core.status.hero.hp;
|
return damage < core.status.hero.hp;
|
||||||
};
|
};
|
||||||
@ -47,7 +45,7 @@ function init() {
|
|||||||
if (!core.canBattle(x, y) && !force && !core.status.event.id) {
|
if (!core.canBattle(x, y) && !force && !core.status.event.id) {
|
||||||
core.stopSound();
|
core.stopSound();
|
||||||
core.playSound('操作失败');
|
core.playSound('操作失败');
|
||||||
core.drawTip('你打不过此怪物!', enemy.id);
|
core.drawTip('你打不过此怪物!', enemy!.id);
|
||||||
return core.clearContinueAutomaticRoute(callback);
|
return core.clearContinueAutomaticRoute(callback);
|
||||||
}
|
}
|
||||||
// 自动存档
|
// 自动存档
|
||||||
@ -98,7 +96,7 @@ function init() {
|
|||||||
const enemy = getEnemy(data.x, data.y);
|
const enemy = getEnemy(data.x, data.y);
|
||||||
|
|
||||||
beforeBattle.push(...(floor.beforeBattle[loc] ?? []));
|
beforeBattle.push(...(floor.beforeBattle[loc] ?? []));
|
||||||
beforeBattle.push(...(enemy.enemy.beforeBattle ?? []));
|
beforeBattle.push(...(enemy!.enemy.beforeBattle ?? []));
|
||||||
|
|
||||||
if (beforeBattle.length > 0) {
|
if (beforeBattle.length > 0) {
|
||||||
beforeBattle.push({ type: 'battle', x: data.x, y: data.y });
|
beforeBattle.push({ type: 'battle', x: data.x, y: data.y });
|
||||||
|
@ -95,6 +95,7 @@ export class EnemyCollection implements RangeCollection<DamageEnemy> {
|
|||||||
core.extractBlocks(this.floorId);
|
core.extractBlocks(this.floorId);
|
||||||
core.status.maps[this.floorId].blocks.forEach(v => {
|
core.status.maps[this.floorId].blocks.forEach(v => {
|
||||||
if (v.event.cls !== 'enemy48' && v.event.cls !== 'enemys') return;
|
if (v.event.cls !== 'enemy48' && v.event.cls !== 'enemys') return;
|
||||||
|
if (v.disable) return;
|
||||||
const enemy = core.material.enemys[v.event.id as EnemyIds];
|
const enemy = core.material.enemys[v.event.id as EnemyIds];
|
||||||
this.list.push(
|
this.list.push(
|
||||||
new DamageEnemy(enemy, v.x, v.y, this.floorId, this)
|
new DamageEnemy(enemy, v.x, v.y, this.floorId, this)
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { getEnemy } from '@/game/enemy/battle';
|
import { getEnemy } from '@/game/enemy/battle';
|
||||||
import { formatDamage } from '../utils';
|
import { formatDamage } from '../utils';
|
||||||
|
import { DamageEnemy } from '@/game/enemy/damage';
|
||||||
|
|
||||||
export function init() {
|
export function init() {
|
||||||
core.maps._initDetachedBlock = function (
|
core.maps._initDetachedBlock = function (
|
||||||
@ -36,7 +37,9 @@ export function init() {
|
|||||||
core.hasItem('book') &&
|
core.hasItem('book') &&
|
||||||
displayDamage
|
displayDamage
|
||||||
) {
|
) {
|
||||||
const enemy = getEnemy(x, y);
|
const enemy =
|
||||||
|
getEnemy(x, y) ??
|
||||||
|
new DamageEnemy(core.material.enemys[info.id as EnemyIds]);
|
||||||
const dam = enemy.calDamage();
|
const dam = enemy.calDamage();
|
||||||
const { damage, color } = formatDamage(dam.damage);
|
const { damage, color } = formatDamage(dam.damage);
|
||||||
|
|
||||||
|
@ -269,8 +269,7 @@ onUnmounted(() => {
|
|||||||
#title {
|
#title {
|
||||||
margin-top: 7%;
|
margin-top: 7%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font: 4em 'normal';
|
font-size: 4em;
|
||||||
font-weight: 200;
|
|
||||||
background-image: linear-gradient(
|
background-image: linear-gradient(
|
||||||
to right,
|
to right,
|
||||||
rgb(0, 0, 0),
|
rgb(0, 0, 0),
|
||||||
@ -320,6 +319,7 @@ onUnmounted(() => {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
transition: height 0.2s ease;
|
transition: height 0.2s ease;
|
||||||
width: 25%;
|
width: 25%;
|
||||||
|
font-size: 100%;
|
||||||
|
|
||||||
.start-button {
|
.start-button {
|
||||||
position: relative;
|
position: relative;
|
||||||
@ -463,4 +463,23 @@ onUnmounted(() => {
|
|||||||
transform: translateX(-20px);
|
transform: translateX(-20px);
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 600px) {
|
||||||
|
#start-main {
|
||||||
|
#buttons {
|
||||||
|
width: 50%;
|
||||||
|
font-size: 250%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#settings {
|
||||||
|
font-size: 300%;
|
||||||
|
width: 24%;
|
||||||
|
bottom: 2%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#title {
|
||||||
|
font-size: 8em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -260,6 +260,7 @@ onMounted(() => {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
padding: 1vh 0;
|
padding: 1vh 0;
|
||||||
|
font-size: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.status-item {
|
.status-item {
|
||||||
@ -342,4 +343,11 @@ onMounted(() => {
|
|||||||
.status-debuff-value[index='2'] {
|
.status-debuff-value[index='2'] {
|
||||||
color: #c2f4e7;
|
color: #c2f4e7;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 600px) {
|
||||||
|
.status-item {
|
||||||
|
font-size: 100%;
|
||||||
|
max-width: 28vw;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
Loading…
Reference in New Issue
Block a user