战斗动画修复!!!

This commit is contained in:
草莓 2025-03-11 22:30:53 +08:00
parent 171f0b5d1f
commit a77c7bf184
7 changed files with 680 additions and 505 deletions

View File

@ -460,6 +460,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
"r.webp",
"sound.webp",
"status.webp",
"statusBackground.webp",
"suiji.webp",
"tati_020101.webp",
"tati_020101a.webp",
@ -1521,7 +1522,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
"title": "秽翼的尤斯蒂娅",
"name": "Eustia",
"version": "鸽子窝造塔小队",
"floorId": "guangchang",
"floorId": "jiaocheng01",
"hero": {
"image": "hero.webp",
"animate": false,
@ -1531,10 +1532,10 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
"hp": 1000,
"manamax": -1,
"mana": 0,
"atk": 10,
"def": 10,
"atk": 30,
"def": 20,
"mdef": 100,
"speed": 10,
"speed": 20,
"money": 0,
"exp": 0,
"equipment": [],
@ -1546,7 +1547,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
"loc": {
"direction": "up",
"x": 6,
"y": 10
"y": 12
},
"flags": {
"itemDetail": true,
@ -1557,9 +1558,9 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
"followers": [],
"steps": 0,
"matk": 0,
"spell": 0,
"spell": 10,
"spelldef": 0,
"mhp": 0
"mhp": 100
},
"startCanvas": [
{
@ -1915,22 +1916,28 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
],
"startText": [
{
"type": "setText"
},
{
"type": "setHeroOpacity",
"opacity": 0
},
{
"type": "setCurtain",
"color": [
0,
0,
0,
1
],
"time": 500,
"keep": true
"type": "if",
"condition": "false",
"true": [
{
"type": "setText"
},
{
"type": "setHeroOpacity",
"opacity": 0
},
{
"type": "setCurtain",
"color": [
0,
0,
0,
1
],
"time": 500,
"keep": true
}
]
},
{
"type": "function",
@ -1945,8 +1952,14 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
"name": "强制横屏"
},
{
"type": "insert",
"name": "chapter0"
"type": "if",
"condition": "false",
"true": [
{
"type": "insert",
"name": "chapter0"
}
]
}
],
"shops": [
@ -2121,7 +2134,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
"redPotion": 100,
"bluePotion": 250,
"yellowPotion": 500,
"greenPotion": 800,
"greenPotion": 900,
"breakArmor": 0.9,
"counterAttack": 0.1,
"purify": 3,
@ -2129,7 +2142,8 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
"animateSpeed": 300,
"moveSpeed": 100,
"statusCanvasRowsOnMobile": 3,
"floorChangeTime": 500
"floorChangeTime": 500,
"yellowGem": 2
},
"flags": {
"statusBarItems": [

View File

@ -22,7 +22,15 @@ main.floors.jiaocheng01=
"血瓶介绍:不同大小"
]
},
"changeFloor": {},
"changeFloor": {
"6,0": {
"floorId": "jiaocheng02",
"loc": [
6,
12
]
}
},
"beforeBattle": {},
"afterBattle": {},
"afterGetItem": {},

View File

@ -25,7 +25,15 @@ main.floors.jiaocheng02=
"法杖魔攻比例10%魔防比例0%"
]
},
"changeFloor": {},
"changeFloor": {
"6,12": {
"floorId": "jiaocheng01",
"loc": [
6,
0
]
}
},
"beforeBattle": {},
"afterBattle": {},
"afterGetItem": {},

View File

@ -308,14 +308,12 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
}
// 获得战斗伤害信息
var damageInfo = core.getDamageInfo(enemyId, null, x, y) || {};
if (!core.getFlag("noAnimate")) await core.attackAnimate(
enemyId,
damageInfo.start[0],
damageInfo.start[1],
damageInfo.start[2],
damageInfo.start[3],
damageInfo.start[4],
damageInfo.heroDiffList,
damageInfo.enemyDiffList,
damageInfo.heroanimateList,
@ -792,7 +790,6 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
}
var guards = [];
// 光环和支援检查
if (!core.status.checkBlock) core.status.checkBlock = {};
@ -1047,7 +1044,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
enemyinfo.now = oneTurn
enemyinfo.onAttack = true
}
const start = [core.clone(heroinfo), core.clone(enemyinfo), core.clone(equipInfo), oneTurn, onegcd] //记录开始战斗时的属性并转发
const start = [core.clone(heroinfo), core.clone(enemyinfo), core.clone(equipInfo), oneTurn] //记录开始战斗时的属性并转发
//---第三部分:递归开始---
const heroDiffList = [],
@ -1064,7 +1061,6 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
enemy_diff = {},
hero_animate = [],
enemy_animate = [];
if (enemyinfo.onAttack) { //怪物先攻的场合
//这里计算怪物攻击时发生的各种变化同时计入enemy_diff
let mon_damage = 0
@ -1097,6 +1093,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
enemyinfo.onAttack = false
enemyinfo.now = 0
onattack = true
}
equipInfo.forEach(v => {
if (v.onAttack) {
@ -1204,25 +1201,26 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
}
})
if (onattack) {
//处理完毕后的数据处理
heroDiffList.push(hero_diff)
enemyDiffList.push(enemy_diff)
heroanimateList.push(hero_animate)
enemyanimateList.push(enemy_animate)
//处理属性变化
for (let v in hero_diff) {
heroinfo[v] += hero_diff[v]
}
for (let v in enemy_diff) {
enemyinfo[v] += enemy_diff[v]
}
//处理完毕后的数据处理
heroDiffList.push(hero_diff)
enemyDiffList.push(enemy_diff)
heroanimateList.push(hero_animate)
enemyanimateList.push(enemy_animate)
//处理属性变化
for (let v in hero_diff) {
heroinfo[v] += hero_diff[v]
}
for (let v in enemy_diff) {
enemyinfo[v] += enemy_diff[v]
}
//出手50回合怪物生命未降低直接判负避免死循环
if (hero_turn === 50) {
//出手50回合怪物生命未降低直接判负避免死循环
if (hero_turn === 50) {
if (enemyinfo.hp >= beforehp) {
return null
if (enemyinfo.hp >= beforehp) {
return null
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

@ -37,7 +37,7 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"canUseItemEffect": "true"
},
"greenGem": {
"cls": "tools",
"cls": "items",
"name": "绿宝石",
"text": ",法强+${core.values.greenGem}",
"itemEffect": "core.status.hero.spell += core.values.greenGem * core.status.thisMap.ratio",
@ -92,7 +92,7 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"canUseItemEffect": "true"
},
"sword0": {
"cls": "items",
"cls": "equips",
"name": "破旧的剑",
"text": "一把已经生锈的剑",
"equip": {
@ -103,7 +103,8 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
}
},
"itemEffect": "core.status.hero.atk += 0",
"itemEffectTip": ",攻击+0"
"itemEffectTip": ",攻击+0",
"equipCls": "匕首"
},
"sword1": {
"cls": "equips",
@ -557,9 +558,15 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"canUseItemEffect": "true"
},
"I375": {
"cls": "items",
"cls": "equips",
"name": "新物品",
"canUseItemEffect": "true"
"canUseItemEffect": "true",
"equipCls": "法杖",
"equip": {
"type": 0,
"value": {},
"percentage": {}
}
},
"I396": {
"cls": "items",

File diff suppressed because it is too large Load Diff