战斗动画

This commit is contained in:
草莓 2025-03-02 20:18:12 +08:00
parent c0617ac80f
commit 77ca6530cc
2 changed files with 2772 additions and 2455 deletions

View File

@ -284,10 +284,11 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
},
"afterBattle": function (enemyId, x, y) {
// 战斗结束后触发的事件
var enemy = core.material.enemys[enemyId];
// 获得战斗伤害信息
var damageInfo = core.getDamageInfo(enemyId, null, x, y) || {};
var enemy = damageInfo.enemyInfo;
var special = enemy.special;
console.log(enemy)
// 播放战斗音效和动画
// 默认播放的动画;你也可以使用
var animate = "hand"; // 默认动画
@ -306,8 +307,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
if (x != null && y != null) core.drawAnimate(animate, x, y);
else core.drawHeroAnimate(animate);
// 获得战斗伤害信息
var damageInfo = core.getDamageInfo(enemyId, null, x, y) || {};
// 战斗伤害
var damage = damageInfo.damage;
// 当前战斗回合数,可用于战后所需的判定
@ -757,7 +757,8 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
hero_def = core.getRealStatusOrDefault(hero, "def"),
hero_mdef = core.getRealStatusOrDefault(hero, "mdef"),
hero_speed = core.getRealStatusOrDefault(hero, "speed");
var mon_id = core.getEnemyValue(enemy, "id", x, y, floorId),
mon_name = core.getEnemyValue(enemy, "name", x, y, floorId);
var mon_hp = core.getEnemyValue(enemy, "hp", x, y, floorId),
mon_atk = core.getEnemyValue(enemy, "atk", x, y, floorId),
mon_def = core.getEnemyValue(enemy, "def", x, y, floorId),
@ -877,6 +878,8 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
// 也可以按需增加各种自定义内容
return {
id: mon_id,
name: mon_name,
hp: Math.floor(mon_hp),
atk: Math.floor(mon_atk),
def: Math.floor(mon_def),
@ -1135,6 +1138,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
turn: Math.floor(hero_turn),
mon_turn: Math.floor(mon_turn),
damage: Math.floor(damage),
enemyInfo: enemyInfo
};
/*TODO:return
1. 显示怪物是魔攻还是物攻在怪物名字上做颜色变化物攻是黄色魔攻是蓝色

File diff suppressed because it is too large Load Diff