手册完成,但性能略差,考虑webgl

This commit is contained in:
strawberry 2025-08-20 16:48:34 +08:00
parent 5a44ba3f28
commit 44ce844d2f

View File

@ -3821,7 +3821,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.isMoving() core.isMoving()
) )
return; return;
core.useItem("fly"); core.useFly(true);
return; return;
} }
/*const equipBox = makeBox([EQUIP_BLOCK_LEFT_VERTICAL, EQUIP_BLOCK_TOP_VERTICAL], [90 * 3, 130 * 3]) /*const equipBox = makeBox([EQUIP_BLOCK_LEFT_VERTICAL, EQUIP_BLOCK_TOP_VERTICAL], [90 * 3, 130 * 3])
@ -3839,7 +3839,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.isMoving() core.isMoving()
) )
return; return;
core.useItem("fly"); core.useFly(true);
return; return;
} }
/* /*
@ -4001,21 +4001,22 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
x, x,
y, y,
floorId, floorId,
config={} config = {}
) { ) {
var mon_hp = info.mon_hp, var mon_hp = info.mon_hp,
hero_atk = config.atk??core.status.hero.atk, hero_atk = config.atk ?? core.status.hero.atk,
mon_def = info.mon_def, mon_def = info.mon_def,
pre = info.damage; damage=info.damage
pre = info.mon_turn;
var list = []; var list = [];
var start_atk = hero_atk; var start_atk = hero_atk;
if (info.__over__) { if (info.__over__) {
start_atk += info.__overAtk__; start_atk += info.__overAtk__;
list.push([info.__overAtk__, -info.damage]); list.push([info.__overAtk__, -info.damage]);
} }
var start=core.clone(config) var start = core.clone(config)
var mid=core.clone(config) var mid = core.clone(config)
var end=core.clone(config) var end = core.clone(config)
var calNext = function (currAtk, maxAtk) { var calNext = function (currAtk, maxAtk) {
start.atk = Math.floor(currAtk) start.atk = Math.floor(currAtk)
end.atk = Math.floor(maxAtk); end.atk = Math.floor(maxAtk);
@ -4025,13 +4026,13 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
mid.atk = Math.floor((start.atk + end.atk) / 2); mid.atk = Math.floor((start.atk + end.atk) / 2);
if (mid.atk - start.atk > end.atk - mid.atk) mid.atk--; if (mid.atk - start.atk > end.atk - mid.atk) mid.atk--;
var nextInfo = core.enemys.getDamageInfo( var nextInfo = core.enemys.getDamageInfo(
enemy, mid , enemy, mid,
x, x,
y, y,
floorId floorId
); );
if (nextInfo == null || typeof nextInfo == "number") return null; if (nextInfo == null || typeof nextInfo == "number") return null;
if (pre > nextInfo.damage) end.atk = mid.atk; if (pre > nextInfo.mon_turn&&damage>nextInfo.damage) end.atk = mid.atk;
else start.atk = mid.atk + 1; else start.atk = mid.atk + 1;
} }
var nextInfo = core.enemys.getDamageInfo( var nextInfo = core.enemys.getDamageInfo(
@ -4042,16 +4043,17 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
); );
return nextInfo == null || return nextInfo == null ||
typeof nextInfo == "number" || typeof nextInfo == "number" ||
nextInfo.damage >= pre ? nextInfo.mon_turn >= pre ||nextInfo.damage>=damage?
null : [start.atk, nextInfo.damage]; null : [start.atk, nextInfo.damage, nextInfo.mon_turn];
}; };
var currAtk = start_atk; var currAtk = start_atk;
while (true) { while (true) {
var next = calNext(currAtk + 1, Number.MAX_SAFE_INTEGER, pre); var next = calNext(currAtk + 1, Number.MAX_SAFE_INTEGER,damage, pre);
if (next == null) break; if (next == null) break;
currAtk = next[0]; currAtk = next[0];
pre = next[1]; damage=next[1];
list.push([currAtk - hero_atk, info.damage - pre]); pre = next[2];
list.push([currAtk - hero_atk, info.damage - damage]);
if (pre <= 0 && !core.flags.enableNegativeDamage) break; if (pre <= 0 && !core.flags.enableNegativeDamage) break;
if (list.length >= number) break; if (list.length >= number) break;
} }
@ -4333,10 +4335,10 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.fillText('data', tip.text, tip.textX, 33 + 42 * k, '#FFFFFF'); core.fillText('data', tip.text, tip.textX, 33 + 42 * k, '#FFFFFF');
core.setAlpha('data', 1); core.setAlpha('data', 1);
} }
let time=0 let time = 0
control.prototype._animateFrame_tip = function (timestamp) { control.prototype._animateFrame_tip = function (timestamp) {
let delta let delta
core.animateFrame.tip??=[] core.animateFrame.tip ??= []
if (core.animateFrame.tip.length === 0) return; if (core.animateFrame.tip.length === 0) return;
if (timestamp - time <= 30) return; if (timestamp - time <= 30) return;
@ -4395,7 +4397,7 @@ let time=0
} }
} }
core.animateFrame.tip.push(one) core.animateFrame.tip.push(one)
if(core.animateFrame.tip.length>4)core.animateFrame.tip.shift() if (core.animateFrame.tip.length > 4) core.animateFrame.tip.shift()
} }
}, },
"额外信息": function () { "额外信息": function () {
@ -21840,7 +21842,8 @@ let time=0
var mon_hp = info.mon_hp, var mon_hp = info.mon_hp,
hero_speed = config.speed ?? core.status.hero.speed, hero_speed = config.speed ?? core.status.hero.speed,
mon_def = info.mon_def, mon_def = info.mon_def,
pre = info.damage; damage = info.damage
pre = info.mon_turn;
var list = []; var list = [];
var start_speed = hero_speed; var start_speed = hero_speed;
var start = core.clone(config) var start = core.clone(config)
@ -21856,19 +21859,20 @@ let time=0
if (mid.speed - start.speed > end.speed - mid.speed) mid.speed--; if (mid.speed - start.speed > end.speed - mid.speed) mid.speed--;
var nextInfo = core.enemys.getDamageInfo(enemy, mid, x, y, floorId); var nextInfo = core.enemys.getDamageInfo(enemy, mid, x, y, floorId);
if (nextInfo == null || (typeof nextInfo == 'number')) return null; if (nextInfo == null || (typeof nextInfo == 'number')) return null;
if (pre > nextInfo.damage) end.speed = mid.speed; if (pre > nextInfo.mon_turn && damage > nextInfo.damage) end.speed = mid.speed;
else start.speed = mid.speed + 1; else start.speed = mid.speed + 1;
} }
var nextInfo = core.enemys.getDamageInfo(enemy, start, x, y, floorId); var nextInfo = core.enemys.getDamageInfo(enemy, start, x, y, floorId);
return nextInfo == null || (typeof nextInfo == 'number') || nextInfo.damage >= pre ? null : [start.speed, nextInfo.damage]; return nextInfo == null || (typeof nextInfo == 'number') || nextInfo.mon_turn >= pre || nextInfo.damage >= damage ? null : [start.speed, nextInfo.damage, nextInfo.mon_turn];
} }
var currSpeed = start_speed; var currSpeed = start_speed;
while (true) { while (true) {
var next = calNext(currSpeed + 1, Number.MAX_SAFE_INTEGER, pre); var next = calNext(currSpeed + 1, Number.MAX_SAFE_INTEGER, damage, pre);
if (next == null) break; if (next == null) break;
currSpeed = next[0]; currSpeed = next[0];
pre = next[1]; damage = next[1]
list.push([currSpeed - hero_speed, info.damage - pre]); pre = next[2];
list.push([currSpeed - hero_speed, info.damage - damage]);
if (pre <= 0 && !core.flags.enableNegativeDamage) break; if (pre <= 0 && !core.flags.enableNegativeDamage) break;
if (list.length >= number) break; if (list.length >= number) break;
} }
@ -21880,7 +21884,7 @@ let time=0
if (typeof enemy == 'string') enemy = core.material.enemys[enemy]; if (typeof enemy == 'string') enemy = core.material.enemys[enemy];
number = number || 1; number = number || 1;
var info = core.getDamageInfo(enemy, null, x, y, floorId); var info = core.getDamageInfo(enemy, config, x, y, floorId);
if (info == null) { // 如果未破防... if (info == null) { // 如果未破防...
return [ return [
['?', '?'] ['?', '?']
@ -21898,8 +21902,8 @@ let time=0
var mon_hp = info.mon_hp, var mon_hp = info.mon_hp,
hero_spell = config.spell ?? core.status.hero.spell, hero_spell = config.spell ?? core.status.hero.spell,
mon_def = info.mon_def, mon_def = info.mon_def,
turn = info.mon_turn, pre = info.mon_turn,
pre = info.damage; damage = info.damage;
var list = []; var list = [];
var start_spell = hero_spell; var start_spell = hero_spell;
var start = core.clone(config) var start = core.clone(config)
@ -21915,19 +21919,20 @@ let time=0
if (mid.spell - start.spell > end.spell - mid.spell) mid.spell--; if (mid.spell - start.spell > end.spell - mid.spell) mid.spell--;
var nextInfo = core.enemys.getDamageInfo(enemy, mid, x, y, floorId); var nextInfo = core.enemys.getDamageInfo(enemy, mid, x, y, floorId);
if (nextInfo == null || (typeof nextInfo == 'number')) return null; if (nextInfo == null || (typeof nextInfo == 'number')) return null;
if (turn > nextInfo.mon_turn) end.spell = mid.spell; if (pre >= nextInfo.mon_turn & damage > nextInfo.damage) end.spell = mid.spell;
else start.spell = mid.spell + 1; else start.spell = mid.spell + 1;
} }
var nextInfo = core.enemys.getDamageInfo(enemy, start, x, y, floorId); var nextInfo = core.enemys.getDamageInfo(enemy, start, x, y, floorId);
return nextInfo == null || (typeof nextInfo == 'number') || nextInfo.mon_turn >= turn ? null : [start.spell, nextInfo.damage]; return nextInfo == null || (typeof nextInfo == 'number') || (nextInfo.mon_turn >= pre || nextInfo.damage >= damage) ? null : [start.spell, nextInfo.damage, nextInfo.mon_turn];
} }
var currSpell = start_spell; var currSpell = start_spell;
while (true) { while (true) {
var next = calNext(currSpell + 1, Number.MAX_SAFE_INTEGER, pre, turn); var next = calNext(currSpell + 1, Number.MAX_SAFE_INTEGER, damage, pre);
if (next == null) break; if (next == null) break;
currSpell = next[0]; currSpell = next[0];
pre = next[1]; pre = next[2];
list.push([currSpell - hero_spell, info.damage - pre]); damage = next[1];
list.push([currSpell - hero_spell, info.damage - damag]);
if (pre <= 0 && !core.flags.enableNegativeDamage) break; if (pre <= 0 && !core.flags.enableNegativeDamage) break;
if (list.length >= number) break; if (list.length >= number) break;
} }
@ -22066,31 +22071,31 @@ let time=0
core.fillText(this.left, "无恶意目标", 150, 214, '#999999', core.ui._buildFont(34, true)); core.fillText(this.left, "无恶意目标", 150, 214, '#999999', core.ui._buildFont(34, true));
core.fillText(this.right, "合上书本", 254, 380, '#000000', core.ui._buildFont(16, true)); core.fillText(this.right, "合上书本", 254, 380, '#000000', core.ui._buildFont(16, true));
} }
drawBoxAnimate(ctx, dir) { drawBoxAnimate(ctx, page, x, y) {
const blockInfo = core.getBlockInfo(this.enemys[this.page + dir].id) const blockInfo = core.getBlockInfo(this.enemys[page].id)
if (blockInfo.bigImage) { if (blockInfo.bigImage) {
core.status.boxAnimateObjs.push({ core.status.boxAnimateObjs.push({
bigImage: blockInfo.bigImage, bigImage: blockInfo.bigImage,
face: blockInfo.face, face: blockInfo.face,
centerX: 150, centerX: x ?? 150,
centerY: 50, centerY: y ?? 50,
max_width: 60, max_width: 60,
ctx: ctx, ctx: ctx,
nobackground: true nobackground: true
}); });
} else if (blockInfo.height >= 48) { } else if (blockInfo.height >= 48) {
var originEnemy = core.material.enemys[this.enemys[this.page + dir]] || {}; var originEnemy = core.material.enemys[this.enemys[page]] || {};
if (originEnemy.is32x32 == null) { if (originEnemy.is32x32 == null) {
originEnemy.is32x32 = core.ui._drawBook_is32x32(blockInfo); originEnemy.is32x32 = core.ui._drawBook_is32x32(blockInfo);
} }
if (originEnemy.is32x32) { if (originEnemy.is32x32) {
core.status.boxAnimateObjs.push({ core.status.boxAnimateObjs.push({
'bgx': 134, 'bgx': x ? x - 16 : 134,
'bgy': 34, 'bgy': y ? y - 16 : 34,
'bgWidth': 32, 'bgWidth': 32,
'bgHeight': 32, 'bgHeight': 32,
'x': 134, 'x': x ? x - 16 : 134,
'y': 34, 'y': y ? y - 16 : 34,
'height': 32, 'height': 32,
'animate': blockInfo.animate, 'animate': blockInfo.animate,
'image': blockInfo.image, 'image': blockInfo.image,
@ -22101,12 +22106,12 @@ let time=0
} else { } else {
var drawWidth = 32 * 32 / blockInfo.height; var drawWidth = 32 * 32 / blockInfo.height;
core.status.boxAnimateObjs.push({ core.status.boxAnimateObjs.push({
'bgx': 134, 'bgx': x ? x - 16 : 134,
'bgy': 34, 'bgy': y ? y - 16 : 34,
'bgWidth': 32, 'bgWidth': 32,
'bgHeight': 48, 'bgHeight': 48,
'x': 134, 'x': x ? x - 16 : 134,
'y': 34, 'y': y ? y - 16 : 34,
'dw': 32, 'dw': 32,
'dh': 48, 'dh': 48,
'height': blockInfo.height, 'height': blockInfo.height,
@ -22119,12 +22124,12 @@ let time=0
} }
} else { } else {
core.status.boxAnimateObjs.push({ core.status.boxAnimateObjs.push({
'bgx': 134, 'bgx': x ? x - 16 : 134,
'bgy': 34, 'bgy': y ? y - 16 : 34,
'bgWidth': 32, 'bgWidth': 32,
'bgHeight': 32, 'bgHeight': 32,
'x': 134, 'x': x ? x - 16 : 134,
'y': 34, 'y': y ? y - 16 : 34,
'height': 32, 'height': 32,
'animate': blockInfo.animate, 'animate': blockInfo.animate,
'image': blockInfo.image, 'image': blockInfo.image,
@ -22136,9 +22141,9 @@ let time=0
} }
drawTempLeft(dir) { drawTempLeft(page) {
core.clearMap(this.tempLeft) core.clearMap(this.tempLeft)
const enemy = this.enemys[this.page + dir] const enemy = this.enemys[page]
core.setTextAlign(this.tempLeft, 'center') core.setTextAlign(this.tempLeft, 'center')
core.fillText(this.tempLeft, enemy.name, 150, 120, "#000000", core.ui._buildFont(20, true)) core.fillText(this.tempLeft, enemy.name, 150, 120, "#000000", core.ui._buildFont(20, true))
core.fillText(this.tempLeft, "基础属性", 150, 150, "#000000", core.ui._buildFont(14, true)) core.fillText(this.tempLeft, "基础属性", 150, 150, "#000000", core.ui._buildFont(14, true))
@ -22170,11 +22175,40 @@ let time=0
lineHeight: 20, lineHeight: 20,
color: "#000000" color: "#000000"
}); });
if (this.enemys.length <= 8) {
for (let i = 0; i < this.enemys.length; i++) {
this.drawBoxAnimate(this.tempLeft, i, 167 - (this.enemys.length / 2 - i) * 34, 370)
} }
drawTempRight(dir) { core.strokeRect(this.tempLeft, 150 - (this.enemys.length / 2 - page) * 34 + 1, 354, 32, 32, "#FFFF00", 2)
} else {
this.tempLeft.beginPath()
this.tempLeft.moveTo(63, 354)
this.tempLeft.lineTo(29, 370)
this.tempLeft.lineTo(63, 386)
this.tempLeft.closePath()
this.tempLeft.fillStyle = page < 3 ? "#999999" : "#000000"
this.tempLeft.fill()
this.tempLeft.beginPath()
this.tempLeft.moveTo(237, 353)
this.tempLeft.lineTo(271, 370)
this.tempLeft.lineTo(237, 386)
this.tempLeft.closePath()
this.tempLeft.fillStyle = page > this.enemys.length - 4 ? "#999999" : "#000000"
this.tempLeft.fill()
this.drawBoxAnimate(this.tempLeft, core.clamp(page - 2, 0, this.enemys.length - 5), 80, 370)
this.drawBoxAnimate(this.tempLeft, core.clamp(page - 1, 1, this.enemys.length - 4), 114, 370)
this.drawBoxAnimate(this.tempLeft, core.clamp(page, 2, this.enemys.length - 3), 148, 370)
this.drawBoxAnimate(this.tempLeft, core.clamp(page + 1, 3, this.enemys.length - 2), 182, 370)
this.drawBoxAnimate(this.tempLeft, core.clamp(page + 2, 4, this.enemys.length - 1), 216, 370)
if (page < 2) core.strokeRect(this.tempLeft, 64 + 34 * page, 354, 32, 32, "#FFFF00", 2)
else if (page > this.enemys.length - 3) core.strokeRect(this.tempLeft, 234 - (this.enemys.length - page) * 34, 354, 32, 32, "#FFFF00", 2)
else core.strokeRect(this.tempLeft, 132, 354, 32, 32, "#FFFF00", 2)
}
this.drawBoxAnimate(bookInfo.tempLeft, page)
}
drawTempRight(page) {
core.clearMap(this.tempRight) core.clearMap(this.tempRight)
const enemy = this.enemys[this.page] const enemy = this.enemys[page]
core.maps.drawThumbnail(this.floorId, null, { ctx: this.tempRight, size: 0.4, x: 10, y: 220, noEnabled: true }) core.maps.drawThumbnail(this.floorId, null, { ctx: this.tempRight, size: 0.4, x: 10, y: 220, noEnabled: true })
enemy.locs.forEach(v => { enemy.locs.forEach(v => {
this.tempRight.beginPath() this.tempRight.beginPath()
@ -22191,8 +22225,9 @@ let time=0
core.fillText(this.tempRight, "受击次数 " + (getDamageInfo ? getDamageInfo.mon_turn : '???'), 130, 50, "#000000", core.ui._buildFont(12, true)) core.fillText(this.tempRight, "受击次数 " + (getDamageInfo ? getDamageInfo.mon_turn : '???'), 130, 50, "#000000", core.ui._buildFont(12, true))
let color = "#FFFF00", let color = "#FFFF00",
damage = enemy.damage damage = enemy.damage
if (damage == '???') {
damage = '你会死的哦~杂鱼❤~'; if (damage == '???' || damage == null) {
damage = '杂鱼喵❤~';
color = '#FF2222'; color = '#FF2222';
} else { } else {
if (damage >= core.status.hero.hp) color = '#FF2222'; if (damage >= core.status.hero.hp) color = '#FF2222';
@ -22201,7 +22236,9 @@ let time=0
damage = core.formatBigNumber(damage); damage = core.formatBigNumber(damage);
} }
if (enemy.notBomb) damage += "[b]"; if (enemy.notBomb) damage += "[b]";
core.fillText(this.tempRight, damage, 230, 50, color, core.ui._buildFont(12, true)) core.setTextAlign(this.tempRight, 'center');
core.fillText(this.tempRight, damage, 240, 50, color, core.ui._buildFont(12, true))
core.setTextAlign(this.tempRight, 'left');
core.fillText(this.tempRight, "攻击临界 " + enemy.criticalAtk[0], 30, 70, "#000000", core.ui._buildFont(12, true)) core.fillText(this.tempRight, "攻击临界 " + enemy.criticalAtk[0], 30, 70, "#000000", core.ui._buildFont(12, true))
core.fillText(this.tempRight, "速度临界 " + enemy.criticalSpeed[0], 120, 70, "#000000", core.ui._buildFont(12, true)) core.fillText(this.tempRight, "速度临界 " + enemy.criticalSpeed[0], 120, 70, "#000000", core.ui._buildFont(12, true))
core.fillText(this.tempRight, '法强临界 ' + enemy.criticalSpell[0], 210, 70, "#000000", core.ui._buildFont(12, true)) core.fillText(this.tempRight, '法强临界 ' + enemy.criticalSpell[0], 210, 70, "#000000", core.ui._buildFont(12, true))
@ -22219,9 +22256,9 @@ let time=0
core.fillText(this.tempRight, "出手次数 " + (getDamageInfo ? getDamageInfo.hero_turn : '???'), 30, 130, "#000000", core.ui._buildFont(12, true)) core.fillText(this.tempRight, "出手次数 " + (getDamageInfo ? getDamageInfo.hero_turn : '???'), 30, 130, "#000000", core.ui._buildFont(12, true))
core.fillText(this.tempRight, "受击次数 " + (getDamageInfo ? getDamageInfo.mon_turn : '???'), 130, 130, "#000000", core.ui._buildFont(12, true)) core.fillText(this.tempRight, "受击次数 " + (getDamageInfo ? getDamageInfo.mon_turn : '???'), 130, 130, "#000000", core.ui._buildFont(12, true))
color = "#FFFF00" color = "#FFFF00"
damage = getDamageInfo.damage damage = getDamageInfo?.damage
if (damage == '???') { if (damage == '???' || !getDamageInfo) {
damage = '你会死的哦~杂鱼❤~'; damage = '杂鱼❤~';
color = '#FF2222'; color = '#FF2222';
} else { } else {
if (damage >= core.status.hero.hp) color = '#FF2222'; if (damage >= core.status.hero.hp) color = '#FF2222';
@ -22230,7 +22267,9 @@ let time=0
damage = core.formatBigNumber(damage); damage = core.formatBigNumber(damage);
} }
if (enemy.notBomb) damage += "[b]"; if (enemy.notBomb) damage += "[b]";
core.fillText(this.tempRight, damage, 230, 130, color, core.ui._buildFont(12, true)) core.setTextAlign(this.tempRight, 'center');
core.fillText(this.tempRight, damage, 240, 130, color, core.ui._buildFont(12, true))
core.setTextAlign(this.tempRight, 'left');
let atk = core.nextCriticals(enemy, null, null, null, null, config) let atk = core.nextCriticals(enemy, null, null, null, null, config)
let speed = core.nextCriticals_speed(enemy, null, null, null, null, config) let speed = core.nextCriticals_speed(enemy, null, null, null, null, config)
let spell = core.nextCriticals_spell(enemy, null, null, null, null, config) let spell = core.nextCriticals_spell(enemy, null, null, null, null, config)
@ -22324,6 +22363,36 @@ let time=0
lineHeight: 16, lineHeight: 16,
color: "#000000" color: "#000000"
}); });
if (this.enemys.length <= 8) {
for (let i = 0; i < this.enemys.length; i++) {
this.drawBoxAnimate(this.left, i, 167 - (this.enemys.length / 2 - i) * 34, 370)
}
core.strokeRect(this.left, 150 - (this.enemys.length / 2 - this.page) * 34 + 1, 354, 32, 32, "#FFFF00", 2)
} else {
this.left.beginPath()
this.left.moveTo(63, 354)
this.left.lineTo(29, 370)
this.left.lineTo(63, 386)
this.left.closePath()
this.left.fillStyle = this.page < 3 ? "#999999" : "#000000"
this.left.fill()
this.left.beginPath()
this.left.moveTo(237, 354)
this.left.lineTo(271, 370)
this.left.lineTo(237, 386)
this.left.closePath()
this.left.fillStyle = this.page > this.enemys.length - 4 ? "#999999" : "#000000"
this.left.fill()
this.drawBoxAnimate(this.left, core.clamp(this.page - 2, 0, this.enemys.length - 5), 80, 370)
this.drawBoxAnimate(this.left, core.clamp(this.page - 1, 1, this.enemys.length - 4), 114, 370)
this.drawBoxAnimate(this.left, core.clamp(this.page, 2, this.enemys.length - 3), 148, 370)
this.drawBoxAnimate(this.left, core.clamp(this.page + 1, 3, this.enemys.length - 2), 182, 370)
this.drawBoxAnimate(this.left, core.clamp(this.page + 2, 4, this.enemys.length - 1), 216, 370)
if (this.page < 2) core.strokeRect(this.left, 64 + 34 * this.page, 354, 32, 32, "#FFFF00", 2)
else if (this.page > this.enemys.length - 3) core.strokeRect(this.left, 234 - (this.enemys.length - this.page) * 34, 354, 32, 32, "#FFFF00", 2)
else core.strokeRect(this.left, 132, 354, 32, 32, "#FFFF00", 2)
}
this.drawBoxAnimate(this.left, this.page)
} }
drawRight() { drawRight() {
@ -22345,8 +22414,8 @@ let time=0
core.fillText(this.right, "受击次数 " + (getDamageInfo ? getDamageInfo.mon_turn : '???'), 130, 50, "#000000", core.ui._buildFont(12, true)) core.fillText(this.right, "受击次数 " + (getDamageInfo ? getDamageInfo.mon_turn : '???'), 130, 50, "#000000", core.ui._buildFont(12, true))
let color = "#FFFF00", let color = "#FFFF00",
damage = enemy.damage damage = enemy.damage
if (damage == '???') { if (damage == '???' || damage == null) {
damage = '你会死的哦~杂鱼❤~'; damage = '杂鱼❤~';
color = '#FF2222'; color = '#FF2222';
} else { } else {
if (damage >= core.status.hero.hp) color = '#FF2222'; if (damage >= core.status.hero.hp) color = '#FF2222';
@ -22355,7 +22424,9 @@ let time=0
damage = core.formatBigNumber(damage); damage = core.formatBigNumber(damage);
} }
if (enemy.notBomb) damage += "[b]"; if (enemy.notBomb) damage += "[b]";
core.fillText(this.right, damage, 230, 50, color, core.ui._buildFont(12, true)) core.setTextAlign(this.left, 'center')
core.fillText(this.right, damage, 240, 50, color, core.ui._buildFont(12, true))
core.setTextAlign(this.left, 'left')
core.fillText(this.right, "攻击临界 " + enemy.criticalAtk[0], 30, 70, "#000000", core.ui._buildFont(12, true)) core.fillText(this.right, "攻击临界 " + enemy.criticalAtk[0], 30, 70, "#000000", core.ui._buildFont(12, true))
core.fillText(this.right, "速度临界 " + enemy.criticalSpeed[0], 120, 70, "#000000", core.ui._buildFont(12, true)) core.fillText(this.right, "速度临界 " + enemy.criticalSpeed[0], 120, 70, "#000000", core.ui._buildFont(12, true))
core.fillText(this.right, '法强临界 ' + enemy.criticalSpell[0], 210, 70, "#000000", core.ui._buildFont(12, true)) core.fillText(this.right, '法强临界 ' + enemy.criticalSpell[0], 210, 70, "#000000", core.ui._buildFont(12, true))
@ -22373,9 +22444,9 @@ let time=0
core.fillText(this.right, "出手次数 " + (getDamageInfo ? getDamageInfo.hero_turn : '???'), 30, 130, "#000000", core.ui._buildFont(12, true)) core.fillText(this.right, "出手次数 " + (getDamageInfo ? getDamageInfo.hero_turn : '???'), 30, 130, "#000000", core.ui._buildFont(12, true))
core.fillText(this.right, "受击次数 " + (getDamageInfo ? getDamageInfo.mon_turn : '???'), 130, 130, "#000000", core.ui._buildFont(12, true)) core.fillText(this.right, "受击次数 " + (getDamageInfo ? getDamageInfo.mon_turn : '???'), 130, 130, "#000000", core.ui._buildFont(12, true))
color = "#FFFF00" color = "#FFFF00"
damage = getDamageInfo.damage damage = getDamageInfo?.damage
if (damage == '???') { if (damage == '???' || !getDamageInfo) {
damage = '你会死的哦~杂鱼❤~'; damage = '杂鱼❤~';
color = '#FF2222'; color = '#FF2222';
} else { } else {
if (damage >= core.status.hero.hp) color = '#FF2222'; if (damage >= core.status.hero.hp) color = '#FF2222';
@ -22384,7 +22455,9 @@ let time=0
damage = core.formatBigNumber(damage); damage = core.formatBigNumber(damage);
} }
if (enemy.notBomb) damage += "[b]"; if (enemy.notBomb) damage += "[b]";
core.fillText(this.right, damage, 230, 130, color, core.ui._buildFont(12, true)) core.setTextAlign(this.left, 'center')
core.fillText(this.right, damage, 240, 130, color, core.ui._buildFont(12, true))
core.setTextAlign(this.left, 'left')
let atk = core.nextCriticals(enemy, null, null, null, null, config) let atk = core.nextCriticals(enemy, null, null, null, null, config)
let speed = core.nextCriticals_speed(enemy, null, null, null, null, config) let speed = core.nextCriticals_speed(enemy, null, null, null, null, config)
let spell = core.nextCriticals_spell(enemy, null, null, null, null, config) let spell = core.nextCriticals_spell(enemy, null, null, null, null, config)
@ -22467,7 +22540,7 @@ let time=0
} }
this.drawLeft() this.drawLeft()
this.drawRight() this.drawRight()
this.drawBoxAnimate(this.left, 0)
} }
} }
@ -22514,7 +22587,43 @@ let time=0
const speedchangebox = makeBox([606, 341], [25, 25]) const speedchangebox = makeBox([606, 341], [25, 25])
const zerochangebox = makeBox([515, 365], [35, 35]) const zerochangebox = makeBox([515, 365], [35, 35])
if (this.isAnimate) return if (this.isAnimate) return
if (inRect(pos, atkupbox)) { let length = bookInfo.enemys.length
if (length > 0) {
if (length > 8 && inRect(pos, makeBox([66, 361], [238, 34]))) {
let num = core.clamp(Math.floor((x - 66) / 34), 0, 6)
if (num === 0) this.turnleft(this.page - 1)
else if (num === 1) {
const clamp = core.clamp(bookInfo.page - 2, 0, length - 5)
if (clamp < this.page - 1) this.turnleft(clamp + 1)
} else if (num === 2) {
const clamp = core.clamp(bookInfo.page - 1, 1, length - 4)
if (clamp < this.page - 1) this.turnleft(clamp + 1)
else if (clamp > this.page - 1) this.turnright(clamp + 1)
} else if (num === 3) {
const clamp = core.clamp(bookInfo.page, 2, length - 3)
if (clamp < this.page - 1) this.turnleft(clamp + 1)
else if (clamp > this.page - 1) this.turnright(clamp + 1)
} else if (num === 4) {
const clamp = core.clamp(bookInfo.page + 1, 3, length - 2)
if (clamp < this.page - 1) this.turnleft(clamp + 1)
else if (clamp > this.page - 1) this.turnright(clamp + 1)
} else if (num === 5) {
const clamp = core.clamp(bookInfo.page + 2, 4, length - 1)
if (clamp < this.page - 1) this.turnleft(clamp + 1)
else if (clamp > this.page - 1) this.turnright(clamp + 1)
} else if (num === 6) this.turnright(this.page + 1)
} else if (length <= 8 && inRect(pos, makeBox([187 - length * 17, 361], [length * 34, 34]))) {
let num = core.clamp(Math.floor((x - 187 + length * 17) / 34), 0, length - 1)
if (num > this.page - 1) this.turnright(num + 1)
else if (num < this.page - 1) this.turnleft(num + 1)
} else if (inRect(pos, atkupbox)) {
bookInfo.atk += bookInfo.atkStep bookInfo.atk += bookInfo.atkStep
bookInfo.drawRight() bookInfo.drawRight()
this.update() this.update()
@ -22615,18 +22724,31 @@ let time=0
return; return;
} else if (inRect(pos, leftbox)) { } else if (inRect(pos, leftbox)) {
this.turnleft() this.turnleft(this.page - 1)
} else if (inRect(pos, rightbox)) { } else if (inRect(pos, rightbox)) {
this.turnright() this.turnright(this.page + 1)
}
return
}
if (inRect(pos, exitbox)) {
core.playSound('取消');
core.book.close()
if (core.events.recoverEvents(core.status.event.interval)) {
return;
} else if (core.status.event.ui != null) {
core.status.boxAnimateObjs = [];
core.ui._drawViewMaps(core.status.event.ui);
} else core.ui.closePanel();
return;
} }
} }
async turnleft() { async turnleft(page) {
if (this.page <= 1) return if (this.page <= 1) return
this.isAnimate = true this.isAnimate = true
bookInfo.drawTempLeft(-1) bookInfo.drawTempLeft(page - 1)
bookInfo.drawTempRight(-1) bookInfo.drawTempRight(page - 1)
bookInfo.drawBoxAnimate(bookInfo.tempLeft, -1)
core.drawBoxAnimate() core.drawBoxAnimate()
await this.ani.time(1) await this.ani.time(1)
.absolute() .absolute()
@ -23249,7 +23371,7 @@ let time=0
ctx.shadowOffsetX = 0; ctx.shadowOffsetX = 0;
ctx.shadowOffsetY = 0; ctx.shadowOffsetY = 0;
//绘制上一页左页 //绘制上一页左页
core.drawImage(ctx, this.paperpages[this.page - 2][0], 0, 0, this.ani.x / (this.width * 2) * 300, 400, dx, dy, this.ani.x / 2, this.height); core.drawImage(ctx, this.paperpages[page - 1][0], 0, 0, this.ani.x / (this.width * 2) * 300, 400, dx, dy, this.ani.x / 2, this.height);
ctx.shadowColor = "transparent"; ctx.shadowColor = "transparent";
core.drawImage(ctx, bookInfo.tempLeft.canvas, 0, 0, this.ani.x / (this.width * 2) * 300, 400, dx, dy, this.ani.x / 2, this.height); core.drawImage(ctx, bookInfo.tempLeft.canvas, 0, 0, this.ani.x / (this.width * 2) * 300, 400, dx, dy, this.ani.x / 2, this.height);
ctx.shadowColor = "rgba(0,0,0,0.5)"; ctx.shadowColor = "rgba(0,0,0,0.5)";
@ -23257,7 +23379,7 @@ let time=0
ctx.shadowOffsetX = 0; ctx.shadowOffsetX = 0;
ctx.shadowOffsetY = 0; ctx.shadowOffsetY = 0;
//绘制翻起的右页 //绘制翻起的右页
core.drawImage(ctx, this.paperpages[this.page - 2][1], 300 - this.ani.x / (this.width * 2) * 300, 0, this.ani.x / (this.width * 2) * 300, 400, this.ani.x / 2 + dx, dy, this.ani.x / 2, this.height); core.drawImage(ctx, this.paperpages[page - 1][1], 300 - this.ani.x / (this.width * 2) * 300, 0, this.ani.x / (this.width * 2) * 300, 400, this.ani.x / 2 + dx, dy, this.ani.x / 2, this.height);
ctx.shadowColor = "transparent"; ctx.shadowColor = "transparent";
core.drawImage(ctx, bookInfo.tempRight.canvas, 300 - this.ani.x / (this.width * 2) * 300, 0, this.ani.x / (this.width * 2) * 300, 400, this.ani.x / 2 + dx, dy, this.ani.x / 2, this.height); core.drawImage(ctx, bookInfo.tempRight.canvas, 300 - this.ani.x / (this.width * 2) * 300, 0, this.ani.x / (this.width * 2) * 300, 400, this.ani.x / 2 + dx, dy, this.ani.x / 2, this.height);
ctx.shadowColor = "rgba(0,0,0,0.5)"; ctx.shadowColor = "rgba(0,0,0,0.5)";
@ -23286,24 +23408,23 @@ let time=0
.move(this.width * 2, 0).n(1) .move(this.width * 2, 0).n(1)
this.ani.ticker.clear() this.ani.ticker.clear()
this.isAnimate = false this.isAnimate = false
this.page-- this.page = page
bookInfo.page--; bookInfo.page = page - 1;
[bookInfo.left, bookInfo.tempLeft] = [bookInfo.tempLeft, bookInfo.left]; [bookInfo.left, bookInfo.tempLeft] = [bookInfo.tempLeft, bookInfo.left];
[bookInfo.right, bookInfo.tempRight] = [bookInfo.tempRight, bookInfo.right] [bookInfo.right, bookInfo.tempRight] = [bookInfo.tempRight, bookInfo.right]
core.clearUI() core.status.boxAnimateObjs = core.status.boxAnimateObjs.filter(v => v.ctx === bookInfo.left)
bookInfo.drawBoxAnimate(bookInfo.left, 0)
core.drawBoxAnimate() core.drawBoxAnimate()
this.update() this.update()
core.clearMap(bookInfo.tempLeft) core.clearMap(bookInfo.tempLeft)
core.clearMap(bookInfo.tempRight) core.clearMap(bookInfo.tempRight)
} }
async turnright() { async turnright(page) {
if (this.page >= this.pagemax) return if (this.page >= this.pagemax) return
this.isAnimate = true this.isAnimate = true
bookInfo.drawTempLeft(1) bookInfo.drawTempLeft(page - 1)
bookInfo.drawTempRight(1) bookInfo.drawTempRight(page - 1)
bookInfo.drawBoxAnimate(bookInfo.tempLeft, 1)
core.drawBoxAnimate() core.drawBoxAnimate()
await this.ani.time(1) await this.ani.time(1)
.absolute() .absolute()
@ -23926,7 +24047,7 @@ let time=0
ctx.shadowOffsetX = 0; ctx.shadowOffsetX = 0;
ctx.shadowOffsetY = 0; ctx.shadowOffsetY = 0;
//绘制翻起的左页 //绘制翻起的左页
core.drawImage(ctx, this.paperpages[this.page][0], 0, 0, this.ani.x / (this.width * 2) * 300, 400, 676 - dx - this.ani.x, dy, this.ani.x / 2, this.height); core.drawImage(ctx, this.paperpages[page - 1][0], 0, 0, this.ani.x / (this.width * 2) * 300, 400, 676 - dx - this.ani.x, dy, this.ani.x / 2, this.height);
ctx.shadowColor = "transparent"; ctx.shadowColor = "transparent";
core.drawImage(ctx, bookInfo.tempLeft.canvas, 0, 0, this.ani.x / (this.width * 2) * 300, 400, 676 - dx - this.ani.x, dy, this.ani.x / 2, this.height); core.drawImage(ctx, bookInfo.tempLeft.canvas, 0, 0, this.ani.x / (this.width * 2) * 300, 400, 676 - dx - this.ani.x, dy, this.ani.x / 2, this.height);
ctx.shadowColor = "rgba(0,0,0,0.5)"; ctx.shadowColor = "rgba(0,0,0,0.5)";
@ -23934,7 +24055,7 @@ let time=0
ctx.shadowOffsetX = 0; ctx.shadowOffsetX = 0;
ctx.shadowOffsetY = 0; ctx.shadowOffsetY = 0;
//绘制下一页右页 //绘制下一页右页
core.drawImage(ctx, this.paperpages[this.page][1], 300 - this.ani.x / (this.width * 2) * 300, 0, this.ani.x / (this.width * 2) * 300, 400, 676 - dx - this.ani.x / 2, dy, this.ani.x / 2, this.height); core.drawImage(ctx, this.paperpages[page - 1][1], 300 - this.ani.x / (this.width * 2) * 300, 0, this.ani.x / (this.width * 2) * 300, 400, 676 - dx - this.ani.x / 2, dy, this.ani.x / 2, this.height);
ctx.shadowColor = "transparent"; ctx.shadowColor = "transparent";
core.drawImage(ctx, bookInfo.tempRight.canvas, 300 - this.ani.x / (this.width * 2) * 300, 0, this.ani.x / (this.width * 2) * 300, 400, 676 - dx - this.ani.x / 2, dy, this.ani.x / 2, this.height); core.drawImage(ctx, bookInfo.tempRight.canvas, 300 - this.ani.x / (this.width * 2) * 300, 0, this.ani.x / (this.width * 2) * 300, 400, 676 - dx - this.ani.x / 2, dy, this.ani.x / 2, this.height);
ctx.shadowColor = "rgba(0,0,0,0.5)"; ctx.shadowColor = "rgba(0,0,0,0.5)";
@ -23965,12 +24086,11 @@ let time=0
.move(this.width * 2, 0).n(1) .move(this.width * 2, 0).n(1)
this.ani.ticker.clear() this.ani.ticker.clear()
this.isAnimate = false this.isAnimate = false
this.page++ this.page = page
bookInfo.page++; bookInfo.page = page - 1;
[bookInfo.left, bookInfo.tempLeft] = [bookInfo.tempLeft, bookInfo.left]; [bookInfo.left, bookInfo.tempLeft] = [bookInfo.tempLeft, bookInfo.left];
[bookInfo.right, bookInfo.tempRight] = [bookInfo.tempRight, bookInfo.right] [bookInfo.right, bookInfo.tempRight] = [bookInfo.tempRight, bookInfo.right]
core.clearUI() core.status.boxAnimateObjs = core.status.boxAnimateObjs.filter(v => v.ctx === bookInfo.left)
bookInfo.drawBoxAnimate(bookInfo.left, 0)
core.drawBoxAnimate() core.drawBoxAnimate()
this.update() this.update()
core.clearMap(bookInfo.tempLeft) core.clearMap(bookInfo.tempLeft)
@ -25277,9 +25397,11 @@ let time=0
ctx.shadowColor = "transparent"; ctx.shadowColor = "transparent";
core.drawImage(ctx, bookInfo.left.canvas, 0, 0, 300, 400, dx, dy, this.width, this.height) core.drawImage(ctx, bookInfo.left.canvas, 0, 0, 300, 400, dx, dy, this.width, this.height)
core.drawImage(ctx, bookInfo.right.canvas, 0, 0, 300, 400, dx + this.width, dy, this.width, this.height) core.drawImage(ctx, bookInfo.right.canvas, 0, 0, 300, 400, dx + this.width, dy, this.width, this.height)
ctx.restore(); ctx.restore();
} }
setPage(num) { setPage(num) {
if (num === 1) { if (num === 1) {
this.paperpages = [ this.paperpages = [
[this.paperTexture('left'), this.paperTexture('right')] [this.paperTexture('left'), this.paperTexture('right')]
@ -27566,7 +27688,7 @@ let time=0
centerX += core.bigmap.offsetX; centerX += core.bigmap.offsetX;
centerY += core.bigmap.offsetY; centerY += core.bigmap.offsetY;
} }
var id = Symbol(); var id = setTimeout();
animate.se = animate.se || {}; animate.se = animate.se || {};
if (typeof animate.se == 'string') animate.se = { 1: animate.se }; if (typeof animate.se == 'string') animate.se = { 1: animate.se };
tran.mode(linear()).time(1).absolute() tran.mode(linear()).time(1).absolute()
@ -27604,7 +27726,7 @@ let time=0
animate.se = animate.se || {}; animate.se = animate.se || {};
if (typeof animate.se == 'string') animate.se = { 1: animate.se }; if (typeof animate.se == 'string') animate.se = { 1: animate.se };
var id = id || Symbol(); var id = id || setTimeout();
tran.mode(linear()).time(1).absolute() tran.mode(linear()).time(1).absolute()
if (!hero) tran.value[id + name + "x"] = centerX if (!hero) tran.value[id + name + "x"] = centerX
if (!hero) tran.value[id + name + "y"] = centerY if (!hero) tran.value[id + name + "y"] = centerY
@ -27809,7 +27931,7 @@ let time=0
if (!flags["animate_" + name]) { if (!flags["animate_" + name]) {
callback?.() callback?.()
} }
if (!id) id = Symbol() if (!id) id = setTimeout()
tran.mode(linear()).time(1).absolute() tran.mode(linear()).time(1).absolute()
if (!hero) tran.value[id + name + "x"] = x if (!hero) tran.value[id + name + "x"] = x
if (!hero) tran.value[id + name + "y"] = y if (!hero) tran.value[id + name + "y"] = y