重构进度条

This commit is contained in:
strawberry 2025-08-19 20:36:06 +08:00
parent 34b596e1ea
commit 5a44ba3f28
7 changed files with 637 additions and 428 deletions

View File

@ -1256,6 +1256,7 @@ actions.prototype._keyUpBook = function (keycode) {
if (core.book.isAnimate) return
if (keycode == 27 || keycode == 88) {
core.playSound('取消');
core.book.close()
if (core.events.recoverEvents(core.status.event.interval)) {
return;
}
@ -1264,7 +1265,6 @@ actions.prototype._keyUpBook = function (keycode) {
core.ui._drawViewMaps(core.status.event.ui);
}
else core.ui.closePanel();
core.book.close()
return;
}
/*if (keycode == 13 || keycode == 32 || keycode == 67) {

View File

@ -204,12 +204,12 @@ enemys.prototype.getDamageString = function (enemy, x, y, floorId) {
else color = '#FF2222';
damage = core.formatBigNumber(damage, true);
if (core.enemys.hasSpecial(enemy, 19))
/* if (core.enemys.hasSpecial(enemy, 19))
damage += "+";
if (core.enemys.hasSpecial(enemy, 21))
damage += "-";
if (core.enemys.hasSpecial(enemy, 11))
damage += "^";
damage += "^";*/
}
return {
@ -219,13 +219,13 @@ enemys.prototype.getDamageString = function (enemy, x, y, floorId) {
}
////// 接下来N个临界值和临界减伤计算 //////
enemys.prototype.nextCriticals = function (enemy, number, x, y, floorId) {
enemys.prototype.nextCriticals = function (enemy, number, x, y, floorId,config={}) {
if (typeof enemy == 'string') enemy = core.material.enemys[enemy];
number = number || 1;
var specialCriticals = this._nextCriticals_special(enemy, number, x, y, floorId);
if (specialCriticals != null) return specialCriticals;
var info = this.getDamageInfo(enemy, null, x, y, floorId);
var info = this.getDamageInfo(enemy, config, x, y, floorId);
if (info == null) { // 如果未破防...
var overAtk = this._nextCriticals_overAtk(enemy, x, y, floorId);
if (overAtk == null) return [];
@ -245,7 +245,7 @@ enemys.prototype.nextCriticals = function (enemy, number, x, y, floorId) {
return this._nextCriticals_useLoop(enemy, info, number, x, y, floorId);
}
else {
return this._nextCriticals_useBinarySearch(enemy, info, number, x, y, floorId);
return this._nextCriticals_useBinarySearch(enemy, info, number, x, y, floorId,config);
}
}
else {
@ -274,7 +274,7 @@ enemys.prototype._nextCriticals_overAtk = function (enemy, x, y, floorId) {
}
enemys.prototype._nextCriticals_special = function (enemy, number, x, y, floorId) {
if (this.hasSpecial(enemy.special, 10) || this.hasSpecial(enemy.special, 3))
if (this.hasSpecial(enemy.special, 3))
return []; // 模仿or坚固临界
return null;
}

View File

@ -1757,7 +1757,11 @@ maps.prototype._drawThumbnail_drawTempCanvas = function (floorId, blocks, option
} else core.maps._setHDCanvasSize(tempCanvas, width * 32, height * 32);
}
options.ctx = tempCanvas;
if(options.noEnabled){
tempCanvas.imageSmoothingEnabled= false
}else{
tempCanvas.imageSmoothingEnabled= true
}
// 地图过大的缩略图不绘制显伤
if (width * height > core.bigmap.threshold)
options.damage = false;
@ -1804,6 +1808,12 @@ maps.prototype._drawThumbnail_realDrawTempCanvas = function (floorId, blocks, op
maps.prototype._drawThumbnail_drawToTarget = function (floorId, options) {
var ctx = core.getContextByName(options.ctx);
let imageSmoothingEnabled=ctx.imageSmoothingEnabled
if(options.noEnabled){
ctx.imageSmoothingEnabled= false
}else{
ctx.imageSmoothingEnabled= true
}
if (ctx == null) return;
var x = options.x || 0, y = options.y || 0, size = options.size || 1;
// size的含义改为(0,1]范围的系数以适配长方形默认为1楼传为3/4SL界面为0.3
@ -1861,6 +1871,7 @@ maps.prototype._drawThumbnail_drawToTarget = function (floorId, options) {
}
}
}
ctx.imageSmoothingEnabled= imageSmoothingEnabled
}
// -------- 获得某个点的图块信息 -------- //

View File

@ -2556,7 +2556,7 @@ ui.prototype.drawFly = function (page) {
}
var size = 0.75;
core.strokeRect('ui', 16, 64, size * core._PX_, size * core._PY_, '#FFFFFF', 2);
core.drawThumbnail(floorId, null, { ctx: 'ui', x: 16, y: 64, size: size, damage: true, all: true });
core.drawThumbnail(floorId, null, { ctx: 'ui', x: 16, y: 64, size: size, damage: true, all: true , noEnabled: true });
}
////// 绘制中心对称飞行器
@ -2568,7 +2568,7 @@ ui.prototype._drawCenterFly = function () {
var toX = core.bigmap.width - 1 - core.getHeroLoc('x'), toY = core.bigmap.height - 1 - core.getHeroLoc('y');
this.clearUI();
core.fillRect('ui', 0, 0, core._PX_, core._PY_, '#000000');
core.drawThumbnail(null, null, { heroLoc: core.status.hero.loc, heroIcon: core.status.hero.image, ctx: 'ui', centerX: toX, centerY: toY });
core.drawThumbnail(null, null, { heroLoc: core.status.hero.loc, heroIcon: core.status.hero.image, ctx: 'ui', centerX: toX, centerY: toY, noEnabled: true });
var offsetX = core.clamp(toX - core._HALF_WIDTH_, 0, core.bigmap.width - core._WIDTH_),
offsetY = core.clamp(toY - core._HALF_HEIGHT_, 0, core.bigmap.height - core._HEIGHT_);
core.fillRect('ui', (toX - offsetX) * 32, (toY - offsetY) * 32, 32, 32, fillstyle);
@ -2588,7 +2588,7 @@ ui.prototype._drawViewMaps = function (index, x, y) {
core.status.checkBlock.cache = {};
var data = this._drawViewMaps_buildData(index, x, y);
core.fillRect('ui', 0, 0, core._PX_, core._PY_, '#000000');
core.drawThumbnail(data.floorId, null, { damage: data.damage, ctx: 'ui', centerX: data.x, centerY: data.y, all: data.all });
core.drawThumbnail(data.floorId, null, { damage: data.damage, ctx: 'ui', centerX: data.x, centerY: data.y, all: data.all , noEnabled: true });
core.clearMap('data');
core.setTextAlign('data', 'left');
core.setFont('data', '16px Arial');

File diff suppressed because it is too large Load Diff

View File

@ -788,18 +788,8 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
if (a) equipInfo.push(a)
}
//处理回合条长度
let oneTurn = [hero_speed, mon_speed];
if (equipInfo.length > 0) {
for (let i = 0; i < equipInfo.length; i++) {
equipInfo[i].now = 0;
equipInfo[i].isAttack = false;
oneTurn.push(equipInfo[i].speed);
}
}
//需要变更
const onegcd = gcd(...oneTurn) //最大公约数
oneTurn = lcm(...oneTurn) //单次回合长度
let oneTurn = 100
//在这里处理equip的初始位置now
equipInfo.forEach(v => {
switch (v.id) {
@ -814,24 +804,14 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
const enemyinfo = { hp: mon_hp, atk: mon_atk, def: mon_def, mhp: 0, mdef: mon_mdef, spell: mon_spell, speed: mon_speed, special: mon_special, now: 0, isAttack: false } //怪物属性
//先攻先攻为怪物50%行动条
if (core.hasSpecial(mon_special, 1)) {
enemyinfo.now = oneTurn / 2
enemyinfo.now = 50
heroinfo.now = 0
} else {
enemyinfo.now = 0
heroinfo.now = oneTurn / 2
heroinfo.now = 50
}
let max = heroinfo.speed
if (enemyinfo.speed > max) max = enemyinfo.speed
equipInfo.forEach(v => { if (v.speed > max) max = v.speed })
let i = 1
while (oneTurn * i / max < 30) {
i++
}
heroinfo.now *= i
enemyinfo.now *= i
equipInfo.forEach(v => { v.now *= i })
oneTurn *= i
const start = [core.clone(heroinfo), core.clone(enemyinfo), core.clone(equipInfo), oneTurn] //记录开始战斗时的属性并转发
let Exspeed = hero_speed
const start = [core.clone(heroinfo), core.clone(enemyinfo), core.clone(equipInfo), Exspeed] //记录开始战斗时的属性并转发
//---第三部分:递归开始---
let poison = 0
const heroDiffList = [],
@ -840,6 +820,8 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
enemyanimateList = [];
let beforehp = enemyinfo.hp
while (
enemyinfo.hp > 0
) {
@ -849,10 +831,10 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
hero_animate = [],
enemy_animate = [];
heroinfo.now += heroinfo.speed
enemyinfo.now += enemyinfo.speed
heroinfo.now += heroinfo.speed / Exspeed
enemyinfo.now += enemyinfo.speed / Exspeed
equipInfo.forEach(v => {
v.now += v.speed
v.now += v.speed / Exspeed
})
if (

View File

@ -4000,10 +4000,11 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
number,
x,
y,
floorId
floorId,
config={}
) {
var mon_hp = info.mon_hp,
hero_atk = core.status.hero.atk,
hero_atk = config.atk??core.status.hero.atk,
mon_def = info.mon_def,
pre = info.damage;
var list = [];
@ -4012,26 +4013,29 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
start_atk += info.__overAtk__;
list.push([info.__overAtk__, -info.damage]);
}
var start=core.clone(config)
var mid=core.clone(config)
var end=core.clone(config)
var calNext = function (currAtk, maxAtk) {
var start = Math.floor(currAtk),
end = Math.floor(maxAtk);
if (start > end) return null;
start.atk = Math.floor(currAtk)
end.atk = Math.floor(maxAtk);
if (start.atk > end.atk) return null;
while (start < end) {
var mid = Math.floor((start + end) / 2);
if (mid - start > end - mid) mid--;
while (start.atk < end.atk) {
mid.atk = Math.floor((start.atk + end.atk) / 2);
if (mid.atk - start.atk > end.atk - mid.atk) mid.atk--;
var nextInfo = core.enemys.getDamageInfo(
enemy, { atk: mid },
enemy, mid ,
x,
y,
floorId
);
if (nextInfo == null || typeof nextInfo == "number") return null;
if (pre > nextInfo.damage) end = mid;
else start = mid + 1;
if (pre > nextInfo.damage) end.atk = mid.atk;
else start.atk = mid.atk + 1;
}
var nextInfo = core.enemys.getDamageInfo(
enemy, { atk: start },
enemy, start,
x,
y,
floorId
@ -4039,7 +4043,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
return nextInfo == null ||
typeof nextInfo == "number" ||
nextInfo.damage >= pre ?
null : [start, nextInfo.damage];
null : [start.atk, nextInfo.damage];
};
var currAtk = start_atk;
while (true) {
@ -4082,110 +4086,6 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
);
}
};
events.prototype.openBook = function (fromUserAction) {
if (core.isReplaying()) return;
// 如果能恢复事件从callBook事件触发
if (
core.status.event.id == "book" &&
core.events.recoverEvents(core.status.event.interval)
)
return;
// 当前是book且从“浏览地图”打开
if (core.status.event.id == "book" && core.status.event.ui) {
core.status.boxAnimateObjs = [];
core.ui._drawViewMaps(core.status.event.ui);
return;
}
// 从“浏览地图”页面打开
if (core.status.event.id == "viewMaps" || core.status.event.id == "fly") {
fromUserAction = false;
core.status.event.ui = core.status.event.data;
}
if (!this._checkStatus("book", fromUserAction, true)) return;
core.playSound("打开界面");
core.useItem("book", true);
};
////// 怪物手册界面时,放开某个键的操作 //////
core.actions._keyUpBook = function (keycode) {
if (keycode == 27 || keycode == 88) {
core.playSound("取消");
if (core.events.recoverEvents(core.status.event.interval)) {
return;
} else if (core.status.event.ui != null) {
core.status.boxAnimateObjs = [];
if (typeof core.status.event.ui === "number") {
core.status.event.id = "fly";
core.ui.drawFly(core.status.event.ui);
} else {
core.ui._drawViewMaps(core.status.event.ui);
}
} else core.ui.closePanel();
return;
}
if (keycode == 13 || keycode == 32 || keycode == 67) {
var data = core.status.event.data;
if (data != null) {
core.ui._drawBookDetail(data);
}
return;
}
};
////// 怪物手册界面的点击操作 //////
actions.prototype._clickBook = function (x, y) {
var pageinfo = core.ui._drawBook_pageinfo();
// 上一页
if (
(x == this._HX_ - 2 || x == this._HX_ - 3) &&
y === core._HEIGHT_ - 1
) {
core.playSound("光标移动");
core.ui.drawBook(core.status.event.data - pageinfo.per_page);
return;
}
// 下一页
if (
(x == this._HX_ + 2 || x == this._HX_ + 3) &&
y === core._HEIGHT_ - 1
) {
core.playSound("光标移动");
core.ui.drawBook(core.status.event.data + pageinfo.per_page);
return;
}
// 返回
if (x >= this.LAST - 2 && y === core._HEIGHT_ - 1) {
core.playSound("取消");
if (core.events.recoverEvents(core.status.event.interval)) {
return;
} else if (core.status.event.ui != null) {
core.status.boxAnimateObjs = [];
if (typeof core.status.event.ui === "number") {
core.status.event.id = "fly";
core.ui.drawFly(core.status.event.ui);
} else {
core.ui._drawViewMaps(core.status.event.ui);
}
} else core.ui.closePanel();
return;
}
// 怪物信息
var data = core.status.event.data;
if (data != null && y < core._HEIGHT_ - 1) {
var per_page = pageinfo.per_page,
page = parseInt(data / per_page);
var u = (core._HEIGHT_ - 1) / per_page;
for (var i = 0; i < per_page; ++i) {
if (y >= u * i && y < u * (i + 1)) {
var index = per_page * page + i;
core.ui.drawBook(index);
core.ui._drawBookDetail(index);
break;
}
}
return;
}
return;
};
////// 执行当前自定义事件列表中的下一个事件 //////
events.prototype.doAction = function () {
// 清空boxAnimate和UI层
@ -20019,7 +19919,6 @@ let time=0
const changeY = -30
let easy = false;
const { imagelighter } = core.plugin.utils;
const { lcm, gcd } = core.plugin.utils;
let a = []
@ -20052,7 +19951,6 @@ let time=0
core.animateFrame.animate2Time = 0
function animationFrame(callback1) {
let time = 0
const ctx = core.getContextByName("animateAttack") ?? core.createCanvas("animateAttack", 0, 0, 416, 416, 80)
const anctx = core.getContextByName("animate2") ?? core.createCanvas("animate2", 0, 0, 416, 416, 91)
core.registerAnimationFrame("animate2", true, function (timestamp) {
@ -20117,13 +20015,14 @@ let time=0
drawAnimate(name, 130, 180 + changeY);
}
}
let sp = [1, 2, 4, 8, 16]
let A = 1
this.attackAnimate = function (
enemyId,
heroInfo,
enemyInfo,
equipInfo,
oneTurn,
Exspeed,
heroDiffList,
enemyDiffList,
heroanimateList,
@ -20140,21 +20039,11 @@ let time=0
enemyInfo.id = enemyId;
enemyInfo.cls = core.getClsFromId(enemyId);
enemyInfo.name = core.material.enemys[enemyId].name;
let max = heroInfo.speed
if (enemyInfo.speed > max) max = enemyInfo.speed
equipInfo.forEach(v => { if (v.speed > max) max = v.speed })
let i = 1
while (oneTurn * i / max < 30) {
i++
}
heroInfo.turn = 0
enemyInfo.turn = 0
heroInfo.now *= i
enemyInfo.now *= i
equipInfo.forEach(v => { v.now *= i })
oneTurn *= i
let time = 0,
farme = 0;
const oneTurn = 100
let farme = 0;
return new Promise((res) => {
core.plugin.battle_onclick = function (x, y, px, py) {
const makeBox = ([x, y], [w, h]) => {
@ -20184,7 +20073,9 @@ let time=0
(inRect(pos, easyspeedbox) && easy) ||
(inRect(pos, uneasyspeedbox) && !easy)
) {
flags.qukly = !flags.qukly
A++
if (A >= sp.length) A = 0
flags.qukly = sp[A]
} else if ((inRect(pos, easyClosebox) && easy) ||
(inRect(pos, uneasyClosebox) && !easy)
@ -20198,7 +20089,6 @@ let time=0
};
async function drawAttackAnimate(
heroInfo,
oneTurn,
enemyInfo,
equipInfo,
farme,
@ -20227,26 +20117,25 @@ let time=0
core.clearMap(ctx);
let animate = Math.floor(farme / 15);
if (flags.qukly) {
while (true) {
let goattack = false
equipInfo.forEach(v => {
if (v.now >= oneTurn) goattack = true
});
if (enemyInfo.now >= oneTurn) goattack = true
if (heroInfo.now >= oneTurn) goattack = true
for (let i = 0; i < (flags.qukly ?? 2) / 2; i++) {
let goattack = false
equipInfo.forEach(v => {
if (v.now >= oneTurn) goattack = true
if (goattack) break;
enemyInfo.now += enemyInfo.speed
heroInfo.now += heroInfo.speed
equipInfo.forEach(function (v) {
v.now += v.speed
});
if (enemyInfo.now >= oneTurn) goattack = true
if (heroInfo.now >= oneTurn) goattack = true
if (goattack || attack || onAttack) break;
enemyInfo.now += enemyInfo.speed / Exspeed
heroInfo.now += heroInfo.speed / Exspeed
equipInfo.forEach(function (v) {
v.now += v.speed / Exspeed
});
});
}
}
if (easy) {
core.fillRect(ctx, 64, 52, 288, 212, "rgba(0,0,0,0.5)");
core.strokeRect(ctx, 64, 52, 288, 212, "rgba(255,255,255,0.5)", 4);
@ -20377,7 +20266,7 @@ let time=0
);
core.fillBoldText(
ctx,
flags.qukly ? "正常" : "极速",
"x" + (flags.qukly ?? 2) / 2,
330,
250 + changeY,
"#FFFF60",
@ -20412,7 +20301,6 @@ let time=0
"bold 36px pala"
);
if (!attack && !onAttack && !flags.qukly) enemyInfo.now += enemyInfo.speed;
let enemynow = Math.min(100 + (enemyInfo.now / oneTurn) * 215, 315);
ctx.fillStyle = "#FFFFFF";
ctx.beginPath();
@ -20425,7 +20313,6 @@ let time=0
core.drawLine(ctx, 100, 125 + changeY, 315, 125 + changeY, "#FFFFFF", 5);
equipInfo.forEach(function (v) {
if (!attack && !onAttack) v.now += v.speed;
let vnow = Math.min(100 + (v.now / oneTurn) * 215, 315);
ctx.beginPath();
ctx.moveTo(vnow, 120 + changeY);
@ -20437,7 +20324,6 @@ let time=0
core.drawIcon(ctx, v.id, vnow - 16, 84 + changeY, 32, 32);
});
if (!attack && !onAttack && !flags.qukly) heroInfo.now += hero.speed;
let heronow = Math.min(100 + (heroInfo.now / oneTurn) * 215, 315);
ctx.beginPath();
ctx.moveTo(heronow, 120);
@ -20697,7 +20583,7 @@ let time=0
);
core.fillBoldText(
ctx,
flags.qukly ? "正常" : "极速",
"x" + (flags.qukly ?? 2) / 2,
330,
365 + changeY,
"#FFFF60",
@ -20732,7 +20618,6 @@ let time=0
"bold 36px pala"
);
if (!attack && !onAttack & !flags.qukly) enemyInfo.now += enemyInfo.speed;
let enemynow = Math.min(100 + (enemyInfo.now / oneTurn) * 215, 315);
ctx.fillStyle = "#FFFFFF";
ctx.beginPath();
@ -20745,7 +20630,6 @@ let time=0
core.drawLine(ctx, 100, 125 + changeY, 315, 125 + changeY, "#FFFFFF", 5);
equipInfo.forEach(function (v) {
if (!attack && !onAttack) v.now += v.speed;
let vnow = Math.min(100 + (v.now / oneTurn) * 215, 315);
ctx.beginPath();
ctx.moveTo(vnow, 120 + changeY);
@ -20757,7 +20641,6 @@ let time=0
core.drawIcon(ctx, v.id, vnow - 16, 84 + changeY, 32, 32);
});
if (!attack && !onAttack && !flags.qukly) heroInfo.now += hero.speed;
let heronow = Math.min(100 + (heroInfo.now / oneTurn) * 215, 315);
ctx.beginPath();
ctx.moveTo(heronow, 120 + changeY);
@ -20852,19 +20735,36 @@ let time=0
if (heroDiffList[turn] < 0) heroInfo.inAttack = true;
if (heroInfo.hp < 0) heroInfo.hp = 0;
if (enemyInfo.hp < 0) enemyInfo.hp = 0;
await Promise.all([
await new Promise((resolve) => animationFrame(resolve)).then(() => {
if (heroInfo.isAttack) {
heroInfo.now -= oneTurn;
heroInfo.isAttack = false;
}
if (enemyInfo.isAttack) {
enemyInfo.now -= oneTurn;
enemyInfo.isAttack = false;
}
if (equipanimate.length > 0) {
equipanimate.forEach((v) => {
v.now -= oneTurn;
v.isAttack = false;
});
}
turn++
})
/*await Promise.all([
await new Promise((resolve) => animationFrame(resolve)),
new Promise((resolve) => {
if (heroInfo.isAttack) {
heroInfo.now = 0;
heroInfo.now -= 100;
heroInfo.isAttack = false;
}
resolve();
}),
new Promise((resolve) => {
if (enemyInfo.isAttack) {
enemyInfo.now = 0;
enemyInfo.now -= 100;
enemyInfo.isAttack = false;
}
resolve();
@ -20872,7 +20772,7 @@ let time=0
new Promise((resolve) => {
if (equipanimate.length > 0) {
equipanimate.forEach((v) => {
v.now = 0;
v.now -= 100;
v.isAttack = false;
});
}
@ -20882,7 +20782,7 @@ let time=0
turn++;
resolve();
}),
]);
]);*/
if (heroInfo.hp <= 0 || enemyInfo.hp <= 0) {
core.status.event.id = "";
@ -20894,12 +20794,10 @@ let time=0
}
}
core.registerAnimationFrame("attackAnimate", true, (temptime) => {
core.registerAnimationFrame("attackAnimate", true, () => {
time = temptime;
drawAttackAnimate(
heroInfo,
oneTurn,
enemyInfo,
equipInfo,
farme,
@ -21895,29 +21793,36 @@ let time=0
//临界表
core.ui._drawBookDetail_turnAndCriticals = function (enemy, floorId, texts) {
// 临界表
var criticals = core.enemys.nextCriticals(enemy.id, 8, enemy.x, enemy.y, floorId).map(function (v) {
var criticals = core.enemys.nextCriticals(enemy.id, 5, enemy.x, enemy.y, floorId).map(function (v) {
return core.formatBigNumber(v[0]) + ":" + core.formatBigNumber(v[1]);
});
while (criticals[0] == '0:0') criticals.shift();
texts.push("\r[#FF6A6A]\\d攻击临界表\\d\r[]" + JSON.stringify(criticals));
var criticals_spell = core.nextCriticals_spell(enemy.id, 8, enemy.x, enemy.y, floorId).map(function (v) {
if (criticals.length > 0) {
texts.push("\r[#FF6A6A]\\d攻击临界表\\d\r[]" + JSON.stringify(criticals));
}
var criticals_spell = core.nextCriticals_spell(enemy.id, 5, enemy.x, enemy.y, floorId).map(function (v) {
return core.formatBigNumber(v[0]) + ":" + core.formatBigNumber(v[1]);
});
while (criticals_spell[0] == '0:0') criticals_spell.shift();
texts.push("\r[#FF6A6A]\\d法强临界表\\d\r[]" + JSON.stringify(criticals_spell));
var criticals_speed = core.nextCriticals_speed(enemy.id, 8, enemy.x, enemy.y, floorId).map(function (v) {
if (criticals_spell.length > 0) {
texts.push("\r[#FF6A6A]\\d法强临界表\\d\r[]" + JSON.stringify(criticals_spell));
}
var criticals_speed = core.nextCriticals_speed(enemy.id, 5, enemy.x, enemy.y, floorId).map(function (v) {
return core.formatBigNumber(v[0]) + ":" + core.formatBigNumber(v[1]);
});
while (criticals_speed[0] == '0:0') criticals_speed.shift();
texts.push("\r[#FF6A6A]\\d速度临界表\\d\r[]" + JSON.stringify(criticals_speed));
if (criticals_speed.length > 0) {
texts.push("\r[#FF6A6A]\\d速度临界表\\d\r[]" + JSON.stringify(criticals_speed));
}
}
//攻速临界计算
core.nextCriticals_speed = function (enemy, number, x, y, floorId) {
core.nextCriticals_speed = function (enemy, number, x, y, floorId, config = {}) {
if (typeof enemy == 'string') enemy = core.material.enemys[enemy];
number = number || 1;
var info = core.getDamageInfo(enemy, null, x, y, floorId);
var info = core.getDamageInfo(enemy, config, x, y, floorId);
if (info == null) { // 如果未破防...
return [
['?', '?']
@ -21929,31 +21834,33 @@ let time=0
[0, 0]
];
}
return core.enemys._nextSpeedCriticals_useBinarySearch(enemy, info, number, x, y, floorId);
return core.enemys._nextSpeedCriticals_useBinarySearch(enemy, info, number, x, y, floorId, config);
}
enemys.prototype._nextSpeedCriticals_useBinarySearch = function (enemy, info, number, x, y, floorId) {
enemys.prototype._nextSpeedCriticals_useBinarySearch = function (enemy, info, number, x, y, floorId, config = {}) {
var mon_hp = info.mon_hp,
hero_speed = core.status.hero.speed,
hero_speed = config.speed ?? core.status.hero.speed,
mon_def = info.mon_def,
pre = info.damage;
var list = [];
var start_speed = hero_speed;
var start = core.clone(config)
var mid = core.clone(config)
var end = core.clone(config)
var calNext = function (currSpeed, maxSpeed) {
var start = Math.floor(currSpeed),
end = Math.floor(maxSpeed);
if (start > end) return null;
start.speed = Math.floor(currSpeed)
end.speed = Math.floor(maxSpeed);
if (start.speed > end.speed) return null;
while (start < end) {
var mid = Math.floor((start + end) / 2);
if (mid - start > end - mid) mid--;
var nextInfo = core.enemys.getDamageInfo(enemy, { "speed": mid }, x, y, floorId);
while (start.speed < end.speed) {
mid.speed = Math.floor((start.speed + end.speed) / 2);
if (mid.speed - start.speed > end.speed - mid.speed) mid.speed--;
var nextInfo = core.enemys.getDamageInfo(enemy, mid, x, y, floorId);
if (nextInfo == null || (typeof nextInfo == 'number')) return null;
if (pre > nextInfo.damage) end = mid;
else start = mid + 1;
if (pre > nextInfo.damage) end.speed = mid.speed;
else start.speed = mid.speed + 1;
}
var nextInfo = core.enemys.getDamageInfo(enemy, { "speed": start }, x, y, floorId);
return nextInfo == null || (typeof nextInfo == 'number') || nextInfo.damage >= pre ? null : [start, nextInfo.damage];
var nextInfo = core.enemys.getDamageInfo(enemy, start, x, y, floorId);
return nextInfo == null || (typeof nextInfo == 'number') || nextInfo.damage >= pre ? null : [start.speed, nextInfo.damage];
}
var currSpeed = start_speed;
while (true) {
@ -21969,7 +21876,7 @@ let time=0
return list;
}
//法强临界计算
core.nextCriticals_spell = function (enemy, number, x, y, floorId) {
core.nextCriticals_spell = function (enemy, number, x, y, floorId, config = {}) {
if (typeof enemy == 'string') enemy = core.material.enemys[enemy];
number = number || 1;
@ -21985,32 +21892,34 @@ let time=0
[0, 0]
];
}
return core.enemys._nextSpellCriticals_useBinarySearch(enemy, info, number, x, y, floorId);
return core.enemys._nextSpellCriticals_useBinarySearch(enemy, info, number, x, y, floorId, config);
}
enemys.prototype._nextSpellCriticals_useBinarySearch = function (enemy, info, number, x, y, floorId) {
enemys.prototype._nextSpellCriticals_useBinarySearch = function (enemy, info, number, x, y, floorId, config = {}) {
var mon_hp = info.mon_hp,
hero_spell = core.status.hero.spell,
hero_spell = config.spell ?? core.status.hero.spell,
mon_def = info.mon_def,
turn = info.mon_turn,
pre = info.damage;
var list = [];
var start_spell = hero_spell;
var start = core.clone(config)
var mid = core.clone(config)
var end = core.clone(config)
var calNext = function (currSpell, maxSpell) {
var start = Math.floor(currSpell),
end = Math.floor(maxSpell);
if (start > end) return null;
start.spell = Math.floor(currSpell)
end.spell = Math.floor(maxSpell);
if (start.spell > end.spell) return null;
while (start < end) {
var mid = Math.floor((start + end) / 2);
if (mid - start > end - mid) mid--;
var nextInfo = core.enemys.getDamageInfo(enemy, { "spell": mid }, x, y, floorId);
while (start.spell < end.spell) {
mid.spell = Math.floor((start.spell + end.spell) / 2);
if (mid.spell - start.spell > end.spell - mid.spell) mid.spell--;
var nextInfo = core.enemys.getDamageInfo(enemy, mid, x, y, floorId);
if (nextInfo == null || (typeof nextInfo == 'number')) return null;
if (turn > nextInfo.mon_turn) end = mid;
else start = mid + 1;
if (turn > nextInfo.mon_turn) end.spell = mid.spell;
else start.spell = mid.spell + 1;
}
var nextInfo = core.enemys.getDamageInfo(enemy, { "spell": start }, x, y, floorId);
return nextInfo == null || (typeof nextInfo == 'number') || nextInfo.mon_turn >= turn ? null : [start, nextInfo.damage];
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];
}
var currSpell = start_spell;
while (true) {
@ -22135,6 +22044,14 @@ let time=0
this.tempLeft = this.tempLeft.getContext("2d")
this.tempRight = this.tempRight.getContext("2d")
this.animateObjs = {}
this.atk = 0
this.speed = 0
this.spell = 0
this.def = 0
this.atkStep = 1
this.speedStep = 1
this.spellStep = 1
this.defStep = 1
}
getCurrentEnemys(floorId) {
@ -22218,9 +22135,6 @@ let time=0
}
}
pageinfo() {
}
drawTempLeft(dir) {
core.clearMap(this.tempLeft)
@ -22260,8 +22174,8 @@ let time=0
}
drawTempRight(dir) {
core.clearMap(this.tempRight)
const enemy = this.enemys[this.page + dir]
core.maps.drawThumbnail(this.floorId, null, { ctx: this.tempRight, size: 0.4, x: 10, y: 220 })
const enemy = this.enemys[this.page]
core.maps.drawThumbnail(this.floorId, null, { ctx: this.tempRight, size: 0.4, x: 10, y: 220, noEnabled: true })
enemy.locs.forEach(v => {
this.tempRight.beginPath()
this.tempRight.moveTo(10 + (32 * v[0] + 16) * 0.4, 220 + 32 * v[1] * 0.4)
@ -22272,11 +22186,108 @@ let time=0
this.tempRight.fill()
})
core.setTextAlign(this.tempRight, 'left')
core.fillText(this.tempRight, "出手 " + (core.getDamageInfo(enemy, null) ? core.getDamageInfo(enemy, null).hero_turn : '???'), 30, 50, "#000000", core.ui._buildFont(12, true))
core.fillText(this.tempRight, "受击 " + (core.getDamageInfo(enemy, null) ? core.getDamageInfo(enemy, null).mon_turn : '???'), 130, 50, "#000000", core.ui._buildFont(12, true))
core.fillText(this.tempRight, enemy.damage === "???" ? "你会死的哦~杂鱼❤~" : enemy.damage, 230, 50, "#FF0000", core.ui._buildFont(12, true))
let getDamageInfo = core.getDamageInfo(enemy, null)
core.fillText(this.tempRight, "出手次数 " + (getDamageInfo ? getDamageInfo.hero_turn : '???'), 30, 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",
damage = enemy.damage
if (damage == '???') {
damage = '你会死的哦~杂鱼❤~';
color = '#FF2222';
} else {
if (damage >= core.status.hero.hp) color = '#FF2222';
else if (damage >= core.status.hero.hp * 2 / 3) color = '#FF9933';
else if (damage <= 0) color = '#11FF11';
damage = core.formatBigNumber(damage);
}
if (enemy.notBomb) damage += "[b]";
core.fillText(this.tempRight, damage, 230, 50, color, 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.criticalSpell[0], 210, 70, "#000000", core.ui._buildFont(12, true))
core.fillText(this.tempRight, "减伤 " + enemy.criticalAtk[1], 30, 90, "#000000", core.ui._buildFont(12, true))
core.fillText(this.tempRight, "减伤 " + enemy.criticalSpeed[1], 120, 90, "#000000", core.ui._buildFont(12, true))
core.fillText(this.tempRight, '减伤 ' + enemy.criticalSpell[1], 210, 90, "#000000", core.ui._buildFont(12, true))
if (this.atk > 0 || this.def > 0 || this.speed > 0 || this.spell > 0) {
core.setTextAlign(this.tempRight, 'center');
core.fillText(this.tempRight, "增幅战斗情况", 150, 110, "#000000", core.ui._buildFont(16, true))
core.setTextAlign(this.tempRight, 'left');
const config = { atk: core.getRealStatus("atk") + this.atk, def: core.getRealStatus("def") + this.def, spell: core.getRealStatus("spell") + this.spell, speed: core.getRealStatus("speed") + this.speed }
getDamageInfo = core.getDamageInfo(enemy, config)
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))
color = "#FFFF00"
damage = getDamageInfo.damage
if (damage == '???') {
damage = '你会死的哦~杂鱼❤~';
color = '#FF2222';
} else {
if (damage >= core.status.hero.hp) color = '#FF2222';
else if (damage >= core.status.hero.hp * 2 / 3) color = '#FF9933';
else if (damage <= 0) color = '#11FF11';
damage = core.formatBigNumber(damage);
}
if (enemy.notBomb) damage += "[b]";
core.fillText(this.tempRight, damage, 230, 130, color, core.ui._buildFont(12, true))
let atk = core.nextCriticals(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)
core.fillText(this.tempRight, "攻击临界 " + atk[0][0], 30, 150, "#000000", core.ui._buildFont(12, true))
core.fillText(this.tempRight, "速度临界 " + speed[0][0], 120, 150, "#000000", core.ui._buildFont(12, true))
core.fillText(this.tempRight, '法强临界 ' + spell[0][0], 210, 150, "#000000", core.ui._buildFont(12, true))
core.fillText(this.tempRight, "减伤 " + atk[0][1], 30, 170, "#000000", core.ui._buildFont(12, true))
core.fillText(this.tempRight, "减伤 " + speed[0][1], 120, 170, "#000000", core.ui._buildFont(12, true))
core.fillText(this.tempRight, '减伤 ' + spell[0][1], 210, 170, "#000000", core.ui._buildFont(12, true))
} else {
core.setTextAlign(this.tempRight, 'center');
core.fillText(this.tempRight, "临界表", 150, 110, "#000000", core.ui._buildFont(16, true))
let texts = []
core.ui._drawBookDetail_turnAndCriticals(enemy, this.floorId, texts)
core.drawTextContent(this.tempRight, texts.join('\n'), {
left: 30,
top: 115,
maxWidth: 240,
fontSize: 10,
lineHeight: 12,
color: "#000000"
});
}
core.setTextAlign(this.tempRight, 'left')
core.fillText(this.tempRight, "攻 " + core.formatBigNumber(this.atk), 30, 210, "#000000", core.ui._buildFont(12, true))
core.fillText(this.tempRight, "防 " + core.formatBigNumber(this.def), 90, 210, "#000000", core.ui._buildFont(12, true))
core.fillText(this.tempRight, "法 " + core.formatBigNumber(this.spell), 150, 210, "#000000", core.ui._buildFont(12, true))
core.fillText(this.tempRight, "速 " + core.formatBigNumber(this.speed), 210, 210, "#000000", core.ui._buildFont(12, true))
core.fillText(this.tempRight, "攻", 180, 260, "#000000", core.ui._buildFont(12, true))
core.fillText(this.tempRight, "防", 180, 290, "#000000", core.ui._buildFont(12, true))
core.fillText(this.tempRight, "法", 180, 320, "#000000", core.ui._buildFont(12, true))
core.fillText(this.tempRight, "速", 180, 350, "#000000", core.ui._buildFont(12, true))
core.fillText(this.tempRight, "-", 200, 262, "#000000", core.ui._buildFont(24, true))
core.fillText(this.tempRight, "-", 200, 292, "#000000", core.ui._buildFont(24, true))
core.fillText(this.tempRight, "-", 200, 322, "#000000", core.ui._buildFont(24, true))
core.fillText(this.tempRight, "-", 200, 352, "#000000", core.ui._buildFont(24, true))
core.setTextAlign(this.tempRight, 'center');
core.fillText(this.tempRight, "当前战斗情况", 150, 25, "#000000", core.ui._buildFont(16, true))
core.fillText(this.tempRight, core.formatBigNumber(this.atkStep), 230, 260, "#000000", core.ui._buildFont(12, true))
core.fillText(this.tempRight, core.formatBigNumber(this.defStep), 230, 290, "#000000", core.ui._buildFont(12, true))
core.fillText(this.tempRight, core.formatBigNumber(this.spellStep), 230, 320, "#000000", core.ui._buildFont(12, true))
core.fillText(this.tempRight, core.formatBigNumber(this.speedStep), 230, 350, "#000000", core.ui._buildFont(12, true))
core.setTextAlign(this.tempRight, 'left');
core.fillText(this.tempRight, "+", 250, 263, "#000000", core.ui._buildFont(24, true))
core.fillText(this.tempRight, "+", 250, 293, "#000000", core.ui._buildFont(24, true))
core.fillText(this.tempRight, "+", 250, 323, "#000000", core.ui._buildFont(24, true))
core.fillText(this.tempRight, "+", 250, 353, "#000000", core.ui._buildFont(24, true))
core.fillText(this.tempRight, "↑", 265, 265, "#000000", core.ui._buildFont(24, true))
core.fillText(this.tempRight, "↑", 265, 295, "#000000", core.ui._buildFont(24, true))
core.fillText(this.tempRight, "↑", 265, 325, "#000000", core.ui._buildFont(24, true))
core.fillText(this.tempRight, "↑", 265, 355, "#000000", core.ui._buildFont(24, true))
core.fillText(this.tempRight, "清零", 180, 380, '#000000', core.ui._buildFont(16, true));
core.setTextAlign(this.tempRight, 'center');
core.fillText(this.tempRight, "当前战斗情况", 150, 30, "#000000", core.ui._buildFont(16, true))
core.fillText(this.tempRight, "模拟属性提升", 150, 190, "#000000", core.ui._buildFont(16, true))
core.fillText(this.tempRight, "模拟属性调整", 230, 233, "#000000", core.ui._buildFont(16, true))
core.fillText(this.tempRight, "合上书本", 254, 380, '#000000', core.ui._buildFont(16, true));
}
drawLeft() {
@ -22308,9 +22319,9 @@ let time=0
core.drawTextContent(this.left, hints.join('\n'), {
left: 30,
top: 240,
maxWidth: 220,
fontSize: 14,
lineHeight: 20,
maxWidth: 240,
fontSize: 12,
lineHeight: 16,
color: "#000000"
});
@ -22318,7 +22329,7 @@ let time=0
drawRight() {
core.clearMap(this.right)
const enemy = this.enemys[this.page]
core.maps.drawThumbnail(this.floorId, null, { ctx: this.right, size: 0.4, x: 10, y: 220 })
core.maps.drawThumbnail(this.floorId, null, { ctx: this.right, size: 0.4, x: 10, y: 220, noEnabled: true })
enemy.locs.forEach(v => {
this.right.beginPath()
this.right.moveTo(10 + (32 * v[0] + 16) * 0.4, 220 + 32 * v[1] * 0.4)
@ -22329,12 +22340,110 @@ let time=0
this.right.fill()
})
core.setTextAlign(this.right, 'left')
core.fillText(this.right, "出手 " + (core.getDamageInfo(enemy, null) ? core.getDamageInfo(enemy, null).hero_turn : '???'), 30, 50, "#000000", core.ui._buildFont(12, true))
core.fillText(this.right, "受击 " + (core.getDamageInfo(enemy, null) ? core.getDamageInfo(enemy, null).mon_turn : '???'), 130, 50, "#000000", core.ui._buildFont(12, true))
core.fillText(this.right, enemy.damage === "???" ? "你会死的哦~杂鱼❤~" : enemy.damage, 230, 50, "#FF0000", core.ui._buildFont(12, true))
let getDamageInfo = core.getDamageInfo(enemy, null)
core.fillText(this.right, "出手次数 " + (getDamageInfo ? getDamageInfo.hero_turn : '???'), 30, 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",
damage = enemy.damage
if (damage == '???') {
damage = '你会死的哦~杂鱼❤~';
color = '#FF2222';
} else {
if (damage >= core.status.hero.hp) color = '#FF2222';
else if (damage >= core.status.hero.hp * 2 / 3) color = '#FF9933';
else if (damage <= 0) color = '#11FF11';
damage = core.formatBigNumber(damage);
}
if (enemy.notBomb) damage += "[b]";
core.fillText(this.right, damage, 230, 50, color, 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.criticalSpell[0], 210, 70, "#000000", core.ui._buildFont(12, true))
core.fillText(this.right, "减伤 " + enemy.criticalAtk[1], 30, 90, "#000000", core.ui._buildFont(12, true))
core.fillText(this.right, "减伤 " + enemy.criticalSpeed[1], 120, 90, "#000000", core.ui._buildFont(12, true))
core.fillText(this.right, '减伤 ' + enemy.criticalSpell[1], 210, 90, "#000000", core.ui._buildFont(12, true))
if (this.atk > 0 || this.def > 0 || this.speed > 0 || this.spell > 0) {
core.setTextAlign(this.right, 'center');
core.fillText(this.right, "增幅战斗情况", 150, 110, "#000000", core.ui._buildFont(16, true))
core.setTextAlign(this.right, 'left');
const config = { atk: core.getRealStatus("atk") + this.atk, def: core.getRealStatus("def") + this.def, spell: core.getRealStatus("spell") + this.spell, speed: core.getRealStatus("speed") + this.speed }
getDamageInfo = core.getDamageInfo(enemy, config)
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))
color = "#FFFF00"
damage = getDamageInfo.damage
if (damage == '???') {
damage = '你会死的哦~杂鱼❤~';
color = '#FF2222';
} else {
if (damage >= core.status.hero.hp) color = '#FF2222';
else if (damage >= core.status.hero.hp * 2 / 3) color = '#FF9933';
else if (damage <= 0) color = '#11FF11';
damage = core.formatBigNumber(damage);
}
if (enemy.notBomb) damage += "[b]";
core.fillText(this.right, damage, 230, 130, color, core.ui._buildFont(12, true))
let atk = core.nextCriticals(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)
core.fillText(this.right, "攻击临界 " + atk[0][0], 30, 150, "#000000", core.ui._buildFont(12, true))
core.fillText(this.right, "速度临界 " + speed[0][0], 120, 150, "#000000", core.ui._buildFont(12, true))
core.fillText(this.right, '法强临界 ' + spell[0][0], 210, 150, "#000000", core.ui._buildFont(12, true))
core.fillText(this.right, "减伤 " + atk[0][1], 30, 170, "#000000", core.ui._buildFont(12, true))
core.fillText(this.right, "减伤 " + speed[0][1], 120, 170, "#000000", core.ui._buildFont(12, true))
core.fillText(this.right, '减伤 ' + spell[0][1], 210, 170, "#000000", core.ui._buildFont(12, true))
} else {
core.setTextAlign(this.right, 'center');
core.fillText(this.right, "临界表", 150, 110, "#000000", core.ui._buildFont(16, true))
let texts = []
core.ui._drawBookDetail_turnAndCriticals(enemy, this.floorId, texts)
core.drawTextContent(this.right, texts.join('\n'), {
left: 30,
top: 115,
maxWidth: 240,
fontSize: 10,
lineHeight: 12,
color: "#000000"
});
}
core.setTextAlign(this.right, 'left')
core.fillText(this.right, "攻 " + core.formatBigNumber(this.atk), 30, 210, "#000000", core.ui._buildFont(12, true))
core.fillText(this.right, "防 " + core.formatBigNumber(this.def), 90, 210, "#000000", core.ui._buildFont(12, true))
core.fillText(this.right, "法 " + core.formatBigNumber(this.spell), 150, 210, "#000000", core.ui._buildFont(12, true))
core.fillText(this.right, "速 " + core.formatBigNumber(this.speed), 210, 210, "#000000", core.ui._buildFont(12, true))
core.fillText(this.right, "攻", 180, 260, "#000000", core.ui._buildFont(12, true))
core.fillText(this.right, "防", 180, 290, "#000000", core.ui._buildFont(12, true))
core.fillText(this.right, "法", 180, 320, "#000000", core.ui._buildFont(12, true))
core.fillText(this.right, "速", 180, 350, "#000000", core.ui._buildFont(12, true))
core.fillText(this.right, "-", 200, 262, "#000000", core.ui._buildFont(24, true))
core.fillText(this.right, "-", 200, 292, "#000000", core.ui._buildFont(24, true))
core.fillText(this.right, "-", 200, 322, "#000000", core.ui._buildFont(24, true))
core.fillText(this.right, "-", 200, 352, "#000000", core.ui._buildFont(24, true))
core.setTextAlign(this.right, 'center');
core.fillText(this.right, "当前战斗情况", 150, 25, "#000000", core.ui._buildFont(16, true))
core.fillText(this.right, core.formatBigNumber(this.atkStep), 230, 260, "#000000", core.ui._buildFont(12, true))
core.fillText(this.right, core.formatBigNumber(this.defStep), 230, 290, "#000000", core.ui._buildFont(12, true))
core.fillText(this.right, core.formatBigNumber(this.spellStep), 230, 320, "#000000", core.ui._buildFont(12, true))
core.fillText(this.right, core.formatBigNumber(this.speedStep), 230, 350, "#000000", core.ui._buildFont(12, true))
core.setTextAlign(this.right, 'left');
core.fillText(this.right, "+", 250, 263, "#000000", core.ui._buildFont(24, true))
core.fillText(this.right, "+", 250, 293, "#000000", core.ui._buildFont(24, true))
core.fillText(this.right, "+", 250, 323, "#000000", core.ui._buildFont(24, true))
core.fillText(this.right, "+", 250, 353, "#000000", core.ui._buildFont(24, true))
core.fillText(this.right, "↑", 265, 265, "#000000", core.ui._buildFont(24, true))
core.fillText(this.right, "↑", 265, 295, "#000000", core.ui._buildFont(24, true))
core.fillText(this.right, "↑", 265, 325, "#000000", core.ui._buildFont(24, true))
core.fillText(this.right, "↑", 265, 355, "#000000", core.ui._buildFont(24, true))
core.fillText(this.right, "清零", 180, 380, '#000000', core.ui._buildFont(16, true));
core.setTextAlign(this.right, 'center');
core.fillText(this.right, "当前战斗情况", 150, 30, "#000000", core.ui._buildFont(16, true))
core.fillText(this.right, "模拟属性提升", 150, 190, "#000000", core.ui._buildFont(16, true))
core.fillText(this.right, "模拟属性调整", 230, 233, "#000000", core.ui._buildFont(16, true))
core.fillText(this.right, "合上书本", 254, 380, '#000000', core.ui._buildFont(16, true));
}
clear() {
@ -22344,7 +22453,12 @@ let time=0
core.clearMap(this.tempLeft)
core.clearMap(this.tempRight)
}
clearEx() {
this.atk = 0
this.speed = 0
this.spell = 0
this.def = 0
}
init(floorId) {
this.page = 0
this.getCurrentEnemys(floorId)
@ -22386,16 +22500,118 @@ let time=0
const leftbox = makeBox([(676 - this.width * 2) / 2, (416 - this.height) / 2], [this.width, this.height])
const rightbox = makeBox([338, (416 - this.height) / 2], [this.width, this.height])
const exitbox = makeBox([555, 365], [70, 35])
const atkupbox = makeBox([581, 251], [25, 25])
const atkdownbox = makeBox([531, 251], [25, 25])
const atkchangebox = makeBox([606, 251], [25, 25])
const defupbox = makeBox([581, 281], [25, 25])
const defdownbox = makeBox([531, 281], [25, 25])
const defchangebox = makeBox([606, 281], [25, 25])
const spellupbox = makeBox([581, 311], [25, 25])
const spelldownbox = makeBox([531, 311], [25, 25])
const spellchangebox = makeBox([606, 311], [25, 25])
const speedupbox = makeBox([581, 341], [25, 25])
const speeddownbox = makeBox([531, 341], [25, 25])
const speedchangebox = makeBox([606, 341], [25, 25])
const zerochangebox = makeBox([515, 365], [35, 35])
if (this.isAnimate) return
if (inRect(pos, exitbox)) {
if (inRect(pos, atkupbox)) {
bookInfo.atk += bookInfo.atkStep
bookInfo.drawRight()
this.update()
} else if (inRect(pos, atkdownbox)) {
bookInfo.atk -= bookInfo.atkStep
if (bookInfo.atk < 0) bookInfo.atk = 0
bookInfo.drawRight()
this.update()
} else if (inRect(pos, atkchangebox)) {
core.myprompt("请输入攻击调整步距(只可输入数字)", null, (value) => {
if (value && !Number.isNaN(Number(value)) && Number(value) >= 1) {
bookInfo.atkStep = Number(value)
bookInfo.drawRight()
this.update()
} else if (value) {
alert("无效的输入!");
} else if (value === "") {
}
});
} else if (inRect(pos, defupbox)) {
bookInfo.def += bookInfo.defStep
bookInfo.drawRight()
this.update()
} else if (inRect(pos, defdownbox)) {
bookInfo.def -= bookInfo.defStep
if (bookInfo.def < 0) bookInfo.def = 0
bookInfo.drawRight()
this.update()
} else if (inRect(pos, defchangebox)) {
core.myprompt("请输入防御调整步距(只可输入数字)", null, (value) => {
if (value && !Number.isNaN(Number(value)) && Number(value) >= 1) {
bookInfo.defStep = Number(value)
bookInfo.drawRight()
this.update()
} else if (value) {
alert("无效的输入!");
} else if (value === "") {
}
});
} else if (inRect(pos, spellupbox)) {
bookInfo.spell += bookInfo.spellStep
bookInfo.drawRight()
this.update()
} else if (inRect(pos, spelldownbox)) {
bookInfo.spell -= bookInfo.spellStep
if (bookInfo.spell < 0) bookInfo.spell = 0
bookInfo.drawRight()
this.update()
} else if (inRect(pos, spellchangebox)) {
core.myprompt("请输入法强调整步距(只可输入数字)", null, (value) => {
if (value && !Number.isNaN(Number(value)) && Number(value) >= 1) {
bookInfo.spellStep = Number(value)
bookInfo.drawRight()
this.update()
} else if (value) {
alert("无效的输入!");
} else if (value === "") {
}
});
} else if (inRect(pos, speedupbox)) {
bookInfo.speed += bookInfo.speedStep
bookInfo.drawRight()
this.update()
} else if (inRect(pos, speeddownbox)) {
bookInfo.speed -= bookInfo.speedStep
if (bookInfo.speed < 0) bookInfo.speed = 0
bookInfo.drawRight()
this.update()
} else if (inRect(pos, speedchangebox)) {
core.myprompt("请输入速度调整步距(只可输入数字)", null, (value) => {
if (value && !Number.isNaN(Number(value)) && Number(value) >= 1) {
bookInfo.speedStep = Number(value)
bookInfo.drawRight()
this.update()
} else if (value) {
alert("无效的输入!");
} else if (value === "") {
}
});
} else if (inRect(pos, zerochangebox)) {
bookInfo.clearEx()
bookInfo.drawRight()
this.update()
} else 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();
core.book.close()
return;
} else if (inRect(pos, leftbox)) {