Merge pull request #229 from ckcz123/v2.0

AfterBattle Animate
This commit is contained in:
Zhang Chen 2018-09-28 10:47:22 +08:00 committed by GitHub
commit 97998f30b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 12 deletions

View File

@ -1137,18 +1137,6 @@ events.prototype.battle = function (id, x, y, force, callback) {
}); });
} }
else { else {
var nowEquipment = 'hand';
if (core.flags.equipment) {
var equipId = (core.status.hero.equipment||[])[0];
if (core.isset(equipId) && core.isset(core.material.items[equipId])
&& core.isset(core.material.items[equipId].equip.animate))
nowEquipment = core.material.items[equipId].equip.animate;
}
core.playSound('attack.mp3');
core.drawAnimate(nowEquipment, x, y);
core.events.afterBattle(id, x, y, callback); core.events.afterBattle(id, x, y, callback);
} }
} }

View File

@ -119,6 +119,17 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
var enemy = core.material.enemys[enemyId]; var enemy = core.material.enemys[enemyId];
// 播放战斗音效和动画
var equipAnimate = 'hand';
if (core.flags.equipment) {
var equipId = (core.status.hero.equipment||[])[0];
if (core.isset(equipId) && core.isset(core.material.items[equipId])
&& core.isset(core.material.items[equipId].equip.animate))
equipAnimate = core.material.items[equipId].equip.animate;
}
core.playSound('attack.mp3');
core.drawAnimate(equipAnimate, x, y);
var damage = core.enemys.getDamage(enemyId); var damage = core.enemys.getDamage(enemyId);
if (damage == null) damage = core.status.hero.hp+1; if (damage == null) damage = core.status.hero.hp+1;