半波损失更新,小芒记得改剧情

This commit is contained in:
草莓 2025-06-03 20:52:58 +08:00
parent d9b257e5fa
commit 56cf1723a8
3 changed files with 27 additions and 34 deletions

View File

@ -26,30 +26,6 @@ main.floors.jiuguan=
], ],
"direction": "down" "direction": "down"
} }
],
"4,10": [
{
"type": "over",
"text": "这段话将在屏幕中心",
"image": "bg_5043.png",
"memory": false,
"time": 3000,
"hidetime": 30,
"sound": "",
"textColor": [
255,
255,
255,
1
],
"boldColor": [
0,
0,
0,
1
],
"font": "bold 48px Verdana"
}
] ]
}, },
"changeFloor": {}, "changeFloor": {},

View File

@ -316,6 +316,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
} }
// 获得战斗伤害信息 // 获得战斗伤害信息
var damageInfo = core.getDamageInfo(enemyId, null, x, y) || {}; var damageInfo = core.getDamageInfo(enemyId, null, x, y) || {};
if ((!core.getFlag("noAnimate") || damageInfo.damage >= core.status.hero.hp) && (!main.replayChecking && !core.isReplaying())) await core.attackAnimate( if ((!core.getFlag("noAnimate") || damageInfo.damage >= core.status.hero.hp) && (!main.replayChecking && !core.isReplaying())) await core.attackAnimate(
enemyId, enemyId,
damageInfo.start[0], damageInfo.start[0],
@ -1032,7 +1033,6 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
} }
} }
//需要变更 //需要变更
const onegcd = gcd(...oneTurn) //最大公约数 const onegcd = gcd(...oneTurn) //最大公约数
oneTurn = lcm(...oneTurn) //单次回合长度 oneTurn = lcm(...oneTurn) //单次回合长度
//在这里处理equip的初始位置now //在这里处理equip的初始位置now
@ -1055,6 +1055,17 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
enemyinfo.now = 0 enemyinfo.now = 0
heroinfo.now = oneTurn / 2 heroinfo.now = oneTurn / 2
} }
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 < 15) {
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] //记录开始战斗时的属性并转发 const start = [core.clone(heroinfo), core.clone(enemyinfo), core.clone(equipInfo), oneTurn] //记录开始战斗时的属性并转发
//---第三部分:递归开始--- //---第三部分:递归开始---

View File

@ -2896,8 +2896,8 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
if (!core.status.floorId || timestamp - now < 50) return if (!core.status.floorId || timestamp - now < 50) return
now = timestamp; now = timestamp;
globalAlphafloor += globalAlphafloorStatus; globalAlphafloor += globalAlphafloorStatus;
if (globalAlphafloor === 100) globalAlphafloorStatus = -2; if (globalAlphafloor === 100) globalAlphafloorStatus = -4;
if (globalAlphafloor === 0) globalAlphafloorStatus = 2; if (globalAlphafloor === 0) globalAlphafloorStatus = 4;
if (core.domStyle.isVertical) { if (core.domStyle.isVertical) {
core.clearMap( core.clearMap(
@ -3083,8 +3083,8 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.drawImage( core.drawImage(
uictx, uictx,
"green.webp", "green.webp",
MAP_BLOCK_LEFT_VERTICAL + 42, MAP_BLOCK_LEFT_VERTICAL + 44,
MAP_BLOCK_TOP_VERTICAL + 57 MAP_BLOCK_TOP_VERTICAL + 57, 20, 20
); );
uictx.globalAlpha = 1; uictx.globalAlpha = 1;
} else { } else {
@ -3095,7 +3095,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
uictx, uictx,
"green.webp", "green.webp",
MAP_BLOCK_LEFT + 50, MAP_BLOCK_LEFT + 50,
MAP_BLOCK_TOP + 57 MAP_BLOCK_TOP + 60, 20, 20
); );
uictx.globalAlpha = 1; uictx.globalAlpha = 1;
} }
@ -20061,13 +20061,13 @@ let time=0
"回合战斗动画": function () { "回合战斗动画": function () {
// 在此增加新插件 // 在此增加新插件
const ctx = core.createCanvas("animateAttack", 0, 0, 416, 416, 80)
const changeY = -30 const changeY = -30
let easy = false; let easy = false;
const { imagelighter } = core.plugin.utils; const { imagelighter } = core.plugin.utils;
const { lcm, gcd } = core.plugin.utils; const { lcm, gcd } = core.plugin.utils;
const anctx = core.createCanvas("animate2", 0, 0, 416, 416, 91)
let a = [] let a = []
function drawAnimate(name, centerX, centerY) { function drawAnimate(name, centerX, centerY) {
@ -20100,6 +20100,8 @@ let time=0
function animationFrame(callback1) { function animationFrame(callback1) {
let time = 0 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) { core.registerAnimationFrame("animate2", true, function (timestamp) {
if ( if (
timestamp - core.animateFrame.animate2Time < 50 || timestamp - core.animateFrame.animate2Time < 50 ||
@ -20174,6 +20176,9 @@ let time=0
heroanimateList, heroanimateList,
enemyanimateList enemyanimateList
) { ) {
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)
//参数分别为怪物id、真实属性战斗信息特殊装备如火焰风衣属性特殊装备属性为以元组{equipId,oneDamage,speed,now:0}构成的数组(列出每个需要计算的特殊装备,没有则为空数组或不填) //参数分别为怪物id、真实属性战斗信息特殊装备如火焰风衣属性特殊装备属性为以元组{equipId,oneDamage,speed,now:0}构成的数组(列出每个需要计算的特殊装备,没有则为空数组或不填)
core.lockControl(); core.lockControl();
core.clearMap(ctx); core.clearMap(ctx);
@ -20262,6 +20267,8 @@ let time=0
equipInfo.forEach(function (v) { equipInfo.forEach(function (v) {
if (v.onAttack) onAttack = true; if (v.onAttack) onAttack = true;
}); });
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.clearMap(ctx); core.clearMap(ctx);
let animate = Math.floor(farme / 15); let animate = Math.floor(farme / 15);
@ -20926,8 +20933,7 @@ let time=0
} }
core.registerAnimationFrame("attackAnimate", true, (temptime) => { core.registerAnimationFrame("attackAnimate", true, (temptime) => {
if (!time) time = temptime
if (temptime - time < 50) return
time = temptime; time = temptime;
drawAttackAnimate( drawAttackAnimate(
heroInfo, heroInfo,