feat:即捡即用事件块-音效

This commit is contained in:
lizhuoyuan 2025-02-08 15:37:08 +08:00
parent d53e72513b
commit eaae6884ce
2 changed files with 20 additions and 18 deletions

View File

@ -496,12 +496,13 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
// 获得一个道具后触发的事件
// itemId获得的道具IDx和y是该道具所在的坐标
// isGentleClick是否是轻按触发的
if (itemId.endsWith('Potion') && core.material.items[itemId].cls == 'items')
core.playSound('回血');
else if (itemId.endsWith('Gem') && core.material.items[itemId].cls == 'items')
core.playSound('宝石')
else
core.playSound('获得道具');
let sound = '获得道具';
const itemInfo = core.material.items[itemId];
if (itemInfo.itemEffectEvent && itemInfo.itemEffectEvent.hasOwnProperty('sound')) {
sound = itemInfo.itemEffectEvent.sound;
}
core.playSound(sound);
var todo = [];
// 检查该点的获得道具后事件。

View File

@ -27,6 +27,7 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"useItemEffect": "core.status.hero.atk += core.values.redGem",
"canUseItemEffect": "true",
"itemEffectEvent": {
"sound": "item.mp3",
"value": {
"atk:o": "core.values.redGem"
}